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/html.rs | |
parent | b993375fa0737dcfbd1aca5e765210969a143282 (diff) |
ui: remove Entity
Diffstat (limited to 'ui/src/components/mail/view/html.rs')
-rw-r--r-- | ui/src/components/mail/view/html.rs | 17 |
1 files changed, 13 insertions, 4 deletions
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; + } } |