ShowWidget: display a notification before removing the show.

This commit is contained in:
Jordan Petridis
2018-03-26 10:57:44 +03:00
parent 482ed7c3c6
commit b2c95e5a73
2 changed files with 24 additions and 9 deletions
+2 -9
View File
@@ -7,7 +7,7 @@ use open;
use hammond_data::Podcast;
use hammond_data::dbqueries;
use hammond_data::utils::{delete_show, replace_extra_spaces};
use hammond_data::utils::{replace_extra_spaces};
use app::Action;
use utils::get_pixbuf_from_path;
@@ -15,7 +15,6 @@ use widgets::episode::episodes_listbox;
use std::sync::Arc;
use std::sync::mpsc::Sender;
use std::thread;
#[derive(Debug, Clone)]
pub struct ShowWidget {
@@ -141,13 +140,7 @@ fn on_unsub_button_clicked(
// hack to get away without properly checking for none.
// if pressed twice would panic.
unsub_button.hide();
// Spawn a thread so it won't block the ui.
thread::spawn(move || {
if let Err(err) = delete_show(&pd) {
error!("Something went wrong trying to remove {}", pd.title());
error!("Error: {}", err);
}
});
sender.send(Action::RemoveShow(pd))?;
sender.send(Action::HeaderBarNormal)?;
sender.send(Action::ShowShowsAnimated)?;