summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2015-01-14 10:05:43 -0600
committerDan Williams <dcbw@redhat.com>2015-01-14 10:05:43 -0600
commit89e1d45440bb043bb72cc4ede1eba769b92db336 (patch)
treebe7527e8227edf0fe6e17a0fc942dcd41e637bec
parent3c64e21b2d0850152ee1e75f69834c8afd3b57ef (diff)
downloadnetwork-manager-applet-89e1d45440bb043bb72cc4ede1eba769b92db336.tar.gz
editor: remove "Network Type" combo from mobile broadband page
The network type was never used with ModemManager 1.0+, and NM itself hasn't supported anything except ModemManager 1.0+ since 0.9.8. Changing the network type is often a very heavy operation for the modem, which may involve re-initialization or hardware reset, and is not an appropriate operation to perform when connecting to a network. It should be an out-of-band action.
-rw-r--r--src/connection-editor/ce-page-mobile.ui88
-rw-r--r--src/connection-editor/page-mobile.c59
2 files changed, 9 insertions, 138 deletions
diff --git a/src/connection-editor/ce-page-mobile.ui b/src/connection-editor/ce-page-mobile.ui
index 272941a2..f09936c9 100644
--- a/src/connection-editor/ce-page-mobile.ui
+++ b/src/connection-editor/ce-page-mobile.ui
@@ -1,35 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.1 -->
<interface>
- <!-- interface-requires gtk+ 3.0 -->
- <object class="GtkListStore" id="model1">
- <columns>
- <!-- column-name gchararray -->
- <column type="gchararray"/>
- </columns>
- <data>
- <row>
- <col id="0" translatable="yes">Any</col>
- </row>
- <row>
- <col id="0" translatable="yes">3G (UMTS/HSPA)</col>
- </row>
- <row>
- <col id="0" translatable="yes">2G (GPRS/EDGE)</col>
- </row>
- <row>
- <col id="0" translatable="yes">Prefer 3G (UMTS/HSPA)</col>
- </row>
- <row>
- <col id="0" translatable="yes">Prefer 2G (GPRS/EDGE)</col>
- </row>
- <row>
- <col id="0" translatable="yes">Prefer 4G (LTE)</col>
- </row>
- <row>
- <col id="0" translatable="yes">Use only 4G (LTE)</col>
- </row>
- </data>
- </object>
+ <requires lib="gtk+" version="3.0"/>
<object class="GtkVBox" id="MobilePage">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -199,7 +171,7 @@
<object class="GtkTable" id="table2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="n_rows">6</property>
+ <property name="n_rows">4</property>
<property name="n_columns">2</property>
<property name="column_spacing">12</property>
<property name="row_spacing">6</property>
@@ -207,12 +179,6 @@
<placeholder/>
</child>
<child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
<object class="GtkLabel" id="label29">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -256,42 +222,6 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="type_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">_Type:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">mobile_network_type</property>
- </object>
- <packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"/>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="mobile_network_type">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="model">model1</property>
- <child>
- <object class="GtkCellRendererText" id="renderer1"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options">GTK_EXPAND</property>
- </packing>
- </child>
- <child>
<object class="GtkHBox" id="hbox2">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -338,8 +268,8 @@
<property name="mnemonic_widget">mobile_pin</property>
</object>
<packing>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"/>
</packing>
@@ -354,8 +284,8 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
<property name="y_options"/>
</packing>
</child>
@@ -373,8 +303,8 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
</object>
diff --git a/src/connection-editor/page-mobile.c b/src/connection-editor/page-mobile.c
index b43879b7..7da1367a 100644
--- a/src/connection-editor/page-mobile.c
+++ b/src/connection-editor/page-mobile.c
@@ -54,7 +54,6 @@ typedef struct {
GtkEntry *apn;
GtkButton *apn_button;
GtkEntry *network_id;
- GtkComboBox *network_type;
GtkToggleButton *roaming_allowed;
GtkEntry *pin;
@@ -85,7 +84,6 @@ mobile_private_init (CEPageMobile *self)
priv->apn = GTK_ENTRY (gtk_builder_get_object (builder, "mobile_apn"));
priv->apn_button = GTK_BUTTON (gtk_builder_get_object (builder, "mobile_apn_button"));
priv->network_id = GTK_ENTRY (gtk_builder_get_object (builder, "mobile_network_id"));
- priv->network_type = GTK_COMBO_BOX (gtk_builder_get_object (builder, "mobile_network_type"));
priv->roaming_allowed = GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "mobile_roaming_allowed"));
priv->pin = GTK_ENTRY (gtk_builder_get_object (builder, "mobile_pin"));
@@ -98,7 +96,6 @@ populate_gsm_ui (CEPageMobile *self, NMConnection *connection)
{
CEPageMobilePrivate *priv = CE_PAGE_MOBILE_GET_PRIVATE (self);
NMSettingGsm *setting = NM_SETTING_GSM (priv->setting);
- int type_idx;
const char *s;
s = nm_setting_gsm_get_number (setting);
@@ -117,34 +114,6 @@ populate_gsm_ui (CEPageMobile *self, NMConnection *connection)
if (s)
gtk_entry_set_text (priv->network_id, s);
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- switch (nm_setting_gsm_get_network_type (setting)) {
- case NM_SETTING_GSM_NETWORK_TYPE_UMTS_HSPA:
- type_idx = NET_TYPE_3G;
- break;
- case NM_SETTING_GSM_NETWORK_TYPE_GPRS_EDGE:
- type_idx = NET_TYPE_2G;
- break;
- case NM_SETTING_GSM_NETWORK_TYPE_PREFER_UMTS_HSPA:
- type_idx = NET_TYPE_PREFER_3G;
- break;
- case NM_SETTING_GSM_NETWORK_TYPE_PREFER_GPRS_EDGE:
- type_idx = NET_TYPE_PREFER_2G;
- break;
- case NM_SETTING_GSM_NETWORK_TYPE_PREFER_4G:
- type_idx = NET_TYPE_PREFER_4G;
- break;
- case NM_SETTING_GSM_NETWORK_TYPE_4G:
- type_idx = NET_TYPE_4G;
- break;
- case NM_SETTING_GSM_NETWORK_TYPE_ANY:
- default:
- type_idx = NET_TYPE_ANY;
- break;
- }
- gtk_combo_box_set_active (priv->network_type, type_idx);
-G_GNUC_END_IGNORE_DEPRECATIONS
-
gtk_toggle_button_set_active (priv->roaming_allowed,
!nm_setting_gsm_get_home_only (setting));
@@ -319,7 +288,6 @@ finish_setup (CEPageMobile *self, gpointer unused, GError *error, gpointer user_
gtk_entry_set_max_length (priv->network_id, 6); /* MCC/MNCs are max 6 chars */
g_signal_connect (priv->network_id, "insert-text", G_CALLBACK (network_id_filter_cb), self);
- g_signal_connect (priv->network_type, "changed", G_CALLBACK (stuff_changed), self);
g_signal_connect (priv->pin, "changed", G_CALLBACK (stuff_changed), self);
g_signal_connect (priv->roaming_allowed, "toggled", G_CALLBACK (stuff_changed), self);
@@ -392,34 +360,8 @@ static void
gsm_ui_to_setting (CEPageMobile *self)
{
CEPageMobilePrivate *priv = CE_PAGE_MOBILE_GET_PRIVATE (self);
- int net_type;
gboolean roaming_allowed;
- switch (gtk_combo_box_get_active (priv->network_type)) {
- case NET_TYPE_3G:
- net_type = NM_SETTING_GSM_NETWORK_TYPE_UMTS_HSPA;
- break;
- case NET_TYPE_2G:
- net_type = NM_SETTING_GSM_NETWORK_TYPE_GPRS_EDGE;
- break;
- case NET_TYPE_PREFER_3G:
- net_type = NM_SETTING_GSM_NETWORK_TYPE_PREFER_UMTS_HSPA;
- break;
- case NET_TYPE_PREFER_2G:
- net_type = NM_SETTING_GSM_NETWORK_TYPE_PREFER_GPRS_EDGE;
- break;
- case NET_TYPE_PREFER_4G:
- net_type = NM_SETTING_GSM_NETWORK_TYPE_PREFER_4G;
- break;
- case NET_TYPE_4G:
- net_type = NM_SETTING_GSM_NETWORK_TYPE_4G;
- break;
- case NET_TYPE_ANY:
- default:
- net_type = NM_SETTING_GSM_NETWORK_TYPE_ANY;
- break;
- }
-
roaming_allowed = gtk_toggle_button_get_active (priv->roaming_allowed);
g_object_set (priv->setting,
@@ -428,7 +370,6 @@ gsm_ui_to_setting (CEPageMobile *self)
NM_SETTING_GSM_PASSWORD, nm_entry_get_text (priv->password),
NM_SETTING_GSM_APN, nm_entry_get_text (priv->apn),
NM_SETTING_GSM_NETWORK_ID, nm_entry_get_text (priv->network_id),
- NM_SETTING_GSM_NETWORK_TYPE, net_type,
NM_SETTING_GSM_PIN, nm_entry_get_text (priv->pin),
NM_SETTING_GSM_HOME_ONLY, !roaming_allowed,
NULL);