From c415a5aae39d94cc74fe0150a77e1fe4b018b833 Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Sat, 25 Aug 2018 12:59:16 +0300 Subject: [PATCH] Rename MailListing to PlainListing --- ui/src/components/mail/listing/compact.rs | 2 +- ui/src/components/mail/listing/mod.rs | 22 +++++++++++----------- ui/src/execute/actions.rs | 4 ++-- ui/src/execute/mod.rs | 2 +- ui/src/state.rs | 4 ++-- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/ui/src/components/mail/listing/compact.rs b/ui/src/components/mail/listing/compact.rs index 8e52ea8d3..4810d8b6d 100644 --- a/ui/src/components/mail/listing/compact.rs +++ b/ui/src/components/mail/listing/compact.rs @@ -418,7 +418,7 @@ impl Component for CompactListing { self.dirty = true; } UIEventType::Action(ref action) => match action { - Action::MailListing(MailListingAction::ToggleThreaded) => { + Action::PlainListing(PlainListingAction::ToggleThreaded) => { context.accounts[self.cursor_pos.0] .runtime_settings .conf_mut() diff --git a/ui/src/components/mail/listing/mod.rs b/ui/src/components/mail/listing/mod.rs index b109c599b..78f8f232e 100644 --- a/ui/src/components/mail/listing/mod.rs +++ b/ui/src/components/mail/listing/mod.rs @@ -29,7 +29,7 @@ const MAX_COLS: usize = 500; /// A list of all mail (`Envelope`s) in a `Mailbox`. On `\n` it opens the `Envelope` content in a /// `MailView`. #[derive(Debug)] -pub struct MailListing { +pub struct PlainListing { /// (x, y, z): x is accounts, y is folders, z is index inside a folder. cursor_pos: (usize, usize, usize), new_cursor_pos: (usize, usize, usize), @@ -46,20 +46,20 @@ pub struct MailListing { view: Option, } -impl Default for MailListing { +impl Default for PlainListing { fn default() -> Self { Self::new() } } -impl fmt::Display for MailListing { +impl fmt::Display for PlainListing { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "mail") } } -impl MailListing { - /// Helper function to format entry strings for MailListing */ +impl PlainListing { + /// Helper function to format entry strings for PlainListing */ /* TODO: Make this configurable */ fn make_entry_string(e: &Envelope, idx: usize) -> String { format!( @@ -72,7 +72,7 @@ impl MailListing { pub fn new() -> Self { let content = CellBuffer::new(0, 0, Cell::with_char(' ')); - MailListing { + PlainListing { cursor_pos: (0, 1, 0), new_cursor_pos: (0, 0, 0), length: 0, @@ -193,7 +193,7 @@ impl MailListing { Color::Default }; let (x, _) = write_string_to_grid( - &MailListing::make_thread_entry( + &PlainListing::make_thread_entry( envelope, idx, indentation, @@ -275,7 +275,7 @@ impl MailListing { Color::Default }; let (x, y) = write_string_to_grid( - &MailListing::make_entry_string(envelope, idx), + &PlainListing::make_entry_string(envelope, idx), &mut self.content, fg_color, bg_color, @@ -436,7 +436,7 @@ impl MailListing { "{}{}{} ", idx, " ".repeat(idx_width + 2 - (idx.to_string().chars().count())), - MailListing::format_date(&envelope) + PlainListing::format_date(&envelope) ); for i in 0..indent { if indentations.len() > i && indentations[i] { @@ -485,7 +485,7 @@ impl MailListing { } } -impl Component for MailListing { +impl Component for PlainListing { fn draw(&mut self, grid: &mut CellBuffer, area: Area, context: &mut Context) { if !self.unfocused { if !self.is_dirty() { @@ -760,7 +760,7 @@ impl Component for MailListing { self.dirty = true; } UIEventType::Action(ref action) => match action { - Action::MailListing(MailListingAction::ToggleThreaded) => { + Action::PlainListing(PlainListingAction::ToggleThreaded) => { context.accounts[self.cursor_pos.0] .runtime_settings .conf_mut() diff --git a/ui/src/execute/actions.rs b/ui/src/execute/actions.rs index ff4154e48..113425462 100644 --- a/ui/src/execute/actions.rs +++ b/ui/src/execute/actions.rs @@ -26,13 +26,13 @@ pub use melib::mailbox::{SortField, SortOrder}; #[derive(Debug, Clone)] -pub enum MailListingAction { +pub enum PlainListingAction { ToggleThreaded, } #[derive(Debug, Clone)] pub enum Action { - MailListing(MailListingAction), + PlainListing(PlainListingAction), ViewMailbox(usize), Sort(SortField, SortOrder), SubSort(SortField, SortOrder), diff --git a/ui/src/execute/mod.rs b/ui/src/execute/mod.rs index 307721144..0c2d4aca9 100644 --- a/ui/src/execute/mod.rs +++ b/ui/src/execute/mod.rs @@ -71,7 +71,7 @@ named!( named!( threaded, map!(ws!(tag!("threaded")), |_| { - Action::MailListing(MailListingAction::ToggleThreaded) + Action::PlainListing(PlainListingAction::ToggleThreaded) }) ); named!( diff --git a/ui/src/state.rs b/ui/src/state.rs index 0ba382632..65ecc58d6 100644 --- a/ui/src/state.rs +++ b/ui/src/state.rs @@ -536,8 +536,8 @@ impl State { self.entities[i].rcv_event( &UIEvent { id: 0, - event_type: UIEventType::Action(Action::MailListing( - MailListingAction::ToggleThreaded, + event_type: UIEventType::Action(Action::PlainListing( + PlainListingAction::ToggleThreaded, )), }, &mut self.context,