diff options
author | Sebastian Geiger <sbastig@gmx.net> | 2012-08-31 12:02:00 -0500 |
---|---|---|
committer | Federico Mena Quintero <federico@gnome.org> | 2012-08-31 12:02:00 -0500 |
commit | afc7466dfdb96c3778b92672f078916cdaf175c3 (patch) | |
tree | 5459c8b00a314c2b2ab24c7f7221496f843f955d /gtk/gtkfilechooserbutton.c | |
parent | e5b2ca5d89f6defd1a12ec8f51c5ad4ba6adfbab (diff) | |
download | gtk+-afc7466dfdb96c3778b92672f078916cdaf175c3.tar.gz |
[GtkFileChooserButton] bgo#645065 - Restore the previously-selected file when the button's GtkFileChooserDialog is canceled
The file chooser is asynchronous, so doing 'select_file (old_file)' and subsequently querying
the file for updating the labels is not going to work. However, the underlying file chooser
will emit 'selection-changed' as appropriate when it finishes restoring the old file. So,
we only need to update the labels when the file chooser dialog is confirmed, not cancelled.
Diffstat (limited to 'gtk/gtkfilechooserbutton.c')
-rw-r--r-- | gtk/gtkfilechooserbutton.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gtk/gtkfilechooserbutton.c b/gtk/gtkfilechooserbutton.c index d1e2d2eed0..7460e39697 100644 --- a/gtk/gtkfilechooserbutton.c +++ b/gtk/gtkfilechooserbutton.c @@ -2683,8 +2683,11 @@ dialog_response_cb (GtkDialog *dialog, if (response == GTK_RESPONSE_ACCEPT || response == GTK_RESPONSE_OK) { - g_signal_emit_by_name (user_data, "current-folder-changed"); - g_signal_emit_by_name (user_data, "selection-changed"); + 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 if (priv->old_file) { @@ -2712,9 +2715,6 @@ dialog_response_cb (GtkDialog *dialog, priv->old_file = NULL; } - update_label_and_image (user_data); - update_combo_box (user_data); - if (priv->active) { g_signal_handler_unblock (priv->dialog, @@ -2731,7 +2731,7 @@ dialog_response_cb (GtkDialog *dialog, if (response == GTK_RESPONSE_ACCEPT || response == GTK_RESPONSE_OK) - g_signal_emit (user_data, file_chooser_button_signals[FILE_SET], 0); + g_signal_emit (button, file_chooser_button_signals[FILE_SET], 0); } |