[sound-juicer] Re-enable ‘re-read’ after album has been selected



commit aa5f6c822a36727d9544f6fb534025f47e4523ea
Author: Phillip Wood <phillip wood dunelm org uk>
Date:   Thu Aug 11 11:38:21 2016 +0100

    Re-enable ‘re-read’ after album has been selected
    
    Make sure the ‘re-read’ action is not re-enabled until the user has
    chosen an album from the last query. This prevents more than one album
    chooser dialog being shown at once.

 src/sj-main.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/src/sj-main.c b/src/sj-main.c
index 2ab10f6..79c88a8 100644
--- a/src/sj-main.c
+++ b/src/sj-main.c
@@ -826,7 +826,6 @@ metadata_cb (GObject      *source,
   }
 
   reread_cancellable = NULL;
-  set_action_enabled ("re-read", TRUE);
   set_action_state ("re-read(false)");
 
   if (error != NULL) {
@@ -846,14 +845,10 @@ metadata_cb (GObject      *source,
     gtk_widget_destroy (dialog);
     update_ui_for_album (NULL);
     g_error_free (error);
+    set_action_enabled ("re-read", TRUE);
     return;
   }
 
-  g_free (current_submit_url);
-  current_submit_url = url;
-  if (current_submit_url) {
-    set_action_enabled ("submit-tracks", TRUE);
-  }
   /* Free old album details */
   g_clear_pointer (&current_album, (GDestroyNotify) album_details_free);
   /* Set the new current album pointer */
@@ -872,6 +867,13 @@ metadata_cb (GObject      *source,
     }
   }
   update_ui_for_album (current_album);
+  set_action_enabled ("re-read", TRUE);
+
+  g_free (current_submit_url);
+  current_submit_url = url;
+  if (current_submit_url) {
+    set_action_enabled ("submit-tracks", TRUE);
+  }
 
   if (autostart) {
     g_signal_emit_by_name (extract_button, "activate", NULL);


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