[network-manager-applet] Revert "connection-editor: Support carrier-detect"
- From: Dan Winship <danw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet] Revert "connection-editor: Support carrier-detect"
- Date: Wed, 3 Apr 2013 14:25:02 +0000 (UTC)
commit 8bad3dc1c039969839ba8ac8e0e4923c1b0ab859
Author: Dan Winship <danw gnome org>
Date: Tue Apr 2 17:03:28 2013 -0400
Revert "connection-editor: Support carrier-detect"
This reverts commit e61f097ee72098a301484036a04995e511664d98.
Carrier-detect override is now a per-device option in
NetworkManager.conf, not a per-connection option.
src/connection-editor/ce-page-ethernet.ui | 54 +-----------------------
src/connection-editor/ce-page-infiniband.ui | 54 +-----------------------
src/connection-editor/ce-page-vlan.ui | 62 ++------------------------
src/connection-editor/page-ethernet.c | 39 -----------------
src/connection-editor/page-infiniband.c | 39 -----------------
src/connection-editor/page-vlan.c | 41 ------------------
6 files changed, 7 insertions(+), 282 deletions(-)
---
diff --git a/src/connection-editor/ce-page-ethernet.ui b/src/connection-editor/ce-page-ethernet.ui
index d3733e0..e619da8 100644
--- a/src/connection-editor/ce-page-ethernet.ui
+++ b/src/connection-editor/ce-page-ethernet.ui
@@ -6,23 +6,6 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
- <object class="GtkListStore" id="ethernet_carrier_model">
- <columns>
- <!-- column-name gchararray1 -->
- <column type="gchararray"/>
- </columns>
- <data>
- <row>
- <col id="0" translatable="yes">Yes</col>
- </row>
- <row>
- <col id="0" translatable="yes">Only on activation</col>
- </row>
- <row>
- <col id="0" translatable="yes">No</col>
- </row>
- </data>
- </object>
<object class="GtkListStore" id="model1">
<columns>
<!-- column-name gchararray -->
@@ -73,7 +56,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">12</property>
- <property name="n_rows">8</property>
+ <property name="n_rows">7</property>
<property name="n_columns">2</property>
<property name="column_spacing">12</property>
<property name="row_spacing">6</property>
@@ -299,40 +282,5 @@
<property name="y_options">GTK_FILL</property>
</packing>
</child>
- <child>
- <object class="GtkLabel" id="ethernet_carrier_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Carrier de_tect:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">ethernet_carrier</property>
- </object>
- <packing>
- <property name="top_attach">7</property>
- <property name="bottom_attach">8</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="ethernet_carrier">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="model">ethernet_carrier_model</property>
- <child>
- <object class="GtkCellRendererText" id="renderer3"/>
- <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">7</property>
- <property name="bottom_attach">8</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
</object>
</interface>
diff --git a/src/connection-editor/ce-page-infiniband.ui b/src/connection-editor/ce-page-infiniband.ui
index 273d179..7773eee 100644
--- a/src/connection-editor/ce-page-infiniband.ui
+++ b/src/connection-editor/ce-page-infiniband.ui
@@ -6,28 +6,11 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
- <object class="GtkListStore" id="infiniband_carrier_model">
- <columns>
- <!-- column-name gchararray1 -->
- <column type="gchararray"/>
- </columns>
- <data>
- <row>
- <col id="0" translatable="yes">Yes</col>
- </row>
- <row>
- <col id="0" translatable="yes">Only on activation</col>
- </row>
- <row>
- <col id="0" translatable="yes">No</col>
- </row>
- </data>
- </object>
<object class="GtkTable" id="InfinibandPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">12</property>
- <property name="n_rows">4</property>
+ <property name="n_rows">3</property>
<property name="n_columns">2</property>
<property name="column_spacing">12</property>
<property name="row_spacing">6</property>
@@ -153,41 +136,6 @@
<property name="y_options"/>
</packing>
</child>
- <child>
- <object class="GtkLabel" id="infiniband_carrier_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Carrier de_tect:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">infiniband_carrier</property>
- </object>
- <packing>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="infiniband_carrier">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="model">infiniband_carrier_model</property>
- <child>
- <object class="GtkCellRendererText" id="renderer3"/>
- <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">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
</object>
<object class="GtkListStore" id="infiniband_mode_model">
<columns>
diff --git a/src/connection-editor/ce-page-vlan.ui b/src/connection-editor/ce-page-vlan.ui
index 1d8ad23..27b5265 100644
--- a/src/connection-editor/ce-page-vlan.ui
+++ b/src/connection-editor/ce-page-vlan.ui
@@ -6,23 +6,6 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
- <object class="GtkListStore" id="vlan_carrier_model">
- <columns>
- <!-- column-name gchararray1 -->
- <column type="gchararray"/>
- </columns>
- <data>
- <row>
- <col id="0" translatable="yes">Yes</col>
- </row>
- <row>
- <col id="0" translatable="yes">Only on activation</col>
- </row>
- <row>
- <col id="0" translatable="yes">No</col>
- </row>
- </data>
- </object>
<object class="GtkAdjustment" id="vlan_id_adjustment">
<property name="upper">4095</property>
<property name="step_increment">1</property>
@@ -32,7 +15,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">12</property>
- <property name="n_rows">6</property>
+ <property name="n_rows">5</property>
<property name="n_columns">2</property>
<property name="column_spacing">12</property>
<property name="row_spacing">6</property>
@@ -46,7 +29,7 @@
</object>
<packing>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"/>
+ <property name="y_options"></property>
</packing>
</child>
<child>
@@ -62,7 +45,7 @@
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"/>
+ <property name="y_options"></property>
</packing>
</child>
<child>
@@ -78,7 +61,7 @@
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"/>
+ <property name="y_options"></property>
</packing>
</child>
<child>
@@ -109,7 +92,7 @@
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"/>
+ <property name="y_options"></property>
</packing>
</child>
<child>
@@ -216,41 +199,6 @@
<property name="y_options">GTK_FILL</property>
</packing>
</child>
- <child>
- <object class="GtkLabel" id="vlan_carrier_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Carrier de_tect:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">vlan_carrier</property>
- </object>
- <packing>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="vlan_carrier">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="model">vlan_carrier_model</property>
- <child>
- <object class="GtkCellRendererText" id="renderer3"/>
- <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">5</property>
- <property name="bottom_attach">6</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
</object>
<object class="GtkListStore" id="vlan_name_type_model">
<columns>
diff --git a/src/connection-editor/page-ethernet.c b/src/connection-editor/page-ethernet.c
index 760a7b5..5c69572 100644
--- a/src/connection-editor/page-ethernet.c
+++ b/src/connection-editor/page-ethernet.c
@@ -49,7 +49,6 @@ typedef struct {
GtkToggleButton *duplex;
GtkToggleButton *autonegotiate;
GtkSpinButton *mtu;
- GtkComboBox *carrier_detect;
gboolean disposed;
} CEPageEthernetPrivate;
@@ -66,10 +65,6 @@ typedef struct {
#define SPEED_1000 3
#define SPEED_10000 4
-#define CARRIER_DETECT_YES 0
-#define CARRIER_DETECT_ON_ACTIVATE 1
-#define CARRIER_DETECT_NO 2
-
static void
ethernet_private_init (CEPageEthernet *self)
{
@@ -99,7 +94,6 @@ ethernet_private_init (CEPageEthernet *self)
priv->duplex = GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "ethernet_duplex"));
priv->autonegotiate = GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "ethernet_autonegotiate"));
priv->mtu = GTK_SPIN_BUTTON (gtk_builder_get_object (builder, "ethernet_mtu"));
- priv->carrier_detect = GTK_COMBO_BOX (gtk_builder_get_object (builder, "ethernet_carrier"));
}
static void
@@ -121,8 +115,6 @@ populate_ui (CEPageEthernet *self)
char **mac_list;
const GByteArray *s_mac;
char *s_mac_str;
- int carrier_detect_idx = CARRIER_DETECT_YES;
- const char *carrier_detect;
/* Port */
port = nm_setting_wired_get_port (setting);
@@ -192,18 +184,6 @@ populate_ui (CEPageEthernet *self)
GINT_TO_POINTER (mtu_def));
gtk_spin_button_set_value (priv->mtu, (gdouble) nm_setting_wired_get_mtu (setting));
-
- /* Carrier detect */
- carrier_detect = nm_setting_wired_get_carrier_detect (setting);
- if (carrier_detect) {
- if (!strcmp (carrier_detect, "yes"))
- carrier_detect_idx = CARRIER_DETECT_YES;
- else if (!strcmp (carrier_detect, "on-activate"))
- carrier_detect_idx = CARRIER_DETECT_ON_ACTIVATE;
- else if (!strcmp (carrier_detect, "no"))
- carrier_detect_idx = CARRIER_DETECT_NO;
- }
- gtk_combo_box_set_active (priv->carrier_detect, carrier_detect_idx);
}
static void
@@ -223,7 +203,6 @@ finish_setup (CEPageEthernet *self, gpointer unused, GError *error, gpointer use
g_signal_connect (priv->duplex, "toggled", G_CALLBACK (stuff_changed), self);
g_signal_connect (priv->autonegotiate, "toggled", G_CALLBACK (stuff_changed), self);
g_signal_connect (priv->mtu, "value-changed", G_CALLBACK (stuff_changed), self);
- g_signal_connect (priv->carrier_detect, "changed", G_CALLBACK (stuff_changed), self);
/* Hide widgets we don't yet support */
widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "ethernet_port_label"));
@@ -289,7 +268,6 @@ ui_to_setting (CEPageEthernet *self)
GByteArray *device_mac = NULL;
GByteArray *cloned_mac = NULL;
GtkWidget *entry;
- const char *carrier_detect;
/* Port */
switch (gtk_combo_box_get_active (priv->port)) {
@@ -329,22 +307,6 @@ ui_to_setting (CEPageEthernet *self)
break;
}
- /* Carrier detect */
- switch (gtk_combo_box_get_active (priv->carrier_detect)) {
- case CARRIER_DETECT_YES:
- carrier_detect = "yes";
- break;
- case CARRIER_DETECT_ON_ACTIVATE:
- carrier_detect = "on-activate";
- break;
- case CARRIER_DETECT_NO:
- carrier_detect = "no";
- break;
- default:
- carrier_detect = NULL;
- break;
- }
-
entry = gtk_bin_get_child (GTK_BIN (priv->device_mac));
if (entry)
device_mac = ce_page_entry_to_mac (GTK_ENTRY (entry), ARPHRD_ETHER, NULL);
@@ -358,7 +320,6 @@ ui_to_setting (CEPageEthernet *self)
NM_SETTING_WIRED_DUPLEX, gtk_toggle_button_get_active (priv->duplex) ? "full" : "half",
NM_SETTING_WIRED_AUTO_NEGOTIATE, gtk_toggle_button_get_active (priv->autonegotiate),
NM_SETTING_WIRED_MTU, (guint32) gtk_spin_button_get_value_as_int (priv->mtu),
- NM_SETTING_WIRED_CARRIER_DETECT, carrier_detect,
NULL);
if (device_mac)
diff --git a/src/connection-editor/page-infiniband.c b/src/connection-editor/page-infiniband.c
index 4f20123..bcd01a4 100644
--- a/src/connection-editor/page-infiniband.c
+++ b/src/connection-editor/page-infiniband.c
@@ -44,16 +44,11 @@ typedef struct {
GtkComboBox *transport_mode;
GtkSpinButton *mtu;
- GtkComboBox *carrier_detect;
} CEPageInfinibandPrivate;
#define TRANSPORT_MODE_DATAGRAM 0
#define TRANSPORT_MODE_CONNECTED 1
-#define CARRIER_DETECT_YES 0
-#define CARRIER_DETECT_ON_ACTIVATE 1
-#define CARRIER_DETECT_NO 2
-
static void
infiniband_private_init (CEPageInfiniband *self)
{
@@ -79,7 +74,6 @@ infiniband_private_init (CEPageInfiniband *self)
priv->transport_mode = GTK_COMBO_BOX (gtk_builder_get_object (builder, "infiniband_mode"));
priv->mtu = GTK_SPIN_BUTTON (gtk_builder_get_object (builder, "infiniband_mtu"));
- priv->carrier_detect = GTK_COMBO_BOX (gtk_builder_get_object (builder, "infiniband_carrier"));
}
static void
@@ -99,8 +93,6 @@ populate_ui (CEPageInfiniband *self)
char **mac_list;
const GByteArray *s_mac;
char *s_mac_str;
- int carrier_detect_idx = CARRIER_DETECT_YES;
- const char *carrier_detect;
/* Port */
mode = nm_setting_infiniband_get_transport_mode (setting);
@@ -130,18 +122,6 @@ populate_ui (CEPageInfiniband *self)
GINT_TO_POINTER (mtu_def));
gtk_spin_button_set_value (priv->mtu, (gdouble) nm_setting_infiniband_get_mtu (setting));
-
- /* Carrier detect */
- carrier_detect = nm_setting_infiniband_get_carrier_detect (setting);
- if (carrier_detect) {
- if (!strcmp (carrier_detect, "yes"))
- carrier_detect_idx = CARRIER_DETECT_YES;
- else if (!strcmp (carrier_detect, "on-activate"))
- carrier_detect_idx = CARRIER_DETECT_ON_ACTIVATE;
- else if (!strcmp (carrier_detect, "no"))
- carrier_detect_idx = CARRIER_DETECT_NO;
- }
- gtk_combo_box_set_active (priv->carrier_detect, carrier_detect_idx);
}
static void
@@ -156,7 +136,6 @@ finish_setup (CEPageInfiniband *self, gpointer unused, GError *error, gpointer u
g_signal_connect (priv->transport_mode, "changed", G_CALLBACK (stuff_changed), self);
g_signal_connect (priv->mtu, "value-changed", G_CALLBACK (stuff_changed), self);
- g_signal_connect (priv->carrier_detect, "changed", G_CALLBACK (stuff_changed), self);
}
CEPage *
@@ -205,7 +184,6 @@ ui_to_setting (CEPageInfiniband *self)
const char *mode;
GByteArray *device_mac = NULL;
GtkWidget *entry;
- const char *carrier_detect;
/* Transport mode */
if (gtk_combo_box_get_active (priv->transport_mode) == TRANSPORT_MODE_CONNECTED)
@@ -213,22 +191,6 @@ ui_to_setting (CEPageInfiniband *self)
else
mode = "datagram";
- /* Carrier detect */
- switch (gtk_combo_box_get_active (priv->carrier_detect)) {
- case CARRIER_DETECT_YES:
- carrier_detect = "yes";
- break;
- case CARRIER_DETECT_ON_ACTIVATE:
- carrier_detect = "on-activate";
- break;
- case CARRIER_DETECT_NO:
- carrier_detect = "no";
- break;
- default:
- carrier_detect = NULL;
- break;
- }
-
entry = gtk_bin_get_child (GTK_BIN (priv->device_mac));
if (entry)
device_mac = nm_utils_hwaddr_atoba (gtk_entry_get_text (GTK_ENTRY (entry)),
@@ -238,7 +200,6 @@ ui_to_setting (CEPageInfiniband *self)
NM_SETTING_INFINIBAND_MAC_ADDRESS, device_mac,
NM_SETTING_INFINIBAND_MTU, (guint32) gtk_spin_button_get_value_as_int (priv->mtu),
NM_SETTING_INFINIBAND_TRANSPORT_MODE, mode,
- NM_SETTING_INFINIBAND_CARRIER_DETECT, carrier_detect,
NULL);
if (device_mac)
diff --git a/src/connection-editor/page-vlan.c b/src/connection-editor/page-vlan.c
index 08defb4..76f0614 100644
--- a/src/connection-editor/page-vlan.c
+++ b/src/connection-editor/page-vlan.c
@@ -57,16 +57,11 @@ typedef struct {
GtkEntry *name_entry;
GtkEntry *cloned_mac;
GtkSpinButton *mtu;
- GtkComboBox *carrier_detect;
char *last_parent;
int last_id;
} CEPageVlanPrivate;
-#define CARRIER_DETECT_YES 0
-#define CARRIER_DETECT_ON_ACTIVATE 1
-#define CARRIER_DETECT_NO 2
-
static void
vlan_private_init (CEPageVlan *self)
{
@@ -93,7 +88,6 @@ vlan_private_init (CEPageVlan *self)
priv->name_entry = GTK_ENTRY (gtk_builder_get_object (builder, "vlan_name_entry"));
priv->cloned_mac = GTK_ENTRY (gtk_builder_get_object (builder, "vlan_cloned_mac_entry"));
priv->mtu = GTK_SPIN_BUTTON (gtk_builder_get_object (builder, "vlan_mtu"));
- priv->carrier_detect = GTK_COMBO_BOX (gtk_builder_get_object (builder, "vlan_carrier"));
}
static void
@@ -343,8 +337,6 @@ populate_ui (CEPageVlan *self)
NMDevice *device, *parent_device = NULL;
const char *parent, *iface, *current_parent;
int i, mtu_def, mtu_val;
- int carrier_detect_idx = CARRIER_DETECT_YES;
- const char *carrier_detect;
devices = get_vlan_devices (self);
@@ -450,32 +442,16 @@ populate_ui (CEPageVlan *self)
gtk_spin_button_set_value (priv->mtu, (gdouble) mtu_val);
g_signal_connect (priv->mtu, "value-changed", G_CALLBACK (stuff_changed), self);
- /* Carrier detect */
- carrier_detect = nm_setting_vlan_get_carrier_detect (priv->setting);
- if (carrier_detect) {
- if (!strcmp (carrier_detect, "yes"))
- carrier_detect_idx = CARRIER_DETECT_YES;
- else if (!strcmp (carrier_detect, "on-activate"))
- carrier_detect_idx = CARRIER_DETECT_ON_ACTIVATE;
- else if (!strcmp (carrier_detect, "no"))
- carrier_detect_idx = CARRIER_DETECT_NO;
- }
- gtk_combo_box_set_active (priv->carrier_detect, carrier_detect_idx);
-
g_slist_free (devices);
}
static void
finish_setup (CEPageVlan *self, gpointer unused, GError *error, gpointer user_data)
{
- CEPageVlanPrivate *priv = CE_PAGE_VLAN_GET_PRIVATE (self);
-
if (error)
return;
populate_ui (self);
-
- g_signal_connect (priv->carrier_detect, "changed", G_CALLBACK (stuff_changed), self);
}
CEPage *
@@ -533,7 +509,6 @@ ui_to_setting (CEPageVlan *self)
GType hwtype;
gboolean mtu_set;
int mtu;
- const char *carrier_detect;
parent_id = gtk_combo_box_get_active (GTK_COMBO_BOX (priv->parent));
if (parent_id == -1) {
@@ -580,26 +555,10 @@ ui_to_setting (CEPageVlan *self)
iface = gtk_entry_get_text (priv->name_entry);
vid = gtk_spin_button_get_value_as_int (priv->id_entry);
- switch (gtk_combo_box_get_active (priv->carrier_detect)) {
- case CARRIER_DETECT_YES:
- carrier_detect = "yes";
- break;
- case CARRIER_DETECT_ON_ACTIVATE:
- carrier_detect = "on-activate";
- break;
- case CARRIER_DETECT_NO:
- carrier_detect = "no";
- break;
- default:
- carrier_detect = NULL;
- break;
- }
-
g_object_set (priv->setting,
NM_SETTING_VLAN_PARENT, parent_uuid ? parent_uuid : parent_iface,
NM_SETTING_VLAN_INTERFACE_NAME, iface,
NM_SETTING_VLAN_ID, vid,
- NM_SETTING_VLAN_CARRIER_DETECT, carrier_detect,
NULL);
if (hwtype != G_TYPE_NONE) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]