diff options
author | Pacho Ramos <pacho@gentoo.org> | 2011-03-27 16:45:12 +0000 |
---|---|---|
committer | Pacho Ramos <pacho@gentoo.org> | 2011-03-27 16:45:12 +0000 |
commit | 2cf6f23a8ede6a7e4dfeb7b84512d6d2aacf2c5f (patch) | |
tree | 0c15171edde2f913bb8566a39e3a6aaaf8676098 /gnome-base | |
parent | Stable on alpha, bug #360047 (diff) | |
download | historical-2cf6f23a8ede6a7e4dfeb7b84512d6d2aacf2c5f.tar.gz historical-2cf6f23a8ede6a7e4dfeb7b84512d6d2aacf2c5f.tar.bz2 historical-2cf6f23a8ede6a7e4dfeb7b84512d6d2aacf2c5f.zip |
Revision bump using URL handlers for browser and mailer applications to be compatible with glib-2.28, not showing twice the configured background if it is a symlink to a known background, not erasing backgrounds.xml under some circumstances (bug #344335 by Matthew Turnbull). Remove old.
Package-Manager: portage-2.1.9.44/cvs/Linux x86_64
Diffstat (limited to 'gnome-base')
-rw-r--r-- | gnome-base/gnome-control-center/ChangeLog | 17 | ||||
-rw-r--r-- | gnome-base/gnome-control-center/Manifest | 21 | ||||
-rw-r--r-- | gnome-base/gnome-control-center/files/gnome-control-center-2.28.1-gdm-default-bg.patch | 160 | ||||
-rw-r--r-- | gnome-base/gnome-control-center/files/gnome-control-center-2.32.1-duplicated-background.patch | 115 | ||||
-rw-r--r-- | gnome-base/gnome-control-center/files/gnome-control-center-2.32.1-erase-background.patch | 46 | ||||
-rw-r--r-- | gnome-base/gnome-control-center/files/gnome-control-center-2.32.1-mime-handler.patch | 1274 | ||||
-rw-r--r-- | gnome-base/gnome-control-center/files/gnome-control-center-2.32.1-mime-handler2.patch | 56 | ||||
-rw-r--r-- | gnome-base/gnome-control-center/files/gnome-control-center-2.32.1-mime-handler3.patch | 290 | ||||
-rw-r--r-- | gnome-base/gnome-control-center/gnome-control-center-2.32.1-r1.ebuild (renamed from gnome-base/gnome-control-center/gnome-control-center-2.30.1.ebuild) | 49 |
9 files changed, 1846 insertions, 182 deletions
diff --git a/gnome-base/gnome-control-center/ChangeLog b/gnome-base/gnome-control-center/ChangeLog index eccc5e521d8b..3208a2293397 100644 --- a/gnome-base/gnome-control-center/ChangeLog +++ b/gnome-base/gnome-control-center/ChangeLog @@ -1,6 +1,21 @@ # ChangeLog for gnome-base/gnome-control-center # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/gnome-base/gnome-control-center/ChangeLog,v 1.81 2011/03/22 19:09:18 ranger Exp $ +# $Header: /var/cvsroot/gentoo-x86/gnome-base/gnome-control-center/ChangeLog,v 1.82 2011/03/27 16:45:12 pacho Exp $ + +*gnome-control-center-2.32.1-r1 (27 Mar 2011) + + 27 Mar 2011; Pacho Ramos <pacho@gentoo.org> + -files/gnome-control-center-2.28.1-gdm-default-bg.patch, + -gnome-control-center-2.30.1.ebuild, +gnome-control-center-2.32.1-r1.ebuild, + +files/gnome-control-center-2.32.1-duplicated-background.patch, + +files/gnome-control-center-2.32.1-erase-background.patch, + +files/gnome-control-center-2.32.1-mime-handler.patch, + +files/gnome-control-center-2.32.1-mime-handler2.patch, + +files/gnome-control-center-2.32.1-mime-handler3.patch: + Revision bump using URL handlers for browser and mailer applications to be + compatible with glib-2.28, not showing twice the configured background if it + is a symlink to a known background, not erasing backgrounds.xml under some + circumstances (bug #344335 by Matthew Turnbull). Remove old. 22 Mar 2011; Brent Baude <ranger@gentoo.org> gnome-control-center-2.32.1.ebuild: diff --git a/gnome-base/gnome-control-center/Manifest b/gnome-base/gnome-control-center/Manifest index 19d4a944613f..2999627509a1 100644 --- a/gnome-base/gnome-control-center/Manifest +++ b/gnome-base/gnome-control-center/Manifest @@ -1,8 +1,21 @@ -AUX gnome-control-center-2.28.1-gdm-default-bg.patch 4946 RMD160 7a8593a071548dd7b8a562927eae56d08164c489 SHA1 2c36d84ba5498a387dd7973eef7b18bac9a40609 SHA256 d6cdfbf3c293d3fa57bf49bd7ba55f41074202df617cd12607b9bacbdb2eb49e +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +AUX gnome-control-center-2.32.1-duplicated-background.patch 3053 RMD160 2d4c8c024e4b89e719f339be17e2de24470979ef SHA1 15d0854f5bdb3e05c74e81a1031922b7a1715c01 SHA256 8223542f9db11769e8ab73f88f434598bb9f740e42993bcc7cb6035eaadc986d +AUX gnome-control-center-2.32.1-erase-background.patch 1899 RMD160 3407e35a16bf8862ef99f8bccc270b183948bae5 SHA1 3cdd95012ec99df9c0d0dd6dc8350e0f1eed7b6d SHA256 95bc536d5b08191222acd63af0d2f626ef6ec3a54f7823a471e0b329f40de3f8 +AUX gnome-control-center-2.32.1-mime-handler.patch 55290 RMD160 0001d36b7409ece4ab0b0f1ecf3f762863028c9a SHA1 9b17ebe472aabb69c768618cada7bfbd10cbe910 SHA256 49c034e437493f1639e97b31e0a38b1921536abfe31d8b3c7917d0b8495994cd +AUX gnome-control-center-2.32.1-mime-handler2.patch 2229 RMD160 b8afdaa2b5df38ca6ba31f925bcbbb1b54f04d0e SHA1 6af85fb5fe55a8e05948338f66d79f10ca787e3e SHA256 3a49a66bb08cbcd24cf750894d156ba85686128e83561df40f8cfe88075ca99d +AUX gnome-control-center-2.32.1-mime-handler3.patch 11957 RMD160 16e734ec1dfecc1e95cfc9ffcfe3b8cd294ee712 SHA1 b069adce19b7286e410beae4b9909ecc13485d2e SHA256 8637fdb6039d43d085cf7cf2915b46e744522b7a3976d1b64035a6be22491538 AUX org.gnome.control-center.defaultbackground.policy 836 RMD160 0e830941e4e03bd0c84ec6a352ed5df598f2ccb5 SHA1 c70e2db5e125e1236b0e796c3d9e293ecb3b58a7 SHA256 4fb135d55626e03a2b02b6c325e0fa3ee773984af2258acb3e2f1b22373dce52 -DIST gnome-control-center-2.30.1.tar.bz2 2830194 RMD160 7323a59deb13a8017de4e9f6ee8499fad6b6d7aa SHA1 f7d3f486e114871e53f3d7e743d53b041ebf2f1e SHA256 db050803a4bf3a2297255b8fff4810f2125a5b001d3fd785ee1ecd7f2c6f593b DIST gnome-control-center-2.32.1.tar.bz2 2280217 RMD160 47515f3f96d5695b457a8363bac183fb2188a256 SHA1 1e5ba3117aba7f939de25dbed13e430b90968561 SHA256 7c568b57358e5c08f4d8dd76dbac7df2539135ad081872b60514b7a8ac797e66 -EBUILD gnome-control-center-2.30.1.ebuild 2250 RMD160 22a6ab0ab951f7f014f924f9eebaeeb077eaa5d4 SHA1 42adb4072570f90a0d863d1ffe75202dc7661b5c SHA256 f71d206e63d5602e8df79f7efe501720c5710986c2ae0d24b5afcea922bdf330 +EBUILD gnome-control-center-2.32.1-r1.ebuild 2634 RMD160 f836b616ba40db9ed1296b89bd14a0f828eda742 SHA1 6761d1970584f2397358167c7687e9a982b121a8 SHA256 439a35dfd992310830c87117f6a8d72fa5062471fa3ea3bf7b7b14de24537bab EBUILD gnome-control-center-2.32.1.ebuild 2049 RMD160 62350d5ee2c63d5dd080e79cf3a14d4f17423ab5 SHA1 006e4c19ca82cbef1b4029ebdcc18eb8b516c8c1 SHA256 ea12f0bc440f917fda3235659d412b4ce27b0dee4ab05851046725bbac73041e -MISC ChangeLog 51017 RMD160 41e8e885565306509039b248f48dfa92c73b8790 SHA1 1e11feca568fa6e8758172a9c4943b7165ee6d73 SHA256 4bab8658da8b5ece2bc91bbaf32fd2ad2c5cf12734a5ef845a4cf8dc36979165 +MISC ChangeLog 51844 RMD160 8dcc726c84df84f3bd1990b1c1e573508ecde009 SHA1 45609be1474a610a4731288701c06d7af3770192 SHA256 a274bb9ce135d9b80c4a243c8c02a09b95f2534c0da453551670ba3a11dd97b2 MISC metadata.xml 158 RMD160 c0e2bae8e91bb6be8922bac5e4f597302e06587e SHA1 38f78e9790bcd4382b4a49aa226aa6dda1d3a3d7 SHA256 3a7dbca0fdc557de69783e0663e2d76ddab129ea8a19b2d0ef6d3e5d1b947ce1 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.17 (GNU/Linux) + +iEYEARECAAYFAk2PaZ4ACgkQCaWpQKGI+9T4uQCghfy9trkGh/m3xRmbzudLwmsO +TBMAoID1cOlq2XR6LCFe/eYNjldDgMey +=Mw07 +-----END PGP SIGNATURE----- diff --git a/gnome-base/gnome-control-center/files/gnome-control-center-2.28.1-gdm-default-bg.patch b/gnome-base/gnome-control-center/files/gnome-control-center-2.28.1-gdm-default-bg.patch deleted file mode 100644 index bfd44cf7c768..000000000000 --- a/gnome-base/gnome-control-center/files/gnome-control-center-2.28.1-gdm-default-bg.patch +++ /dev/null @@ -1,160 +0,0 @@ -From d97abc9405b138f9d5ed600b85a9c1d0a97f1877 Mon Sep 17 00:00:00 2001 -From: Peter Henriksson <peter.henriksson@gmail.com> -Date: Mon, 16 Nov 2009 23:45:56 +0100 -Subject: [PATCH] Add functionality for setting the default background - -Rebased patch from gnome bug #536531. ---- - capplets/appearance/appearance-desktop.c | 115 ++++++++++++++++++++++++++++++ - 1 files changed, 115 insertions(+), 0 deletions(-) - -diff --git a/capplets/appearance/appearance-desktop.c b/capplets/appearance/appearance-desktop.c -index b0043dc..2568e35 100644 ---- a/capplets/appearance/appearance-desktop.c -+++ b/capplets/appearance/appearance-desktop.c -@@ -30,6 +30,7 @@ - #include <gconf/gconf-client.h> - #include <libgnomeui/gnome-desktop-thumbnail.h> - #include <libgnomeui/gnome-bg.h> -+#include <dbus/dbus-glib.h> - - enum { - TARGET_URI_LIST, -@@ -984,6 +985,100 @@ wp_select_after_realize (GtkWidget *widget, - select_item (data, item, TRUE); - } - -+static char *background_keys[7] = { -+ "/desktop/gnome/background/picture_filename", -+ "/desktop/gnome/background/picture_opacity", -+ "/desktop/gnome/background/picture_options", -+ "/desktop/gnome/background/color_shading_type", -+ "/desktop/gnome/background/primary_color", -+ "/desktop/gnome/background/secondary_color", -+ NULL -+}; -+ -+static void -+set_background (GtkAction *action, gpointer data) -+{ -+ AppearanceData *adata = (AppearanceData *)data; -+ DBusGProxy *proxy; -+ DBusGConnection *connection; -+ GError *error; -+ -+ gconf_client_suggest_sync (adata->client, NULL); -+ -+ error = NULL; -+ connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error); -+ if (error != NULL) { -+ g_warning ("failed to get system bus connection: %s", error->message); -+ g_error_free (error); -+ return; -+ } -+ -+ proxy = dbus_g_proxy_new_for_name (connection, -+ "org.gnome.GConf.Defaults", -+ "/", -+ "org.gnome.GConf.Defaults"); -+ if (proxy == NULL) { -+ g_warning ("Cannot connect to defaults mechanism"); -+ return; -+ } -+ -+ if (!dbus_g_proxy_call (proxy, "SetSystem", -+ &error, -+ G_TYPE_STRV, background_keys, -+ G_TYPE_STRV, NULL, -+ G_TYPE_INVALID, -+ G_TYPE_INVALID)) { -+ g_warning ("error calling SetSystem: %s\n", error->message); -+ g_error_free (error); -+ } -+ -+ g_object_unref (proxy); -+} -+ -+static void -+check_can_set_background (GtkAction *action) -+{ -+ DBusGProxy *proxy; -+ DBusGConnection *connection; -+ GError *error; -+ guint result; -+ -+ result = 0; -+ -+ error = NULL; -+ connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error); -+ if (error != NULL) { -+ g_warning ("failed to get system bus connection: %s", error->message); -+ g_error_free (error); -+ goto out; -+ } -+ -+ proxy = dbus_g_proxy_new_for_name (connection, -+ "org.gnome.GConf.Defaults", -+ "/", -+ "org.gnome.GConf.Defaults"); -+ if (proxy == NULL) { -+ g_warning ("Cannot connect to defaults mechanism"); -+ goto out; -+ } -+ -+ if (!dbus_g_proxy_call (proxy, "CanSetSystem", -+ &error, -+ G_TYPE_STRV, background_keys, -+ G_TYPE_INVALID, -+ G_TYPE_UINT, &result, -+ G_TYPE_INVALID)) { -+ g_warning ("error calling CanSetSystem: %s\n", error->message); -+ g_error_free (error); -+ } -+ -+ g_print ("calling CanSetSystem: %d\n", result); -+ g_object_unref (proxy); -+ -+out: -+ gtk_action_set_visible (action, result != 0); -+} -+ - static GdkPixbuf *buttons[3]; - - static void -@@ -1146,6 +1241,8 @@ desktop_init (AppearanceData *data, - { - GtkWidget *add_button, *w; - GtkCellRenderer *cr; -+ GtkAction *action; -+ GtkWidget *widget, *box, *button; - char *url; - - g_object_set (gtk_settings_get_default (), "gtk-tooltip-timeout", 500, NULL); -@@ -1295,6 +1392,24 @@ desktop_init (AppearanceData *data, - /* create the file selector later to save time on startup */ - data->wp_filesel = NULL; - -+ widget = appearance_capplet_get_widget (data, "background_vbox"); -+ box = gtk_hbox_new (FALSE, 0); -+ gtk_box_pack_end (GTK_BOX (widget), box, FALSE, FALSE, 0); -+ -+ action = gtk_action_new ("set-system", -+ _("Make Default"), -+ _("Set the current background as the system-wide default"), -+ NULL); -+ check_can_set_background (action); -+ -+ button = gtk_button_new (); -+ gtk_activatable_set_related_action (GTK_ACTIVATABLE (button), action); -+ gtk_widget_set_no_show_all (button, TRUE); -+ g_object_unref (action); -+ -+ gtk_box_pack_end (GTK_BOX (box), button, FALSE, FALSE, 0); -+ -+ g_signal_connect (action, "activate", G_CALLBACK (set_background), data); - } - - void --- -1.6.5.2 - diff --git a/gnome-base/gnome-control-center/files/gnome-control-center-2.32.1-duplicated-background.patch b/gnome-base/gnome-control-center/files/gnome-control-center-2.32.1-duplicated-background.patch new file mode 100644 index 000000000000..7b4250559ad4 --- /dev/null +++ b/gnome-base/gnome-control-center/files/gnome-control-center-2.32.1-duplicated-background.patch @@ -0,0 +1,115 @@ +Index: gnome-control-center-2.32.1/capplets/appearance/appearance-desktop.c +=================================================================== +--- gnome-control-center-2.32.1.orig/capplets/appearance/appearance-desktop.c ++++ gnome-control-center-2.32.1/capplets/appearance/appearance-desktop.c +@@ -48,6 +48,50 @@ static const GtkTargetEntry drag_types[] + + static void wp_update_preview (GtkFileChooser *chooser, AppearanceData *data); + ++static GnomeWPItem * ++lookup_with_symlink (AppearanceData *data, ++ const char *path, ++ char **real_path) ++{ ++ GnomeWPItem *item; ++ gchar *readlink; ++ ++ if (real_path) ++ *real_path = NULL; ++ ++ if (!path) ++ return NULL; ++ ++ item = g_hash_table_lookup (data->wp_hash, path); ++ if (item) ++ return item; ++ ++ /* if the current background is not in the hash of known backgrounds, ++ * see if it's a symlink and if the file it points to is in the hash */ ++ ++ readlink = g_strdup (path); ++ ++ while (readlink && ++ g_file_test (readlink, G_FILE_TEST_IS_SYMLINK) && ++ item == NULL) { ++ gchar *new; ++ ++ new = g_file_read_link (readlink, NULL); ++ g_free (readlink); ++ readlink = new; ++ ++ if (readlink) ++ item = g_hash_table_lookup (data->wp_hash, readlink); ++ } ++ ++ if (item != NULL && real_path) ++ *real_path = readlink; ++ else ++ g_free (readlink); ++ ++ return item; ++} ++ + static void + select_item (AppearanceData *data, + GnomeWPItem * item, +@@ -418,11 +462,16 @@ wp_uri_changed (const gchar *uri, + AppearanceData *data) + { + GnomeWPItem *item, *selected; ++ gchar *realuri; ++ ++ realuri = NULL; ++ item = lookup_with_symlink (data, uri, &realuri); ++ if (!realuri) ++ realuri = g_strdup (uri); + +- item = g_hash_table_lookup (data->wp_hash, uri); + selected = get_selected_item (data, NULL); + +- if (selected != NULL && strcmp (selected->filename, uri) != 0) ++ if (selected != NULL && strcmp (selected->filename, realuri) != 0) + { + if (item == NULL) + item = wp_add_image (data, uri); +@@ -430,6 +479,8 @@ wp_uri_changed (const gchar *uri, + if (item) + select_item (data, item, TRUE); + } ++ ++ g_free (realuri); + } + + static void +@@ -936,6 +987,7 @@ wp_load_stuffs (void *user_data) + AppearanceData *data; + gchar *imagepath, *uri, *style; + GnomeWPItem *item; ++ gchar *realpath; + + data = (AppearanceData *) user_data; + +@@ -971,7 +1023,12 @@ wp_load_stuffs (void *user_data) + + g_free (uri); + +- item = g_hash_table_lookup (data->wp_hash, imagepath); ++ realpath = NULL; ++ item = lookup_with_symlink (data, imagepath, &realpath); ++ if (realpath) { ++ g_free (imagepath); ++ imagepath = realpath; ++ } + + if (item != NULL) + { +@@ -986,7 +1043,9 @@ wp_load_stuffs (void *user_data) + wp_props_load_wallpaper (item->filename, item, data); + } + ++ data->wp_update_gconf = FALSE; + select_item (data, item, FALSE); ++ data->wp_update_gconf = TRUE; + } + } + else if (strcmp (style, "none") != 0) diff --git a/gnome-base/gnome-control-center/files/gnome-control-center-2.32.1-erase-background.patch b/gnome-base/gnome-control-center/files/gnome-control-center-2.32.1-erase-background.patch new file mode 100644 index 000000000000..00be2f2eb0fc --- /dev/null +++ b/gnome-base/gnome-control-center/files/gnome-control-center-2.32.1-erase-background.patch @@ -0,0 +1,46 @@ +diff -rupN gnome-control-center-2.32.0.old/capplets/appearance/appearance-desktop.c gnome-control-center-2.32.0.new/capplets/appearance/appearance-desktop.c +--- a/capplets/appearance/appearance-desktop.c 2010-09-21 08:54:55.000000000 -0400 ++++ b/capplets/appearance/appearance-desktop.c 2010-11-05 20:51:53.867234128 -0400 +@@ -1225,6 +1225,7 @@ desktop_init (AppearanceData *data, + GtkCellRenderer *cr; + char *url; + ++ data->wp_xml_list_loaded = FALSE; + data->wp_update_gconf = TRUE; + + data->wp_uris = NULL; +diff -rupN gnome-control-center-2.32.0.old/capplets/appearance/appearance.h gnome-control-center-2.32.0.new/capplets/appearance/appearance.h +--- a/capplets/appearance/appearance.h 2010-09-21 08:54:55.000000000 -0400 ++++ b/capplets/appearance/appearance.h 2010-11-05 20:51:58.050214779 -0400 +@@ -41,6 +41,7 @@ typedef struct + + /* desktop */ + GHashTable *wp_hash; ++ gboolean wp_xml_list_loaded; + gboolean wp_update_gconf; + GtkIconView *wp_view; + GtkTreeModel *wp_model; +diff -rupN gnome-control-center-2.32.0.old/capplets/appearance/gnome-wp-xml.c gnome-control-center-2.32.0.new/capplets/appearance/gnome-wp-xml.c +--- a/capplets/appearance/gnome-wp-xml.c 2010-09-21 08:54:55.000000000 -0400 ++++ b/capplets/appearance/gnome-wp-xml.c 2010-11-05 20:54:03.198634367 -0400 +@@ -378,6 +378,8 @@ void gnome_wp_xml_load_list (AppearanceD + gnome_wp_xml_load_from_dir (WALLPAPER_DATADIR, data); + + gnome_wp_load_legacy (data); ++ ++ data->wp_xml_list_loaded = TRUE; + } + + static void gnome_wp_list_flatten (const gchar * key, GnomeWPItem * item, +@@ -394,6 +396,11 @@ void gnome_wp_xml_save_list (AppearanceD + GSList * list = NULL; + gchar * wpfile; + ++ if (!data->wp_xml_list_loaded) { ++ g_hash_table_destroy (data->wp_hash); ++ return; ++ } ++ + g_hash_table_foreach (data->wp_hash, + (GHFunc) gnome_wp_list_flatten, &list); + g_hash_table_destroy (data->wp_hash); diff --git a/gnome-base/gnome-control-center/files/gnome-control-center-2.32.1-mime-handler.patch b/gnome-base/gnome-control-center/files/gnome-control-center-2.32.1-mime-handler.patch new file mode 100644 index 000000000000..6ab26b817fda --- /dev/null +++ b/gnome-base/gnome-control-center/files/gnome-control-center-2.32.1-mime-handler.patch @@ -0,0 +1,1274 @@ +diff -ur gnome-control-center-2.32.1.orig/capplets/default-applications/gnome-da-capplet.c gnome-control-center-2.32.1/capplets/default-applications/gnome-da-capplet.c +--- gnome-control-center-2.32.1.orig/capplets/default-applications/gnome-da-capplet.c 2011-03-27 15:30:55.000000000 +0200 ++++ gnome-control-center-2.32.1/capplets/default-applications/gnome-da-capplet.c 2011-03-27 15:31:26.000000000 +0200 +@@ -64,83 +64,26 @@ + } + + static void +-web_radiobutton_toggled_cb (GtkWidget *togglebutton, GnomeDACapplet *capplet) +-{ +- gint index; +- GnomeDAWebItem *item; +- const gchar *command; +- GError *error = NULL; +- +- index = gtk_combo_box_get_active (GTK_COMBO_BOX (capplet->web_combo_box)); +- +- if (index == -1) +- return; +- +- item = (GnomeDAWebItem *) g_list_nth_data (capplet->web_browsers, index); +- if (item == NULL) +- return; +- +- if (togglebutton == capplet->new_win_radiobutton) { +- command = item->win_command; +- } +- else if (togglebutton == capplet->new_tab_radiobutton) { +- command = item->tab_command; +- } +- else { +- command = item->generic.command; +- } +- +- gconf_client_set_string (capplet->gconf, DEFAULT_APPS_KEY_HTTP_EXEC, command, &error); +- +- gtk_entry_set_text (GTK_ENTRY (capplet->web_browser_command_entry), command); +- +- if (error != NULL) { +- g_warning (_("Error saving configuration: %s"), error->message); +- g_error_free (error); +- } +-} +- +-static void + web_combo_changed_cb (GtkComboBox *combo, GnomeDACapplet *capplet) + { + guint current_index; +- gboolean is_custom_active; +- gboolean has_net_remote; +- GnomeDAWebItem *item; +- GtkWidget *active = NULL; + + current_index = gtk_combo_box_get_active (combo); + + if (current_index < g_list_length (capplet->web_browsers)) { ++ GnomeDAURLItem *item; ++ GError *error = NULL; + +- item = (GnomeDAWebItem*) g_list_nth_data (capplet->web_browsers, current_index); +- has_net_remote = item->netscape_remote; +- is_custom_active = FALSE; +- +- } +- else { +- has_net_remote = FALSE; +- is_custom_active = TRUE; +- } +- gtk_widget_set_sensitive (capplet->default_radiobutton, has_net_remote); +- gtk_widget_set_sensitive (capplet->new_win_radiobutton, has_net_remote); +- gtk_widget_set_sensitive (capplet->new_tab_radiobutton, has_net_remote); +- +- gtk_widget_set_sensitive (capplet->web_browser_command_entry, is_custom_active); +- gtk_widget_set_sensitive (capplet->web_browser_command_label, is_custom_active); +- gtk_widget_set_sensitive (capplet->web_browser_terminal_checkbutton, is_custom_active); +- +- if (has_net_remote) { +- +- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (capplet->new_win_radiobutton))) +- active = capplet->new_win_radiobutton; +- else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (capplet->new_tab_radiobutton))) +- active = capplet->new_tab_radiobutton; +- else +- active = capplet->default_radiobutton; ++ item = (GnomeDAURLItem*) g_list_nth_data (capplet->web_browsers, current_index); ++ if (item == NULL) ++ return; ++ ++ if (!g_app_info_set_as_default_for_type (item->app_info, "x-scheme-handler/http", &error) || ++ !g_app_info_set_as_default_for_type (item->app_info, "x-scheme-handler/https", &error)) { ++ g_warning (_("Error setting default browser: %s"), error->message); ++ g_error_free (error); ++ } + } +- +- web_radiobutton_toggled_cb (active, capplet); + } + + /* FIXME: Refactor these two functions below into one... */ +@@ -148,14 +91,23 @@ + mail_combo_changed_cb (GtkComboBox *combo, GnomeDACapplet *capplet) + { + guint current_index; +- gboolean is_custom_active; + + current_index = gtk_combo_box_get_active (combo); +- is_custom_active = (current_index >= g_list_length (capplet->mail_readers)); + +- gtk_widget_set_sensitive (capplet->mail_reader_command_entry, is_custom_active); +- gtk_widget_set_sensitive (capplet->mail_reader_command_label, is_custom_active); +- gtk_widget_set_sensitive (capplet->mail_reader_terminal_checkbutton, is_custom_active); ++ if (current_index < g_list_length (capplet->mail_readers)) { ++ GnomeDAURLItem *item; ++ GError *error = NULL; ++ ++ item = (GnomeDAURLItem*) g_list_nth_data (capplet->mail_readers, current_index); ++ if (item == NULL) ++ return; ++ ++ if (!g_app_info_set_as_default_for_type (item->app_info, "x-scheme-handler/mailto", &error)) { ++ g_warning (_("Error setting default mailer: %s"), error->message); ++ g_error_free (error); ++ } ++ } ++ + } + + static void +@@ -297,221 +249,6 @@ + return (strcmp (((GnomeDAItem *) list_item)->command, (gchar *) command)); + } + +-static gint +-web_item_comp (gconstpointer item, gconstpointer command) +-{ +- GnomeDAWebItem *web_list_item; +- +- web_list_item = (GnomeDAWebItem *) item; +- +- if (strcmp (web_list_item->generic.command, (gchar *) command) == 0) +- return 0; +- +- if (web_list_item->netscape_remote) { +- if (strcmp (web_list_item->tab_command, (gchar *) command) == 0) +- return 0; +- +- if (strcmp (web_list_item->win_command, (gchar *) command) == 0) +- return 0; +- } +- +- return (strcmp (web_list_item->generic.command, (gchar *) command)); +-} +- +-static void +-web_gconf_changed_cb (GConfPropertyEditor *peditor, gchar *key, GConfValue *value, GnomeDACapplet *capplet) +-{ +- GConfChangeSet *cs; +- GError *error = NULL; +- GList *list_entry; +- +- /* This function is used to update HTTPS,ABOUT and UNKNOWN handlers, which +- * should also use the same value as HTTP +- */ +- +- if (strcmp (key, DEFAULT_APPS_KEY_HTTP_EXEC) == 0) { +- gchar *short_browser, *pos; +- const gchar *value_str = gconf_value_get_string (value); +- +- cs = gconf_change_set_new (); +- +- gconf_change_set_set (cs, DEFAULT_APPS_KEY_HTTPS_EXEC, value); +- gconf_change_set_set (cs, DEFAULT_APPS_KEY_UNKNOWN_EXEC, value); +- gconf_change_set_set (cs, DEFAULT_APPS_KEY_ABOUT_EXEC, value); +- pos = strstr (value_str, " "); +- if (pos == NULL) +- short_browser = g_strdup (value_str); +- else +- short_browser = g_strndup (value_str, pos - value_str); +- gconf_change_set_set_string (cs, DEFAULT_APPS_KEY_BROWSER_EXEC, short_browser); +- g_free (short_browser); +- +- list_entry = g_list_find_custom (capplet->web_browsers, +- value_str, +- (GCompareFunc) web_item_comp); +- +- if (list_entry) { +- GnomeDAWebItem *item = (GnomeDAWebItem *) list_entry->data; +- +- gconf_change_set_set_bool (cs, DEFAULT_APPS_KEY_BROWSER_NREMOTE, item->netscape_remote); +- } +- +- gconf_client_commit_change_set (capplet->gconf, cs, TRUE, &error); +- +- if (error != NULL) { +- g_warning (_("Error saving configuration: %s"), error->message); +- g_error_free (error); +- error = NULL; +- } +- +- gconf_change_set_unref (cs); +- } +- else if (strcmp (key, DEFAULT_APPS_KEY_HTTP_NEEDS_TERM) == 0) { +- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (capplet->web_browser_terminal_checkbutton), +- gconf_value_get_bool (value)); +- +- cs = gconf_change_set_new (); +- +- gconf_change_set_set (cs, DEFAULT_APPS_KEY_HTTPS_NEEDS_TERM, value); +- gconf_change_set_set (cs, DEFAULT_APPS_KEY_UNKNOWN_NEEDS_TERM, value); +- gconf_change_set_set (cs, DEFAULT_APPS_KEY_ABOUT_NEEDS_TERM, value); +- gconf_change_set_set (cs, DEFAULT_APPS_KEY_BROWSER_NEEDS_TERM, value); +- +- gconf_client_commit_change_set (capplet->gconf, cs, TRUE, &error); +- +- if (error != NULL) { +- g_warning (_("Error saving configuration: %s"), error->message); +- g_error_free (error); +- error = NULL; +- } +- +- gconf_change_set_unref (cs); +- } +-} +- +-static void +-web_browser_update_radio_buttons (GnomeDACapplet *capplet, const gchar *command) +-{ +- GList *entry; +- gboolean has_net_remote; +- +- entry = g_list_find_custom (capplet->web_browsers, command, (GCompareFunc) web_item_comp); +- +- if (entry) { +- GnomeDAWebItem *item = (GnomeDAWebItem *) entry->data; +- +- has_net_remote = item->netscape_remote; +- +- if (has_net_remote) { +- /* disable "toggle" signal emitting, thus preventing calling this function twice */ +- g_signal_handlers_block_matched (capplet->default_radiobutton, G_SIGNAL_MATCH_FUNC, 0, +- 0, NULL, G_CALLBACK (web_radiobutton_toggled_cb), NULL); +- g_signal_handlers_block_matched (capplet->new_tab_radiobutton, G_SIGNAL_MATCH_FUNC, 0, +- 0, NULL, G_CALLBACK (web_radiobutton_toggled_cb), NULL); +- g_signal_handlers_block_matched (capplet->new_win_radiobutton,G_SIGNAL_MATCH_FUNC, 0, +- 0, NULL, G_CALLBACK (web_radiobutton_toggled_cb), NULL); +- +- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (capplet->default_radiobutton), +- strcmp (item->generic.command, command) == 0); +- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (capplet->new_tab_radiobutton), +- strcmp (item->tab_command, command) == 0); +- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (capplet->new_win_radiobutton), +- strcmp (item->win_command, command) == 0); +- +- g_signal_handlers_unblock_matched (capplet->default_radiobutton, G_SIGNAL_MATCH_FUNC, 0, +- 0, NULL, G_CALLBACK (web_radiobutton_toggled_cb), NULL); +- g_signal_handlers_unblock_matched (capplet->new_tab_radiobutton, G_SIGNAL_MATCH_FUNC, 0, +- 0, NULL, G_CALLBACK (web_radiobutton_toggled_cb), NULL); +- g_signal_handlers_unblock_matched (capplet->new_win_radiobutton, G_SIGNAL_MATCH_FUNC, 0, +- 0, NULL, G_CALLBACK (web_radiobutton_toggled_cb), NULL); +- } +- } +- else { +- has_net_remote = FALSE; +- } +- +- gtk_widget_set_sensitive (capplet->default_radiobutton, has_net_remote); +- gtk_widget_set_sensitive (capplet->new_win_radiobutton, has_net_remote); +- gtk_widget_set_sensitive (capplet->new_tab_radiobutton, has_net_remote); +-} +- +-static GConfValue* +-web_combo_conv_to_widget (GConfPropertyEditor *peditor, const GConfValue *value) +-{ +- GConfValue *ret; +- GList *entry, *handlers; +- const gchar *command; +- gint index; +- GnomeDACapplet *capplet; +- +- g_object_get (G_OBJECT (peditor), "data", &capplet, NULL); +- +- command = gconf_value_get_string (value); +- handlers = capplet->web_browsers; +- +- if (handlers) +- { +- entry = g_list_find_custom (handlers, command, (GCompareFunc) web_item_comp); +- if (entry) +- index = g_list_position (handlers, entry); +- else +- index = g_list_length (handlers) + 1; +- } +- else +- { +- /* if the item has no handlers lsit then select the Custom item */ +- index = 1; +- } +- +- web_browser_update_radio_buttons (capplet, command); +- +- ret = gconf_value_new (GCONF_VALUE_INT); +- gconf_value_set_int (ret, index); +- +- return ret; +-} +- +-static GConfValue* +-web_combo_conv_from_widget (GConfPropertyEditor *peditor, const GConfValue *value) +-{ +- GConfValue *ret; +- GList *handlers; +- gint index; +- GnomeDAWebItem *item; +- const gchar *command; +- GnomeDACapplet *capplet; +- +- g_object_get (G_OBJECT (peditor), "data", &capplet, NULL); +- +- index = gconf_value_get_int (value); +- handlers = capplet->web_browsers; +- +- item = g_list_nth_data (handlers, index); +- +- ret = gconf_value_new (GCONF_VALUE_STRING); +- if (!item) +- { +- /* if item was not found, this is probably the "Custom" item */ +- /* XXX: returning "" as the value here is not ideal, but required to +- * prevent the combo box from jumping back to the previous value if the +- * user has selected Custom */ +- gconf_value_set_string (ret, ""); +- return ret; +- } +- else +- { +- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (capplet->new_win_radiobutton)) && item->netscape_remote == TRUE) +- command = item->win_command; +- else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (capplet->new_tab_radiobutton)) && item->netscape_remote == TRUE) +- command = item->tab_command; +- else +- command = item->generic.command; +- +- gconf_value_set_string (ret, command); +- return ret; +- } +-} +- + static GConfValue* + combo_conv_to_widget (GConfPropertyEditor *peditor, const GConfValue *value) + { +@@ -632,7 +369,7 @@ + } + + static void +-fill_combo_box (GtkIconTheme *theme, GtkComboBox *combo_box, GList *app_list) ++fill_combo_box (GtkIconTheme *theme, GtkComboBox *combo_box, GList *app_list, gboolean add_custom) + { + GList *entry; + GtkTreeModel *model; +@@ -644,8 +381,10 @@ + theme = gtk_icon_theme_get_default (); + } + +- gtk_combo_box_set_row_separator_func (combo_box, is_separator, +- GINT_TO_POINTER (g_list_length (app_list)), NULL); ++ if (add_custom) { ++ gtk_combo_box_set_row_separator_func (combo_box, is_separator, ++ GINT_TO_POINTER (g_list_length (app_list)), NULL); ++ } + + model = GTK_TREE_MODEL (gtk_list_store_new (2, GDK_TYPE_PIXBUF, G_TYPE_STRING)); + gtk_combo_box_set_model (combo_box, model); +@@ -683,13 +422,41 @@ + g_object_unref (pixbuf); + } + +- gtk_list_store_append (GTK_LIST_STORE (model), &iter); +- gtk_list_store_set (GTK_LIST_STORE (model), &iter, -1); +- gtk_list_store_append (GTK_LIST_STORE (model), &iter); +- gtk_list_store_set (GTK_LIST_STORE (model), &iter, +- PIXBUF_COL, NULL, +- TEXT_COL, _("Custom"), +- -1); ++ if (add_custom) { ++ gtk_list_store_append (GTK_LIST_STORE (model), &iter); ++ gtk_list_store_set (GTK_LIST_STORE (model), &iter, -1); ++ gtk_list_store_append (GTK_LIST_STORE (model), &iter); ++ gtk_list_store_set (GTK_LIST_STORE (model), &iter, ++ PIXBUF_COL, NULL, ++ TEXT_COL, _("Custom"), ++ -1); ++ } ++} ++ ++static void ++select_current_for_uri_scheme (GtkComboBox *combo_box, GList *app_list, const gchar *uri) ++{ ++ GAppInfo *current_default; ++ GList *l; ++ int index; ++ ++ current_default = g_app_info_get_default_for_uri_scheme (uri); ++ if (!current_default) ++ return; ++ ++ index = 0; ++ ++ for (l = app_list; l != NULL; l = l->next) { ++ if (!g_app_info_equal (current_default, ((GnomeDAURLItem *) l->data)->app_info)) { ++ index++; ++ continue; ++ } ++ ++ gtk_combo_box_set_active (combo_box, index); ++ break; ++ } ++ ++ g_object_unref (current_default); + } + + static GtkWidget* +@@ -702,7 +469,6 @@ + static void + show_dialog (GnomeDACapplet *capplet, const gchar *start_page) + { +- GObject *obj; + GtkBuilder *builder; + guint builder_result; + +@@ -732,17 +498,6 @@ + capplet->window = _gtk_builder_get_widget (builder,"preferred_apps_dialog"); + g_signal_connect (capplet->window, "response", G_CALLBACK (close_cb), NULL); + +- capplet->web_browser_command_entry = _gtk_builder_get_widget (builder, "web_browser_command_entry"); +- capplet->web_browser_command_label = _gtk_builder_get_widget (builder, "web_browser_command_label"); +- capplet->web_browser_terminal_checkbutton = _gtk_builder_get_widget(builder, "web_browser_terminal_checkbutton"); +- capplet->default_radiobutton = _gtk_builder_get_widget (builder, "web_browser_default_radiobutton"); +- capplet->new_win_radiobutton = _gtk_builder_get_widget (builder, "web_browser_new_win_radiobutton"); +- capplet->new_tab_radiobutton = _gtk_builder_get_widget (builder, "web_browser_new_tab_radiobutton"); +- +- capplet->mail_reader_command_entry = _gtk_builder_get_widget (builder, "mail_reader_command_entry"); +- capplet->mail_reader_command_label = _gtk_builder_get_widget (builder, "mail_reader_command_label"); +- capplet->mail_reader_terminal_checkbutton = _gtk_builder_get_widget (builder, "mail_reader_terminal_checkbutton"); +- + capplet->terminal_command_entry = _gtk_builder_get_widget (builder, "terminal_command_entry"); + capplet->terminal_command_label = _gtk_builder_get_widget (builder, "terminal_command_label"); + capplet->terminal_exec_flag_entry = _gtk_builder_get_widget (builder, "terminal_exec_flag_entry"); +@@ -770,12 +525,15 @@ + g_signal_connect (capplet->window, "screen-changed", G_CALLBACK (screen_changed_cb), capplet); + screen_changed_cb (capplet->window, gdk_screen_get_default (), capplet); + +- fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->web_combo_box), capplet->web_browsers); +- fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->mail_combo_box), capplet->mail_readers); +- fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->term_combo_box), capplet->terminals); +- fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->media_combo_box), capplet->media_players); +- fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->visual_combo_box), capplet->visual_ats); +- fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->mobility_combo_box), capplet->mobility_ats); ++ fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->web_combo_box), capplet->web_browsers, FALSE); ++ fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->mail_combo_box), capplet->mail_readers, FALSE); ++ fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->term_combo_box), capplet->terminals, TRUE); ++ fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->media_combo_box), capplet->media_players, TRUE); ++ fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->visual_combo_box), capplet->visual_ats, TRUE); ++ fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->mobility_combo_box), capplet->mobility_ats, TRUE); ++ ++ select_current_for_uri_scheme (GTK_COMBO_BOX (capplet->web_combo_box), capplet->web_browsers, "http"); ++ select_current_for_uri_scheme (GTK_COMBO_BOX (capplet->mail_combo_box), capplet->mail_readers, "mailto"); + + g_signal_connect (capplet->web_combo_box, "changed", G_CALLBACK (web_combo_changed_cb), capplet); + g_signal_connect (capplet->mail_combo_box, "changed", G_CALLBACK (mail_combo_changed_cb), capplet); +@@ -784,53 +542,8 @@ + g_signal_connect (capplet->visual_combo_box, "changed", G_CALLBACK (visual_combo_changed_cb), capplet); + g_signal_connect (capplet->mobility_combo_box, "changed", G_CALLBACK (mobility_combo_changed_cb), capplet); + +- +- g_signal_connect (capplet->default_radiobutton, "toggled", G_CALLBACK (web_radiobutton_toggled_cb), capplet); +- g_signal_connect (capplet->new_win_radiobutton, "toggled", G_CALLBACK (web_radiobutton_toggled_cb), capplet); +- g_signal_connect (capplet->new_tab_radiobutton, "toggled", G_CALLBACK (web_radiobutton_toggled_cb), capplet); +- + /* Setup GConfPropertyEditors */ + +- /* Web Browser */ +- gconf_peditor_new_combo_box (NULL, +- DEFAULT_APPS_KEY_HTTP_EXEC, +- capplet->web_combo_box, +- "conv-from-widget-cb", web_combo_conv_from_widget, +- "conv-to-widget-cb", web_combo_conv_to_widget, +- "data", capplet, +- NULL); +- +- obj = gconf_peditor_new_string (NULL, +- DEFAULT_APPS_KEY_HTTP_EXEC, +- capplet->web_browser_command_entry, +- NULL); +- g_signal_connect (obj, "value-changed", G_CALLBACK (web_gconf_changed_cb), capplet); +- +- obj = gconf_peditor_new_boolean (NULL, +- DEFAULT_APPS_KEY_HTTP_NEEDS_TERM, +- capplet->web_browser_terminal_checkbutton, +- NULL); +- g_signal_connect (obj, "value-changed", G_CALLBACK (web_gconf_changed_cb), capplet); +- +- /* Mailer */ +- gconf_peditor_new_combo_box (NULL, +- DEFAULT_APPS_KEY_MAILER_EXEC, +- capplet->mail_combo_box, +- "conv-from-widget-cb", combo_conv_from_widget, +- "conv-to-widget-cb", combo_conv_to_widget, +- "data", capplet->mail_readers, +- NULL); +- +- gconf_peditor_new_string (NULL, +- DEFAULT_APPS_KEY_MAILER_EXEC, +- capplet->mail_reader_command_entry, +- NULL); +- +- gconf_peditor_new_boolean (NULL, +- DEFAULT_APPS_KEY_MAILER_NEEDS_TERM, +- capplet->mail_reader_terminal_checkbutton, +- NULL); +- + /* Media player */ + gconf_peditor_new_combo_box (NULL, + DEFAULT_APPS_KEY_MEDIA_EXEC, +diff -ur gnome-control-center-2.32.1.orig/capplets/default-applications/gnome-da-capplet.h gnome-control-center-2.32.1/capplets/default-applications/gnome-da-capplet.h +--- gnome-control-center-2.32.1.orig/capplets/default-applications/gnome-da-capplet.h 2011-03-27 15:30:55.000000000 +0200 ++++ gnome-control-center-2.32.1/capplets/default-applications/gnome-da-capplet.h 2011-03-27 15:31:26.000000000 +0200 +@@ -85,17 +85,6 @@ + GtkWidget *visual_combo_box; + GtkWidget *mobility_combo_box; + +- GtkWidget *web_browser_command_entry; +- GtkWidget *web_browser_command_label; +- GtkWidget *web_browser_terminal_checkbutton; +- GtkWidget *default_radiobutton; +- GtkWidget *new_win_radiobutton; +- GtkWidget *new_tab_radiobutton; +- +- GtkWidget *mail_reader_command_entry; +- GtkWidget *mail_reader_command_label; +- GtkWidget *mail_reader_terminal_checkbutton; +- + GtkWidget *terminal_command_entry; + GtkWidget *terminal_command_label; + GtkWidget *terminal_exec_flag_entry; +diff -ur gnome-control-center-2.32.1.orig/capplets/default-applications/gnome-da-item.c gnome-control-center-2.32.1/capplets/default-applications/gnome-da-item.c +--- gnome-control-center-2.32.1.orig/capplets/default-applications/gnome-da-item.c 2011-03-27 15:30:55.000000000 +0200 ++++ gnome-control-center-2.32.1/capplets/default-applications/gnome-da-item.c 2011-03-27 15:31:26.000000000 +0200 +@@ -21,12 +21,12 @@ + #include "gnome-da-capplet.h" + #include "gnome-da-item.h" + +-GnomeDAWebItem* +-gnome_da_web_item_new (void) ++GnomeDAURLItem* ++gnome_da_url_item_new (void) + { +- GnomeDAWebItem *item = NULL; ++ GnomeDAURLItem *item = NULL; + +- item = g_new0 (GnomeDAWebItem, 1); ++ item = g_new0 (GnomeDAURLItem, 1); + + return item; + } +@@ -72,7 +72,7 @@ + } + + void +-gnome_da_web_item_free (GnomeDAWebItem *item) ++gnome_da_url_item_free (GnomeDAURLItem *item) + { + g_return_if_fail (item != NULL); + +@@ -82,8 +82,7 @@ + g_free (item->generic.icon_name); + g_free (item->generic.icon_path); + +- g_free (item->tab_command); +- g_free (item->win_command); ++ g_object_unref (item->app_info); + + g_free (item); + } +diff -ur gnome-control-center-2.32.1.orig/capplets/default-applications/gnome-da-item.h gnome-control-center-2.32.1/capplets/default-applications/gnome-da-item.h +--- gnome-control-center-2.32.1.orig/capplets/default-applications/gnome-da-item.h 2011-03-27 15:30:55.000000000 +0200 ++++ gnome-control-center-2.32.1/capplets/default-applications/gnome-da-item.h 2011-03-27 15:31:26.000000000 +0200 +@@ -25,7 +25,7 @@ + + typedef struct _GnomeDAItem GnomeDAItem; + +-typedef struct _GnomeDAWebItem GnomeDAWebItem; ++typedef struct _GnomeDAURLItem GnomeDAURLItem; + typedef struct _GnomeDATermItem GnomeDATermItem; + typedef struct _GnomeDASimpleItem GnomeDASimpleItem; + typedef struct _GnomeDAVisualItem GnomeDAVisualItem; +@@ -39,17 +39,14 @@ + gchar *icon_path; + }; + +-struct _GnomeDAWebItem { ++struct _GnomeDASimpleItem { + GnomeDAItem generic; + gboolean run_in_terminal; +- gboolean netscape_remote; +- gchar *tab_command; +- gchar *win_command; + }; + +-struct _GnomeDASimpleItem { ++struct _GnomeDAURLItem { + GnomeDAItem generic; +- gboolean run_in_terminal; ++ GAppInfo *app_info; + }; + + struct _GnomeDATermItem { +@@ -67,13 +64,13 @@ + gboolean run_at_startup; + }; + +-GnomeDAWebItem* gnome_da_web_item_new (void); + GnomeDATermItem* gnome_da_term_item_new (void); ++GnomeDAURLItem* gnome_da_url_item_new (void); + GnomeDASimpleItem* gnome_da_simple_item_new (void); + GnomeDAVisualItem* gnome_da_visual_item_new (void); + GnomeDAMobilityItem* gnome_da_mobility_item_new (void); +-void gnome_da_web_item_free (GnomeDAWebItem *item); + void gnome_da_term_item_free (GnomeDATermItem *item); ++void gnome_da_url_item_free (GnomeDAURLItem *item); + void gnome_da_simple_item_free (GnomeDASimpleItem *item); + void gnome_da_visual_item_free (GnomeDAVisualItem *item); + void gnome_da_mobility_item_free (GnomeDAMobilityItem *item); +diff -ur gnome-control-center-2.32.1.orig/capplets/default-applications/gnome-da-xml.c gnome-control-center-2.32.1/capplets/default-applications/gnome-da-xml.c +--- gnome-control-center-2.32.1.orig/capplets/default-applications/gnome-da-xml.c 2011-03-27 15:30:55.000000000 +0200 ++++ gnome-control-center-2.32.1/capplets/default-applications/gnome-da-xml.c 2011-03-27 15:31:26.000000000 +0200 +@@ -47,7 +47,7 @@ + if (!xmlStrncmp (element->name, xml_val_name, len)) { + xmlChar *cont = xmlNodeGetContent (element); + +- if (!xmlStrcasecmp (cont, "true") || !xmlStrcasecmp (cont, "1")) ++ if (!xmlStrcasecmp (cont, (const xmlChar *) "true") || !xmlStrcasecmp (cont, (const xmlChar *) "1")) + ret_val = TRUE; + else + ret_val = FALSE; +@@ -91,7 +91,7 @@ + } + else { + for (i = 0; sys_langs[i] != NULL; i++) { +- if (!strcmp (sys_langs[i], node_lang)) { ++ if (!strcmp ((const char *) sys_langs[i], (const char *) node_lang)) { + ret_val = (gchar *) xmlNodeGetContent (element); + /* since sys_langs is sorted from most desirable to + * least desirable, exit at first match +@@ -109,7 +109,7 @@ + } + + static gboolean +-is_executable_valid (gchar *executable) ++is_executable_valid (const gchar *executable) + { + gchar *path; + +@@ -129,8 +129,6 @@ + xmlDoc *xml_doc; + xmlNode *root, *section, *element; + gchar *executable; +- GnomeDAWebItem *web_item; +- GnomeDASimpleItem *mail_item; + GnomeDASimpleItem *media_item; + GnomeDATermItem *term_item; + GnomeDAVisualItem *visual_item; +@@ -144,56 +142,9 @@ + root = xmlDocGetRootElement (xml_doc); + + for (section = root->children; section != NULL; section = section->next) { +- if (!xmlStrncmp (section->name, "web-browsers", 12)) { ++ if (!xmlStrncmp (section->name, (const xmlChar *) "terminals", 9)) { + for (element = section->children; element != NULL; element = element->next) { +- if (!xmlStrncmp (element->name, "web-browser", 11)) { +- executable = gnome_da_xml_get_string (element, "executable"); +- if (is_executable_valid (executable)) { +- web_item = gnome_da_web_item_new (); +- +- web_item->generic.name = gnome_da_xml_get_string (element, "name"); +- web_item->generic.executable = executable; +- web_item->generic.command = gnome_da_xml_get_string (element, "command"); +- web_item->generic.icon_name = gnome_da_xml_get_string (element, "icon-name"); +- +- web_item->run_in_terminal = gnome_da_xml_get_bool (element, "run-in-terminal"); +- web_item->netscape_remote = gnome_da_xml_get_bool (element, "netscape-remote"); +- if (web_item->netscape_remote) { +- web_item->tab_command = gnome_da_xml_get_string (element, "tab-command"); +- web_item->win_command = gnome_da_xml_get_string (element, "win-command"); +- } +- +- capplet->web_browsers = g_list_append (capplet->web_browsers, web_item); +- } +- else +- g_free (executable); +- } +- } +- } +- else if (!xmlStrncmp (section->name, "mail-readers", 12)) { +- for (element = section->children; element != NULL; element = element->next) { +- if (!xmlStrncmp (element->name, "mail-reader", 11)) { +- executable = gnome_da_xml_get_string (element, "executable"); +- if (is_executable_valid (executable)) { +- mail_item = gnome_da_simple_item_new (); +- +- mail_item->generic.name = gnome_da_xml_get_string (element, "name"); +- mail_item->generic.executable = executable; +- mail_item->generic.command = gnome_da_xml_get_string (element, "command"); +- mail_item->generic.icon_name = gnome_da_xml_get_string (element, "icon-name"); +- +- mail_item->run_in_terminal = gnome_da_xml_get_bool (element, "run-in-terminal"); +- +- capplet->mail_readers = g_list_append (capplet->mail_readers, mail_item); +- } +- else +- g_free (executable); +- } +- } +- } +- else if (!xmlStrncmp (section->name, "terminals", 9)) { +- for (element = section->children; element != NULL; element = element->next) { +- if (!xmlStrncmp (element->name, "terminal", 8)) { ++ if (!xmlStrncmp (element->name, (const xmlChar *) "terminal", 8)) { + executable = gnome_da_xml_get_string (element, "executable"); + if (is_executable_valid (executable)) { + term_item = gnome_da_term_item_new (); +@@ -212,9 +163,9 @@ + } + } + } +- else if (!xmlStrncmp (section->name, "media-players", 13)) { ++ else if (!xmlStrncmp (section->name, (const xmlChar *) "media-players", 13)) { + for (element = section->children; element != NULL; element = element->next) { +- if (!xmlStrncmp (element->name, "media-player", 12)) { ++ if (!xmlStrncmp (element->name, (const xmlChar *) "media-player", 12)) { + executable = gnome_da_xml_get_string (element, "executable"); + if (is_executable_valid (executable)) { + media_item = gnome_da_simple_item_new (); +@@ -233,9 +184,9 @@ + } + } + } +- else if (!xmlStrncmp (section->name, "a11y-visual", 11)) { ++ else if (!xmlStrncmp (section->name, (const xmlChar *) "a11y-visual", 11)) { + for (element = section->children; element != NULL; element = element->next) { +- if (!xmlStrncmp (element->name, "visual", 6)) { ++ if (!xmlStrncmp (element->name, (const xmlChar *) "visual", 6)) { + executable = gnome_da_xml_get_string (element,"executable"); + if (is_executable_valid (executable)) { + visual_item = gnome_da_visual_item_new (); +@@ -254,9 +205,9 @@ + } + } + } +- else if (!xmlStrncmp (section->name, "a11y-mobility", 13)) { ++ else if (!xmlStrncmp (section->name, (const xmlChar *) "a11y-mobility", 13)) { + for (element = section->children; element != NULL; element = element->next) { +- if (!xmlStrncmp (element->name, "mobility", 8)) { ++ if (!xmlStrncmp (element->name, (const xmlChar *) "mobility", 8)) { + executable = gnome_da_xml_get_string (element,"executable"); + if (is_executable_valid (executable)) { + mobility_item = gnome_da_mobility_item_new (); +@@ -280,11 +231,46 @@ + xmlFreeDoc (xml_doc); + } + ++static GList * ++load_url_handlers (GnomeDACapplet *capplet, const gchar *scheme) ++{ ++ GList *app_list, *l, *ret; ++ ++ app_list = g_app_info_get_all_for_type (scheme); ++ ret = NULL; ++ ++ for (l = app_list; l != NULL; l = l->next) { ++ const gchar *executable; ++ GAppInfo *app_info = l->data; ++ ++ executable = g_app_info_get_executable (app_info); ++ if (is_executable_valid (executable)) { ++ GnomeDAURLItem *url_item; ++ ++ url_item = gnome_da_url_item_new (); ++ url_item->generic.name = g_strdup (g_app_info_get_display_name (app_info)); ++ url_item->generic.executable = g_strdup (executable); ++ url_item->generic.command = g_strdup (g_app_info_get_commandline (app_info)); ++ url_item->generic.icon_name = g_strdup (g_app_info_get_name (app_info)); ++ /* Steal the reference */ ++ url_item->app_info = app_info; ++ ++ ret = g_list_prepend (ret, url_item); ++ } else { ++ g_object_unref (app_info); ++ } ++ } ++ g_list_free (app_list); ++ ++ return g_list_reverse (ret); ++} ++ + void + gnome_da_xml_load_list (GnomeDACapplet *capplet) + { + GDir *app_dir = g_dir_open (GNOMECC_APPS_DIR, 0, NULL); + ++ /* First load all applications from the XML files */ + if (app_dir != NULL) { + const gchar *extra_file; + gchar *filename; +@@ -299,13 +285,17 @@ + } + g_dir_close (app_dir); + } ++ ++ /* Now load URL handlers */ ++ capplet->web_browsers = load_url_handlers (capplet, "x-scheme-handler/http"); ++ capplet->mail_readers = load_url_handlers (capplet, "x-scheme-handler/mailto"); + } + + void + gnome_da_xml_free (GnomeDACapplet *capplet) + { +- g_list_foreach (capplet->web_browsers, (GFunc) gnome_da_web_item_free, NULL); +- g_list_foreach (capplet->mail_readers, (GFunc) gnome_da_simple_item_free, NULL); ++ g_list_foreach (capplet->web_browsers, (GFunc) gnome_da_url_item_free, NULL); ++ g_list_foreach (capplet->mail_readers, (GFunc) gnome_da_url_item_free, NULL); + g_list_foreach (capplet->terminals, (GFunc) gnome_da_term_item_free, NULL); + g_list_foreach (capplet->media_players, (GFunc) gnome_da_simple_item_free, NULL); + g_list_foreach (capplet->visual_ats, (GFunc) gnome_da_visual_item_free, NULL); +diff -ur gnome-control-center-2.32.1.orig/capplets/default-applications/gnome-default-applications-properties.ui gnome-control-center-2.32.1/capplets/default-applications/gnome-default-applications-properties.ui +--- gnome-control-center-2.32.1.orig/capplets/default-applications/gnome-default-applications-properties.ui 2011-03-27 15:30:55.000000000 +0200 ++++ gnome-control-center-2.32.1/capplets/default-applications/gnome-default-applications-properties.ui 2011-03-27 15:31:26.000000000 +0200 +@@ -1,4 +1,4 @@ +-<?xml version="1.0"?> ++<?xml version="1.0" encoding="UTF-8"?> + <interface> + <requires lib="gtk+" version="2.16"/> + <!-- interface-naming-policy toplevel-contextual --> +@@ -69,122 +69,7 @@ + </packing> + </child> + <child> +- <object class="GtkTable" id="web_browser_options_table"> +- <property name="visible">True</property> +- <property name="n_rows">4</property> +- <property name="n_columns">3</property> +- <property name="column_spacing">12</property> +- <property name="row_spacing">6</property> +- <child> +- <object class="GtkEntry" id="web_browser_command_entry"> +- <property name="visible">True</property> +- <property name="can_focus">True</property> +- <property name="tooltip_text" translatable="yes">All %s occurrences will be replaced with actual link</property> +- </object> +- <packing> +- <property name="left_attach">1</property> +- <property name="right_attach">2</property> +- <property name="top_attach">3</property> +- <property name="bottom_attach">4</property> +- <property name="y_options"></property> +- </packing> +- </child> +- <child> +- <object class="GtkCheckButton" id="web_browser_terminal_checkbutton"> +- <property name="label" translatable="yes">Run in t_erminal</property> +- <property name="visible">True</property> +- <property name="sensitive">False</property> +- <property name="can_focus">True</property> +- <property name="receives_default">False</property> +- <property name="use_underline">True</property> +- <property name="draw_indicator">True</property> +- </object> +- <packing> +- <property name="left_attach">2</property> +- <property name="right_attach">3</property> +- <property name="top_attach">3</property> +- <property name="bottom_attach">4</property> +- <property name="x_options">GTK_FILL</property> +- <property name="y_options"></property> +- </packing> +- </child> +- <child> +- <object class="GtkRadioButton" id="web_browser_default_radiobutton"> +- <property name="label" translatable="yes">Open link with web browser _default</property> +- <property name="visible">True</property> +- <property name="sensitive">False</property> +- <property name="can_focus">True</property> +- <property name="receives_default">False</property> +- <property name="use_underline">True</property> +- <property name="active">True</property> +- <property name="draw_indicator">True</property> +- </object> +- <packing> +- <property name="right_attach">3</property> +- <property name="x_options">GTK_FILL</property> +- <property name="y_options"></property> +- </packing> +- </child> +- <child> +- <object class="GtkRadioButton" id="web_browser_new_tab_radiobutton"> +- <property name="label" translatable="yes">Open link in new _tab</property> +- <property name="visible">True</property> +- <property name="sensitive">False</property> +- <property name="can_focus">True</property> +- <property name="receives_default">False</property> +- <property name="use_underline">True</property> +- <property name="draw_indicator">True</property> +- <property name="group">web_browser_default_radiobutton</property> +- </object> +- <packing> +- <property name="right_attach">3</property> +- <property name="top_attach">2</property> +- <property name="bottom_attach">3</property> +- <property name="x_options">GTK_FILL</property> +- <property name="y_options"></property> +- </packing> +- </child> +- <child> +- <object class="GtkRadioButton" id="web_browser_new_win_radiobutton"> +- <property name="label" translatable="yes">Open link in new _window</property> +- <property name="visible">True</property> +- <property name="sensitive">False</property> +- <property name="can_focus">True</property> +- <property name="receives_default">False</property> +- <property name="use_underline">True</property> +- <property name="draw_indicator">True</property> +- <property name="group">web_browser_default_radiobutton</property> +- </object> +- <packing> +- <property name="right_attach">3</property> +- <property name="top_attach">1</property> +- <property name="bottom_attach">2</property> +- <property name="x_options">GTK_FILL</property> +- <property name="y_options"></property> +- </packing> +- </child> +- <child> +- <object class="GtkLabel" id="web_browser_command_label"> +- <property name="visible">True</property> +- <property name="sensitive">False</property> +- <property name="xalign">0</property> +- <property name="label" translatable="yes">C_ommand:</property> +- <property name="use_underline">True</property> +- <property name="mnemonic_widget">web_browser_command_entry</property> +- </object> +- <packing> +- <property name="top_attach">3</property> +- <property name="bottom_attach">4</property> +- <property name="x_options">GTK_FILL</property> +- <property name="y_options"></property> +- </packing> +- </child> +- </object> +- <packing> +- <property name="expand">False</property> +- <property name="fill">False</property> +- <property name="position">1</property> +- </packing> ++ <placeholder/> + </child> + </object> + <packing> +@@ -250,58 +135,7 @@ + </packing> + </child> + <child> +- <object class="GtkTable" id="mail_reader_options_table"> +- <property name="visible">True</property> +- <property name="n_columns">3</property> +- <property name="column_spacing">12</property> +- <property name="row_spacing">6</property> +- <child> +- <object class="GtkLabel" id="mail_reader_command_label"> +- <property name="visible">True</property> +- <property name="sensitive">False</property> +- <property name="xalign">0</property> +- <property name="label" translatable="yes">Co_mmand:</property> +- <property name="use_underline">True</property> +- <property name="mnemonic_widget">mail_reader_command_entry</property> +- </object> +- <packing> +- <property name="x_options">GTK_FILL</property> +- <property name="y_options"></property> +- </packing> +- </child> +- <child> +- <object class="GtkEntry" id="mail_reader_command_entry"> +- <property name="visible">True</property> +- <property name="can_focus">True</property> +- <property name="tooltip_text" translatable="yes">All %s occurrences will be replaced with actual link</property> +- </object> +- <packing> +- <property name="left_attach">1</property> +- <property name="right_attach">2</property> +- <property name="y_options"></property> +- </packing> +- </child> +- <child> +- <object class="GtkCheckButton" id="mail_reader_terminal_checkbutton"> +- <property name="label" translatable="yes">Run in t_erminal</property> +- <property name="visible">True</property> +- <property name="sensitive">False</property> +- <property name="can_focus">True</property> +- <property name="receives_default">False</property> +- <property name="use_underline">True</property> +- <property name="draw_indicator">True</property> +- </object> +- <packing> +- <property name="left_attach">2</property> +- <property name="right_attach">3</property> +- <property name="x_options">GTK_FILL</property> +- <property name="y_options"></property> +- </packing> +- </child> +- </object> +- <packing> +- <property name="position">1</property> +- </packing> ++ <placeholder/> + </child> + </object> + <packing> +diff -ur gnome-control-center-2.32.1.orig/capplets/default-applications/gnome-default-applications.xml.in gnome-control-center-2.32.1/capplets/default-applications/gnome-default-applications.xml.in +--- gnome-control-center-2.32.1.orig/capplets/default-applications/gnome-default-applications.xml.in 2011-03-27 15:30:55.000000000 +0200 ++++ gnome-control-center-2.32.1/capplets/default-applications/gnome-default-applications.xml.in 2011-03-27 15:31:26.000000000 +0200 +@@ -4,245 +4,6 @@ + + <!-- Remember to never use the same string for <command>, <tab-command> and <win-command> entries --> + +- <web-browsers> +- <web-browser> +- <_name>Opera</_name> +- <executable>opera</executable> +- <command>opera %s</command> +- <icon-name>opera</icon-name> +- <run-in-terminal>false</run-in-terminal> +- <netscape-remote>true</netscape-remote> +- <tab-command>opera -newpage %s</tab-command> +- <win-command>opera -newwindow %s</win-command> +- </web-browser> +- <web-browser> +- <_name>Debian Sensible Browser</_name> +- <executable>sensible-browser</executable> +- <command>sensible-browser %s</command> +- <icon-name></icon-name> +- <run-in-terminal>false</run-in-terminal> +- <netscape-remote>false</netscape-remote> +- </web-browser> +- <web-browser> +- <_name>Epiphany Web Browser</_name> +- <executable>epiphany</executable> +- <command>epiphany %s</command> +- <icon-name>web-browser</icon-name> +- <run-in-terminal>false</run-in-terminal> +- <netscape-remote>true</netscape-remote> +- <tab-command>epiphany --new-tab %s</tab-command> +- <win-command>epiphany --new-window %s</win-command> +- </web-browser> +- <web-browser> +- <_name>Galeon</_name> +- <executable>galeon</executable> +- <command>galeon %s</command> +- <icon-name>galeon</icon-name> +- <run-in-terminal>false</run-in-terminal> +- <netscape-remote>true</netscape-remote> +- <tab-command>galeon -n %s</tab-command> +- <win-command>galeon -w %s</win-command> +- </web-browser> +- <web-browser> +- <_name>Encompass</_name> +- <executable>encompass</executable> +- <command>encompass %s</command> +- <icon-name>encompass</icon-name> +- <run-in-terminal>false</run-in-terminal> +- <netscape-remote>false</netscape-remote> +- </web-browser> +- <web-browser> +- <_name>Firebird</_name> +- <executable>mozilla-firebird</executable> +- <command>mozilla-firebird %s</command> +- <icon-name></icon-name> +- <run-in-terminal>false</run-in-terminal> +- <netscape-remote>true</netscape-remote> +- <tab-command>mozilla-firebird -remote "openurl(%s,new-tab)"</tab-command> +- <win-command>mozilla-firebird -remote "openurl(%s,new-window)"</win-command> +- </web-browser> +- <web-browser> +- <_name>Firefox</_name> +- <executable>firefox</executable> +- <command>firefox %s</command> +- <icon-name>firefox</icon-name> +- <run-in-terminal>false</run-in-terminal> +- <netscape-remote>true</netscape-remote> +- <tab-command>firefox -new-tab "%s"</tab-command> +- <win-command>firefox -new-window "%s"</win-command> +- </web-browser> +- <web-browser> +- <_name>Iceweasel</_name> +- <executable>iceweasel</executable> +- <command>iceweasel %s</command> +- <icon-name>iceweasel</icon-name> +- <run-in-terminal>false</run-in-terminal> +- <netscape-remote>true</netscape-remote> +- <tab-command>iceweasel -new-tab "%s"</tab-command> +- <win-command>iceweasel -new-window "%s"</win-command> +- </web-browser> +- <web-browser> +- <_name>Mozilla 1.6</_name> +- <executable>mozilla-1.6</executable> +- <command>mozilla-1.6 %s</command> +- <icon-name>mozilla-icon</icon-name> +- <run-in-terminal>false</run-in-terminal> +- <netscape-remote>true</netscape-remote> +- <tab-command>mozilla-1.6 -remote "openurl(%s,new-tab)"</tab-command> +- <win-command>mozilla-1.6 -remote "openurl(%s,new-window)"</win-command> +- </web-browser> +- <web-browser> +- <_name>Mozilla</_name> +- <executable>mozilla</executable> +- <command>mozilla %s</command> +- <icon-name>mozilla-icon</icon-name> +- <run-in-terminal>false</run-in-terminal> +- <netscape-remote>true</netscape-remote> +- <tab-command>mozilla -remote "openurl(%s,new-tab)"</tab-command> +- <win-command>mozilla -remote "openurl(%s,new-window)"</win-command> +- </web-browser> +- <web-browser> +- <_name>SeaMonkey</_name> +- <executable>seamonkey</executable> +- <command>seamonkey %s</command> +- <icon-name>seamonkey</icon-name> +- <run-in-terminal>false</run-in-terminal> +- <netscape-remote>true</netscape-remote> +- <tab-command>seamonkey -remote "openurl(%s,new-tab)"</tab-command> +- <win-command>seamonkey -remote "openurl(%s,new-window)"</win-command> +- </web-browser> +- <web-browser> +- <_name>Iceape</_name> +- <executable>iceape</executable> +- <command>iceape %s</command> +- <icon-name>iceape</icon-name> +- <run-in-terminal>false</run-in-terminal> +- <netscape-remote>true</netscape-remote> +- <tab-command>iceape -remote "openurl(%s,new-tab)"</tab-command> +- <win-command>iceape -remote "openurl(%s,new-window)"</win-command> +- </web-browser> +- <web-browser> +- <_name>Netscape Communicator</_name> +- <executable>netscape</executable> +- <command>netscape %s</command> +- <icon-name>netscape</icon-name> +- <run-in-terminal>false</run-in-terminal> +- <netscape-remote>true</netscape-remote> +- <tab-command>netscape -remote "openurl(%s,new-tab)"</tab-command> +- <win-command>netscape -remote "openurl(%s,new-window)"</win-command> +- </web-browser> +- <web-browser> +- <_name>Konqueror</_name> +- <executable>konqueror</executable> +- <command>konqueror %s</command> +- <icon-name>konqueror</icon-name> +- <run-in-terminal>false</run-in-terminal> +- <netscape-remote>false</netscape-remote> +- </web-browser> +- <web-browser> +- <_name>Midori</_name> +- <executable>midori</executable> +- <command>midori %s</command> +- <icon-name>midori</icon-name> +- <run-in-terminal>false</run-in-terminal> +- <netscape-remote>false</netscape-remote> +- </web-browser> +- </web-browsers> +- +- <mail-readers> +- <mail-reader> +- <_name>Evolution Mail Reader</_name> +- <executable>evolution</executable> +- <command>evolution %s</command> +- <icon-name>evolution</icon-name> +- <run-in-terminal>false</run-in-terminal> +- </mail-reader> +- <mail-reader> +- <_name>Balsa</_name> +- <executable>balsa</executable> +- <command>balsa -m %s</command> +- <icon-name>gnome-balsa2</icon-name> +- <run-in-terminal>false</run-in-terminal> +- </mail-reader> +- <mail-reader> +- <_name>KMail</_name> +- <executable>kmail</executable> +- <command>kmail %s</command> +- <icon-name>kmail</icon-name> +- <run-in-terminal>false</run-in-terminal> +- </mail-reader> +- <mail-reader> +- <_name>Icedove</_name> +- <executable>icedove</executable> +- <command>icedove %s</command> +- <icon-name>icedove</icon-name> +- <run-in-terminal>false</run-in-terminal> +- </mail-reader> +- <mail-reader> +- <_name>Thunderbird</_name> +- <executable>thunderbird</executable> +- <command>thunderbird %s</command> +- <icon-name>thunderbird</icon-name> +- <run-in-terminal>false</run-in-terminal> +- </mail-reader> +- <mail-reader> +- <_name>Mozilla Thunderbird</_name> +- <executable>mozilla-thunderbird</executable> +- <command>mozilla-thunderbird %s</command> +- <icon-name>thunderbird</icon-name> +- <run-in-terminal>false</run-in-terminal> +- </mail-reader> +- <mail-reader> +- <_name>Mozilla Mail</_name> +- <executable>mozilla</executable> +- <command>mozilla -mail %s</command> +- <icon-name>mozilla-mail-icon</icon-name> +- <run-in-terminal>false</run-in-terminal> +- </mail-reader> +- <mail-reader> +- <_name>SeaMonkey Mail</_name> +- <executable>seamonkey</executable> +- <command>seamonkey -mail %s</command> +- <icon-name>seamonkey</icon-name> +- <run-in-terminal>false</run-in-terminal> +- </mail-reader> +- <mail-reader> +- <_name>Iceape Mail</_name> +- <executable>iceape</executable> +- <command>iceape -mail %s</command> +- <icon-name>iceape</icon-name> +- <run-in-terminal>false</run-in-terminal> +- </mail-reader> +- <mail-reader> +- <_name>Mutt</_name> +- <executable>mutt</executable> +- <command>mutt %s</command> +- <icon-name>gnome-mime-application-x-executable</icon-name> +- <run-in-terminal>true</run-in-terminal> +- </mail-reader> +- <mail-reader> +- <_name>Claws Mail</_name> +- <executable>claws-mail</executable> +- <command>claws-mail --compose %s</command> +- <icon-name>claws-mail</icon-name> +- <run-in-terminal>false</run-in-terminal> +- </mail-reader> +- <mail-reader> +- <_name>Sylpheed-Claws</_name> +- <executable>sylpheed-claws</executable> +- <command>sylpheed-claws --compose %s</command> +- <icon-name>sylpheed</icon-name> +- <run-in-terminal>false</run-in-terminal> +- </mail-reader> +- <mail-reader> +- <_name>Sylpheed</_name> +- <executable>sylpheed</executable> +- <command>sylpheed --compose %s</command> +- <icon-name>sylpheed</icon-name> +- <run-in-terminal>false</run-in-terminal> +- </mail-reader> +- </mail-readers> +- + <terminals> + <terminal> + <_name>Debian Terminal Emulator</_name> diff --git a/gnome-base/gnome-control-center/files/gnome-control-center-2.32.1-mime-handler2.patch b/gnome-base/gnome-control-center/files/gnome-control-center-2.32.1-mime-handler2.patch new file mode 100644 index 000000000000..046e8a1d4613 --- /dev/null +++ b/gnome-base/gnome-control-center/files/gnome-control-center-2.32.1-mime-handler2.patch @@ -0,0 +1,56 @@ + +++ gnome-control-center-2.32.1/debian/patches/141_set_default_internet_apps.patch + +Description: When starting up, read current web and mail values +Author: Michael Terry <michael.terry@canonical.com> +Bug: https://bugzilla.gnome.org/show_bug.cgi?id=638771 + +Index: gnome-control-center-2.32.1/capplets/default-applications/gnome-da-capplet.c +=================================================================== +--- gnome-control-center-2.32.1.orig/capplets/default-applications/gnome-da-capplet.c 2011-01-05 15:02:37.406338902 -0500 ++++ gnome-control-center-2.32.1/capplets/default-applications/gnome-da-capplet.c 2011-01-05 15:02:44.836276440 -0500 +@@ -111,6 +111,34 @@ + } + + static void ++set_combo_to_default_for_scheme (GtkComboBox *combo, GList *handlers, const gchar *scheme) ++{ ++ GAppInfo *type_default; ++ GList *l; ++ int index; ++ ++ type_default = g_app_info_get_default_for_uri_scheme (scheme); ++ index = 0; ++ ++ if (type_default == NULL) ++ return; ++ ++ for (l = handlers; l != NULL; l = l->next) { ++ GnomeDAURLItem *handler = l->data; ++ if (g_app_info_equal(handler->app_info, type_default)) { ++ break; ++ } ++ ++index; ++ } ++ ++ if (l != NULL) { ++ gtk_combo_box_set_active (combo, index); ++ } ++ ++ g_object_unref (type_default); ++} ++ ++static void + media_combo_changed_cb (GtkComboBox *combo, GnomeDACapplet *capplet) + { + guint current_index; +@@ -507,6 +535,9 @@ + fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->visual_combo_box), capplet->visual_ats, TRUE); + fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->mobility_combo_box), capplet->mobility_ats, TRUE); + ++ set_combo_to_default_for_scheme (GTK_COMBO_BOX (capplet->web_combo_box), capplet->web_browsers, "http"); ++ set_combo_to_default_for_scheme (GTK_COMBO_BOX (capplet->mail_combo_box), capplet->mail_readers, "mailto"); ++ + g_signal_connect (capplet->web_combo_box, "changed", G_CALLBACK (web_combo_changed_cb), capplet); + g_signal_connect (capplet->mail_combo_box, "changed", G_CALLBACK (mail_combo_changed_cb), capplet); + g_signal_connect (capplet->term_combo_box, "changed", G_CALLBACK (terminal_combo_changed_cb), capplet); diff --git a/gnome-base/gnome-control-center/files/gnome-control-center-2.32.1-mime-handler3.patch b/gnome-base/gnome-control-center/files/gnome-control-center-2.32.1-mime-handler3.patch new file mode 100644 index 000000000000..8c9976c7bced --- /dev/null +++ b/gnome-base/gnome-control-center/files/gnome-control-center-2.32.1-mime-handler3.patch @@ -0,0 +1,290 @@ + +++ gnome-control-center-2.32.1/debian/patches/142_fix_icons_for_default_apps.patch + +Description: Fix icons for new glib url handlers +Author: Michael Terry <michael.terry@canonical.com> +Bug: https://bugzilla.gnome.org/show_bug.cgi?id=638775 + +Index: gnome-control-center-2.32.1/capplets/default-applications/gnome-da-capplet.c +=================================================================== +--- gnome-control-center-2.32.1.orig/capplets/default-applications/gnome-da-capplet.c 2011-01-05 16:05:40.623854462 -0500 ++++ gnome-control-center-2.32.1/capplets/default-applications/gnome-da-capplet.c 2011-01-05 16:12:03.030460004 -0500 +@@ -35,7 +35,7 @@ + + enum + { +- PIXBUF_COL, ++ ICON_COL, + TEXT_COL, + N_COLUMNS + }; +@@ -193,33 +193,6 @@ + gtk_widget_set_sensitive (capplet->mobility_command_label, is_custom_active); + } + +-static void +-refresh_combo_box_icons (GtkIconTheme *theme, GtkComboBox *combo_box, GList *app_list) +-{ +- GList *entry; +- GnomeDAItem *item; +- GtkTreeModel *model; +- GtkTreeIter iter; +- GdkPixbuf *pixbuf; +- +- for (entry = app_list; entry != NULL; entry = g_list_next (entry)) { +- item = (GnomeDAItem *) entry->data; +- +- model = gtk_combo_box_get_model (combo_box); +- +- if (item->icon_path && gtk_tree_model_get_iter_from_string (model, &iter, item->icon_path)) { +- pixbuf = gtk_icon_theme_load_icon (theme, item->icon_name, 22, 0, NULL); +- +- gtk_list_store_set (GTK_LIST_STORE (model), &iter, +- PIXBUF_COL, pixbuf, +- -1); +- +- if (pixbuf) +- g_object_unref (pixbuf); +- } +- } +-} +- + static struct { + const gchar *name; + const gchar *icon; +@@ -246,13 +219,6 @@ + icon = gtk_builder_get_object (capplet->builder, icons[i].name); + set_icon (GTK_IMAGE (icon), theme, icons[i].icon); + } +- +- refresh_combo_box_icons (theme, GTK_COMBO_BOX (capplet->web_combo_box), capplet->web_browsers); +- refresh_combo_box_icons (theme, GTK_COMBO_BOX (capplet->mail_combo_box), capplet->mail_readers); +- refresh_combo_box_icons (theme, GTK_COMBO_BOX (capplet->media_combo_box), capplet->media_players); +- refresh_combo_box_icons (theme, GTK_COMBO_BOX (capplet->term_combo_box), capplet->terminals); +- refresh_combo_box_icons (theme, GTK_COMBO_BOX (capplet->visual_combo_box), capplet->visual_ats); +- refresh_combo_box_icons (theme, GTK_COMBO_BOX (capplet->mobility_combo_box), capplet->mobility_ats); + } + + static void +@@ -397,33 +363,31 @@ + } + + static void +-fill_combo_box (GtkIconTheme *theme, GtkComboBox *combo_box, GList *app_list, gboolean add_custom) ++fill_combo_box (GtkComboBox *combo_box, GList *app_list, gboolean add_custom) + { + GList *entry; + GtkTreeModel *model; + GtkCellRenderer *renderer; + GtkTreeIter iter; +- GdkPixbuf *pixbuf; +- +- if (theme == NULL) { +- theme = gtk_icon_theme_get_default (); +- } + + if (add_custom) { + gtk_combo_box_set_row_separator_func (combo_box, is_separator, + GINT_TO_POINTER (g_list_length (app_list)), NULL); + } + +- model = GTK_TREE_MODEL (gtk_list_store_new (2, GDK_TYPE_PIXBUF, G_TYPE_STRING)); ++ model = GTK_TREE_MODEL (gtk_list_store_new (2, G_TYPE_ICON, G_TYPE_STRING)); + gtk_combo_box_set_model (combo_box, model); + + renderer = gtk_cell_renderer_pixbuf_new (); + + /* not all cells have a pixbuf, this prevents the combo box to shrink */ +- gtk_cell_renderer_set_fixed_size (renderer, -1, 22); ++ gtk_cell_renderer_set_fixed_size (renderer, -1, 24); ++ g_object_set (G_OBJECT (renderer), ++ "stock-size", GTK_ICON_SIZE_LARGE_TOOLBAR, ++ NULL); + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_box), renderer, FALSE); + gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box), renderer, +- "pixbuf", PIXBUF_COL, ++ "gicon", ICON_COL, + NULL); + + renderer = gtk_cell_renderer_text_new (); +@@ -436,18 +400,11 @@ + GnomeDAItem *item; + item = (GnomeDAItem *) entry->data; + +- pixbuf = gtk_icon_theme_load_icon (theme, item->icon_name, 22, 0, NULL); +- + gtk_list_store_append (GTK_LIST_STORE (model), &iter); + gtk_list_store_set (GTK_LIST_STORE (model), &iter, +- PIXBUF_COL, pixbuf, ++ ICON_COL, item->icon, + TEXT_COL, item->name, + -1); +- +- item->icon_path = gtk_tree_model_get_string_from_iter (model, &iter); +- +- if (pixbuf) +- g_object_unref (pixbuf); + } + + if (add_custom) { +@@ -455,7 +412,7 @@ + gtk_list_store_set (GTK_LIST_STORE (model), &iter, -1); + gtk_list_store_append (GTK_LIST_STORE (model), &iter); + gtk_list_store_set (GTK_LIST_STORE (model), &iter, +- PIXBUF_COL, NULL, ++ ICON_COL, NULL, + TEXT_COL, _("Custom"), + -1); + } +@@ -528,12 +485,12 @@ + g_signal_connect (capplet->window, "screen-changed", G_CALLBACK (screen_changed_cb), capplet); + screen_changed_cb (capplet->window, gdk_screen_get_default (), capplet); + +- fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->web_combo_box), capplet->web_browsers, FALSE); +- fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->mail_combo_box), capplet->mail_readers, FALSE); +- fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->term_combo_box), capplet->terminals, TRUE); +- fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->media_combo_box), capplet->media_players, TRUE); +- fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->visual_combo_box), capplet->visual_ats, TRUE); +- fill_combo_box (capplet->icon_theme, GTK_COMBO_BOX (capplet->mobility_combo_box), capplet->mobility_ats, TRUE); ++ fill_combo_box (GTK_COMBO_BOX (capplet->web_combo_box), capplet->web_browsers, FALSE); ++ fill_combo_box (GTK_COMBO_BOX (capplet->mail_combo_box), capplet->mail_readers, FALSE); ++ fill_combo_box (GTK_COMBO_BOX (capplet->term_combo_box), capplet->terminals, TRUE); ++ fill_combo_box (GTK_COMBO_BOX (capplet->media_combo_box), capplet->media_players, TRUE); ++ fill_combo_box (GTK_COMBO_BOX (capplet->visual_combo_box), capplet->visual_ats, TRUE); ++ fill_combo_box (GTK_COMBO_BOX (capplet->mobility_combo_box), capplet->mobility_ats, TRUE); + + set_combo_to_default_for_scheme (GTK_COMBO_BOX (capplet->web_combo_box), capplet->web_browsers, "http"); + set_combo_to_default_for_scheme (GTK_COMBO_BOX (capplet->mail_combo_box), capplet->mail_readers, "mailto"); +Index: gnome-control-center-2.32.1/capplets/default-applications/gnome-da-item.c +=================================================================== +--- gnome-control-center-2.32.1.orig/capplets/default-applications/gnome-da-item.c 2011-01-05 16:04:48.644316418 -0500 ++++ gnome-control-center-2.32.1/capplets/default-applications/gnome-da-item.c 2011-01-05 16:05:40.653854197 -0500 +@@ -79,8 +79,8 @@ + g_free (item->generic.name); + g_free (item->generic.executable); + g_free (item->generic.command); +- g_free (item->generic.icon_name); +- g_free (item->generic.icon_path); ++ if (item->generic.icon) ++ g_object_unref (item->generic.icon); + + g_object_unref (item->app_info); + +@@ -95,8 +95,8 @@ + g_free (item->generic.name); + g_free (item->generic.executable); + g_free (item->generic.command); +- g_free (item->generic.icon_name); +- g_free (item->generic.icon_path); ++ if (item->generic.icon) ++ g_object_unref (item->generic.icon); + + g_free (item); + } +@@ -109,8 +109,8 @@ + g_free (item->generic.name); + g_free (item->generic.executable); + g_free (item->generic.command); +- g_free (item->generic.icon_name); +- g_free (item->generic.icon_path); ++ if (item->generic.icon) ++ g_object_unref (item->generic.icon); + + g_free (item->exec_flag); + +@@ -125,8 +125,8 @@ + g_free (item->generic.name); + g_free (item->generic.executable); + g_free (item->generic.command); +- g_free (item->generic.icon_name); +- g_free (item->generic.icon_path); ++ if (item->generic.icon) ++ g_object_unref (item->generic.icon); + + g_free (item); + } +@@ -139,8 +139,8 @@ + g_free (item->generic.name); + g_free (item->generic.executable); + g_free (item->generic.command); +- g_free (item->generic.icon_name); +- g_free (item->generic.icon_path); ++ if (item->generic.icon) ++ g_object_unref (item->generic.icon); + + g_free (item); + } +Index: gnome-control-center-2.32.1/capplets/default-applications/gnome-da-item.h +=================================================================== +--- gnome-control-center-2.32.1.orig/capplets/default-applications/gnome-da-item.h 2011-01-05 16:04:48.684316062 -0500 ++++ gnome-control-center-2.32.1/capplets/default-applications/gnome-da-item.h 2011-01-05 16:05:40.653854197 -0500 +@@ -35,8 +35,7 @@ + gchar *name; + gchar *executable; + gchar *command; +- gchar *icon_name; +- gchar *icon_path; ++ GIcon *icon; + }; + + struct _GnomeDASimpleItem { +Index: gnome-control-center-2.32.1/capplets/default-applications/gnome-da-xml.c +=================================================================== +--- gnome-control-center-2.32.1.orig/capplets/default-applications/gnome-da-xml.c 2011-01-05 16:04:48.624316596 -0500 ++++ gnome-control-center-2.32.1/capplets/default-applications/gnome-da-xml.c 2011-01-05 16:05:40.653854197 -0500 +@@ -152,7 +152,7 @@ + term_item->generic.name = gnome_da_xml_get_string (element, "name"); + term_item->generic.executable = executable; + term_item->generic.command = gnome_da_xml_get_string (element, "command"); +- term_item->generic.icon_name = gnome_da_xml_get_string (element, "icon-name"); ++ term_item->generic.icon = g_themed_icon_new (gnome_da_xml_get_string (element, "icon-name")); + + term_item->exec_flag = gnome_da_xml_get_string (element, "exec-flag"); + +@@ -173,7 +173,7 @@ + media_item->generic.name = gnome_da_xml_get_string (element, "name"); + media_item->generic.executable = executable; + media_item->generic.command = gnome_da_xml_get_string (element, "command"); +- media_item->generic.icon_name = gnome_da_xml_get_string (element, "icon-name"); ++ media_item->generic.icon = g_themed_icon_new (gnome_da_xml_get_string (element, "icon-name")); + + media_item->run_in_terminal = gnome_da_xml_get_bool (element, "run-in-terminal"); + +@@ -194,7 +194,7 @@ + visual_item->generic.name = gnome_da_xml_get_string (element, "name"); + visual_item->generic.executable = executable; + visual_item->generic.command = gnome_da_xml_get_string (element, "command"); +- visual_item->generic.icon_name = gnome_da_xml_get_string (element, "icon-name"); ++ visual_item->generic.icon = g_themed_icon_new (gnome_da_xml_get_string (element, "icon-name")); + + visual_item->run_at_startup = gnome_da_xml_get_bool (element, "run-at-startup"); + +@@ -215,7 +215,7 @@ + mobility_item->generic.name = gnome_da_xml_get_string (element, "name"); + mobility_item->generic.executable = executable; + mobility_item->generic.command = gnome_da_xml_get_string (element, "command"); +- mobility_item->generic.icon_name = gnome_da_xml_get_string (element, "icon-name"); ++ mobility_item->generic.icon = g_themed_icon_new (gnome_da_xml_get_string (element, "icon-name")); + + mobility_item->run_at_startup = gnome_da_xml_get_bool (element, "run-at-startup"); + +@@ -246,12 +246,18 @@ + executable = g_app_info_get_executable (app_info); + if (is_executable_valid (executable)) { + GnomeDAURLItem *url_item; ++ GIcon *icon; + + url_item = gnome_da_url_item_new (); + url_item->generic.name = g_strdup (g_app_info_get_display_name (app_info)); + url_item->generic.executable = g_strdup (executable); + url_item->generic.command = g_strdup (g_app_info_get_commandline (app_info)); +- url_item->generic.icon_name = g_strdup (g_app_info_get_name (app_info)); ++ ++ icon = g_app_info_get_icon (app_info); ++ if (icon != NULL) { ++ url_item->generic.icon = g_object_ref (icon); ++ } ++ + /* Steal the reference */ + url_item->app_info = app_info; + diff --git a/gnome-base/gnome-control-center/gnome-control-center-2.30.1.ebuild b/gnome-base/gnome-control-center/gnome-control-center-2.32.1-r1.ebuild index 03fa372e9e0d..c16c2fc2cfda 100644 --- a/gnome-base/gnome-control-center/gnome-control-center-2.30.1.ebuild +++ b/gnome-base/gnome-control-center/gnome-control-center-2.32.1-r1.ebuild @@ -1,24 +1,25 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/gnome-base/gnome-control-center/gnome-control-center-2.30.1.ebuild,v 1.9 2011/03/16 10:38:58 nirbheek Exp $ +# $Header: /var/cvsroot/gentoo-x86/gnome-base/gnome-control-center/gnome-control-center-2.32.1-r1.ebuild,v 1.1 2011/03/27 16:45:12 pacho Exp $ -EAPI="2" +EAPI="3" +GCONF_DEBUG="yes" -inherit eutils gnome2 +inherit gnome2 eutils DESCRIPTION="The gnome2 Desktop configuration tool" HOMEPAGE="http://www.gnome.org/" LICENSE="GPL-2" SLOT="2" -KEYWORDS="alpha amd64 arm ia64 ppc ppc64 sh sparc x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris" -IUSE="eds policykit" +KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris" +IUSE="eds" -# Newer gconf[policykit] needed for CanSetSystem attribute for default bg patch +# TODO: appindicator RDEPEND="x11-libs/libXft >=x11-libs/libXi-1.2 - >=x11-libs/gtk+-2.18.0:2 - >=dev-libs/glib-2.17.4:2 + >=x11-libs/gtk+-2.20:2 + >=dev-libs/glib-2.28:2 >=gnome-base/gconf-2.0:2 >=gnome-base/librsvg-2.0:2 >=gnome-base/nautilus-2.6 @@ -26,7 +27,7 @@ RDEPEND="x11-libs/libXft >=dev-libs/dbus-glib-0.73 >=x11-libs/libxklavier-4.0 >=x11-wm/metacity-2.23.1 - >=gnome-base/libgnomekbd-2.27.4 + >=gnome-base/libgnomekbd-2.31.2 >=gnome-base/gnome-desktop-2.29.4:2 >=gnome-base/gnome-menus-2.11.1 gnome-base/gnome-settings-daemon @@ -35,16 +36,17 @@ RDEPEND="x11-libs/libXft x11-libs/pango dev-libs/libxml2 media-libs/freetype - >=media-libs/libcanberra-0.4[gtk] + media-libs/libcanberra[gtk] eds? ( >=gnome-extra/evolution-data-server-1.7.90 ) - policykit? ( >=gnome-base/gconf-2.28:2[policykit] ) x11-apps/xmodmap x11-libs/libXScrnSaver x11-libs/libXext x11-libs/libX11 x11-libs/libXxf86misc + x11-libs/libXrandr + x11-libs/libXrender x11-libs/libXcursor" DEPEND="${RDEPEND} x11-proto/scrnsaverproto @@ -52,6 +54,8 @@ DEPEND="${RDEPEND} x11-proto/xproto x11-proto/xf86miscproto x11-proto/kbproto + x11-proto/randrproto + x11-proto/renderproto sys-devel/gettext >=dev-util/intltool-0.40 @@ -63,26 +67,37 @@ DEPEND="${RDEPEND} # Needed for autoreconf # gnome-base/gnome-common -DOCS="AUTHORS ChangeLog NEWS README TODO" - pkg_setup() { G2CONF="${G2CONF} --disable-update-mimedb --disable-static + --disable-appindicator $(use_enable eds aboutme)" + DOCS="AUTHORS ChangeLog NEWS README TODO" } src_prepare() { gnome2_src_prepare - # Add functionality for setting the default background in gdm, bug 293439 - # gnome bug #536531 - epatch "${FILESDIR}/${PN}-2.28.1-gdm-default-bg.patch" + # Use URL handlers for browser and mailer applications + epatch "${FILESDIR}/${P}-mime-handler.patch" + + # When starting up, read current web and mail values + epatch "${FILESDIR}/${P}-mime-handler2.patch" + + # Fix icons for new glib url handlers + epatch "${FILESDIR}/${P}-mime-handler3.patch" + + # Do not show twice the configured background if it is a symlink to a known background + epatch "${FILESDIR}/${P}-duplicated-background.patch" + + # Don't erase backgounds.xml, bug #344335 + epatch "${FILESDIR}/${P}-erase-background.patch" } src_install() { gnome2_src_install # gmodule is used to load plugins # (on POSIX systems gmodule uses dlopen) - find "${D}" -name "*.la" -delete || die "remove of la files failed" + find "${ED}" -name "*.la" -delete || die "remove of la files failed" } |