[gnome-control-center] network: Get connection editor root widget from a virtual method



commit eb4e124b04564da1808115d0949901506ff19fc6
Author: Robert Ancell <robert ancell canonical com>
Date:   Wed Nov 6 14:55:12 2019 +1300

    network: Get connection editor root widget from a virtual method

 .../connection-editor/8021x-security-page.ui       |  2 +-
 .../connection-editor/ce-page-8021x-security.c     | 18 +++++++---
 panels/network/connection-editor/ce-page-details.c | 10 ++++++
 .../network/connection-editor/ce-page-ethernet.c   | 18 +++++++---
 panels/network/connection-editor/ce-page-ip4.c     | 40 +++++++++++++--------
 panels/network/connection-editor/ce-page-ip6.c     | 42 +++++++++++++---------
 .../network/connection-editor/ce-page-security.c   | 10 ++++++
 panels/network/connection-editor/ce-page-vpn.c     | 14 ++++++--
 panels/network/connection-editor/ce-page-wifi.c    | 10 ++++++
 panels/network/connection-editor/ce-page.c         | 12 ++-----
 panels/network/connection-editor/ce-page.h         |  4 +--
 panels/network/connection-editor/details-page.ui   |  2 +-
 panels/network/connection-editor/ethernet-page.ui  |  2 +-
 panels/network/connection-editor/ip4-page.ui       |  2 +-
 panels/network/connection-editor/ip6-page.ui       |  2 +-
 .../connection-editor/net-connection-editor.c      |  4 +--
 panels/network/connection-editor/security-page.ui  |  2 +-
 panels/network/connection-editor/vpn-page.ui       |  2 +-
 panels/network/connection-editor/wifi-page.ui      |  2 +-
 19 files changed, 134 insertions(+), 64 deletions(-)
---
diff --git a/panels/network/connection-editor/8021x-security-page.ui 
b/panels/network/connection-editor/8021x-security-page.ui
index 6da8ce3db..d07a4ba68 100644
--- a/panels/network/connection-editor/8021x-security-page.ui
+++ b/panels/network/connection-editor/8021x-security-page.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
-  <object class="GtkNotebook" id="page">
+  <object class="GtkNotebook" id="notebook">
     <property name="visible">True</property>
     <property name="can_focus">True</property>
     <property name="show_tabs">False</property>
diff --git a/panels/network/connection-editor/ce-page-8021x-security.c 
b/panels/network/connection-editor/ce-page-8021x-security.c
index 5f343ad70..25da3238a 100644
--- a/panels/network/connection-editor/ce-page-8021x-security.c
+++ b/panels/network/connection-editor/ce-page-8021x-security.c
@@ -37,9 +37,10 @@
 struct _CEPage8021xSecurity {
        CEPage parent;
 
-        GtkBox    *box;
-        GtkSwitch *enable_8021x_switch;
-        GtkLabel  *security_label;
+        GtkBox      *box;
+        GtkSwitch   *enable_8021x_switch;
+        GtkNotebook *notebook;
+        GtkLabel    *security_label;
 
         GtkWidget *security_widget;
         WirelessSecurity *security;
@@ -106,7 +107,8 @@ ce_page_8021x_security_new (NMConnection     *connection,
                                                    
"/org/gnome/control-center/network/8021x-security-page.ui"));
 
         self->box = GTK_BOX (gtk_builder_get_object (CE_PAGE (self)->builder, "box"));
-       self->enable_8021x_switch = GTK_SWITCH (gtk_builder_get_object (CE_PAGE (self)->builder, 
"enable_8021x_switch"));
+        self->enable_8021x_switch = GTK_SWITCH (gtk_builder_get_object (CE_PAGE (self)->builder, 
"enable_8021x_switch"));
+        self->notebook = GTK_NOTEBOOK (gtk_builder_get_object (CE_PAGE (self)->builder, "notebook"));
         self->security_label = GTK_LABEL (gtk_builder_get_object (CE_PAGE (self)->builder, 
"security_label"));
 
        if (nm_connection_get_setting_802_1x (connection))
@@ -128,6 +130,13 @@ ce_page_8021x_security_get_security_setting (CEPage *page)
         return NULL;
 }
 
+static GtkWidget *
+ce_page_8021x_security_get_widget (CEPage *page)
+{
+        CEPage8021xSecurity *self = CE_PAGE_8021X_SECURITY (page);
+        return GTK_WIDGET (self->notebook);
+}
+
 static const gchar *
 ce_page_8021x_security_get_title (CEPage *page)
 {
@@ -202,6 +211,7 @@ ce_page_8021x_security_class_init (CEPage8021xSecurityClass *security_class)
        object_class->dispose = dispose;
 
         parent_class->get_security_setting = ce_page_8021x_security_get_security_setting;
+        parent_class->get_widget = ce_page_8021x_security_get_widget;
         parent_class->get_title = ce_page_8021x_security_get_title;
        parent_class->validate = ce_page_8021x_security_validate;
 }
diff --git a/panels/network/connection-editor/ce-page-details.c 
b/panels/network/connection-editor/ce-page-details.c
index 27f09ef30..7c4f75398 100644
--- a/panels/network/connection-editor/ce-page-details.c
+++ b/panels/network/connection-editor/ce-page-details.c
@@ -37,6 +37,7 @@ struct _CEPageDetails
         GtkLabel *dns_heading_label;
         GtkLabel *dns_label;
         GtkButton *forget_button;
+        GtkGrid *grid;
         GtkLabel *ipv4_heading_label;
         GtkLabel *ipv4_label;
         GtkLabel *ipv6_heading_label;
@@ -393,6 +394,13 @@ connect_details_page (CEPageDetails *self)
                 gtk_widget_hide (GTK_WIDGET (self->forget_button));
 }
 
+static GtkWidget *
+ce_page_details_get_widget (CEPage *page)
+{
+        CEPageDetails *self = CE_PAGE_DETAILS (page);
+        return GTK_WIDGET (self->grid);
+}
+
 static const gchar *
 ce_page_details_get_title (CEPage *page)
 {
@@ -409,6 +417,7 @@ ce_page_details_class_init (CEPageDetailsClass *class)
 {
         CEPageClass *page_class = CE_PAGE_CLASS (class);
 
+        page_class->get_widget = ce_page_details_get_widget;
         page_class->get_title = ce_page_details_get_title;
 }
 
@@ -430,6 +439,7 @@ ce_page_details_new (NMConnection        *connection,
         self->dns_heading_label = GTK_LABEL (gtk_builder_get_object (CE_PAGE (self)->builder, 
"dns_heading_label"));
         self->dns_label = GTK_LABEL (gtk_builder_get_object (CE_PAGE (self)->builder, "dns_label"));
         self->forget_button = GTK_BUTTON (gtk_builder_get_object (CE_PAGE (self)->builder, "forget_button"));
+        self->grid = GTK_GRID (gtk_builder_get_object (CE_PAGE (self)->builder, "grid"));
         self->ipv4_heading_label = GTK_LABEL (gtk_builder_get_object (CE_PAGE (self)->builder, 
"ipv4_heading_label"));
         self->ipv4_label = GTK_LABEL (gtk_builder_get_object (CE_PAGE (self)->builder, "ipv4_label"));
         self->ipv6_heading_label = GTK_LABEL (gtk_builder_get_object (CE_PAGE (self)->builder, 
"ipv6_heading_label"));
diff --git a/panels/network/connection-editor/ce-page-ethernet.c 
b/panels/network/connection-editor/ce-page-ethernet.c
index 3ecacc4a2..81dac4f7c 100644
--- a/panels/network/connection-editor/ce-page-ethernet.c
+++ b/panels/network/connection-editor/ce-page-ethernet.c
@@ -35,11 +35,12 @@ struct _CEPageEthernet
 {
         CEPage parent;
 
-        GtkEntry        *name;
-        GtkComboBoxText *device_mac;
         GtkComboBoxText *cloned_mac;
+        GtkComboBoxText *device_mac;
+        GtkGrid         *grid;
         GtkSpinButton   *mtu;
         GtkWidget       *mtu_label;
+        GtkEntry        *name;
 
         NMClient *client;
         NMSettingConnection *setting_connection;
@@ -139,6 +140,13 @@ ui_to_setting (CEPageEthernet *self)
                       NULL);
 }
 
+static GtkWidget *
+ce_page_ethernet_get_widget (CEPage *page)
+{
+        CEPageEthernet *self = CE_PAGE_ETHERNET (page);
+        return GTK_WIDGET (self->grid);
+}
+
 static const gchar *
 ce_page_ethernet_get_title (CEPage *page)
 {
@@ -192,6 +200,7 @@ ce_page_ethernet_class_init (CEPageEthernetClass *class)
 {
         CEPageClass *page_class = CE_PAGE_CLASS (class);
 
+        page_class->get_widget = ce_page_ethernet_get_widget;
         page_class->get_title = ce_page_ethernet_get_title;
         page_class->validate = ce_page_ethernet_validate;
 }
@@ -206,11 +215,12 @@ ce_page_ethernet_new (NMConnection     *connection,
                                               connection,
                                               "/org/gnome/control-center/network/ethernet-page.ui"));
 
-        self->name = GTK_ENTRY (gtk_builder_get_object (CE_PAGE (self)->builder, "name_entry"));
-        self->device_mac = GTK_COMBO_BOX_TEXT (gtk_builder_get_object (CE_PAGE (self)->builder, 
"mac_combo"));
         self->cloned_mac = GTK_COMBO_BOX_TEXT (gtk_builder_get_object (CE_PAGE (self)->builder, 
"cloned_mac_combo"));
+        self->device_mac = GTK_COMBO_BOX_TEXT (gtk_builder_get_object (CE_PAGE (self)->builder, 
"mac_combo"));
+        self->grid = GTK_GRID (gtk_builder_get_object (CE_PAGE (self)->builder, "grid"));
         self->mtu = GTK_SPIN_BUTTON (gtk_builder_get_object (CE_PAGE (self)->builder, "mtu_spin"));
         self->mtu_label = GTK_WIDGET (gtk_builder_get_object (CE_PAGE (self)->builder, "mtu_label"));
+        self->name = GTK_ENTRY (gtk_builder_get_object (CE_PAGE (self)->builder, "name_entry"));
 
         self->client = client;
         self->setting_connection = nm_connection_get_setting_connection (connection);
diff --git a/panels/network/connection-editor/ce-page-ip4.c b/panels/network/connection-editor/ce-page-ip4.c
index 40b3e5013..c82c789fd 100644
--- a/panels/network/connection-editor/ce-page-ip4.c
+++ b/panels/network/connection-editor/ce-page-ip4.c
@@ -39,20 +39,21 @@ struct _CEPageIP4
 {
         CEPage parent;
 
-        GtkBox         *address_box;
-        GtkSizeGroup   *address_sizegroup;
-        GtkSwitch      *auto_dns_switch;
-        GtkSwitch      *auto_routes_switch;
-        GtkRadioButton *automatic_radio;
-        GtkBox         *content_box;
-        GtkRadioButton *disabled_radio;
-        GtkEntry       *dns_entry;
-        GtkRadioButton *local_radio;
-        GtkRadioButton *manual_radio;
-        GtkCheckButton *never_default_check;
-        GtkBox         *routes_box;
-        GtkSizeGroup   *routes_metric_sizegroup;
-        GtkSizeGroup   *routes_sizegroup;
+        GtkBox            *address_box;
+        GtkSizeGroup      *address_sizegroup;
+        GtkSwitch         *auto_dns_switch;
+        GtkSwitch         *auto_routes_switch;
+        GtkRadioButton    *automatic_radio;
+        GtkBox            *content_box;
+        GtkRadioButton    *disabled_radio;
+        GtkEntry          *dns_entry;
+        GtkRadioButton    *local_radio;
+        GtkRadioButton    *manual_radio;
+        GtkCheckButton    *never_default_check;
+        GtkBox            *routes_box;
+        GtkSizeGroup      *routes_metric_sizegroup;
+        GtkSizeGroup      *routes_sizegroup;
+        GtkScrolledWindow *scrolled_window;
 
         NMSettingIPConfig *setting;
 
@@ -153,7 +154,7 @@ remove_row (CEPageIP4 *self)
         GtkWidget *row;
         GtkWidget *row_box;
 
-        row_box = gtk_widget_get_parent (GTK_WIDGET (CE_PAGE (self)->page));
+        row_box = gtk_widget_get_parent (GTK_WIDGET (self->scrolled_window));
         row = gtk_widget_get_parent (row_box);
         list = gtk_widget_get_parent (row);
 
@@ -523,6 +524,7 @@ connect_ip4_page (CEPageIP4 *self)
         self->routes_box = GTK_BOX (gtk_builder_get_object (CE_PAGE (self)->builder, "routes_box"));
         self->routes_metric_sizegroup = GTK_SIZE_GROUP (gtk_builder_get_object (CE_PAGE (self)->builder, 
"routes_metric_sizegroup"));
         self->routes_sizegroup = GTK_SIZE_GROUP (gtk_builder_get_object (CE_PAGE (self)->builder, 
"routes_sizegroup"));
+        self->scrolled_window = GTK_SCROLLED_WINDOW (gtk_builder_get_object (CE_PAGE (self)->builder, 
"scrolled_window"));
 
         add_address_box (self);
         add_dns_section (self);
@@ -860,6 +862,13 @@ out:
         return ret;
 }
 
+static GtkWidget *
+ce_page_ip4_get_widget (CEPage *page)
+{
+        CEPageIP4 *self = CE_PAGE_IP4 (page);
+        return GTK_WIDGET (self->scrolled_window);
+}
+
 static const gchar *
 ce_page_ip4_get_title (CEPage *page)
 {
@@ -887,6 +896,7 @@ ce_page_ip4_class_init (CEPageIP4Class *class)
 {
         CEPageClass *page_class = CE_PAGE_CLASS (class);
 
+        page_class->get_widget = ce_page_ip4_get_widget;
         page_class->get_title = ce_page_ip4_get_title;
         page_class->validate = ce_page_ip4_validate;
 }
diff --git a/panels/network/connection-editor/ce-page-ip6.c b/panels/network/connection-editor/ce-page-ip6.c
index 26ffab3e4..08759ed12 100644
--- a/panels/network/connection-editor/ce-page-ip6.c
+++ b/panels/network/connection-editor/ce-page-ip6.c
@@ -40,21 +40,22 @@ struct _CEPageIP6
 {
         CEPage parent;
 
-        GtkBox         *address_box;
-        GtkSizeGroup   *address_sizegroup;
-        GtkSwitch      *auto_dns_switch;
-        GtkSwitch      *auto_routes_switch;
-        GtkRadioButton *automatic_radio;
-        GtkBox         *content_box;
-        GtkRadioButton *dhcp_radio;
-        GtkRadioButton *disabled_radio;
-        GtkEntry       *dns_entry;
-        GtkRadioButton *local_radio;
-        GtkRadioButton *manual_radio;
-        GtkCheckButton *never_default_check;
-        GtkBox         *routes_box;
-        GtkSizeGroup   *routes_metric_sizegroup;
-        GtkSizeGroup   *routes_sizegroup;
+        GtkBox            *address_box;
+        GtkSizeGroup      *address_sizegroup;
+        GtkSwitch         *auto_dns_switch;
+        GtkSwitch         *auto_routes_switch;
+        GtkRadioButton    *automatic_radio;
+        GtkBox            *content_box;
+        GtkRadioButton    *dhcp_radio;
+        GtkRadioButton    *disabled_radio;
+        GtkEntry          *dns_entry;
+        GtkRadioButton    *local_radio;
+        GtkRadioButton    *manual_radio;
+        GtkCheckButton    *never_default_check;
+        GtkBox            *routes_box;
+        GtkSizeGroup      *routes_metric_sizegroup;
+        GtkSizeGroup      *routes_sizegroup;
+        GtkScrolledWindow *scrolled_window;
 
         NMSettingIPConfig *setting;
 
@@ -136,7 +137,7 @@ remove_row (CEPageIP6 *self)
         GtkWidget *row_box;
         GtkWidget *list;
 
-        row_box = gtk_widget_get_parent (GTK_WIDGET (CE_PAGE (self)->page));
+        row_box = gtk_widget_get_parent (GTK_WIDGET (self->scrolled_window));
         row = gtk_widget_get_parent (row_box);
         list = gtk_widget_get_parent (row);
 
@@ -485,6 +486,7 @@ connect_ip6_page (CEPageIP6 *self)
         self->routes_box = GTK_BOX (gtk_builder_get_object (CE_PAGE (self)->builder, "routes_box"));
         self->routes_metric_sizegroup = GTK_SIZE_GROUP (gtk_builder_get_object (CE_PAGE (self)->builder, 
"routes_metric_sizegroup"));
         self->routes_sizegroup = GTK_SIZE_GROUP (gtk_builder_get_object (CE_PAGE (self)->builder, 
"routes_sizegroup"));
+        self->scrolled_window = GTK_SCROLLED_WINDOW (gtk_builder_get_object (CE_PAGE (self)->builder, 
"scrolled_window"));
 
         add_address_box (self);
         add_dns_section (self);
@@ -784,6 +786,13 @@ out:
         return ret;
 }
 
+static GtkWidget *
+ce_page_ip6_get_widget (CEPage *page)
+{
+        CEPageIP6 *self = CE_PAGE_IP6 (page);
+        return GTK_WIDGET (self->scrolled_window);
+}
+
 static const gchar *
 ce_page_ip6_get_title (CEPage *page)
 {
@@ -811,6 +820,7 @@ ce_page_ip6_class_init (CEPageIP6Class *class)
 {
         CEPageClass *page_class = CE_PAGE_CLASS (class);
 
+        page_class->get_widget = ce_page_ip6_get_widget;
         page_class->get_title = ce_page_ip6_get_title;
         page_class->validate = ce_page_ip6_validate;
 }
diff --git a/panels/network/connection-editor/ce-page-security.c 
b/panels/network/connection-editor/ce-page-security.c
index 679903419..03f3138e2 100644
--- a/panels/network/connection-editor/ce-page-security.c
+++ b/panels/network/connection-editor/ce-page-security.c
@@ -39,6 +39,7 @@ struct _CEPageSecurity
         CEPage parent;
 
         GtkBox      *box;
+        GtkNotebook *notebook;
         GtkComboBox *security_combo;
         GtkLabel    *security_label;
 
@@ -232,6 +233,7 @@ finish_setup (CEPageSecurity *self)
         self->group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
 
         self->box = GTK_BOX (gtk_builder_get_object (CE_PAGE (self)->builder, "box"));
+        self->notebook = GTK_NOTEBOOK (gtk_builder_get_object (CE_PAGE (self)->builder, "notebook"));
         self->security_label = GTK_LABEL (gtk_builder_get_object (CE_PAGE (self)->builder, 
"security_label"));
         self->security_combo = GTK_COMBO_BOX (gtk_builder_get_object (CE_PAGE (self)->builder, 
"security_combo"));
 
@@ -380,6 +382,13 @@ ce_page_security_get_security_setting (CEPage *page)
         return CE_PAGE_SECURITY (page)->security_setting;
 }
 
+static GtkWidget *
+ce_page_security_get_widget (CEPage *page)
+{
+        CEPageSecurity *self = CE_PAGE_SECURITY (page);
+        return GTK_WIDGET (self->notebook);
+}
+
 static const gchar *
 ce_page_security_get_title (CEPage *page)
 {
@@ -449,6 +458,7 @@ ce_page_security_class_init (CEPageSecurityClass *class)
 
         object_class->dispose = ce_page_security_dispose;
         page_class->get_security_setting = ce_page_security_get_security_setting;
+        page_class->get_widget = ce_page_security_get_widget;
         page_class->get_title = ce_page_security_get_title;
         page_class->validate = ce_page_security_validate;
 }
diff --git a/panels/network/connection-editor/ce-page-vpn.c b/panels/network/connection-editor/ce-page-vpn.c
index 6a243581f..086bff435 100644
--- a/panels/network/connection-editor/ce-page-vpn.c
+++ b/panels/network/connection-editor/ce-page-vpn.c
@@ -33,9 +33,9 @@ struct _CEPageVpn
 {
         CEPage parent;
 
+        GtkBox   *box;
         GtkLabel *failure_label;
         GtkEntry *name_entry;
-        GtkBox   *page;
 
         NMSettingConnection *setting_connection;
         NMSettingVpn *setting_vpn;
@@ -108,7 +108,7 @@ load_vpn_plugin (CEPageVpn *self, NMConnection *connection)
 
         gtk_widget_destroy (GTK_WIDGET (self->failure_label));
 
-        gtk_box_pack_start (self->page, ui_widget, TRUE, TRUE, 0);
+        gtk_box_pack_start (self->box, ui_widget, TRUE, TRUE, 0);
        gtk_widget_show_all (ui_widget);
 
         g_signal_connect_swapped (self->editor, "changed", G_CALLBACK (ce_page_changed), self);
@@ -140,6 +140,13 @@ ce_page_vpn_get_security_setting (CEPage *page)
         return NM_SETTING_VPN_SETTING_NAME;
 }
 
+static GtkWidget *
+ce_page_vpn_get_widget (CEPage *page)
+{
+        CEPageVpn *self = CE_PAGE_VPN (page);
+        return GTK_WIDGET (self->box);
+}
+
 static const gchar *
 ce_page_vpn_get_title (CEPage *page)
 {
@@ -179,6 +186,7 @@ ce_page_vpn_class_init (CEPageVpnClass *class)
 
         object_class->dispose = ce_page_vpn_dispose;
         page_class->get_security_setting = ce_page_vpn_get_security_setting;
+        page_class->get_widget = ce_page_vpn_get_widget;
         page_class->get_title = ce_page_vpn_get_title;
         page_class->validate = ce_page_vpn_validate;
 }
@@ -210,9 +218,9 @@ ce_page_vpn_new (NMConnection     *connection,
                                         connection,
                                         "/org/gnome/control-center/network/vpn-page.ui"));
 
+        self->box = GTK_BOX (gtk_builder_get_object (CE_PAGE (self)->builder, "box"));
         self->failure_label = GTK_LABEL (gtk_builder_get_object (CE_PAGE (self)->builder, "failure_label"));
         self->name_entry = GTK_ENTRY (gtk_builder_get_object (CE_PAGE (self)->builder, "name_entry"));
-        self->page = GTK_BOX (gtk_builder_get_object (CE_PAGE (self)->builder, "page"));
 
         g_signal_connect (self, "initialized", G_CALLBACK (finish_setup), NULL);
 
diff --git a/panels/network/connection-editor/ce-page-wifi.c b/panels/network/connection-editor/ce-page-wifi.c
index 07900d791..a9b5e4fa0 100644
--- a/panels/network/connection-editor/ce-page-wifi.c
+++ b/panels/network/connection-editor/ce-page-wifi.c
@@ -37,6 +37,7 @@ struct _CEPageWifi
 
         GtkComboBoxText *bssid_combo;
         GtkComboBoxText *cloned_mac_combo;
+        GtkGrid         *grid;
         GtkComboBoxText *mac_combo;
         GtkEntry        *ssid_entry;
 
@@ -122,6 +123,13 @@ ui_to_setting (CEPageWifi *self)
                       NULL);
 }
 
+static GtkWidget *
+ce_page_wifi_get_widget (CEPage *page)
+{
+        CEPageWifi *self = CE_PAGE_WIFI (page);
+        return GTK_WIDGET (self->grid);
+}
+
 static const gchar *
 ce_page_wifi_get_title (CEPage *page)
 {
@@ -178,6 +186,7 @@ ce_page_wifi_class_init (CEPageWifiClass *class)
 {
         CEPageClass *page_class= CE_PAGE_CLASS (class);
 
+        page_class->get_widget = ce_page_wifi_get_widget;
         page_class->get_title = ce_page_wifi_get_title;
         page_class->validate = ce_page_wifi_class_validate;
 }
@@ -194,6 +203,7 @@ ce_page_wifi_new (NMConnection     *connection,
 
         self->bssid_combo = GTK_COMBO_BOX_TEXT (gtk_builder_get_object (CE_PAGE (self)->builder, 
"bssid_combo"));
         self->cloned_mac_combo = GTK_COMBO_BOX_TEXT (gtk_builder_get_object (CE_PAGE (self)->builder, 
"cloned_mac_combo"));
+        self->grid = GTK_GRID (gtk_builder_get_object (CE_PAGE (self)->builder, "grid"));
         self->mac_combo = GTK_COMBO_BOX_TEXT (gtk_builder_get_object (CE_PAGE (self)->builder, "mac_combo"));
         self->ssid_entry = GTK_ENTRY (gtk_builder_get_object (CE_PAGE (self)->builder, "ssid_entry"));
 
diff --git a/panels/network/connection-editor/ce-page.c b/panels/network/connection-editor/ce-page.c
index 40be1ff53..6b94168fa 100644
--- a/panels/network/connection-editor/ce-page.c
+++ b/panels/network/connection-editor/ce-page.c
@@ -66,7 +66,6 @@ dispose (GObject *object)
 {
         CEPage *self = CE_PAGE (object);
 
-        g_clear_object (&self->page);
         g_clear_object (&self->builder);
         g_clear_object (&self->connection);
 
@@ -74,11 +73,11 @@ dispose (GObject *object)
 }
 
 GtkWidget *
-ce_page_get_page (CEPage *self)
+ce_page_get_widget (CEPage *self)
 {
         g_return_val_if_fail (CE_IS_PAGE (self), NULL);
 
-        return self->page;
+        return CE_PAGE_GET_CLASS (self)->get_widget (self);
 }
 
 const char *
@@ -214,13 +213,6 @@ ce_page_new (GType             type,
                         g_warning ("Couldn't load builder file: %s", error->message);
                         return NULL;
                 }
-                self->page = GTK_WIDGET (gtk_builder_get_object (self->builder, "page"));
-                if (!self->page) {
-                        g_warning ("Couldn't load page widget from %s", ui_resource);
-                        return NULL;
-                }
-
-                g_object_ref_sink (self->page);
         }
 
         return g_steal_pointer (&self);
diff --git a/panels/network/connection-editor/ce-page.h b/panels/network/connection-editor/ce-page.h
index 6628662a5..cc9477f78 100644
--- a/panels/network/connection-editor/ce-page.h
+++ b/panels/network/connection-editor/ce-page.h
@@ -46,7 +46,6 @@ struct _CEPage
 
         gboolean initialized;
         GtkBuilder *builder;
-        GtkWidget *page;
 
         NMConnection *connection;
 };
@@ -56,13 +55,14 @@ struct _CEPageClass
         GObjectClass parent_class;
 
         gboolean     (*validate)             (CEPage *page, NMConnection *connection, GError **error);
+        GtkWidget   *(*get_widget)           (CEPage *page);
         const gchar *(*get_title)            (CEPage *page);
         const gchar *(*get_security_setting) (CEPage *page);
 };
 
 GType        ce_page_get_type        (void);
 
-GtkWidget   *ce_page_get_page        (CEPage           *page);
+GtkWidget   *ce_page_get_widget      (CEPage           *page);
 const gchar *ce_page_get_title       (CEPage           *page);
 const gchar *ce_page_get_security_setting (CEPage           *page);
 gboolean     ce_page_validate        (CEPage           *page,
diff --git a/panels/network/connection-editor/details-page.ui 
b/panels/network/connection-editor/details-page.ui
index 7c2fecdec..7f71da808 100644
--- a/panels/network/connection-editor/details-page.ui
+++ b/panels/network/connection-editor/details-page.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
-  <object class="GtkGrid" id="page">
+  <object class="GtkGrid" id="grid">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
     <property name="margin_start">24</property>
diff --git a/panels/network/connection-editor/ethernet-page.ui 
b/panels/network/connection-editor/ethernet-page.ui
index 57c7a3023..e172c8dda 100644
--- a/panels/network/connection-editor/ethernet-page.ui
+++ b/panels/network/connection-editor/ethernet-page.ui
@@ -6,7 +6,7 @@
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
-  <object class="GtkGrid" id="page">
+  <object class="GtkGrid" id="grid">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
     <property name="margin_start">50</property>
diff --git a/panels/network/connection-editor/ip4-page.ui b/panels/network/connection-editor/ip4-page.ui
index 232a0072c..81ef05d05 100644
--- a/panels/network/connection-editor/ip4-page.ui
+++ b/panels/network/connection-editor/ip4-page.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
-  <object class="GtkScrolledWindow" id="page">
+  <object class="GtkScrolledWindow" id="scrolled_window">
     <property name="visible">True</property>
     <property name="can_focus">True</property>
     <property name="hscrollbar_policy">never</property>
diff --git a/panels/network/connection-editor/ip6-page.ui b/panels/network/connection-editor/ip6-page.ui
index 991f2f0c3..96f5dfb97 100644
--- a/panels/network/connection-editor/ip6-page.ui
+++ b/panels/network/connection-editor/ip6-page.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
-  <object class="GtkScrolledWindow" id="page">
+  <object class="GtkScrolledWindow" id="scrolled_window">
     <property name="visible">True</property>
     <property name="can_focus">True</property>
     <property name="hscrollbar_policy">never</property>
diff --git a/panels/network/connection-editor/net-connection-editor.c 
b/panels/network/connection-editor/net-connection-editor.c
index e96d1ff07..9ba8f1dc0 100644
--- a/panels/network/connection-editor/net-connection-editor.c
+++ b/panels/network/connection-editor/net-connection-editor.c
@@ -345,7 +345,7 @@ update_sensitivity (NetConnectionEditor *self)
         }
 
         for (l = self->pages; l; l = l->next) {
-                widget = ce_page_get_page (CE_PAGE (l->data));
+                widget = ce_page_get_widget (CE_PAGE (l->data));
                 gtk_widget_set_sensitive (widget, sensitive);
         }
 }
@@ -417,7 +417,7 @@ page_initialized (NetConnectionEditor *self, GError *error, CEPage *page)
         GList *children, *l;
         gint i;
 
-        widget = ce_page_get_page (page);
+        widget = ce_page_get_widget (page);
         position = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (page), "position"));
         g_object_set_data (G_OBJECT (widget), "position", GINT_TO_POINTER (position));
         children = gtk_container_get_children (GTK_CONTAINER (self->notebook));
diff --git a/panels/network/connection-editor/security-page.ui 
b/panels/network/connection-editor/security-page.ui
index 8dedfa856..2b3ed80a2 100644
--- a/panels/network/connection-editor/security-page.ui
+++ b/panels/network/connection-editor/security-page.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
-  <object class="GtkNotebook" id="page">
+  <object class="GtkNotebook" id="notebook">
     <property name="visible">True</property>
     <property name="can_focus">True</property>
     <property name="show_tabs">False</property>
diff --git a/panels/network/connection-editor/vpn-page.ui b/panels/network/connection-editor/vpn-page.ui
index 5ed822cf8..a35801564 100644
--- a/panels/network/connection-editor/vpn-page.ui
+++ b/panels/network/connection-editor/vpn-page.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
-  <object class="GtkBox" id="page">
+  <object class="GtkBox" id="box">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
     <property name="margin_start">50</property>
diff --git a/panels/network/connection-editor/wifi-page.ui b/panels/network/connection-editor/wifi-page.ui
index 0532f5c43..c32fd28df 100644
--- a/panels/network/connection-editor/wifi-page.ui
+++ b/panels/network/connection-editor/wifi-page.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
-  <object class="GtkGrid" id="page">
+  <object class="GtkGrid" id="grid">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
     <property name="margin_start">50</property>


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