diff options
author | William Jon McCann <jmccann@redhat.com> | 2011-01-20 16:58:19 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2011-01-20 21:29:29 -0500 |
commit | 6f4df09a0437895a7c9e7b4efa7a2b1c03df2ee9 (patch) | |
tree | 00d188045995d0b80ac85655a17f3d7178ae7ee6 /gtk/gtkappchooserbutton.c | |
parent | 9532e96db477353fbffbba8eb9b86e9c17b82dc9 (diff) | |
download | gtk+-6f4df09a0437895a7c9e7b4efa7a2b1c03df2ee9.tar.gz |
When cancelling the app dialog return to the last item in combobox
https://bugzilla.gnome.org/show_bug.cgi?id=640011
Diffstat (limited to 'gtk/gtkappchooserbutton.c')
-rw-r--r-- | gtk/gtkappchooserbutton.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gtk/gtkappchooserbutton.c b/gtk/gtkappchooserbutton.c index c01ce9b1f0..4448899c7b 100644 --- a/gtk/gtkappchooserbutton.c +++ b/gtk/gtkappchooserbutton.c @@ -88,6 +88,7 @@ G_DEFINE_TYPE_WITH_CODE (GtkAppChooserButton, gtk_app_chooser_button, GTK_TYPE_C struct _GtkAppChooserButtonPrivate { GtkListStore *store; + int last_active; gchar *content_type; gboolean show_dialog_item; @@ -200,7 +201,7 @@ other_application_dialog_response_cb (GtkDialog *dialog, /* reset the active item, otherwise we are stuck on * 'Other application...' */ - gtk_combo_box_set_active (GTK_COMBO_BOX (self), 0); + gtk_combo_box_set_active (GTK_COMBO_BOX (self), self->priv->last_active); gtk_widget_destroy (GTK_WIDGET (dialog)); return; } @@ -404,6 +405,7 @@ gtk_app_chooser_button_changed (GtkComboBox *object) { name_quark = g_quark_from_string (name); g_signal_emit (self, signals[SIGNAL_CUSTOM_ITEM_ACTIVATED], name_quark, name); + self->priv->last_active = gtk_combo_box_get_active (object); } else { @@ -413,6 +415,8 @@ gtk_app_chooser_button_changed (GtkComboBox *object) g_free (name); } + else + self->priv->last_active = gtk_combo_box_get_active (object); } static void |