~kroq-gar78/ubuntu/precise/gnome-control-center/fix-885947

« back to all changes in this revision

Viewing changes to debian/patches/143_write_default_internet_apps_to_gconf.patch

  • Committer: Bazaar Package Importer
  • Author(s): Rodrigo Moya
  • Date: 2011-05-17 10:47:27 UTC
  • mfrom: (0.1.11 experimental) (1.1.45 upstream)
  • Revision ID: james.westby@ubuntu.com-20110517104727-lqel6m8vhfw5jby1
Tags: 1:3.0.1.1-1ubuntu1
* Rebase on Debian, remaining Ubuntu changes:
* debian/control:
  - Build-Depend on hardening-wrapper, dpkg-dev and dh-autoreconf
  - Add dependency on ubuntu-system-service
  - Remove dependency on gnome-icon-theme-symbolic
  - Move dependency on apg, gnome-icon-theme-symbolic and accountsservice to
    be a Recommends: until we get them in main
* debian/rules:
  - Use autoreconf
  - Add binary-post-install rule for gnome-control-center-data
  - Run dh-autoreconf
* debian/gnome-control-center.dirs:
* debian/gnome-control-center.links:
  - Add a link to the control center shell for indicators
* debian/patches/00_disable-nm.patch:
  - Temporary patch to disable building with NetworkManager until we get
    the new one in the archive
* debian/patches/01_git_remove_gettext_calls.patch:
  - Remove calls to AM_GNU_GETTEXT, IT_PROG_INTLTOOL should be enough
* debian/patches/01_git_kill_warning.patch:
  - Kill warning
* debian/patches/50_ubuntu_systemwide_prefs.patch:
  - Ubuntu specific proxy preferences
* debian/patches/51_ubuntu_system_keyboard.patch:
  - Implement the global keyboard spec at https://wiki.ubuntu.com/DefaultKeyboardSettings

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Description: Write new glib url handling values back to gconf for compatibility
2
 
 This patch can go away in Ubuntu 11.10 because by then, gnome-control-center
3
 
 will be all gsettings.  This is just to provide a bridge between the new glib
4
 
 and any program still listening to the old gconf values.  This only sets the
5
 
 values, it does not read them.
6
 
Author: Michael Terry <michael.terry@canonical.com>
7
 
Forwarded: not-needed
8
 
 
9
 
Index: gnome-control-center-2.32.1/capplets/default-applications/gnome-da-capplet.c
10
 
===================================================================
11
 
--- gnome-control-center-2.32.1.orig/capplets/default-applications/gnome-da-capplet.c   2011-01-06 09:04:37.637883006 -0500
12
 
+++ gnome-control-center-2.32.1/capplets/default-applications/gnome-da-capplet.c        2011-01-06 09:37:03.383415569 -0500
13
 
@@ -64,6 +64,47 @@
14
 
 }
15
 
 
16
 
 static void
17
 
+web_combo_write_to_gconf (GtkComboBox *combo, GnomeDACapplet *capplet)
18
 
+{
19
 
+    guint current_index;
20
 
+
21
 
+    current_index = gtk_combo_box_get_active (combo);
22
 
+
23
 
+    if (current_index < g_list_length (capplet->web_browsers)) {
24
 
+        GnomeDAURLItem *item;
25
 
+        GConfChangeSet *cs;
26
 
+        gchar *short_browser, *pos;
27
 
+
28
 
+        item = (GnomeDAURLItem*) g_list_nth_data (capplet->web_browsers, current_index);
29
 
+        if (item == NULL)
30
 
+            return;
31
 
+
32
 
+        cs = gconf_change_set_new ();
33
 
+        gconf_change_set_set_string (cs, DEFAULT_APPS_KEY_HTTP_EXEC, item->generic.command);
34
 
+        gconf_change_set_set_string (cs, DEFAULT_APPS_KEY_HTTPS_EXEC, item->generic.command);
35
 
+        gconf_change_set_set_string (cs, DEFAULT_APPS_KEY_ABOUT_EXEC, item->generic.command);
36
 
+        gconf_change_set_set_string (cs, DEFAULT_APPS_KEY_UNKNOWN_EXEC, item->generic.command);
37
 
+
38
 
+        pos = strstr (item->generic.command, " ");
39
 
+        if (pos == NULL)
40
 
+            short_browser = g_strdup (item->generic.command);
41
 
+        else
42
 
+            short_browser = g_strndup (item->generic.command, pos - item->generic.command);
43
 
+        gconf_change_set_set_string (cs, DEFAULT_APPS_KEY_BROWSER_EXEC, short_browser);
44
 
+        g_free (short_browser);
45
 
+
46
 
+        gconf_change_set_set_bool (cs, DEFAULT_APPS_KEY_BROWSER_NREMOTE, FALSE);
47
 
+        gconf_change_set_set_bool (cs, DEFAULT_APPS_KEY_HTTP_NEEDS_TERM, FALSE);
48
 
+        gconf_change_set_set_bool (cs, DEFAULT_APPS_KEY_HTTPS_NEEDS_TERM, FALSE);
49
 
+        gconf_change_set_set_bool (cs, DEFAULT_APPS_KEY_ABOUT_NEEDS_TERM, FALSE);
50
 
+        gconf_change_set_set_bool (cs, DEFAULT_APPS_KEY_UNKNOWN_NEEDS_TERM, FALSE);
51
 
+        gconf_change_set_set_bool (cs, DEFAULT_APPS_KEY_BROWSER_NEEDS_TERM, FALSE);
52
 
+        gconf_client_commit_change_set (capplet->gconf, cs, TRUE, NULL);
53
 
+        gconf_change_set_unref (cs);
54
 
+    }
55
 
+}
56
 
+
57
 
+static void
58
 
 web_combo_changed_cb (GtkComboBox *combo, GnomeDACapplet *capplet)
59
 
 {
60
 
     guint current_index;
61
 
@@ -84,6 +125,29 @@
62
 
            g_error_free (error);
63
 
        }
64
 
     }
65
 
+       web_combo_write_to_gconf (combo, capplet);
66
 
+}
67
 
+
68
 
+static void
69
 
+mail_combo_write_to_gconf (GtkComboBox *combo, GnomeDACapplet *capplet)
70
 
+{
71
 
+    guint current_index;
72
 
+
73
 
+    current_index = gtk_combo_box_get_active (combo);
74
 
+
75
 
+    if (current_index < g_list_length (capplet->mail_readers)) {
76
 
+        GnomeDAURLItem *item;
77
 
+        GConfClient *client;
78
 
+
79
 
+        item = (GnomeDAURLItem*) g_list_nth_data (capplet->mail_readers, current_index);
80
 
+        if (item == NULL)
81
 
+            return;
82
 
+
83
 
+        client = gconf_client_get_default ();
84
 
+        gconf_client_set_string (client, DEFAULT_APPS_KEY_MAILER_EXEC, item->generic.command, NULL);
85
 
+        gconf_client_set_bool (client, DEFAULT_APPS_KEY_MAILER_NEEDS_TERM, FALSE, NULL);
86
 
+        g_object_unref (client);
87
 
+    }
88
 
 }
89
 
 
90
 
 /* FIXME: Refactor these two functions below into one... */
91
 
@@ -106,6 +170,7 @@
92
 
             g_warning (_("Error setting default mailer: %s"), error->message);
93
 
            g_error_free (error);
94
 
        }
95
 
+       mail_combo_write_to_gconf (combo, capplet);
96
 
     }
97
 
 
98
 
 }
99
 
@@ -495,6 +560,9 @@
100
 
     set_combo_to_default_for_scheme (GTK_COMBO_BOX (capplet->web_combo_box), capplet->web_browsers, "http");
101
 
     set_combo_to_default_for_scheme (GTK_COMBO_BOX (capplet->mail_combo_box), capplet->mail_readers, "mailto");
102
 
 
103
 
+    web_combo_write_to_gconf (GTK_COMBO_BOX (capplet->web_combo_box), capplet);
104
 
+    mail_combo_write_to_gconf (GTK_COMBO_BOX (capplet->mail_combo_box), capplet);
105
 
+
106
 
     g_signal_connect (capplet->web_combo_box, "changed", G_CALLBACK (web_combo_changed_cb), capplet);
107
 
     g_signal_connect (capplet->mail_combo_box, "changed", G_CALLBACK (mail_combo_changed_cb), capplet);
108
 
     g_signal_connect (capplet->term_combo_box, "changed", G_CALLBACK (terminal_combo_changed_cb), capplet);