Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 356729
Collapse All | Expand All

(-)a/panels/network/cc-network-panel.c (-32 / +38 lines)
Lines 28-33 Link Here
28
#include "nm-client.h"
28
#include "nm-client.h"
29
#include "nm-device.h"
29
#include "nm-device.h"
30
#include "nm-device-ethernet.h"
30
#include "nm-device-ethernet.h"
31
#include "nm-device-modem.h"
31
#include "nm-device-wifi.h"
32
#include "nm-device-wifi.h"
32
#include "nm-utils.h"
33
#include "nm-utils.h"
33
#include "nm-active-connection.h"
34
#include "nm-active-connection.h"
Lines 376-383 panel_add_device (CcNetworkPanel *panel, NMDevice *device) Link Here
376
377
377
        /* do we have to get additonal data from ModemManager */
378
        /* do we have to get additonal data from ModemManager */
378
        type = nm_device_get_device_type (device);
379
        type = nm_device_get_device_type (device);
379
        if (type == NM_DEVICE_TYPE_GSM ||
380
        if (type == NM_DEVICE_TYPE_MODEM) {
380
            type == NM_DEVICE_TYPE_CDMA) {
381
                g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
381
                g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
382
                                          G_DBUS_PROXY_FLAGS_NONE,
382
                                          G_DBUS_PROXY_FLAGS_NONE,
383
                                          NULL,
383
                                          NULL,
Lines 400-414 panel_add_device (CcNetworkPanel *panel, NMDevice *device) Link Here
400
400
401
        /* make title a bit bigger */
401
        /* make title a bit bigger */
402
        title = g_strdup_printf ("<span size=\"large\">%s</span>",
402
        title = g_strdup_printf ("<span size=\"large\">%s</span>",
403
                                 panel_device_type_to_localized_string (nm_device_get_device_type (device)));
403
                                 panel_device_to_localized_string (device));
404
404
405
        liststore_devices = GTK_LIST_STORE (gtk_builder_get_object (priv->builder,
405
        liststore_devices = GTK_LIST_STORE (gtk_builder_get_object (priv->builder,
406
                                            "liststore_devices"));
406
                                            "liststore_devices"));
407
        gtk_list_store_append (liststore_devices, &iter);
407
        gtk_list_store_append (liststore_devices, &iter);
408
        gtk_list_store_set (liststore_devices,
408
        gtk_list_store_set (liststore_devices,
409
                            &iter,
409
                            &iter,
410
                            PANEL_DEVICES_COLUMN_ICON, panel_device_type_to_icon_name (nm_device_get_device_type (device)),
410
                            PANEL_DEVICES_COLUMN_ICON, panel_device_to_icon_name (device),
411
                            PANEL_DEVICES_COLUMN_SORT, panel_device_type_to_sortable_string (nm_device_get_device_type (device)),
411
                            PANEL_DEVICES_COLUMN_SORT, panel_device_to_sortable_string (device),
412
                            PANEL_DEVICES_COLUMN_TITLE, title,
412
                            PANEL_DEVICES_COLUMN_TITLE, title,
413
                            PANEL_DEVICES_COLUMN_ID, nm_device_get_udi (device),
413
                            PANEL_DEVICES_COLUMN_ID, nm_device_get_udi (device),
414
                            PANEL_DEVICES_COLUMN_TOOLTIP, NULL,
414
                            PANEL_DEVICES_COLUMN_TOOLTIP, NULL,
Lines 729-742 nm_device_refresh_item_ui (CcNetworkPanel *panel, NMDevice *device) Link Here
729
        widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,
729
        widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,
730
                                                     "image_device"));
730
                                                     "image_device"));
731
        gtk_image_set_from_icon_name (GTK_IMAGE (widget),
731
        gtk_image_set_from_icon_name (GTK_IMAGE (widget),
732
                                      panel_device_type_to_icon_name (type),
732
                                      panel_device_to_icon_name (device),
733
                                      GTK_ICON_SIZE_DIALOG);
733
                                      GTK_ICON_SIZE_DIALOG);
734
734
735
        /* set device kind */
735
        /* set device kind */
736
        widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,
736
        widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,
737
                                                     "label_device"));
737
                                                     "label_device"));
738
        gtk_label_set_label (GTK_LABEL (widget),
738
        gtk_label_set_label (GTK_LABEL (widget),
739
                             panel_device_type_to_localized_string (type));
739
                             panel_device_to_localized_string (device));
740
740
741
741
742
        /* set device state */
742
        /* set device state */
Lines 754-763 nm_device_refresh_item_ui (CcNetworkPanel *panel, NMDevice *device) Link Here
754
        } else if (type == NM_DEVICE_TYPE_WIFI) {
754
        } else if (type == NM_DEVICE_TYPE_WIFI) {
755
                gtk_notebook_set_current_page (GTK_NOTEBOOK (widget), 1);
755
                gtk_notebook_set_current_page (GTK_NOTEBOOK (widget), 1);
756
                sub_pane = "wireless";
756
                sub_pane = "wireless";
757
        } else if (type == NM_DEVICE_TYPE_GSM ||
757
        } else if (type == NM_DEVICE_TYPE_MODEM) {
758
                   type == NM_DEVICE_TYPE_CDMA) {
758
                NMDeviceModemCapabilities caps = nm_device_modem_get_current_capabilities (NM_DEVICE_MODEM (device));
759
                gtk_notebook_set_current_page (GTK_NOTEBOOK (widget), 4);
759
                if ((caps & NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS) ||
760
                sub_pane = "mobilebb";
760
                    (caps & NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO)) {
761
                        gtk_notebook_set_current_page (GTK_NOTEBOOK (widget), 4);
762
                        sub_pane = "mobilebb";
763
                }
761
        }
764
        }
762
        if (sub_pane == NULL)
765
        if (sub_pane == NULL)
763
                goto out;
766
                goto out;
Lines 824-853 nm_device_refresh_item_ui (CcNetworkPanel *panel, NMDevice *device) Link Here
824
                                          active_ap);
827
                                          active_ap);
825
                }
828
                }
826
829
827
        } else if (type == NM_DEVICE_TYPE_GSM ||
830
        } else if (type == NM_DEVICE_TYPE_MODEM) {
828
                   type == NM_DEVICE_TYPE_CDMA) {
831
                NMDeviceModemCapabilities caps = nm_device_modem_get_current_capabilities (NM_DEVICE_MODEM (device));
829
832
830
                /* IMEI */
833
                if ((caps & NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS) ||
831
                str = g_object_get_data (G_OBJECT (device),
834
                    (caps & NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO)) {
832
                                         "ControlCenter::EquipmentIdentifier");
835
                        /* IMEI */
833
                panel_set_widget_data (panel,
836
                        str = g_object_get_data (G_OBJECT (device),
834
                                       sub_pane,
837
                                                 "ControlCenter::EquipmentIdentifier");
835
                                       "imei",
838
                        panel_set_widget_data (panel,
836
                                       str);
839
                                               sub_pane,
840
                                               "imei",
841
                                               str);
837
842
838
                /* operator name */
843
                        /* operator name */
839
                str = g_object_get_data (G_OBJECT (device),
844
                        str = g_object_get_data (G_OBJECT (device),
840
                                         "ControlCenter::OperatorName");
845
                                                 "ControlCenter::OperatorName");
841
                panel_set_widget_data (panel,
846
                        panel_set_widget_data (panel,
842
                                       sub_pane,
847
                                              sub_pane,
843
                                       "provider",
848
                                              "provider",
844
                                       str);
849
                                               str);
845
850
846
                /* device speed */
851
                        /* device speed */
847
                panel_set_widget_data (panel,
852
                        panel_set_widget_data (panel,
848
                                       sub_pane,
853
                                               sub_pane,
849
                                       "speed",
854
                                               "speed",
850
                                       NULL);
855
                                               NULL);
856
                }
851
        }
857
        }
852
858
853
        /* get IP4 parameters */
859
        /* get IP4 parameters */
(-)a/panels/network/panel-common.c (-18 / +33 lines)
Lines 26-50 Link Here
26
#include <gtk/gtk.h>
26
#include <gtk/gtk.h>
27
27
28
#include "panel-common.h"
28
#include "panel-common.h"
29
#include "nm-device-modem.h"
29
30
30
/**
31
/**
31
 * panel_device_type_to_icon_name:
32
 * panel_device_to_icon_name:
32
 **/
33
 **/
33
const gchar *
34
const gchar *
34
panel_device_type_to_icon_name (NMDeviceType type)
35
panel_device_to_icon_name (NMDevice *device)
35
{
36
{
36
        const gchar *value = NULL;
37
        const gchar *value = NULL;
37
        switch (type) {
38
        NMDeviceModemCapabilities caps;
39
        switch (nm_device_get_device_type (device)) {
38
        case NM_DEVICE_TYPE_ETHERNET:
40
        case NM_DEVICE_TYPE_ETHERNET:
39
                value = "network-wired";
41
                value = "network-wired";
40
                break;
42
                break;
41
        case NM_DEVICE_TYPE_WIFI:
43
        case NM_DEVICE_TYPE_WIFI:
42
        case NM_DEVICE_TYPE_GSM:
43
        case NM_DEVICE_TYPE_CDMA:
44
        case NM_DEVICE_TYPE_BT:
44
        case NM_DEVICE_TYPE_BT:
45
        case NM_DEVICE_TYPE_OLPC_MESH:
45
        case NM_DEVICE_TYPE_OLPC_MESH:
46
                value = "network-wireless";
46
                value = "network-wireless";
47
                break;
47
                break;
48
        case NM_DEVICE_TYPE_MODEM:
49
                caps = nm_device_modem_get_current_capabilities (NM_DEVICE_MODEM (device));
50
                if ((caps & NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS) ||
51
                    (caps & NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO)) {
52
                        value = "network-wireless";
53
                }
54
                break;
48
        default:
55
        default:
49
                break;
56
                break;
50
        }
57
        }
Lines 52-64 panel_device_type_to_icon_name (NMDeviceType type) Link Here
52
}
59
}
53
60
54
/**
61
/**
55
 * panel_device_type_to_localized_string:
62
 * panel_device_to_localized_string:
56
 **/
63
 **/
57
const gchar *
64
const gchar *
58
panel_device_type_to_localized_string (NMDeviceType type)
65
panel_device_to_localized_string (NMDevice *device)
59
{
66
{
60
        const gchar *value = NULL;
67
        const gchar *value = NULL;
61
        switch (type) {
68
        NMDeviceModemCapabilities caps;
69
        switch (nm_device_get_device_type (device)) {
62
        case NM_DEVICE_TYPE_UNKNOWN:
70
        case NM_DEVICE_TYPE_UNKNOWN:
63
                /* TRANSLATORS: device type */
71
                /* TRANSLATORS: device type */
64
                value = _("Unknown");
72
                value = _("Unknown");
Lines 71-80 panel_device_type_to_localized_string (NMDeviceType type) Link Here
71
                /* TRANSLATORS: device type */
79
                /* TRANSLATORS: device type */
72
                value = _("Wireless");
80
                value = _("Wireless");
73
                break;
81
                break;
74
        case NM_DEVICE_TYPE_GSM:
82
        case NM_DEVICE_TYPE_MODEM:
75
        case NM_DEVICE_TYPE_CDMA:
83
                caps = nm_device_modem_get_current_capabilities (NM_DEVICE_MODEM (device));
76
                /* TRANSLATORS: device type */
84
                if ((caps & NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS) ||
77
                value = _("Mobile broadband");
85
                    (caps & NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO)) {
86
                        /* TRANSLATORS: device type */
87
                        value = _("Mobile broadband");
88
                }
78
                break;
89
                break;
79
        case NM_DEVICE_TYPE_BT:
90
        case NM_DEVICE_TYPE_BT:
80
                /* TRANSLATORS: device type */
91
                /* TRANSLATORS: device type */
Lines 91-114 panel_device_type_to_localized_string (NMDeviceType type) Link Here
91
}
102
}
92
103
93
/**
104
/**
94
 * panel_device_type_to_sortable_string:
105
 * panel_device_to_sortable_string:
95
 *
106
 *
96
 * Try to return order of approximate connection speed.
107
 * Try to return order of approximate connection speed.
97
 **/
108
 **/
98
const gchar *
109
const gchar *
99
panel_device_type_to_sortable_string (NMDeviceType type)
110
panel_device_to_sortable_string (NMDevice *device)
100
{
111
{
101
        const gchar *value = NULL;
112
        const gchar *value = NULL;
102
        switch (type) {
113
        NMDeviceModemCapabilities caps;
114
        switch (nm_device_get_device_type (device)) {
103
        case NM_DEVICE_TYPE_ETHERNET:
115
        case NM_DEVICE_TYPE_ETHERNET:
104
                value = "1";
116
                value = "1";
105
                break;
117
                break;
106
        case NM_DEVICE_TYPE_WIFI:
118
        case NM_DEVICE_TYPE_WIFI:
107
                value = "2";
119
                value = "2";
108
                break;
120
                break;
109
        case NM_DEVICE_TYPE_GSM:
121
        case NM_DEVICE_TYPE_MODEM:
110
        case NM_DEVICE_TYPE_CDMA:
122
                caps = nm_device_modem_get_current_capabilities (NM_DEVICE_MODEM (device));
111
                value = "3";
123
                if ((caps & NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS) ||
124
                    (caps & NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO)) {
125
                        value = "3";
126
                }
112
                break;
127
                break;
113
        case NM_DEVICE_TYPE_BT:
128
        case NM_DEVICE_TYPE_BT:
114
                value = "4";
129
                value = "4";
(-)a/panels/network/panel-common.h (-4 / +4 lines)
Lines 24-35 Link Here
24
24
25
#include <glib-object.h>
25
#include <glib-object.h>
26
#include <NetworkManager.h>
26
#include <NetworkManager.h>
27
#include <nm-device.h>
27
28
28
G_BEGIN_DECLS
29
G_BEGIN_DECLS
29
30
30
const gchar     *panel_device_type_to_icon_name                 (NMDeviceType type);
31
const gchar     *panel_device_to_icon_name                 (NMDevice *device);
31
const gchar     *panel_device_type_to_localized_string          (NMDeviceType type);
32
const gchar     *panel_device_to_localized_string          (NMDevice *device);
32
const gchar     *panel_device_type_to_sortable_string           (NMDeviceType type);
33
const gchar     *panel_device_to_sortable_string           (NMDevice *device);
33
const gchar     *panel_ap_mode_to_localized_string              (NM80211Mode mode);
34
const gchar     *panel_ap_mode_to_localized_string              (NM80211Mode mode);
34
const gchar     *panel_device_state_to_localized_string         (NMDeviceState type);
35
const gchar     *panel_device_state_to_localized_string         (NMDeviceState type);
35
36
36
- 

Return to bug 356729