r36575 - in /desktop/unstable/gnome-shell/debian: changelog patches/05-NetworkMenu-fix-updating-connection-lists.patch patches/28_network_user_connections.patch patches/series
biebl at users.alioth.debian.org
biebl at users.alioth.debian.org
Mon Jan 14 23:26:17 UTC 2013
Author: biebl
Date: Mon Jan 14 23:26:17 2013
New Revision: 36575
URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=36575
Log:
05-NetworkMenu-fix-updating-connection-lists.patch: Properly update the
Network UI when connections change their name or id. Patch cherry-picked
from upstream Git.
Added:
desktop/unstable/gnome-shell/debian/patches/05-NetworkMenu-fix-updating-connection-lists.patch
Modified:
desktop/unstable/gnome-shell/debian/changelog
desktop/unstable/gnome-shell/debian/patches/28_network_user_connections.patch
desktop/unstable/gnome-shell/debian/patches/series
Modified: desktop/unstable/gnome-shell/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-shell/debian/changelog?rev=36575&op=diff
==============================================================================
--- desktop/unstable/gnome-shell/debian/changelog [utf-8] (original)
+++ desktop/unstable/gnome-shell/debian/changelog [utf-8] Mon Jan 14 23:26:17 2013
@@ -15,6 +15,9 @@
[ Michael Biebl ]
* Refresh patches to apply without fuzz.
+ * 05-NetworkMenu-fix-updating-connection-lists.patch: Properly update the
+ Network UI when connections change their name or id. Patch cherry-picked
+ from upstream Git.
-- Josselin Mouette <joss at debian.org> Mon, 14 Jan 2013 16:22:43 +0100
Added: desktop/unstable/gnome-shell/debian/patches/05-NetworkMenu-fix-updating-connection-lists.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-shell/debian/patches/05-NetworkMenu-fix-updating-connection-lists.patch?rev=36575&op=file
==============================================================================
--- desktop/unstable/gnome-shell/debian/patches/05-NetworkMenu-fix-updating-connection-lists.patch (added)
+++ desktop/unstable/gnome-shell/debian/patches/05-NetworkMenu-fix-updating-connection-lists.patch [utf-8] Mon Jan 14 23:26:17 2013
@@ -1,0 +1,215 @@
+From f098bc6b6e9743cd3fab18a68a5595319a527eba Mon Sep 17 00:00:00 2001
+From: Giovanni Campagna <gcampagna at src.gnome.org>
+Date: Thu, 31 May 2012 19:13:16 +0200
+Subject: [PATCH] NetworkMenu: fix updating connection lists
+
+Ensure that the UI is updated when a connection changes name or id,
+even if it was already known by a device.
+Also, use less private properties on NMConnection objects, as they
+can become stale and cause problems.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=677097
+---
+ js/ui/status/network.js | 80 ++++++++++++++++++++++-------------------------
+ 1 file changed, 37 insertions(+), 43 deletions(-)
+
+diff --git a/js/ui/status/network.js b/js/ui/status/network.js
+index f7d2258..94bce24 100644
+--- a/js/ui/status/network.js
++++ b/js/ui/status/network.js
+@@ -304,9 +304,10 @@ const NMDevice = new Lang.Class({
+ // record the connection
+ let obj = {
+ connection: connections[i],
+- name: connections[i]._name,
+- uuid: connections[i]._uuid,
++ name: connections[i].get_id(),
++ uuid: connections[i].get_uuid(),
+ timestamp: connections[i]._timestamp,
++ item: null,
+ };
+ this._connections.push(obj);
+ }
+@@ -401,48 +402,46 @@ const NMDevice = new Lang.Class({
+ },
+
+ checkConnection: function(connection) {
+- let pos = this._findConnection(connection._uuid);
++ let pos = this._findConnection(connection.get_uuid());
+ let exists = pos != -1;
+ let valid = this.connectionValid(connection);
++ let similar = false;
++ if (exists) {
++ let existing = this._connections[pos];
+
+- if (exists && !valid)
+- this.removeConnection(connection);
+- else if (!exists && valid)
+- this.addConnection(connection);
+- else if (exists && valid) {
+- // propagate changes and update the UI
+-
+- if (this._connections[pos].timestamp != connection._timestamp) {
+- this._connections[pos].timestamp = connection._timestamp;
+- this._connections.sort(this._connectionSortFunction);
++ // Check if connection changed name or id
++ similar = existing.name == connection.get_id() &&
++ existing.timestamp == connection._timestamp;
++ }
+
+- this._clearSection();
+- this._queueCreateSection();
+- }
++ if (exists && valid && similar) {
++ // Nothing to do
++ return;
+ }
++
++ if (exists)
++ this.removeConnection(connection);
++ if (valid)
++ this.addConnection(connection);
+ },
+
+ addConnection: function(connection) {
+ // record the connection
+ let obj = {
+ connection: connection,
+- name: connection._name,
+- uuid: connection._uuid,
++ name: connection.get_id(),
++ uuid: connection.get_uuid(),
+ timestamp: connection._timestamp,
++ item: null,
+ };
+- this._connections.push(obj);
+- this._connections.sort(this._connectionSortFunction);
++ Util.insertSorted(this._connections, obj, this._connectionSortFunction);
+
+ this._clearSection();
+ this._queueCreateSection();
+ },
+
+ removeConnection: function(connection) {
+- if (!connection._uuid) {
+- log('Cannot remove a connection without an UUID');
+- return;
+- }
+- let pos = this._findConnection(connection._uuid);
++ let pos = this._findConnection(connection.get_uuid());
+ if (pos == -1) {
+ // this connection was never added, nothing to do here
+ return;
+@@ -715,10 +714,10 @@ const NMDeviceWired = new Lang.Class({
+
+ _createAutomaticConnection: function() {
+ let connection = new NetworkManager.Connection();
+- connection._uuid = NetworkManager.utils_uuid_generate();
++ let uuid = NetworkManager.utils_uuid_generate();
+ connection.add_setting(new NetworkManager.SettingWired());
+ connection.add_setting(new NetworkManager.SettingConnection({
+- uuid: connection._uuid,
++ uuid: uuid,
+ id: this._autoConnectionName,
+ type: NetworkManager.SETTING_WIRED_SETTING_NAME,
+ autoconnect: true
+@@ -862,10 +861,10 @@ const NMDeviceBluetooth = new Lang.Class({
+
+ _createAutomaticConnection: function() {
+ let connection = new NetworkManager.Connection;
+- connection._uuid = NetworkManager.utils_uuid_generate();
++ let uuid = NetworkManager.utils_uuid_generate();
+ connection.add_setting(new NetworkManager.SettingBluetooth);
+ connection.add_setting(new NetworkManager.SettingConnection({
+- uuid: connection._uuid,
++ uuid: uuid,
+ id: this._autoConnectionName,
+ type: NetworkManager.SETTING_BLUETOOTH_SETTING_NAME,
+ autoconnect: false
+@@ -1331,9 +1330,7 @@ const NMDeviceWireless = new Lang.Class({
+ },
+
+ removeConnection: function(connection) {
+- if (!connection._uuid)
+- return;
+- let pos = this._findConnection(connection._uuid);
++ let pos = this._findConnection(connection.get_uuid());
+ if (pos == -1) {
+ // removing connection that was never added
+ return;
+@@ -1347,7 +1344,7 @@ const NMDeviceWireless = new Lang.Class({
+ let apObj = this._networks[i];
+ let connections = apObj.connections;
+ for (let k = 0; k < connections.length; k++) {
+- if (connections[k]._uuid == connection._uuid) {
++ if (connections[k].get_uuid() == connection.get_uuid()) {
+ // remove the connection from the access point group
+ connections.splice(k);
+ forceupdate = forceupdate || connections.length == 0;
+@@ -1363,7 +1360,7 @@ const NMDeviceWireless = new Lang.Class({
+ forceupdate = true;
+ } else {
+ for (let j = 0; j < items.length; j++) {
+- if (items[j]._connection._uuid == connection._uuid) {
++ if (items[j]._connection.get_uuid() == connection.get_uuid()) {
+ items[j].destroy();
+ break;
+ }
+@@ -1390,8 +1387,8 @@ const NMDeviceWireless = new Lang.Class({
+ // record the connection
+ let obj = {
+ connection: connection,
+- name: connection._name,
+- uuid: connection._uuid,
++ name: connection.get_id(),
++ uuid: connection.get_uuid(),
+ };
+ this._connections.push(obj);
+
+@@ -1883,7 +1880,7 @@ const NMApplet = new Lang.Class({
+ let connections = this._settings.list_connections();
+ for (let i = 0; i < connections.length; i++) {
+ let connection = connections[i];
+- if (connection._uuid) {
++ if (connection._updatedId) {
+ // connection was already seen (for example because NetworkManager was restarted)
+ continue;
+ }
+@@ -1896,7 +1893,7 @@ const NMApplet = new Lang.Class({
+ },
+
+ _newConnection: function(settings, connection) {
+- if (connection._uuid) {
++ if (connection._updatedId) {
+ // connection was already seen
+ return;
+ }
+@@ -1927,23 +1924,20 @@ const NMApplet = new Lang.Class({
+ devices[i].removeConnection(connection);
+ }
+
+- connection._uuid = null;
+ connection.disconnect(connection._removedId);
+ connection.disconnect(connection._updatedId);
++ connection._removedId = connection._updatedId = 0;
+ },
+
+ _updateConnection: function(connection) {
+ let connectionSettings = connection.get_setting_by_name(NetworkManager.SETTING_CONNECTION_SETTING_NAME);
+ connection._type = connectionSettings.type;
+-
+ connection._section = this._ctypes[connection._type] || NMConnectionCategory.INVALID;
+- connection._name = connectionSettings.id;
+- connection._uuid = connectionSettings.uuid;
+ connection._timestamp = connectionSettings.timestamp;
+
+ let section = connection._section;
+
+- if (connection._section == NMConnectionCategory.INVALID)
++ if (section == NMConnectionCategory.INVALID)
+ return;
+ if (section == NMConnectionCategory.VPN) {
+ this._devices.vpn.device.checkConnection(connection);
+--
+1.7.10.4
+
Modified: desktop/unstable/gnome-shell/debian/patches/28_network_user_connections.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-shell/debian/patches/28_network_user_connections.patch?rev=36575&op=diff
==============================================================================
--- desktop/unstable/gnome-shell/debian/patches/28_network_user_connections.patch [utf-8] (original)
+++ desktop/unstable/gnome-shell/debian/patches/28_network_user_connections.patch [utf-8] Mon Jan 14 23:26:17 2013
@@ -1,8 +1,8 @@
Index: gnome-shell-3.4.2/js/ui/status/network.js
===================================================================
---- gnome-shell-3.4.2.orig/js/ui/status/network.js 2012-07-20 19:38:25.000000000 +0200
-+++ gnome-shell-3.4.2/js/ui/status/network.js 2013-01-14 16:16:07.806637098 +0100
-@@ -97,6 +97,11 @@ function ssidToLabel(ssid) {
+--- gnome-shell-3.4.2.orig/js/ui/status/network.js 2013-01-15 00:12:14.109789321 +0100
++++ gnome-shell-3.4.2/js/ui/status/network.js 2013-01-15 00:12:14.101789249 +0100
+@@ -97,6 +97,11 @@
return label;
}
@@ -14,13 +14,13 @@
const NMNetworkMenuItem = new Lang.Class({
Name: 'NMNetworkMenuItem',
Extends: PopupMenu.PopupBaseMenuItem,
-@@ -864,12 +869,14 @@ const NMDeviceBluetooth = new Lang.Class
+@@ -863,12 +868,14 @@
let connection = new NetworkManager.Connection;
- connection._uuid = NetworkManager.utils_uuid_generate();
+ let uuid = NetworkManager.utils_uuid_generate();
connection.add_setting(new NetworkManager.SettingBluetooth);
- connection.add_setting(new NetworkManager.SettingConnection({
+ let setting_conn = new NetworkManager.SettingConnection({
- uuid: connection._uuid,
+ uuid: uuid,
id: this._autoConnectionName,
type: NetworkManager.SETTING_BLUETOOTH_SETTING_NAME,
autoconnect: false
@@ -31,7 +31,7 @@
return connection;
},
-@@ -950,6 +957,8 @@ const NMDeviceWireless = new Lang.Class(
+@@ -949,6 +956,8 @@
this._overflowItem = null;
this._networks = [ ];
@@ -40,7 +40,7 @@
// breaking the layers with this, but cannot call
// this.connectionValid until I have a device
this.device = device;
-@@ -1455,12 +1464,22 @@ const NMDeviceWireless = new Lang.Class(
+@@ -1452,12 +1461,22 @@
let connection = new NetworkManager.Connection();
connection.add_setting(new NetworkManager.SettingWireless());
Modified: desktop/unstable/gnome-shell/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-shell/debian/patches/series?rev=36575&op=diff
==============================================================================
--- desktop/unstable/gnome-shell/debian/patches/series [utf-8] (original)
+++ desktop/unstable/gnome-shell/debian/patches/series [utf-8] Mon Jan 14 23:26:17 2013
@@ -2,6 +2,7 @@
02_filter_nodisplay_parents.patch
03_don-t-show-apps-in-NoDisplay-categories.patch
04_fix_nodisplay.patch
+05-NetworkMenu-fix-updating-connection-lists.patch
10-make-NetworkManager-optional.patch
11-no-gettext.patch
14_make-GLX-optional.patch
More information about the pkg-gnome-commits
mailing list