[sound-juicer] Give re-read action state



commit f9a94b739804d98260435e579b436cbad15c2c4f
Author: Phillip Wood <phillip wood dunelm org uk>
Date:   Thu Aug 7 11:53:42 2014 +0100

    Give re-read action state
    
    Make re-read a boolean action so we can tell if a re-read is currently
    in progress.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=705159

 src/sj-main.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/sj-main.c b/src/sj-main.c
index 75675a7..604d94a 100644
--- a/src/sj-main.c
+++ b/src/sj-main.c
@@ -197,7 +197,7 @@ static void on_eject_activate (GSimpleAction *action, GVariant *parameter, gpoin
 {
   /* first make sure we're not playing */
   stop_playback ();
-
+  set_action_state ("re-read(false)");
   brasero_drive_eject (drive, FALSE, NULL);
 }
 
@@ -1119,6 +1119,8 @@ metadata_cb (SjMetadataGetter *m, GList *albums, GError *error)
 {
   gboolean realized = gtk_widget_get_realized (main_window);
 
+  set_action_state ("re-read(false)");
+
   if (realized)
     gdk_window_set_cursor (gtk_widget_get_window (main_window), NULL);
     /* Clear the statusbar message */
@@ -1212,6 +1214,7 @@ static void reread_cd (gboolean ignore_no_media)
 
   window = gtk_widget_get_window (main_window);
 
+  set_action_state ("re-read(true)");
   set_action_enabled ("re-read", FALSE);
 
   /* Make sure nothing is playing */
@@ -1237,6 +1240,7 @@ static void reread_cd (gboolean ignore_no_media)
 
   if (!is_audio_cd (drive)) {
     sj_debug (DEBUG_CD, "Media is not an audio CD\n");
+    set_action_state ("re-read(false)");
     update_ui_for_album (NULL);
     gtk_statusbar_pop(GTK_STATUSBAR(status_bar), 0);
     if (realized)
@@ -2028,7 +2032,7 @@ is_cd_duplication_available(void)
 }
 
 GActionEntry app_entries[] = {
-  { "re-read", on_reread_activate, NULL, NULL, NULL },
+  { "re-read", on_reread_activate, NULL, "false", NULL },
   { "duplicate", on_duplicate_activate, NULL, NULL, NULL },
   { "eject", on_eject_activate, NULL, NULL, NULL },
   { "submit-tracks", on_submit_activate, NULL, NULL, NULL },


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]