summaryrefslogtreecommitdiff
blob: 046e8a1d46134cfd29f31c11ce994c52616a6fdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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);