[gnome-control-center/gnome-3-2] info: Use new GtkAppChooserButton API
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/gnome-3-2] info: Use new GtkAppChooserButton API
- Date: Mon, 26 Sep 2011 16:51:59 +0000 (UTC)
commit d3b765a658e186fca1c4e73db2e12b4dfbdaefa5
Author: Bastien Nocera <hadess hadess net>
Date: Mon Sep 12 23:01:57 2011 +0100
info: Use new GtkAppChooserButton API
gtk_app_chooser_button_set_show_default_item() was
added so that we could show the default application
for the content-type at the top, and selected, without
hacks.
https://bugzilla.gnome.org/show_bug.cgi?id=658693
panels/info/cc-info-panel.c | 17 +----------------
1 files changed, 1 insertions(+), 16 deletions(-)
---
diff --git a/panels/info/cc-info-panel.c b/panels/info/cc-info-panel.c
index 035a5d8..473b50f 100644
--- a/panels/info/cc-info-panel.c
+++ b/panels/info/cc-info-panel.c
@@ -907,27 +907,12 @@ info_panel_setup_default_app (CcInfoPanel *self,
{
GtkWidget *button;
GtkWidget *table;
- GAppInfo *info;
- GError *error = NULL;
GtkWidget *label;
table = WID ("default_apps_table");
- /* FIXME: We need to do this because GtkAppChooser doesn't
- * give us the opportunity to select what app should be selected
- * by default.
- * https://bugzilla.gnome.org/show_bug.cgi?id=642706 */
- info = g_app_info_get_default_for_type (content_type, FALSE);
- if (info != NULL && g_app_info_set_as_last_used_for_type (info, content_type, &error) == FALSE)
- {
- g_warning ("Failed to set '%s' as the default application for '%s': %s",
- g_app_info_get_name (info), content_type, error->message);
- g_error_free (error);
- }
- if (info != NULL)
- g_object_unref (info);
-
button = gtk_app_chooser_button_new (content_type);
+ gtk_app_chooser_button_set_show_default_item (GTK_APP_CHOOSER_BUTTON (button), TRUE);
gtk_table_attach (GTK_TABLE (table), button,
left_attach, right_attach,
top_attach, bottom_attach, GTK_FILL, 0, 0, 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]