public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Nirbheek Chauhan" <nirbheek@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gnome:master commit in: gnome-base/gnome-control-center/, gnome-base/gnome-control-center/files/
Date: Mon, 28 Feb 2011 07:48:32 +0000 (UTC)	[thread overview]
Message-ID: <9ab32e0c1e4a93ad6a4a5644c014028a48605d85.nirbheek@gentoo> (raw)

commit:     9ab32e0c1e4a93ad6a4a5644c014028a48605d85
Author:     Nirbheek Chauhan <nirbheek <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 28 07:27:16 2011 +0000
Commit:     Nirbheek Chauhan <nirbheek <AT> gentoo <DOT> org>
CommitDate: Mon Feb 28 07:34:48 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gnome.git;a=commit;h=9ab32e0c

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-fix-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-networkmanager-api.patch
@@ -0,0 +1,285 @@
+From ab15c3ce94424c25f4afdb13a8c0acd4dc6351ea Mon Sep 17 00:00:00 2001
+From: Daniel Trebbien <dtrebbien@gmail.com>
+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=643390
+---
+ 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-network-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 *device)
+ 
+         /* do we have to get additonal data from ModemManager */
+         type = nm_device_get_device_type (device);
+-        if (type == NM_DEVICE_TYPE_GSM ||
+-            type == NM_DEVICE_TYPE_CDMA) {
++        if (type == 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)
+ 
+         /* make title a bit bigger */
+         title = g_strdup_printf ("<span size=\"large\">%s</span>",
+-                                 panel_device_type_to_localized_string (nm_device_get_device_type (device)));
++                                 panel_device_to_localized_string (device));
+ 
+         liststore_devices = GTK_LIST_STORE (gtk_builder_get_object (priv->builder,
+                                             "liststore_devices"));
+         gtk_list_store_append (liststore_devices, &iter);
+         gtk_list_store_set (liststore_devices,
+                             &iter,
+-                            PANEL_DEVICES_COLUMN_ICON, panel_device_type_to_icon_name (nm_device_get_device_type (device)),
+-                            PANEL_DEVICES_COLUMN_SORT, panel_device_type_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 = 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 (type),
++                                      panel_device_to_icon_name (device),
+                                       GTK_ICON_SIZE_DIALOG);
+ 
+         /* set device kind */
+         widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,
+                                                      "label_device"));
+         gtk_label_set_label (GTK_LABEL (widget),
+-                             panel_device_type_to_localized_string (type));
++                             panel_device_to_localized_string (device));
+ 
+ 
+         /* set device state */
+@@ -754,10 +754,13 @@ nm_device_refresh_item_ui (CcNetworkPanel *panel, NMDevice *device)
+         } else if (type == NM_DEVICE_TYPE_WIFI) {
+                 gtk_notebook_set_current_page (GTK_NOTEBOOK (widget), 1);
+                 sub_pane = "wireless";
+-        } else if (type == NM_DEVICE_TYPE_GSM ||
+-                   type == NM_DEVICE_TYPE_CDMA) {
+-                gtk_notebook_set_current_page (GTK_NOTEBOOK (widget), 4);
+-                sub_pane = "mobilebb";
++        } else if (type == NM_DEVICE_TYPE_MODEM) {
++                NMDeviceModemCapabilities caps = 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 (widget), 4);
++                        sub_pane = "mobilebb";
++                }
+         }
+         if (sub_pane == NULL)
+                 goto out;
+@@ -824,30 +827,33 @@ nm_device_refresh_item_ui (CcNetworkPanel *panel, NMDevice *device)
+                                           active_ap);
+                 }
+ 
+-        } else if (type == NM_DEVICE_TYPE_GSM ||
+-                   type == NM_DEVICE_TYPE_CDMA) {
++        } else if (type == NM_DEVICE_TYPE_MODEM) {
++                NMDeviceModemCapabilities caps = nm_device_modem_get_current_capabilities (NM_DEVICE_MODEM (device));
+ 
+-                /* IMEI */
+-                str = g_object_get_data (G_OBJECT (device),
+-                                         "ControlCenter::EquipmentIdentifier");
+-                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 = g_object_get_data (G_OBJECT (device),
++                                                 "ControlCenter::EquipmentIdentifier");
++                        panel_set_widget_data (panel,
++                                               sub_pane,
++                                               "imei",
++                                               str);
+ 
+-                /* operator name */
+-                str = g_object_get_data (G_OBJECT (device),
+-                                         "ControlCenter::OperatorName");
+-                panel_set_widget_data (panel,
+-                                       sub_pane,
+-                                       "provider",
+-                                       str);
++                        /* operator name */
++                        str = g_object_get_data (G_OBJECT (device),
++                                                 "ControlCenter::OperatorName");
++                        panel_set_widget_data (panel,
++                                              sub_pane,
++                                              "provider",
++                                               str);
+ 
+-                /* device speed */
+-                panel_set_widget_data (panel,
+-                                       sub_pane,
+-                                       "speed",
+-                                       NULL);
++                        /* device speed */
++                        panel_set_widget_data (panel,
++                                               sub_pane,
++                                               "speed",
++                                               NULL);
++                }
+         }
+ 
+         /* 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 <gtk/gtk.h>
+ 
+ #include "panel-common.h"
++#include "nm-device-modem.h"
+ 
+ /**
+- * 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 = NULL;
+-        switch (type) {
++        NMDeviceModemCapabilities caps;
++        switch (nm_device_get_device_type (device)) {
+         case NM_DEVICE_TYPE_ETHERNET:
+                 value = "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 = "network-wireless";
+                 break;
++        case NM_DEVICE_TYPE_MODEM:
++                caps = 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)) {
++                        value = "network-wireless";
++                }
++                break;
+         default:
+                 break;
+         }
+@@ -52,13 +59,14 @@ panel_device_type_to_icon_name (NMDeviceType type)
+ }
+ 
+ /**
+- * 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 = NULL;
+-        switch (type) {
++        NMDeviceModemCapabilities caps;
++        switch (nm_device_get_device_type (device)) {
+         case NM_DEVICE_TYPE_UNKNOWN:
+                 /* TRANSLATORS: device type */
+                 value = _("Unknown");
+@@ -71,10 +79,13 @@ panel_device_type_to_localized_string (NMDeviceType type)
+                 /* TRANSLATORS: device type */
+                 value = _("Wireless");
+                 break;
+-        case NM_DEVICE_TYPE_GSM:
+-        case NM_DEVICE_TYPE_CDMA:
+-                /* TRANSLATORS: device type */
+-                value = _("Mobile broadband");
++        case NM_DEVICE_TYPE_MODEM:
++                caps = 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)) {
++                        /* TRANSLATORS: device type */
++                        value = _("Mobile broadband");
++                }
+                 break;
+         case NM_DEVICE_TYPE_BT:
+                 /* TRANSLATORS: device type */
+@@ -91,24 +102,28 @@ panel_device_type_to_localized_string (NMDeviceType type)
+ }
+ 
+ /**
+- * 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 = NULL;
+-        switch (type) {
++        NMDeviceModemCapabilities caps;
++        switch (nm_device_get_device_type (device)) {
+         case NM_DEVICE_TYPE_ETHERNET:
+                 value = "1";
+                 break;
+         case NM_DEVICE_TYPE_WIFI:
+                 value = "2";
+                 break;
+-        case NM_DEVICE_TYPE_GSM:
+-        case NM_DEVICE_TYPE_CDMA:
+-                value = "3";
++        case NM_DEVICE_TYPE_MODEM:
++                caps = 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)) {
++                        value = "3";
++                }
+                 break;
+         case NM_DEVICE_TYPE_BT:
+                 value = "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 @@
+ 
+ #include <glib-object.h>
+ #include <NetworkManager.h>
++#include <nm-device.h>
+ 
+ G_BEGIN_DECLS
+ 
+-const gchar     *panel_device_type_to_icon_name                 (NMDeviceType type);
+-const gchar     *panel_device_type_to_localized_string          (NMDeviceType type);
+-const gchar     *panel_device_type_to_sortable_string           (NMDeviceType type);
++const gchar     *panel_device_to_icon_name                 (NMDevice *device);
++const gchar     *panel_device_to_localized_string          (NMDevice *device);
++const gchar     *panel_device_to_sortable_string           (NMDevice *device);
+ const gchar     *panel_ap_mode_to_localized_string              (NM80211Mode mode);
+ const gchar     *panel_device_state_to_localized_string         (NMDeviceState type);
+ 
+-- 
+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.ebuild
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="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.ebuild 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="AUTHORS ChangeLog NEWS README TODO"
+
+	# bug 356729
+	epatch "${FILESDIR}/${PN}-fix-networkmanager-api.patch"
+
+	gnome2_src_prepare
 }



             reply	other threads:[~2011-02-28  7:48 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-28  7:48 Nirbheek Chauhan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-03-25  0:56 [gentoo-commits] proj/gnome:master commit in: gnome-base/gnome-control-center/, gnome-base/gnome-control-center/files/ Ole Reifschneider
2015-10-02 12:50 Ole Reifschneider
2015-05-10 17:20 Gilles Dartiguelongue
2014-10-12 23:19 Gilles Dartiguelongue
2014-04-25 21:07 Gilles Dartiguelongue
2014-04-20 18:17 Gilles Dartiguelongue
2014-04-20 18:17 Gilles Dartiguelongue
2013-12-09 23:06 Gilles Dartiguelongue
2012-12-07 20:02 Arun Raghavan
2012-10-27  8:43 Priit Laes
2012-09-21  0:27 Nirbheek Chauhan
2012-09-10 16:13 Priit Laes
2012-09-10  5:08 Nirbheek Chauhan
2012-07-19  2:47 Alexandre Restovtsev
2012-05-25  8:22 Alexandre Restovtsev
2012-03-26  8:20 Nirbheek Chauhan
2011-10-28  5:28 Alexandre Restovtsev
2011-07-12  0:28 Alexandre Restovtsev
2011-06-24 17:35 Alexandre Restovtsev
2011-03-29  8:35 Nirbheek Chauhan
2011-03-26  0:37 Nirbheek Chauhan
2011-02-18  6:31 Nirbheek Chauhan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9ab32e0c1e4a93ad6a4a5644c014028a48605d85.nirbheek@gentoo \
    --to=nirbheek@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox