From a94bb1e27afdaaa062da9bd988d9b58a49c23da7 Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Fri, 28 Feb 2020 09:16:19 +0200 Subject: [PATCH] Show float notification on refresh cmd --- src/conf/accounts.rs | 9 +++++++++ src/state.rs | 2 ++ 2 files changed, 11 insertions(+) diff --git a/src/conf/accounts.rs b/src/conf/accounts.rs index 3e7f669c..21421a4c 100644 --- a/src/conf/accounts.rs +++ b/src/conf/accounts.rs @@ -631,6 +631,11 @@ impl Account { .stdout(std::process::Stdio::null()) .stderr(std::process::Stdio::piped()) .spawn()?; + self.sender + .send(ThreadEvent::UIEvent(UIEvent::StatusEvent( + StatusEvent::DisplayMessage(format!("Running command {}", refresh_command)), + ))) + .unwrap(); return Ok(()); } @@ -1045,6 +1050,10 @@ impl Account { self.init(); } self.is_online = ret.is_ok(); + if !self.is_online { + self.backend.write().unwrap().connect(); + } + ret } diff --git a/src/state.rs b/src/state.rs index 9ce30701..014460cc 100644 --- a/src/state.rs +++ b/src/state.rs @@ -960,7 +960,9 @@ impl State { msg: msg.clone(), }); self.display_messages_active = true; + self.display_messages_expiration_start = None; self.display_messages_pos = self.display_messages.len() - 1; + self.redraw(); } UIEvent::FinishedUIDialog(ref id, ref mut results) if self.overlay.iter().any(|c| c.id() == *id) =>