From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1PtxqU-0001qU-AO for garchives@archives.gentoo.org; Mon, 28 Feb 2011 07:48:42 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D25CBE0504; Mon, 28 Feb 2011 07:48:33 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 7E484E0504 for ; Mon, 28 Feb 2011 07:48:33 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BC5CF1B4047 for ; Mon, 28 Feb 2011 07:48:32 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 04F338006A for ; Mon, 28 Feb 2011 07:48:32 +0000 (UTC) From: "Nirbheek Chauhan" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Nirbheek Chauhan" Message-ID: <9ab32e0c1e4a93ad6a4a5644c014028a48605d85.nirbheek@gentoo> Subject: [gentoo-commits] proj/gnome:master commit in: gnome-base/gnome-control-center/, gnome-base/gnome-control-center/files/ X-VCS-Repository: proj/gnome X-VCS-Files: gnome-base/gnome-control-center/files/gnome-control-center-fix-networkmanager-api.patch gnome-base/gnome-control-center/gnome-control-center-2.91.90.ebuild gnome-base/gnome-control-center/gnome-control-center-9999.ebuild X-VCS-Directories: gnome-base/gnome-control-center/ gnome-base/gnome-control-center/files/ X-VCS-Committer: nirbheek X-VCS-Committer-Name: Nirbheek Chauhan X-VCS-Revision: 9ab32e0c1e4a93ad6a4a5644c014028a48605d85 Date: Mon, 28 Feb 2011 07:48:32 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 9a4db7b6adb90b29812060bcbaad9c6d commit: 9ab32e0c1e4a93ad6a4a5644c014028a48605d85 Author: Nirbheek Chauhan gentoo org> AuthorDate: Mon Feb 28 07:27:16 2011 +0000 Commit: Nirbheek Chauhan gentoo org> CommitDate: Mon Feb 28 07:34:48 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gnome.git;a=3D= commit;h=3D9ab32e0c gnome-base/gnome-control-center: fix bug 356729 and bug 356715 * Reported by Alexandre Rostovtsev --- ...ome-control-center-fix-networkmanager-api.patch | 285 ++++++++++++++= ++++++ .../gnome-control-center-2.91.90.ebuild | 5 + .../gnome-control-center-9999.ebuild | 5 + 3 files changed, 295 insertions(+), 0 deletions(-) diff --git a/gnome-base/gnome-control-center/files/gnome-control-center-f= ix-networkmanager-api.patch b/gnome-base/gnome-control-center/files/gnome= -control-center-fix-networkmanager-api.patch new file mode 100644 index 0000000..e73b16d --- /dev/null +++ b/gnome-base/gnome-control-center/files/gnome-control-center-fix-netw= orkmanager-api.patch @@ -0,0 +1,285 @@ +From ab15c3ce94424c25f4afdb13a8c0acd4dc6351ea Mon Sep 17 00:00:00 2001 +From: Daniel Trebbien +Date: Sun, 27 Feb 2011 11:10:10 -0500 +Subject: [PATCH 1/1] Use the NetworkManager modem capabilities API. + +A recent change to the NetworkManager API combined the +NM_DEVICE_TYPE_GSM and NM_DEVICE_TYPE_CDMA types as +NM_DEVICE_TYPE_MODEM and provided an alternative API for accessing the +modem device's capabilities (including GSM_UMTS and CDMA_EVDO). + +https://bugzilla.gnome.org/show_bug.cgi?id=3D643390 +--- + panels/network/cc-network-panel.c | 76 ++++++++++++++++++++----------= ------- + panels/network/panel-common.c | 51 ++++++++++++++++--------- + panels/network/panel-common.h | 7 ++- + 3 files changed, 78 insertions(+), 56 deletions(-) + +diff --git a/panels/network/cc-network-panel.c b/panels/network/cc-netwo= rk-panel.c +index 9148df7..ba37581 100644 +--- a/panels/network/cc-network-panel.c ++++ b/panels/network/cc-network-panel.c +@@ -28,6 +28,7 @@ + #include "nm-client.h" + #include "nm-device.h" + #include "nm-device-ethernet.h" ++#include "nm-device-modem.h" + #include "nm-device-wifi.h" + #include "nm-utils.h" + #include "nm-active-connection.h" +@@ -376,8 +377,7 @@ panel_add_device (CcNetworkPanel *panel, NMDevice *d= evice) +=20 + /* do we have to get additonal data from ModemManager */ + type =3D nm_device_get_device_type (device); +- if (type =3D=3D NM_DEVICE_TYPE_GSM || +- type =3D=3D NM_DEVICE_TYPE_CDMA) { ++ if (type =3D=3D NM_DEVICE_TYPE_MODEM) { + g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM, + G_DBUS_PROXY_FLAGS_NONE, + NULL, +@@ -400,15 +400,15 @@ panel_add_device (CcNetworkPanel *panel, NMDevice = *device) +=20 + /* make title a bit bigger */ + title =3D g_strdup_printf ("%s", +- panel_device_type_to_localized_string = (nm_device_get_device_type (device))); ++ panel_device_to_localized_string (devi= ce)); +=20 + liststore_devices =3D GTK_LIST_STORE (gtk_builder_get_object (p= riv->builder, + "liststore_devices")); + gtk_list_store_append (liststore_devices, &iter); + gtk_list_store_set (liststore_devices, + &iter, +- PANEL_DEVICES_COLUMN_ICON, panel_device_typ= e_to_icon_name (nm_device_get_device_type (device)), +- PANEL_DEVICES_COLUMN_SORT, panel_device_typ= e_to_sortable_string (nm_device_get_device_type (device)), ++ PANEL_DEVICES_COLUMN_ICON, panel_device_to_= icon_name (device), ++ PANEL_DEVICES_COLUMN_SORT, panel_device_to_= sortable_string (device), + PANEL_DEVICES_COLUMN_TITLE, title, + PANEL_DEVICES_COLUMN_ID, nm_device_get_udi = (device), + PANEL_DEVICES_COLUMN_TOOLTIP, NULL, +@@ -729,14 +729,14 @@ nm_device_refresh_item_ui (CcNetworkPanel *panel, = NMDevice *device) + widget =3D GTK_WIDGET (gtk_builder_get_object (priv->builder, + "image_device")); + gtk_image_set_from_icon_name (GTK_IMAGE (widget), +- panel_device_type_to_icon_name (t= ype), ++ panel_device_to_icon_name (device= ), + GTK_ICON_SIZE_DIALOG); +=20 + /* set device kind */ + widget =3D GTK_WIDGET (gtk_builder_get_object (priv->builder, + "label_device")); + gtk_label_set_label (GTK_LABEL (widget), +- panel_device_type_to_localized_string (typ= e)); ++ panel_device_to_localized_string (device))= ; +=20 +=20 + /* set device state */ +@@ -754,10 +754,13 @@ nm_device_refresh_item_ui (CcNetworkPanel *panel, = NMDevice *device) + } else if (type =3D=3D NM_DEVICE_TYPE_WIFI) { + gtk_notebook_set_current_page (GTK_NOTEBOOK (widget), 1= ); + sub_pane =3D "wireless"; +- } else if (type =3D=3D NM_DEVICE_TYPE_GSM || +- type =3D=3D NM_DEVICE_TYPE_CDMA) { +- gtk_notebook_set_current_page (GTK_NOTEBOOK (widget), 4= ); +- sub_pane =3D "mobilebb"; ++ } else if (type =3D=3D NM_DEVICE_TYPE_MODEM) { ++ NMDeviceModemCapabilities caps =3D nm_device_modem_get_= current_capabilities (NM_DEVICE_MODEM (device)); ++ if ((caps & NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS) || ++ (caps & NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO)) { ++ gtk_notebook_set_current_page (GTK_NOTEBOOK (wi= dget), 4); ++ sub_pane =3D "mobilebb"; ++ } + } + if (sub_pane =3D=3D NULL) + goto out; +@@ -824,30 +827,33 @@ nm_device_refresh_item_ui (CcNetworkPanel *panel, = NMDevice *device) + active_ap); + } +=20 +- } else if (type =3D=3D NM_DEVICE_TYPE_GSM || +- type =3D=3D NM_DEVICE_TYPE_CDMA) { ++ } else if (type =3D=3D NM_DEVICE_TYPE_MODEM) { ++ NMDeviceModemCapabilities caps =3D nm_device_modem_get_= current_capabilities (NM_DEVICE_MODEM (device)); +=20 +- /* IMEI */ +- str =3D g_object_get_data (G_OBJECT (device), +- "ControlCenter::EquipmentIdent= ifier"); +- panel_set_widget_data (panel, +- sub_pane, +- "imei", +- str); ++ if ((caps & NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS) || ++ (caps & NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO)) { ++ /* IMEI */ ++ str =3D g_object_get_data (G_OBJECT (device), ++ "ControlCenter::Equipm= entIdentifier"); ++ panel_set_widget_data (panel, ++ sub_pane, ++ "imei", ++ str); +=20 +- /* operator name */ +- str =3D g_object_get_data (G_OBJECT (device), +- "ControlCenter::OperatorName")= ; +- panel_set_widget_data (panel, +- sub_pane, +- "provider", +- str); ++ /* operator name */ ++ str =3D g_object_get_data (G_OBJECT (device), ++ "ControlCenter::Operat= orName"); ++ panel_set_widget_data (panel, ++ sub_pane, ++ "provider", ++ str); +=20 +- /* device speed */ +- panel_set_widget_data (panel, +- sub_pane, +- "speed", +- NULL); ++ /* device speed */ ++ panel_set_widget_data (panel, ++ sub_pane, ++ "speed", ++ NULL); ++ } + } +=20 + /* get IP4 parameters */ +diff --git a/panels/network/panel-common.c b/panels/network/panel-common= .c +index 928b0c4..b07189b 100644 +--- a/panels/network/panel-common.c ++++ b/panels/network/panel-common.c +@@ -26,25 +26,32 @@ + #include +=20 + #include "panel-common.h" ++#include "nm-device-modem.h" +=20 + /** +- * panel_device_type_to_icon_name: ++ * panel_device_to_icon_name: + **/ + const gchar * +-panel_device_type_to_icon_name (NMDeviceType type) ++panel_device_to_icon_name (NMDevice *device) + { + const gchar *value =3D NULL; +- switch (type) { ++ NMDeviceModemCapabilities caps; ++ switch (nm_device_get_device_type (device)) { + case NM_DEVICE_TYPE_ETHERNET: + value =3D "network-wired"; + break; + case NM_DEVICE_TYPE_WIFI: +- case NM_DEVICE_TYPE_GSM: +- case NM_DEVICE_TYPE_CDMA: + case NM_DEVICE_TYPE_BT: + case NM_DEVICE_TYPE_OLPC_MESH: + value =3D "network-wireless"; + break; ++ case NM_DEVICE_TYPE_MODEM: ++ caps =3D nm_device_modem_get_current_capabilities (NM_D= EVICE_MODEM (device)); ++ if ((caps & NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS) || ++ (caps & NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO)) { ++ value =3D "network-wireless"; ++ } ++ break; + default: + break; + } +@@ -52,13 +59,14 @@ panel_device_type_to_icon_name (NMDeviceType type) + } +=20 + /** +- * panel_device_type_to_localized_string: ++ * panel_device_to_localized_string: + **/ + const gchar * +-panel_device_type_to_localized_string (NMDeviceType type) ++panel_device_to_localized_string (NMDevice *device) + { + const gchar *value =3D NULL; +- switch (type) { ++ NMDeviceModemCapabilities caps; ++ switch (nm_device_get_device_type (device)) { + case NM_DEVICE_TYPE_UNKNOWN: + /* TRANSLATORS: device type */ + value =3D _("Unknown"); +@@ -71,10 +79,13 @@ panel_device_type_to_localized_string (NMDeviceType = type) + /* TRANSLATORS: device type */ + value =3D _("Wireless"); + break; +- case NM_DEVICE_TYPE_GSM: +- case NM_DEVICE_TYPE_CDMA: +- /* TRANSLATORS: device type */ +- value =3D _("Mobile broadband"); ++ case NM_DEVICE_TYPE_MODEM: ++ caps =3D nm_device_modem_get_current_capabilities (NM_D= EVICE_MODEM (device)); ++ if ((caps & NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS) || ++ (caps & NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO)) { ++ /* TRANSLATORS: device type */ ++ value =3D _("Mobile broadband"); ++ } + break; + case NM_DEVICE_TYPE_BT: + /* TRANSLATORS: device type */ +@@ -91,24 +102,28 @@ panel_device_type_to_localized_string (NMDeviceType= type) + } +=20 + /** +- * panel_device_type_to_sortable_string: ++ * panel_device_to_sortable_string: + * + * Try to return order of approximate connection speed. + **/ + const gchar * +-panel_device_type_to_sortable_string (NMDeviceType type) ++panel_device_to_sortable_string (NMDevice *device) + { + const gchar *value =3D NULL; +- switch (type) { ++ NMDeviceModemCapabilities caps; ++ switch (nm_device_get_device_type (device)) { + case NM_DEVICE_TYPE_ETHERNET: + value =3D "1"; + break; + case NM_DEVICE_TYPE_WIFI: + value =3D "2"; + break; +- case NM_DEVICE_TYPE_GSM: +- case NM_DEVICE_TYPE_CDMA: +- value =3D "3"; ++ case NM_DEVICE_TYPE_MODEM: ++ caps =3D nm_device_modem_get_current_capabilities (NM_D= EVICE_MODEM (device)); ++ if ((caps & NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS) || ++ (caps & NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO)) { ++ value =3D "3"; ++ } + break; + case NM_DEVICE_TYPE_BT: + value =3D "4"; +diff --git a/panels/network/panel-common.h b/panels/network/panel-common= .h +index c50f6b3..dd0eb08 100644 +--- a/panels/network/panel-common.h ++++ b/panels/network/panel-common.h +@@ -24,12 +24,13 @@ +=20 + #include + #include ++#include +=20 + G_BEGIN_DECLS +=20 +-const gchar *panel_device_type_to_icon_name (NMDevi= ceType type); +-const gchar *panel_device_type_to_localized_string (NMDevi= ceType type); +-const gchar *panel_device_type_to_sortable_string (NMDevi= ceType type); ++const gchar *panel_device_to_icon_name (NMDevice *d= evice); ++const gchar *panel_device_to_localized_string (NMDevice *d= evice); ++const gchar *panel_device_to_sortable_string (NMDevice *d= evice); + const gchar *panel_ap_mode_to_localized_string (NM8021= 1Mode mode); + const gchar *panel_device_state_to_localized_string (NMDevi= ceState type); +=20 +--=20 +1.7.2.3 + diff --git a/gnome-base/gnome-control-center/gnome-control-center-2.91.90= .ebuild b/gnome-base/gnome-control-center/gnome-control-center-2.91.90.eb= uild index d1101b0..9cb2b1b 100644 --- a/gnome-base/gnome-control-center/gnome-control-center-2.91.90.ebuild +++ b/gnome-base/gnome-control-center/gnome-control-center-2.91.90.ebuild @@ -89,4 +89,9 @@ src_prepare() { --disable-schemas-install $(use_with socialweb libsocialweb)" DOCS=3D"AUTHORS ChangeLog NEWS README TODO" + + # bug 356729 + epatch "${FILESDIR}/${PN}-fix-networkmanager-api.patch" + + gnome2_src_prepare } diff --git a/gnome-base/gnome-control-center/gnome-control-center-9999.eb= uild b/gnome-base/gnome-control-center/gnome-control-center-9999.ebuild index d1101b0..9cb2b1b 100644 --- a/gnome-base/gnome-control-center/gnome-control-center-9999.ebuild +++ b/gnome-base/gnome-control-center/gnome-control-center-9999.ebuild @@ -89,4 +89,9 @@ src_prepare() { --disable-schemas-install $(use_with socialweb libsocialweb)" DOCS=3D"AUTHORS ChangeLog NEWS README TODO" + + # bug 356729 + epatch "${FILESDIR}/${PN}-fix-networkmanager-api.patch" + + gnome2_src_prepare }