diff options
author | Federico Mena Quintero <federico@gnome.org> | 2013-06-21 19:14:36 -0500 |
---|---|---|
committer | Federico Mena Quintero <federico@gnome.org> | 2013-06-21 19:14:36 -0500 |
commit | 32e75adf6a13acd367416e07fc08a0fa814815a5 (patch) | |
tree | ee96a9ca7148a2c94111a10f2a4c977be751f3c8 /gtk/gtkfilechooserbutton.c | |
parent | 9162589b5af83a36bdfe8929dfb6465c69df2909 (diff) | |
download | gtk+-32e75adf6a13acd367416e07fc08a0fa814815a5.tar.gz |
GtkFileChooserButton: Also emit 'file-set' when changing the selection through the combo box
https://bugzilla.gnome.org/show_bug.cgi?id=696498
Diffstat (limited to 'gtk/gtkfilechooserbutton.c')
-rw-r--r-- | gtk/gtkfilechooserbutton.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/gtk/gtkfilechooserbutton.c b/gtk/gtkfilechooserbutton.c index c2c686f3b2..06bf946306 100644 --- a/gtk/gtkfilechooserbutton.c +++ b/gtk/gtkfilechooserbutton.c @@ -2712,12 +2712,15 @@ static void combo_box_changed_cb (GtkComboBox *combo_box, gpointer user_data) { + GtkFileChooserButton *button = GTK_FILE_CHOOSER_BUTTON (user_data); + GtkFileChooserButtonPrivate *priv = button->priv; GtkTreeIter iter; + gboolean file_was_set; + + file_was_set = FALSE; if (gtk_combo_box_get_active_iter (combo_box, &iter)) { - GtkFileChooserButton *button = GTK_FILE_CHOOSER_BUTTON (user_data); - GtkFileChooserButtonPrivate *priv = button->priv; gchar type; gpointer data; @@ -2736,7 +2739,10 @@ combo_box_changed_cb (GtkComboBox *combo_box, case ROW_TYPE_BOOKMARK: case ROW_TYPE_CURRENT_FOLDER: if (data) - gtk_file_chooser_button_select_file (GTK_FILE_CHOOSER (button), data, NULL); + { + gtk_file_chooser_button_select_file (GTK_FILE_CHOOSER (button), data, NULL); + file_was_set = TRUE; + } break; case ROW_TYPE_VOLUME: { @@ -2746,6 +2752,7 @@ combo_box_changed_cb (GtkComboBox *combo_box, if (base_file) { gtk_file_chooser_button_select_file (GTK_FILE_CHOOSER (button), base_file, NULL); + file_was_set = TRUE; g_object_unref (base_file); } } @@ -2757,6 +2764,9 @@ combo_box_changed_cb (GtkComboBox *combo_box, break; } } + + if (file_was_set) + g_signal_emit (button, file_chooser_button_signals[FILE_SET], 0); } /* Calback for the "notify::popup-shown" signal on the combo box. |