[gnome-control-center] network: cleanup: Avoid toggling button twice



commit 5bcbe0729911f2ebad5edd1dff1682ef9d16b7be
Author: Carlo Caione <carlo endlessm com>
Date:   Fri Jul 20 10:55:40 2018 +0100

    network: cleanup: Avoid toggling button twice
    
    After checking the method property of the connection settings we set the
    disabled toggle button twice. One is enough.

 panels/network/connection-editor/ce-page-ip4.c | 3 ---
 panels/network/connection-editor/ce-page-ip6.c | 3 ---
 2 files changed, 6 deletions(-)
---
diff --git a/panels/network/connection-editor/ce-page-ip4.c b/panels/network/connection-editor/ce-page-ip4.c
index 21ae4c777..d403c202d 100644
--- a/panels/network/connection-editor/ce-page-ip4.c
+++ b/panels/network/connection-editor/ce-page-ip4.c
@@ -509,7 +509,6 @@ static void
 connect_ip4_page (CEPageIP4 *self)
 {
         const gchar *str_method;
-        gboolean disabled;
         guint method;
 
         add_address_box (self);
@@ -517,8 +516,6 @@ connect_ip4_page (CEPageIP4 *self)
         add_routes_box (self);
 
         str_method = nm_setting_ip_config_get_method (self->setting);
-        disabled = g_strcmp0 (str_method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED) == 0;
-        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (self->disabled_radio), disabled);
         g_signal_connect_swapped (self->disabled_radio, "notify::active", G_CALLBACK (ce_page_changed), 
self);
         g_object_bind_property (self->disabled_radio, "active",
                                 self->content_box, "sensitive",
diff --git a/panels/network/connection-editor/ce-page-ip6.c b/panels/network/connection-editor/ce-page-ip6.c
index 49d411f62..a2bdcb542 100644
--- a/panels/network/connection-editor/ce-page-ip6.c
+++ b/panels/network/connection-editor/ce-page-ip6.c
@@ -470,7 +470,6 @@ static void
 connect_ip6_page (CEPageIP6 *self)
 {
         const gchar *str_method;
-        gboolean disabled;
         guint method;
 
         add_address_box (self);
@@ -478,8 +477,6 @@ connect_ip6_page (CEPageIP6 *self)
         add_routes_box (self);
 
         str_method = nm_setting_ip_config_get_method (self->setting);
-        disabled = g_strcmp0 (str_method, NM_SETTING_IP6_CONFIG_METHOD_IGNORE) == 0;
-        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (self->disabled_radio), disabled);
         g_signal_connect_swapped (self->disabled_radio, "notify::active", G_CALLBACK (ce_page_changed), 
self);
         g_object_bind_property (self->disabled_radio, "active",
                                 self->content_box, "sensitive",


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