[gnome-control-center] network: Remove unused GtkNotebooks and pages that are never shown



commit d163fb3f223585a9dfe45d1d7949826ad07b18fb
Author: Robert Ancell <robert ancell canonical com>
Date:   Wed Nov 6 15:14:04 2019 +1300

    network: Remove unused GtkNotebooks and pages that are never shown
    
    This has the side effect of allowing these pages to be shorter - the hidden
    widgets forced the visible widgets to have a minimum height. If the old
    behaviour is desired then this requires this to be fixed using a better
    method.

 .../connection-editor/8021x-security-page.ui       | 286 +++------------------
 .../connection-editor/ce-page-8021x-security.c     |   6 +-
 .../network/connection-editor/ce-page-security.c   |   6 +-
 panels/network/connection-editor/security-page.ui  | 284 +++-----------------
 4 files changed, 85 insertions(+), 497 deletions(-)
---
diff --git a/panels/network/connection-editor/8021x-security-page.ui 
b/panels/network/connection-editor/8021x-security-page.ui
index d07a4ba68..91823c502 100644
--- a/panels/network/connection-editor/8021x-security-page.ui
+++ b/panels/network/connection-editor/8021x-security-page.ui
@@ -1,267 +1,61 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
-  <object class="GtkNotebook" id="notebook">
+  <object class="GtkGrid" id="grid">
     <property name="visible">True</property>
-    <property name="can_focus">True</property>
-    <property name="show_tabs">False</property>
-    <property name="show_border">False</property>
+    <property name="can_focus">False</property>
+    <property name="margin_start">50</property>
+    <property name="margin_end">50</property>
+    <property name="margin_top">12</property>
+    <property name="margin_bottom">12</property>
+    <property name="hexpand">True</property>
+    <property name="vexpand">True</property>
+    <property name="row_spacing">10</property>
+    <property name="column_spacing">6</property>
     <child>
-      <object class="GtkGrid">
+      <object class="GtkLabel" id="security_label">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
-        <property name="margin_start">50</property>
-        <property name="margin_end">50</property>
-        <property name="margin_top">12</property>
-        <property name="margin_bottom">12</property>
+        <property name="xalign">1</property>
+        <property name="label" translatable="yes">802.1x _Security</property>
+        <property name="use_underline">True</property>
+        <property name="mnemonic_widget">enable_8021x_switch</property>
+      </object>
+      <packing>
+        <property name="left_attach">0</property>
+        <property name="top_attach">0</property>
+        <property name="width">1</property>
+        <property name="height">1</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkSwitch" id="enable_8021x_switch">
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="halign">start</property>
         <property name="hexpand">True</property>
-        <property name="vexpand">True</property>
-        <property name="row_spacing">10</property>
-        <property name="column_spacing">6</property>
-        <child>
-          <object class="GtkLabel" id="security_label">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="xalign">1</property>
-            <property name="label" translatable="yes">802.1x _Security</property>
-            <property name="use_underline">True</property>
-            <property name="mnemonic_widget">enable_8021x_switch</property>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">0</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkSwitch" id="enable_8021x_switch">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="halign">start</property>
-            <property name="hexpand">True</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">0</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkBox" id="box">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="orientation">vertical</property>
-            <child>
-              <placeholder/>
-            </child>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">1</property>
-            <property name="width">2</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
       </object>
+      <packing>
+        <property name="left_attach">1</property>
+        <property name="top_attach">0</property>
+        <property name="width">1</property>
+        <property name="height">1</property>
+      </packing>
     </child>
     <child>
-      <object class="GtkGrid">
+      <object class="GtkBox" id="box">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
-        <property name="margin_start">50</property>
-        <property name="margin_end">50</property>
-        <property name="margin_top">12</property>
-        <property name="margin_bottom">12</property>
-        <property name="row_spacing">10</property>
-        <property name="column_spacing">6</property>
-        <child>
-          <object class="GtkEntry" id="entry1">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="invisible_char">●</property>
-            <property name="width_chars">35</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">0</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkEntry" id="entry2">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="invisible_char">●</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">1</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkEntry" id="entry3">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="invisible_char">●</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">2</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkEntry" id="entry4">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="invisible_char">●</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">3</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkEntry" id="entry5">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="invisible_char">●</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">4</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkEntry" id="entry6">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="invisible_char">●</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">5</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkEntry" id="entry7">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="invisible_char">●</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">6</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkEntry" id="entry8">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="invisible_char">●</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">7</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkEntry" id="entry9">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="invisible_char">●</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">8</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkEntry" id="entry10">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="invisible_char">●</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">9</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkLabel">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="label" translatable="yes">Anony_mous identity</property>
-            <property name="use_underline">True</property>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">0</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkLabel">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="label" translatable="yes">Inner _authentication</property>
-            <property name="use_underline">True</property>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">1</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
+        <property name="orientation">vertical</property>
         <child>
           <placeholder/>
         </child>
       </object>
       <packing>
-        <property name="position">1</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">1</property>
+        <property name="width">2</property>
+        <property name="height">1</property>
       </packing>
     </child>
   </object>
diff --git a/panels/network/connection-editor/ce-page-8021x-security.c 
b/panels/network/connection-editor/ce-page-8021x-security.c
index 327b5869f..9884fa77b 100644
--- a/panels/network/connection-editor/ce-page-8021x-security.c
+++ b/panels/network/connection-editor/ce-page-8021x-security.c
@@ -40,7 +40,7 @@ struct _CEPage8021xSecurity {
         GtkBuilder  *builder;
         GtkBox      *box;
         GtkSwitch   *enable_8021x_switch;
-        GtkNotebook *notebook;
+        GtkGrid     *grid;
         GtkLabel    *security_label;
 
         GtkWidget *security_widget;
@@ -116,7 +116,7 @@ ce_page_8021x_security_new (NMConnection     *connection,
 
         self->box = GTK_BOX (gtk_builder_get_object (self->builder, "box"));
         self->enable_8021x_switch = GTK_SWITCH (gtk_builder_get_object (self->builder, 
"enable_8021x_switch"));
-        self->notebook = GTK_NOTEBOOK (gtk_builder_get_object (self->builder, "notebook"));
+        self->grid = GTK_GRID (gtk_builder_get_object (self->builder, "grid"));
         self->security_label = GTK_LABEL (gtk_builder_get_object (self->builder, "security_label"));
 
        if (nm_connection_get_setting_802_1x (connection))
@@ -142,7 +142,7 @@ static GtkWidget *
 ce_page_8021x_security_get_widget (CEPage *page)
 {
         CEPage8021xSecurity *self = CE_PAGE_8021X_SECURITY (page);
-        return GTK_WIDGET (self->notebook);
+        return GTK_WIDGET (self->grid);
 }
 
 static const gchar *
diff --git a/panels/network/connection-editor/ce-page-security.c 
b/panels/network/connection-editor/ce-page-security.c
index 41ecf980f..5bac5ad68 100644
--- a/panels/network/connection-editor/ce-page-security.c
+++ b/panels/network/connection-editor/ce-page-security.c
@@ -40,7 +40,7 @@ struct _CEPageSecurity
 
         GtkBuilder  *builder;
         GtkBox      *box;
-        GtkNotebook *notebook;
+        GtkGrid     *grid;
         GtkComboBox *security_combo;
         GtkLabel    *security_label;
 
@@ -383,7 +383,7 @@ static GtkWidget *
 ce_page_security_get_widget (CEPage *page)
 {
         CEPageSecurity *self = CE_PAGE_SECURITY (page);
-        return GTK_WIDGET (self->notebook);
+        return GTK_WIDGET (self->grid);
 }
 
 static const gchar *
@@ -480,7 +480,7 @@ ce_page_security_new (NMConnection      *connection,
         }
 
         self->box = GTK_BOX (gtk_builder_get_object (self->builder, "box"));
-        self->notebook = GTK_NOTEBOOK (gtk_builder_get_object (self->builder, "notebook"));
+        self->grid = GTK_GRID (gtk_builder_get_object (self->builder, "grid"));
         self->security_label = GTK_LABEL (gtk_builder_get_object (self->builder, "security_label"));
         self->security_combo = GTK_COMBO_BOX (gtk_builder_get_object (self->builder, "security_combo"));
 
diff --git a/panels/network/connection-editor/security-page.ui 
b/panels/network/connection-editor/security-page.ui
index 2b3ed80a2..9cfbc0ac6 100644
--- a/panels/network/connection-editor/security-page.ui
+++ b/panels/network/connection-editor/security-page.ui
@@ -1,266 +1,60 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
-  <object class="GtkNotebook" id="notebook">
+  <object class="GtkGrid" id="grid">
     <property name="visible">True</property>
-    <property name="can_focus">True</property>
-    <property name="show_tabs">False</property>
-    <property name="show_border">False</property>
+    <property name="can_focus">False</property>
+    <property name="margin_start">50</property>
+    <property name="margin_end">50</property>
+    <property name="margin_top">12</property>
+    <property name="margin_bottom">12</property>
+    <property name="hexpand">True</property>
+    <property name="vexpand">True</property>
+    <property name="row_spacing">10</property>
+    <property name="column_spacing">6</property>
     <child>
-      <object class="GtkGrid">
+      <object class="GtkLabel" id="security_label">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="xalign">1</property>
+        <property name="label" translatable="yes">S_ecurity</property>
+        <property name="use_underline">True</property>
+        <property name="mnemonic_widget">security_combo</property>
+      </object>
+      <packing>
+        <property name="left_attach">0</property>
+        <property name="top_attach">0</property>
+        <property name="width">1</property>
+        <property name="height">1</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkComboBox" id="security_combo">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
-        <property name="margin_start">50</property>
-        <property name="margin_end">50</property>
-        <property name="margin_top">12</property>
-        <property name="margin_bottom">12</property>
         <property name="hexpand">True</property>
-        <property name="vexpand">True</property>
-        <property name="row_spacing">10</property>
-        <property name="column_spacing">6</property>
-        <child>
-          <object class="GtkLabel" id="security_label">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="xalign">1</property>
-            <property name="label" translatable="yes">S_ecurity</property>
-            <property name="use_underline">True</property>
-            <property name="mnemonic_widget">security_combo</property>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">0</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkComboBox" id="security_combo">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="hexpand">True</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">0</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkBox" id="box">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="orientation">vertical</property>
-            <child>
-              <placeholder/>
-            </child>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">1</property>
-            <property name="width">2</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
       </object>
+      <packing>
+        <property name="left_attach">1</property>
+        <property name="top_attach">0</property>
+        <property name="width">1</property>
+        <property name="height">1</property>
+      </packing>
     </child>
     <child>
-      <object class="GtkGrid">
+      <object class="GtkBox" id="box">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
-        <property name="margin_start">50</property>
-        <property name="margin_end">50</property>
-        <property name="margin_top">12</property>
-        <property name="margin_bottom">12</property>
-        <property name="row_spacing">10</property>
-        <property name="column_spacing">6</property>
-        <child>
-          <object class="GtkEntry" id="entry1">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="invisible_char">●</property>
-            <property name="width_chars">35</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">0</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkEntry" id="entry2">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="invisible_char">●</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">1</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkEntry" id="entry3">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="invisible_char">●</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">2</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkEntry" id="entry4">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="invisible_char">●</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">3</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkEntry" id="entry5">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="invisible_char">●</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">4</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkEntry" id="entry6">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="invisible_char">●</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">5</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkEntry" id="entry7">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="invisible_char">●</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">6</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkEntry" id="entry8">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="invisible_char">●</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">7</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkEntry" id="entry9">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="invisible_char">●</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">8</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkEntry" id="entry10">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="invisible_char">●</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">9</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkLabel">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="label" translatable="yes">Anony_mous identity</property>
-            <property name="use_underline">True</property>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">0</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkLabel">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="label" translatable="yes">Inner _authentication</property>
-            <property name="use_underline">True</property>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">1</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
+        <property name="orientation">vertical</property>
         <child>
           <placeholder/>
         </child>
       </object>
       <packing>
-        <property name="position">1</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">1</property>
+        <property name="width">2</property>
+        <property name="height">1</property>
       </packing>
     </child>
   </object>


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