]> Pileus Git - ~andy/gtk/commitdiff
filechooserbutton: Update the combo box even after the dialog is cancelled
authorFederico Mena Quintero <federico@gnome.org>
Fri, 8 Mar 2013 18:43:10 +0000 (12:43 -0600)
committerFederico Mena Quintero <federico@gnome.org>
Fri, 8 Mar 2013 18:43:21 +0000 (12:43 -0600)
We assumed that we didn't have to update the combo box if the dialog got cancelled,
as it should simply retain its previous contents.  But this assumption doesn't work
as the dialog is brought up with the 'Other...' item - we don't want the
combo box to keep showing 'Other...' if the dialog is cancelled.

The test from the previous commit now passes.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
gtk/gtkfilechooserbutton.c

index d61a4d940bd059b3a4fda059dbfa99b8be722a07..c69157d3b1fb1367867a235cd9072a3199fedb7b 100644 (file)
@@ -2982,9 +2982,6 @@ dialog_response_cb (GtkDialog *dialog,
 
       g_signal_emit_by_name (button, "current-folder-changed");
       g_signal_emit_by_name (button, "selection-changed");
-
-      update_label_and_image (button);
-      update_combo_box (button);
     }
   else
     {
@@ -3002,6 +2999,9 @@ dialog_response_cb (GtkDialog *dialog,
       priv->active = FALSE;
     }
 
+  update_label_and_image (button);
+  update_combo_box (button);
+
   gtk_widget_set_sensitive (priv->combo_box, TRUE);
   gtk_widget_hide (priv->dialog);