~ubuntu-branches/ubuntu/utopic/gnome-control-center/utopic-proposed

« back to all changes in this revision

Viewing changes to debian/patches/50_ubuntu_systemwide_prefs.patch

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher, Sebastien Bacher, Robert Ancell, Iain Lane, Edward Donovan, Rico Tzschichholz, Jeremy Bicha, David Henningsson
  • Date: 2012-11-21 19:32:45 UTC
  • mfrom: (1.1.63)
  • Revision ID: package-import@ubuntu.com-20121121193245-mj61nzz1z4fk3z25
Tags: 1:3.6.3-0ubuntu1
[ Sebastien Bacher ]
* New upstream version
* debian/control.in: recommends libcanberra-pulse (lp: #1004973)
* debian/patches/58_ubuntu_icon_views_redesign.patch:
  - drop most of the changes, keep the different grid size though
    to fit on screen with our extra icons
* debian/patches/91_dont_show_in_unity.patch:
  - dropped, show the upstream printer panel and the layout tab
* debian/patches/revert_git_keyboard_gsettings.patch,
  debian/patches/revert_git_stop_using_gconf.patch:
  - dropped the gconf->gsettings reverts

[ Robert Ancell ]
* New upstream release (LP: #1010317)
* debian/control:
  - Bump build-depends on libgnome-desktop-3-dev, libwacom-dev
  - Add build-depends on libclutter-1.0-dev, libclutter-gtk-1.0-dev,
    libpwquality-dev
  - Drop build-depends on libgnomekbd-dev
* debian/patches/60_ubuntu_nav_bar.patch:
  - Disabled for now, doesn't apply
* debian/patches/revert_ua_gsettings.patch:
  - We can use GSettings for universal access now
* debian/patches/00git_online_accounts_gtkgrid.patch:
* debian/patches/00git_online_accounts_layout.part:
* debian/patches/git_wacom_translations.patch:
  - Applied upstream

[ Iain Lane ]
* Add Build-Depends on libxkbfile-dev
* New upstream release.
* Refresh all patches to apply cleanly.

[ Edward Donovan ]
* debian/source_gnome-control-center.py: Fix for Python 3. (LP: #1013171)

[ Rico Tzschichholz ]
* debian/control.in:
  - Build-depend on gtk-doc-tools instead of docbook directly
  - Bump minimum glib-2.0, gnome-desktop3, gnome-settings-daemon
     and gsettings-desktop-schemas

[ Jeremy Bicha ]
* Dropped more patches applied in new version:
  - git_unmute_sound_event.patch
  - git_fix_big_editable_labels.patch
  - 96_sound_nua_panel.patch
* debian/patches/04_new_appearance_settings.patch:
  - Dropped, this is now packaged separately as gnome-control-center-unity
* debian/patches/10_keyboard_layout_on_unity.patch:
  - Don't change the keyboard panel name when not running Unity
* debian/patches/52_ubuntu_language_list_mods.patch:
  - Don't disable adding current language to the list. While this
    fix shows the current language twice, at least it avoids the
    "Ubuntu suddenly in Chinese" bug (LP: #1035219)
* debian/patches/53_use_ubuntu_help.patch:
  - Only show Ubuntu help when running Unity
* debian/patches/58_hide_gdm_notifications.patch:
  - Hide "Show notifications when locked" settings when running Unity
    since it's a GNOME Shell-specific feature
* debian/patches/63_normal_scrollbar_in_a11y.patch:
  - Drop, overlay-scrollbars should handle this instead
* debian/patches/91_dont_show_in_unity.patch:
  - Hide Printers & Region panels in Unity until we're ready to switch
    to them.
* debian/patches/fix-crash-on-user-panel.patch:
  - Dropped, GNOME says it's obsolete
* debian/rules:
  - Build with -z,defs again
  - Explicitly disable ibus support since ibus 1.4 isn't supported in
    this version
* debian/control.in:
  - Drop ubuntu-docs and gnome-user-guide from recommends to suggests
  - Don't recommend indicators; let's leave that to Unity

[ David Henningsson ]
* sound_nua_panel.patch: Rebase to gnome 3.6 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Index: gnome-control-center-3.4.0/panels/network/cc-network-panel.c
2
 
===================================================================
3
 
--- gnome-control-center-3.4.0.orig/panels/network/cc-network-panel.c   2012-03-26 18:48:44.000000000 +0200
4
 
+++ gnome-control-center-3.4.0/panels/network/cc-network-panel.c        2012-04-12 15:04:42.414238811 +0200
5
 
@@ -23,6 +23,10 @@
6
 
 #include <arpa/inet.h>
7
 
 #include <netinet/ether.h>
8
 
 #include <stdlib.h>
9
 
+#include <grp.h>
10
 
+#include <unistd.h>
11
 
+#include <gio/gio.h>
12
 
+#include <gdesktop-enums.h>
13
 
 
14
 
 #include "cc-network-panel.h"
15
 
 
16
 
@@ -3372,6 +3376,139 @@
17
 
         return FALSE;
18
 
 }
19
 
 
20
 
+static gboolean
21
 
+is_in_admin_group (int id_group)
22
 
+{
23
 
+        gid_t groups [1024];
24
 
+       int i, ngroups;
25
 
+
26
 
+        ngroups = getgroups (1024, groups);
27
 
+        if (ngroups < 0) {
28
 
+                perror ("getgroups");
29
 
+                return FALSE;
30
 
+        }
31
 
+
32
 
+        for (i = 0; i < ngroups; ++i) {
33
 
+                if (groups[i] == id_group)
34
 
+                        return TRUE;
35
 
+        }
36
 
+
37
 
+        return FALSE;
38
 
+}
39
 
+
40
 
+static gboolean
41
 
+is_admin ()
42
 
+{
43
 
+        struct group *admin_group;
44
 
+
45
 
+        admin_group = getgrnam ("admin");
46
 
+        if (admin_group != NULL && is_in_admin_group (admin_group->gr_gid))
47
 
+                return TRUE;
48
 
+
49
 
+        admin_group = getgrnam ("sudo");
50
 
+        if (admin_group != NULL && is_in_admin_group (admin_group->gr_gid))
51
 
+                return TRUE;
52
 
+
53
 
+        return FALSE;
54
 
+}
55
 
+
56
 
+static void
57
 
+reset_system_proxy (GDBusProxy *proxy, const gchar *protocol)
58
 
+{
59
 
+        GVariant *result;
60
 
+        GError *error = NULL;
61
 
+
62
 
+        result = g_dbus_proxy_call_sync (proxy, "set_proxy",
63
 
+                                         g_variant_new ("(ss)", protocol, ""),
64
 
+                                         G_DBUS_CALL_FLAGS_NONE,
65
 
+                                         -1, NULL, &error);
66
 
+        if (result)
67
 
+                g_variant_unref (result);
68
 
+        else {
69
 
+                g_warning ("Error while calling set_proxy for %s protocol: %s", protocol, error->message);
70
 
+                g_error_free (error);
71
 
+        }
72
 
+}
73
 
+
74
 
+static void
75
 
+set_proxy_for_protocol (GDBusProxy *proxy, const gchar *protocol, GSettings *settings)
76
 
+{
77
 
+        GVariant *result;
78
 
+        gchar *proxy_str;
79
 
+        GError *error = NULL;
80
 
+
81
 
+        proxy_str = g_strdup_printf ("%s://%s:%i/",
82
 
+                                     protocol,
83
 
+                                     g_settings_get_string (settings, "host"),
84
 
+                                     g_settings_get_int (settings, "port"));
85
 
+        result = g_dbus_proxy_call_sync (proxy, "set_proxy",
86
 
+                                         g_variant_new ("(ss)", protocol, proxy_str),
87
 
+                                         G_DBUS_CALL_FLAGS_NONE,
88
 
+                                         -1, NULL, &error);
89
 
+        if (result)
90
 
+                g_variant_unref (result);
91
 
+        else {
92
 
+                g_warning ("Error while calling set_proxy for %s protocol: %s", protocol, error->message);
93
 
+                g_error_free (error);
94
 
+        }
95
 
+
96
 
+        /* Free memory */
97
 
+        g_free (proxy_str);
98
 
+        g_object_unref (settings);
99
 
+}
100
 
+
101
 
+static void
102
 
+on_proxy_apply_system_wide (GtkButton *button, gpointer user_data)
103
 
+{
104
 
+        GDBusConnection *bus;
105
 
+        GDBusProxy *proxy;
106
 
+        GError *error;
107
 
+        GDesktopProxyMode proxy_mode;
108
 
+        CcNetworkPanel *panel = CC_NETWORK_PANEL (user_data);
109
 
+
110
 
+        error = NULL;
111
 
+        bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
112
 
+        if (!bus) {
113
 
+                g_warning ("Could not retrieve system bus: %s", error->message);
114
 
+                g_error_free (error);
115
 
+
116
 
+                return;
117
 
+        }
118
 
+
119
 
+        proxy = g_dbus_proxy_new_sync (bus, 0, NULL,
120
 
+                                       "com.ubuntu.SystemService",
121
 
+                                       "/",
122
 
+                                       "com.ubuntu.SystemService",
123
 
+                                       NULL,
124
 
+                                       &error);
125
 
+        if (!proxy) {
126
 
+                g_warning ("Could not retrieve bus object: %s", error->message);
127
 
+                g_error_free (error);
128
 
+
129
 
+                return;
130
 
+        }
131
 
+
132
 
+        /* Retrieve the current settings */
133
 
+        proxy_mode = g_settings_get_enum (panel->priv->proxy_settings, "mode");
134
 
+        switch (proxy_mode) {
135
 
+        case G_DESKTOP_PROXY_MODE_NONE:
136
 
+                reset_system_proxy (proxy, "http");
137
 
+                reset_system_proxy (proxy, "https");
138
 
+                reset_system_proxy (proxy, "ftp");
139
 
+                reset_system_proxy (proxy, "socks");
140
 
+                break;
141
 
+        case G_DESKTOP_PROXY_MODE_MANUAL:
142
 
+                set_proxy_for_protocol (proxy, "http", g_settings_get_child (panel->priv->proxy_settings, "http"));
143
 
+                set_proxy_for_protocol (proxy, "https", g_settings_get_child (panel->priv->proxy_settings, "https"));
144
 
+                set_proxy_for_protocol (proxy, "ftp", g_settings_get_child (panel->priv->proxy_settings, "ftp"));
145
 
+                set_proxy_for_protocol (proxy, "socks", g_settings_get_child (panel->priv->proxy_settings, "socks"));
146
 
+                break;
147
 
+        }
148
 
+
149
 
+        /* Free memory */
150
 
+        g_object_unref (proxy);
151
 
+}
152
 
+
153
 
 static void
154
 
 cc_network_panel_init (CcNetworkPanel *panel)
155
 
 {
156
 
@@ -3507,6 +3644,13 @@
157
 
         /* add the virtual proxy device */
158
 
         panel_add_proxy_device (panel);
159
 
 
160
 
+        /* System wide proxy settings */
161
 
+        if (is_admin ()) {
162
 
+                g_signal_connect (G_OBJECT (gtk_builder_get_object (panel->priv->builder, "system_proxy_button")), "clicked",
163
 
+                                  G_CALLBACK (on_proxy_apply_system_wide), panel);
164
 
+        } else
165
 
+                gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "system_proxy_button")));
166
 
+
167
 
         /* setup wireless combobox model */
168
 
         combobox = GTK_COMBO_BOX (gtk_builder_get_object (panel->priv->builder,
169
 
                                                           "combobox_wireless_network_name"));
170
 
Index: gnome-control-center-3.4.0/panels/network/network.ui
171
 
===================================================================
172
 
--- gnome-control-center-3.4.0.orig/panels/network/network.ui   2012-03-01 08:56:37.000000000 +0100
173
 
+++ gnome-control-center-3.4.0/panels/network/network.ui        2012-04-12 14:23:34.181999513 +0200
174
 
@@ -2311,6 +2311,20 @@
175
 
                             <property name="position">0</property>
176
 
                           </packing>
177
 
                         </child>
178
 
+                        <child>
179
 
+                          <object class="GtkButton" id="system_proxy_button">
180
 
+                            <property name="label" translatable="yes">Apply system wide</property>
181
 
+                            <property name="visible">True</property>
182
 
+                            <property name="can_focus">True</property>
183
 
+                            <property name="receives_default">True</property>
184
 
+                            <property name="use_action_appearance">False</property>
185
 
+                          </object>
186
 
+                          <packing>
187
 
+                            <property name="expand">False</property>
188
 
+                            <property name="fill">False</property>
189
 
+                            <property name="position">1</property>
190
 
+                          </packing>
191
 
+                        </child>
192
 
                       </object>
193
 
                       <packing>
194
 
                         <property name="position">2</property>