[gnome-control-center/wip/networking2: 24/36] network: Remove non-supported ethernet config



commit b210f2bb5e61f5f6d3d383b329a257be945e95e1
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Jan 6 19:33:30 2013 -0500

    network: Remove non-supported ethernet config
    
    These controls were hidden, but messed up the layout of the page.
    So just remove them ofr now.

 .../network/connection-editor/ce-page-ethernet.c   |  130 --------------------
 1 files changed, 0 insertions(+), 130 deletions(-)
---
diff --git a/panels/network/connection-editor/ce-page-ethernet.c b/panels/network/connection-editor/ce-page-ethernet.c
index 264ba3e..b924320 100644
--- a/panels/network/connection-editor/ce-page-ethernet.c
+++ b/panels/network/connection-editor/ce-page-ethernet.c
@@ -33,22 +33,6 @@
 
 G_DEFINE_TYPE (CEPageEthernet, ce_page_ethernet, CE_TYPE_PAGE)
 
-enum {
-        PORT_DEFAULT,
-        PORT_TP,
-        PORT_AUI,
-        PORT_BNC,
-        PORT_MII
-};
-
-enum {
-        SPEED_DEFAULT,
-        SPEED_10,
-        SPEED_100,
-        SPEED_1000,
-        SPEED_10000
-};
-
 static void
 all_user_changed (GtkToggleButton *b, CEPageEthernet *page)
 {
@@ -68,10 +52,6 @@ connect_ethernet_page (CEPageEthernet *page)
 {
         NMSettingWired *setting = page->setting_wired;
         NMSettingConnection *sc;
-        const char *port;
-        const char *duplex;
-        int port_idx = PORT_DEFAULT;
-        int speed_idx;
         int mtu_def;
         char **mac_list;
         const GByteArray *s_mac;
@@ -82,50 +62,6 @@ connect_ethernet_page (CEPageEthernet *page)
         name = nm_setting_connection_get_id (page->setting_connection);
         gtk_entry_set_text (page->name, name);
 
-        /* Port */
-        port = nm_setting_wired_get_port (setting);
-        if (port) {
-                if (!strcmp (port, "tp"))
-                        port_idx = PORT_TP;
-                else if (!strcmp (port, "aui"))
-                        port_idx = PORT_AUI;
-                else if (!strcmp (port, "bnc"))
-                        port_idx = PORT_BNC;
-                else if (!strcmp (port, "mii"))
-                        port_idx = PORT_MII;
-        }
-        gtk_combo_box_set_active (page->port, port_idx);
-
-        /* Speed */
-        switch (nm_setting_wired_get_speed (setting)) {
-        case 10:
-                speed_idx = SPEED_10;
-                break;
-        case 100:
-                speed_idx = SPEED_100;
-                break;
-        case 1000:
-                speed_idx = SPEED_1000;
-                break;
-        case 10000:
-                speed_idx = SPEED_10000;
-                break;
-        default:
-                speed_idx = SPEED_DEFAULT;
-                break;
-        }
-        gtk_combo_box_set_active (page->speed, speed_idx);
-        /* Duplex */
-        duplex = nm_setting_wired_get_duplex (setting);
-        if (duplex && !strcmp (duplex, "half"))
-                gtk_toggle_button_set_active (page->duplex, FALSE);
-        else
-                gtk_toggle_button_set_active (page->duplex, TRUE);
-
-        /* Autonegotiate */
-        gtk_toggle_button_set_active (page->autonegotiate,
-                                      nm_setting_wired_get_auto_negotiate (setting));
-
         /* Device MAC address */
         mac_list = ce_page_get_mac_list (CE_PAGE (page)->client, NM_TYPE_DEVICE_ETHERNET,
                                          NM_DEVICE_ETHERNET_PERMANENT_HW_ADDRESS);
@@ -150,26 +86,8 @@ connect_ethernet_page (CEPageEthernet *page)
         gtk_spin_button_set_value (page->mtu, (gdouble) nm_setting_wired_get_mtu (setting));
 
         g_signal_connect_swapped (page->name, "changed", G_CALLBACK (ce_page_changed), page);
-        g_signal_connect_swapped (page->port, "changed", G_CALLBACK (ce_page_changed), page);
-        g_signal_connect_swapped (page->speed, "changed", G_CALLBACK (ce_page_changed), page);
-        g_signal_connect_swapped (page->duplex, "toggled", G_CALLBACK (ce_page_changed), page);
-        g_signal_connect_swapped (page->autonegotiate, "toggled", G_CALLBACK (ce_page_changed), page);
         g_signal_connect_swapped (page->mtu, "value-changed", G_CALLBACK (ce_page_changed), page);
 
-        /* Hide widgets we don't yet support */
-        widget = GTK_WIDGET (gtk_builder_get_object (CE_PAGE (page)->builder, "heading_port"));
-        gtk_widget_hide (widget);
-        gtk_widget_hide (GTK_WIDGET (page->port));
-
-        widget = GTK_WIDGET (gtk_builder_get_object (CE_PAGE (page)->builder, "heading_speed"));
-        gtk_widget_hide (widget);
-        gtk_widget_hide (GTK_WIDGET (page->speed));
-
-        widget = GTK_WIDGET (gtk_builder_get_object (CE_PAGE (page)->builder, "check_duplex"));
-        gtk_widget_hide (widget);
-        widget = GTK_WIDGET (gtk_builder_get_object (CE_PAGE (page)->builder, "check_renegotiate"));
-        gtk_widget_hide (widget);
-
         widget = GTK_WIDGET (gtk_builder_get_object (CE_PAGE (page)->builder,
                                                      "auto_connect_check"));
         sc = nm_connection_get_setting_connection (CE_PAGE (page)->connection);
@@ -187,50 +105,10 @@ connect_ethernet_page (CEPageEthernet *page)
 static void
 ui_to_setting (CEPageEthernet *page)
 {
-        const char *port;
-        guint32 speed;
         GByteArray *device_mac = NULL;
         GByteArray *cloned_mac = NULL;
         GtkWidget *entry;
 
-        /* Port */
-        switch (gtk_combo_box_get_active (page->port)) {
-        case PORT_TP:
-                port = "tp";
-                break;
-        case PORT_AUI:
-                port = "aui";
-                break;
-        case PORT_BNC:
-                port = "bnc";
-                break;
-        case PORT_MII:
-                port = "mii";
-                break;
-        default:
-                port = NULL;
-                break;
-        }
-
-        /* Speed */
-        switch (gtk_combo_box_get_active (page->speed)) {
-        case SPEED_10:
-                speed = 10;
-                break;
-        case SPEED_100:
-                speed = 100;
-                break;
-        case SPEED_1000:
-                speed = 1000;
-                break;
-        case SPEED_10000:
-                speed = 10000;
-                break;
-        default:
-                speed = 0;
-                break;
-        }
-
         entry = gtk_bin_get_child (GTK_BIN (page->device_mac));
         if (entry)
                 device_mac = ce_page_entry_to_mac (GTK_ENTRY (entry), ARPHRD_ETHER, NULL);
@@ -239,10 +117,6 @@ ui_to_setting (CEPageEthernet *page)
         g_object_set (page->setting_wired,
                       NM_SETTING_WIRED_MAC_ADDRESS, device_mac,
                       NM_SETTING_WIRED_CLONED_MAC_ADDRESS, cloned_mac,
-                      NM_SETTING_WIRED_PORT, port,
-                      NM_SETTING_WIRED_SPEED, speed,
-                      NM_SETTING_WIRED_DUPLEX, gtk_toggle_button_get_active (page->duplex) ? "full" : "half",
-                      NM_SETTING_WIRED_AUTO_NEGOTIATE, gtk_toggle_button_get_active (page->autonegotiate),
                       NM_SETTING_WIRED_MTU, (guint32) gtk_spin_button_get_value_as_int (page->mtu),
                       NULL);
 
@@ -317,10 +191,6 @@ ce_page_ethernet_new (NMConnection     *connection,
         page->name = GTK_ENTRY (gtk_builder_get_object (CE_PAGE (page)->builder, "entry_name"));
         page->device_mac = GTK_COMBO_BOX_TEXT (gtk_builder_get_object (CE_PAGE (page)->builder, "combo_mac"));
         page->cloned_mac = GTK_ENTRY (gtk_builder_get_object (CE_PAGE (page)->builder, "entry_cloned_mac"));
-        page->port = GTK_COMBO_BOX (gtk_builder_get_object (CE_PAGE (page)->builder, "combo_port"));
-        page->speed = GTK_COMBO_BOX (gtk_builder_get_object (CE_PAGE (page)->builder, "combo_speed"));
-        page->duplex = GTK_TOGGLE_BUTTON (gtk_builder_get_object (CE_PAGE (page)->builder, "check_duplex"));
-        page->autonegotiate = GTK_TOGGLE_BUTTON (gtk_builder_get_object (CE_PAGE (page)->builder, "check_renegotiate"));
         page->mtu = GTK_SPIN_BUTTON (gtk_builder_get_object (CE_PAGE (page)->builder, "spin_mtu"));
 
         page->setting_connection = nm_connection_get_setting_connection (connection);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]