EpisodeWidget: Make cancel button insensitive.

This commit is contained in:
Jordan Petridis 2017-12-27 15:13:09 +02:00
parent 0a7825dfff
commit ada73a616f
No known key found for this signature in database
GPG Key ID: CEABAD9F5683B9A6
2 changed files with 5 additions and 4 deletions

View File

@ -175,8 +175,9 @@
<child> <child>
<object class="GtkButton" id="cancel_button"> <object class="GtkButton" id="cancel_button">
<property name="label" translatable="yes">Cancel</property> <property name="label" translatable="yes">Cancel</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">True</property> <property name="receives_default">False</property>
<property name="no_show_all">True</property> <property name="no_show_all">True</property>
<property name="valign">center</property> <property name="valign">center</property>
</object> </object>

View File

@ -212,7 +212,7 @@ fn on_download_clicked(
let pd = dbqueries::get_podcast_from_id(ep.podcast_id()).unwrap(); let pd = dbqueries::get_podcast_from_id(ep.podcast_id()).unwrap();
let pd_title = pd.title().to_owned(); let pd_title = pd.title().to_owned();
let mut ep = ep.clone(); let mut ep = ep.clone();
// cancel_bttn.show(); cancel_bttn.show();
progress.show(); progress.show();
download_bttn.hide(); download_bttn.hide();
thread::spawn(move || { thread::spawn(move || {
@ -264,7 +264,7 @@ fn receive() -> glib::Continue {
if let Some(( if let Some((
ref download_bttn, ref download_bttn,
ref play_bttn, ref play_bttn,
ref _cancel_bttn, ref cancel_bttn,
ref progress_bar, ref progress_bar,
ref reciever, ref reciever,
)) = *global.borrow() )) = *global.borrow()
@ -272,7 +272,7 @@ fn receive() -> glib::Continue {
if reciever.try_recv().is_ok() { if reciever.try_recv().is_ok() {
download_bttn.hide(); download_bttn.hide();
play_bttn.show(); play_bttn.show();
// cancel_bttn.hide(); cancel_bttn.hide();
progress_bar.hide(); progress_bar.hide();
} }
} }