diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-04-10 22:01:02 +0300 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-06-10 19:40:44 +0300 |
commit | 106744c7ca4e5444d993a04c23bc04d93e2bfa6a (patch) | |
tree | 5aea51551eb5621a339d7066a6db103cb41a1c3f /ui/src/components/mail/view | |
parent | b993375fa0737dcfbd1aca5e765210969a143282 (diff) |
ui: remove Entity
Diffstat (limited to 'ui/src/components/mail/view')
-rw-r--r-- | ui/src/components/mail/view/envelope.rs | 9 | ||||
-rw-r--r-- | ui/src/components/mail/view/html.rs | 17 | ||||
-rw-r--r-- | ui/src/components/mail/view/thread.rs | 8 |
3 files changed, 30 insertions, 4 deletions
diff --git a/ui/src/components/mail/view/envelope.rs b/ui/src/components/mail/view/envelope.rs index 51299f12..13217a5f 100644 --- a/ui/src/components/mail/view/envelope.rs +++ b/ui/src/components/mail/view/envelope.rs @@ -55,6 +55,7 @@ pub struct EnvelopeView { account_pos: usize, cmd_buf: String, + id: ComponentId, } impl fmt::Display for EnvelopeView { @@ -79,6 +80,7 @@ impl EnvelopeView { wrapper, account_pos, cmd_buf: String::with_capacity(4), + id: ComponentId::default(), } } @@ -545,4 +547,11 @@ impl Component for EnvelopeView { fn set_dirty(&mut self) { self.dirty = true; } + + fn id(&self) -> ComponentId { + self.id + } + fn set_id(&mut self, id: ComponentId) { + self.id = id; + } } diff --git a/ui/src/components/mail/view/html.rs b/ui/src/components/mail/view/html.rs index b4ca9f55..c5e5cfab 100644 --- a/ui/src/components/mail/view/html.rs +++ b/ui/src/components/mail/view/html.rs @@ -27,10 +27,12 @@ use std::process::{Command, Stdio}; pub struct HtmlView { pager: Pager, bytes: Vec<u8>, + id: ComponentId, } impl HtmlView { pub fn new(bytes: Vec<u8>, context: &mut Context, account_pos: usize) -> Self { + let id = ComponentId::default(); let settings = context.accounts[account_pos].runtime_settings.conf(); if let Some(filter_invocation) = settings.html_filter() { let parts = split_command!(filter_invocation); @@ -57,7 +59,7 @@ impl HtmlView { None, None, ); - HtmlView { pager, bytes } + HtmlView { pager, bytes, id } } else { let mut html_filter = command_obj.unwrap(); html_filter @@ -75,7 +77,7 @@ impl HtmlView { )); let pager = Pager::from_string(display_text, None, None, None); - HtmlView { pager, bytes } + HtmlView { pager, bytes, id } } } else { if let Ok(mut html_filter) = Command::new("w3m") @@ -98,7 +100,7 @@ impl HtmlView { )); let pager = Pager::from_string(display_text, None, None, None); - HtmlView { pager, bytes } + HtmlView { pager, bytes, id } } else { context.replies.push_back(UIEvent { id: 0, @@ -115,7 +117,7 @@ impl HtmlView { None, None, ); - HtmlView { pager, bytes } + HtmlView { pager, bytes, id } } } } @@ -168,4 +170,11 @@ impl Component for HtmlView { fn set_dirty(&mut self) { self.pager.set_dirty(); } + + fn id(&self) -> ComponentId { + self.id + } + fn set_id(&mut self, id: ComponentId) { + self.id = id; + } } diff --git a/ui/src/components/mail/view/thread.rs b/ui/src/components/mail/view/thread.rs index 0a625cd9..d5d2986f 100644 --- a/ui/src/components/mail/view/thread.rs +++ b/ui/src/components/mail/view/thread.rs @@ -51,6 +51,7 @@ pub struct ThreadView { dirty: bool, content: CellBuffer, initiated: bool, + id: ComponentId, } #[derive(Debug)] @@ -985,4 +986,11 @@ impl Component for ThreadView { map } + + fn id(&self) -> ComponentId { + self.id + } + fn set_id(&mut self, id: ComponentId) { + self.id = id; + } } |