Accepting request 133759 from home:vuntz:branches:GNOME:Factory

Rebase patch; untested at runtime

OBS-URL: https://build.opensuse.org/request/show/133759
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gnome-control-center?expand=0&rev=156
This commit is contained in:
Vincent Untz 2012-09-14 12:37:21 +00:00 committed by Git OBS Bridge
parent 587234ba13
commit 269b3160ce
3 changed files with 88 additions and 91 deletions

View File

@ -16,11 +16,11 @@ https://bugzilla.gnome.org/show_bug.cgi?id=646187
panels/network/network-dialogs.c | 16 ++++++++
4 files changed, 91 insertions(+), 2 deletions(-)
Index: gnome-control-center-3.5.4/configure.ac
Index: gnome-control-center-3.5.91/configure.ac
===================================================================
--- gnome-control-center-3.5.4.orig/configure.ac
+++ gnome-control-center-3.5.4/configure.ac
@@ -108,7 +108,8 @@ PKG_CHECK_MODULES(KEYBOARD_PANEL, $COMMO
--- gnome-control-center-3.5.91.orig/configure.ac
+++ gnome-control-center-3.5.91/configure.ac
@@ -136,7 +136,8 @@ PKG_CHECK_MODULES(KEYBOARD_PANEL, $COMMO
PKG_CHECK_MODULES(MEDIA_PANEL, $COMMON_MODULES)
PKG_CHECK_MODULES(MOUSE_PANEL, $COMMON_MODULES xi >= 1.2
gnome-settings-daemon >= $GSD_REQUIRED_VERSION x11)
@ -30,12 +30,12 @@ Index: gnome-control-center-3.5.4/configure.ac
PKG_CHECK_MODULES(ONLINE_ACCOUNTS_PANEL, $COMMON_MODULES goa-1.0 goa-backend-1.0 >= $GOA_REQUIRED_VERSION)
PKG_CHECK_MODULES(POWER_PANEL, $COMMON_MODULES upower-glib >= 0.9.1
gnome-settings-daemon >= $GSD_REQUIRED_VERSION)
Index: gnome-control-center-3.5.4/panels/network/cc-network-panel.c
Index: gnome-control-center-3.5.91/panels/network/cc-network-panel.c
===================================================================
--- gnome-control-center-3.5.4.orig/panels/network/cc-network-panel.c
+++ gnome-control-center-3.5.4/panels/network/cc-network-panel.c
@@ -25,6 +25,8 @@
#include <netinet/ether.h>
--- gnome-control-center-3.5.91.orig/panels/network/cc-network-panel.c
+++ gnome-control-center-3.5.91/panels/network/cc-network-panel.c
@@ -23,6 +23,8 @@
#include <glib/gi18n.h>
#include <stdlib.h>
+#include <polkit/polkit.h>
@ -43,7 +43,7 @@ Index: gnome-control-center-3.5.4/panels/network/cc-network-panel.c
#include "cc-network-panel.h"
#include "nm-remote-settings.h"
@@ -88,6 +90,9 @@ struct _CcNetworkPanelPrivate
@@ -73,6 +75,9 @@ struct _CcNetworkPanelPrivate
gchar *arg_device;
gchar *arg_access_point;
gboolean operation_done;
@ -53,75 +53,8 @@ Index: gnome-control-center-3.5.4/panels/network/cc-network-panel.c
};
enum {
@@ -3000,8 +3005,10 @@ wireless_ap_changed_cb (GtkComboBox *com
NetObject *object;
NMConnection *connection;
NMConnection *connection_activate = NULL;
+ NMConnection *partial = NULL;
NMDevice *device;
NMSettingWireless *setting_wireless;
+ NMSettingConnection *setting_con;
if (panel->priv->updating_device)
goto out;
@@ -3070,8 +3077,17 @@ wireless_ap_changed_cb (GtkComboBox *com
/* create one, as it's missing */
g_debug ("no existing connection found for %s, creating",
ssid_target);
+ if (panel->priv->default_private) {
+ partial = nm_connection_new ();
+ setting_con = nm_setting_connection_new ();
+ nm_connection_add_setting (partial, NM_SETTING (setting_con));
+ nm_setting_connection_add_permission (setting_con,
+ "user",
+ g_get_user_name(),
+ NULL);
+ }
nm_client_add_and_activate_connection (panel->priv->client,
- NULL,
+ partial,
device, object_path,
connection_add_activate_cb, panel);
out:
@@ -3323,6 +3339,11 @@ start_shared_connection (CcNetworkPanel
"id", "Hotspot",
"autoconnect", FALSE,
NULL);
+ if (panel->priv->default_private)
+ nm_setting_connection_add_permission (sc,
+ "user",
+ g_get_user_name(),
+ NULL);
nm_connection_add_setting (c, (NMSetting *)sc);
sw = (NMSettingWireless *)nm_setting_wireless_new ();
@@ -3548,6 +3569,24 @@ network_add_shell_header_widgets_cb (gpo
}
static void
+check_authorization_cb (PolkitAuthority *authority,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ PolkitAuthorizationResult *result;
+ CcNetworkPanel *panel = user_data;
+ GError *error = NULL;
+
+ result = polkit_authority_check_authorization_finish (authority, res, &error);
+ if (error != NULL) {
+ g_warning ("Failed to check authorization: %s", error->message);
+ g_error_free (error);
+ } else if (polkit_authorization_result_get_is_authorized (result)) {
+ panel->priv->default_private = FALSE;
+ }
+}
+
+static void
cc_network_panel_init (CcNetworkPanel *panel)
{
DBusGConnection *bus = NULL;
@@ -3562,6 +3601,9 @@ cc_network_panel_init (CcNetworkPanel *p
GtkTreeSortable *sortable;
@@ -1027,6 +1032,9 @@ cc_network_panel_init (CcNetworkPanel *p
GtkTreeSelection *selection;
GtkWidget *widget;
GtkWidget *toplevel;
+ PolkitSubject *subject;
@ -130,7 +63,7 @@ Index: gnome-control-center-3.5.4/panels/network/cc-network-panel.c
panel->priv = NETWORK_PANEL_PRIVATE (panel);
@@ -3841,6 +3883,28 @@ cc_network_panel_init (CcNetworkPanel *p
@@ -1112,6 +1120,28 @@ cc_network_panel_init (CcNetworkPanel *p
/* add kill switch widgets when dialog activated */
panel->priv->add_header_widgets_idle = g_idle_add (network_add_shell_header_widgets_cb, panel);
@ -159,7 +92,7 @@ Index: gnome-control-center-3.5.4/panels/network/cc-network-panel.c
}
void
@@ -3851,3 +3915,9 @@ cc_network_panel_register (GIOModule *mo
@@ -1122,3 +1152,9 @@ cc_network_panel_register (GIOModule *mo
CC_TYPE_NETWORK_PANEL,
"network", 0);
}
@ -169,10 +102,10 @@ Index: gnome-control-center-3.5.4/panels/network/cc-network-panel.c
+{
+ return panel->priv->default_private;
+}
Index: gnome-control-center-3.5.4/panels/network/cc-network-panel.h
Index: gnome-control-center-3.5.91/panels/network/cc-network-panel.h
===================================================================
--- gnome-control-center-3.5.4.orig/panels/network/cc-network-panel.h
+++ gnome-control-center-3.5.4/panels/network/cc-network-panel.h
--- gnome-control-center-3.5.91.orig/panels/network/cc-network-panel.h
+++ gnome-control-center-3.5.91/panels/network/cc-network-panel.h
@@ -67,6 +67,8 @@ GType cc_network_panel_get_type (void) G
void cc_network_panel_register (GIOModule *module);
@ -182,10 +115,10 @@ Index: gnome-control-center-3.5.4/panels/network/cc-network-panel.h
G_END_DECLS
#endif /* _CC_NETWORK_PANEL_H */
Index: gnome-control-center-3.5.4/panels/network/network-dialogs.c
Index: gnome-control-center-3.5.91/panels/network/network-dialogs.c
===================================================================
--- gnome-control-center-3.5.4.orig/panels/network/network-dialogs.c
+++ gnome-control-center-3.5.4/panels/network/network-dialogs.c
--- gnome-control-center-3.5.91.orig/panels/network/network-dialogs.c
+++ gnome-control-center-3.5.91/panels/network/network-dialogs.c
@@ -41,6 +41,7 @@ typedef struct {
NMClient *client;
NMRemoteSettings *settings;
@ -251,3 +184,62 @@ Index: gnome-control-center-3.5.4/panels/network/network-dialogs.c
caps = nm_device_modem_get_current_capabilities (NM_DEVICE_MODEM (device));
if (caps & NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS) {
Index: gnome-control-center-3.5.91/panels/network/net-device-wifi.c
===================================================================
--- gnome-control-center-3.5.91.orig/panels/network/net-device-wifi.c
+++ gnome-control-center-3.5.91/panels/network/net-device-wifi.c
@@ -977,6 +977,9 @@ wireless_try_to_connect (NetDeviceWifi *
NMSettingWireless *setting_wireless;
NMRemoteSettings *remote_settings;
NMClient *client;
+ CcNetworkPanel *panel;
+ NMConnection *partial = NULL;
+ NMSettingConnection *setting_con;
if (device_wifi->priv->updating_device)
goto out;
@@ -1038,8 +1041,20 @@ wireless_try_to_connect (NetDeviceWifi *
/* create one, as it's missing */
g_debug ("no existing connection found for %s, creating",
ssid_target);
+
+ panel = net_object_get_panel (NET_OBJECT (device_wifi));
+ if (cc_network_panel_get_default_private (panel)) {
+ partial = nm_connection_new ();
+ setting_con = (NMSettingConnection *)nm_setting_connection_new ();
+ nm_connection_add_setting (partial, NM_SETTING (setting_con));
+ nm_setting_connection_add_permission (setting_con,
+ "user",
+ g_get_user_name(),
+ NULL);
+ }
+
nm_client_add_and_activate_connection (client,
- NULL,
+ partial,
device, object_path,
connection_add_activate_cb, device_wifi);
out:
@@ -1296,6 +1311,7 @@ start_shared_connection (NetDeviceWifi *
GSList *l;
NMClient *client;
NMRemoteSettings *remote_settings;
+ CcNetworkPanel *panel;
device = net_device_get_nm_device (NET_DEVICE (device_wifi));
g_assert (nm_device_get_device_type (device) == NM_DEVICE_TYPE_WIFI);
@@ -1335,6 +1351,14 @@ start_shared_connection (NetDeviceWifi *
"id", "Hotspot",
"autoconnect", FALSE,
NULL);
+
+ panel = net_object_get_panel (NET_OBJECT (device_wifi));
+ if (cc_network_panel_get_default_private (panel))
+ nm_setting_connection_add_permission (sc,
+ "user",
+ g_get_user_name(),
+ NULL);
+
nm_connection_add_setting (c, (NMSetting *)sc);
sw = (NMSettingWireless *)nm_setting_wireless_new ();

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Sep 12 09:38:20 UTC 2012 - vuntz@opensuse.org
- Rebase gcc-private-connection.patch.
-------------------------------------------------------------------
Tue Sep 4 21:32:36 UTC 2012 - dimstar@opensuse.org

View File

@ -23,7 +23,8 @@
Name: gnome-control-center
Version: 3.5.91
Release: 0
# FIXME: in 12.2 and later, check if we still need patch2 (gnome-control-center-hide-region-system-tab.patch) (see bnc#703833)
# FIXME: stop owning %%{_datadir}/polkit-1/rules.d once polkit >= 0.106 is in (should be soon-ish, end of 09/2012)
# FIXME: in 12.3 and later, check if we still need patch2 (gnome-control-center-hide-region-system-tab.patch) (see bnc#703833)
Summary: The GNOME Control Center
License: GPL-2.0+
Group: System/GUI/GNOME
@ -37,7 +38,7 @@ Patch2: gnome-control-center-hide-region-system-tab.patch
Patch3: gnome-control-center-fine-grained-tz-polkit.patch
# PATCH-NEEDS-REBASE gnome-control-center-system-proxy-configuration.patch -- this needs to be reimplemented to be more distro-generic before submitting upstream - docs at http://en.opensuse.org/GNOME/Proxy_configuration (was PATCH-FEATURE-OPENSUSE)
Patch14: gnome-control-center-system-proxy-configuration.patch
# PATCH-NEEDS-REBASE gcc-private-connection.patch bnc#751211 bgo#646187 dimstar@opensuse.org -- network: create private connections if the user if not authorized. (WAS: PATCH-FIX-UPSTREAM)
# PATCH-FIX-UPSTREAM gcc-private-connection.patch bnc#751211 bgo#646187 dimstar@opensuse.org -- network: create private connections if the user if not authorized
Patch15: gcc-private-connection.patch
# PATCH-FIX-UPSTREAM gnome-control-center-probe-radius-server-cert.patch bnc#574266 glin@suse.com -- network: Probe the RADIUS server certificate
Patch16: gnome-control-center-probe-radius-server-cert.patch
@ -164,8 +165,7 @@ translation-update-upstream
%patch3 -p1
#NEEDS-REBASE
#%patch14 -p1
#NEEDS-REBASE
#patch15 -p1
%patch15 -p1
%patch16 -p1
%if 0%{?BUILD_FROM_VCS}