[gimp] file-open-location: create only one progress bar



commit 33b7d8e3349bf68a97eddfce3ef9f6140097e1d0
Author: Edward E <develinthedetail gmail com>
Date:   Sat Mar 31 11:48:18 2018 -0500

    file-open-location: create only one progress bar

 app/dialogs/file-open-location-dialog.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/app/dialogs/file-open-location-dialog.c b/app/dialogs/file-open-location-dialog.c
index a7b00b2..d542241 100644
--- a/app/dialogs/file-open-location-dialog.c
+++ b/app/dialogs/file-open-location-dialog.c
@@ -149,10 +149,10 @@ file_open_location_response (GtkDialog *dialog,
   GtkWidget   *box;
   const gchar *text = NULL;
 
+  box = g_object_get_data (G_OBJECT (dialog), "progress-box");
+
   if (response_id != GTK_RESPONSE_OK)
     {
-      box = g_object_get_data (G_OBJECT (dialog), "progress-box");
-
       if (box && GIMP_PROGRESS_BOX (box)->active)
         gimp_progress_cancel (GIMP_PROGRESS (box));
       else
@@ -188,12 +188,15 @@ file_open_location_response (GtkDialog *dialog,
           file = file_utils_filename_to_file (gimp, text, &error);
         }
 
-      box = gimp_progress_box_new ();
-      gtk_container_set_border_width (GTK_CONTAINER (box), 12);
-      gtk_box_pack_end (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
-                        box, FALSE, FALSE, 0);
+      if (!box)
+        {
+          box = gimp_progress_box_new ();
+          gtk_container_set_border_width (GTK_CONTAINER (box), 12);
+          gtk_box_pack_end (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
+                            box, FALSE, FALSE, 0);
 
-      g_object_set_data (G_OBJECT (dialog), "progress-box", box);
+          g_object_set_data (G_OBJECT (dialog), "progress-box", box);
+        }
 
       if (file)
         {


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