[gnome-control-center/wip/gbsneto/connection-editor: 50/53] network: Simplify DNS management in connection editor



commit ed8073d99575767c3f06e804e8225c49d5d6e727
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Tue May 23 02:44:58 2017 -0300

    network: Simplify DNS management in connection editor
    
    When editing the DNS servers of a given connection, a simple
    entry is enough to display and edit the DNS servers. The user
    can separate IP addresses with commas. This is exemplified
    by the mockup at [1].
    
    This, however, is not the current implementation, which uses
    a combination of listbox rows, entries and buttons to manage
    that with added complexity.
    
    Fix that by using an entry to handle the DNS servers.
    
    [1] 
https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/system-settings/network/aday2/network-wires.png
    
    https://bugzilla.gnome.org/show_bug.cgi?id=779841

 panels/network/connection-editor/ce-page-ip4.c |  123 ++++++-----------------
 panels/network/connection-editor/ce-page-ip4.h |    3 +-
 panels/network/connection-editor/ce-page-ip6.c |  125 ++++++------------------
 panels/network/connection-editor/ce-page-ip6.h |    3 +-
 panels/network/connection-editor/ip4-page.ui   |   87 +++++------------
 panels/network/connection-editor/ip6-page.ui   |   89 +++++------------
 6 files changed, 115 insertions(+), 315 deletions(-)
---
diff --git a/panels/network/connection-editor/ce-page-ip4.c b/panels/network/connection-editor/ce-page-ip4.c
index 3488657..8743852 100644
--- a/panels/network/connection-editor/ce-page-ip4.c
+++ b/panels/network/connection-editor/ce-page-ip4.c
@@ -69,7 +69,7 @@ method_changed (GtkToggleButton *radio, CEPageIP4 *page)
 
         widget = GTK_WIDGET (gtk_builder_get_object (CE_PAGE (page)->builder, "address_section"));
         gtk_widget_set_visible (widget, addr_enabled);
-        gtk_widget_set_sensitive (page->dns_list, dns_enabled);
+        gtk_widget_set_sensitive (page->dns_entry, dns_enabled);
         gtk_widget_set_sensitive (page->routes_list, routes_enabled);
         gtk_widget_set_sensitive (page->never_default, routes_enabled);
 
@@ -343,93 +343,29 @@ add_address_section (CEPageIP4 *page)
 }
 
 static void
-add_dns_row (CEPageIP4   *page,
-             const gchar *address)
-{
-        GtkWidget *row;
-        GtkWidget *row_box;
-        GtkWidget *label;
-        GtkWidget *widget;
-        GtkWidget *delete_button;
-        GtkWidget *image;
-
-        row = gtk_list_box_row_new ();
-
-        row_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-        label = gtk_label_new (_("Server"));
-        gtk_widget_set_halign (label, GTK_ALIGN_END);
-        gtk_box_pack_start (GTK_BOX (row_box), label, FALSE, FALSE, 0);
-        widget = gtk_entry_new ();
-        gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
-        g_signal_connect_swapped (widget, "changed", G_CALLBACK (ce_page_changed), page);
-        g_object_set_data (G_OBJECT (row), "address", widget);
-        gtk_entry_set_text (GTK_ENTRY (widget), address);
-        gtk_widget_set_margin_start (widget, 10);
-        gtk_widget_set_margin_end (widget, 10);
-        gtk_widget_set_hexpand (widget, TRUE);
-        gtk_box_pack_start (GTK_BOX (row_box), widget, TRUE, TRUE, 0);
-
-        delete_button = gtk_button_new ();
-        gtk_style_context_add_class (gtk_widget_get_style_context (delete_button), "image-button");
-        g_signal_connect (delete_button, "clicked", G_CALLBACK (remove_row), page);
-        image = gtk_image_new_from_icon_name ("user-trash-symbolic", GTK_ICON_SIZE_MENU);
-        atk_object_set_name (gtk_widget_get_accessible (delete_button), _("Delete DNS Server"));
-        gtk_button_set_image (GTK_BUTTON (delete_button), image);
-        gtk_box_pack_start (GTK_BOX (row_box), delete_button, FALSE, FALSE, 0);
-        g_object_set_data (G_OBJECT (row), "delete-button", delete_button);
-
-        gtk_widget_set_margin_start (row_box, 10);
-        gtk_widget_set_margin_end (row_box, 10);
-        gtk_widget_set_margin_top (row_box, 10);
-        gtk_widget_set_margin_bottom (row_box, 10);
-        gtk_widget_set_halign (row_box, GTK_ALIGN_FILL);
-
-        gtk_container_add (GTK_CONTAINER (row), row_box);
-        gtk_widget_show_all (row);
-        gtk_container_add (GTK_CONTAINER (page->dns_list), row);
-
-        update_row_sensitivity (page, page->dns_list);
-}
-
-static void
-add_empty_dns_row (CEPageIP4 *page)
-{
-        add_dns_row (page, "");
-}
-
-static void
 add_dns_section (CEPageIP4 *page)
 {
-        GtkWidget *widget;
-        GtkWidget *frame;
-        GtkWidget *list;
+        GtkEntry *entry;
+        GString *string;
         gint i;
 
-        widget = GTK_WIDGET (gtk_builder_get_object (CE_PAGE (page)->builder, "dns_section"));
-
-        frame = gtk_frame_new (NULL);
-        gtk_container_add (GTK_CONTAINER (widget), frame);
-        page->dns_list = list = gtk_list_box_new ();
-        gtk_list_box_set_selection_mode (GTK_LIST_BOX (list), GTK_SELECTION_NONE);
-        gtk_list_box_set_header_func (GTK_LIST_BOX (list), cc_list_box_update_header_func, NULL, NULL);
-        gtk_list_box_set_sort_func (GTK_LIST_BOX (list), (GtkListBoxSortFunc)sort_first_last, NULL, NULL);
-        gtk_container_add (GTK_CONTAINER (frame), list);
-        page->auto_dns = GTK_SWITCH (gtk_builder_get_object (CE_PAGE (page)->builder, "auto_dns_switch"));
-        gtk_switch_set_active (page->auto_dns, !nm_setting_ip_config_get_ignore_auto_dns (page->setting));
-        g_signal_connect (page->auto_dns, "notify::active", G_CALLBACK (switch_toggled), page);
-
-        add_section_toolbar (page, widget, G_CALLBACK (add_empty_dns_row));
+        entry = GTK_ENTRY (gtk_builder_get_object (CE_PAGE (page)->builder, "dns_entry"));
+        string = g_string_new ("");
 
         for (i = 0; i < nm_setting_ip_config_get_num_dns (page->setting); i++) {
                 const char *address;
 
                 address = nm_setting_ip_config_get_dns (page->setting, i);
-                add_dns_row (page, address);
+
+                if (i > 0)
+                        g_string_append (string, ", ");
+
+                g_string_append (string, address);
         }
-        if (nm_setting_ip_config_get_num_dns (page->setting) == 0)
-                add_empty_dns_row (page);
 
-        gtk_widget_show_all (widget);
+        gtk_entry_set_text (entry, string->str);
+
+        g_string_free (string, TRUE);
 }
 
 static void
@@ -628,6 +564,9 @@ connect_ip4_page (CEPageIP4 *page)
                 method = IP4_METHOD_DISABLED;
         }
 
+        page->dns_entry = GTK_WIDGET (gtk_builder_get_object (CE_PAGE (page)->builder, "dns_entry"));
+        g_signal_connect_swapped (page->dns_entry, "notify::text", G_CALLBACK (ce_page_changed), page);
+
         page->never_default = GTK_WIDGET (gtk_builder_get_object (CE_PAGE (page)->builder, 
"never_default_check"));
         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (page->never_default),
                                       nm_setting_ip_config_get_never_default (page->setting));
@@ -698,9 +637,12 @@ ui_to_setting (CEPageIP4 *page)
         GPtrArray *addresses = NULL;
         GPtrArray *dns_servers = NULL;
         GPtrArray *routes = NULL;
+        GStrv dns_addresses = NULL;
         GList *children, *l;
         gboolean ret = TRUE;
         const char *default_gateway = NULL;
+        gchar *dns_text = NULL;
+        guint i;
 
         if (gtk_toggle_button_get_active (page->disabled)) {
                 method = NM_SETTING_IP4_CONFIG_METHOD_DISABLED;
@@ -789,37 +731,32 @@ ui_to_setting (CEPageIP4 *page)
         }
 
         dns_servers = g_ptr_array_new_with_free_func (g_free);
+        dns_text = g_strstrip (g_strdup (gtk_entry_get_text (GTK_ENTRY (page->dns_entry))));
         if (g_str_equal (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO) ||
             g_str_equal (method, NM_SETTING_IP4_CONFIG_METHOD_MANUAL))
-                children = gtk_container_get_children (GTK_CONTAINER (page->dns_list));
+                dns_addresses = g_strsplit (dns_text, ", ", -1);
         else
-                children = NULL;
+                dns_addresses = NULL;
 
-        for (l = children; l; l = l->next) {
-                GtkWidget *row = l->data;
-                GtkEntry *entry;
+        for (i = 0; dns_addresses && dns_addresses[i]; i++) {
                 const gchar *text;
 
-                entry = GTK_ENTRY (g_object_get_data (G_OBJECT (row), "address"));
-                if (!entry)
-                        continue;
-
-                text = gtk_entry_get_text (entry);
+                text = g_strstrip (dns_addresses[i]);
                 if (!*text) {
                         /* ignore empty rows */
-                        widget_unset_error (GTK_WIDGET (entry));
+                        widget_unset_error (page->dns_entry);
                         continue;
                 }
 
                 if (text && !nm_utils_ipaddr_valid (AF_INET, text)) {
-                        widget_set_error (GTK_WIDGET (entry));
+                        widget_set_error (page->dns_entry);
                         ret = FALSE;
                 } else {
-                        widget_unset_error (GTK_WIDGET (entry));
+                        widget_unset_error (page->dns_entry);
                         g_ptr_array_add (dns_servers, g_strdup (text));
                 }
         }
-        g_list_free (children);
+        g_clear_pointer (&dns_addresses, g_strfreev);
 
         if (dns_servers->len == 0) {
                 g_ptr_array_free (dns_servers, TRUE);
@@ -912,7 +849,7 @@ ui_to_setting (CEPageIP4 *page)
         if (!ret)
                 goto out;
 
-        ignore_auto_dns = !gtk_switch_get_active (page->auto_dns);
+        ignore_auto_dns = g_utf8_strlen (dns_text, -1) > 0;
         ignore_auto_routes = !gtk_switch_get_active (page->auto_routes);
         never_default = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (page->never_default));
 
@@ -937,6 +874,8 @@ out:
         if (routes)
                 g_ptr_array_free (routes, TRUE);
 
+        g_clear_pointer (&dns_text, g_free);
+
         return ret;
 }
 
diff --git a/panels/network/connection-editor/ce-page-ip4.h b/panels/network/connection-editor/ce-page-ip4.h
index 07aa1d7..100075f 100644
--- a/panels/network/connection-editor/ce-page-ip4.h
+++ b/panels/network/connection-editor/ce-page-ip4.h
@@ -47,8 +47,7 @@ struct _CEPageIP4
 
         GtkToggleButton *disabled;
         GtkWidget       *address_list;
-        GtkSwitch       *auto_dns;
-        GtkWidget       *dns_list;
+        GtkWidget       *dns_entry;
         GtkSwitch       *auto_routes;
         GtkWidget       *routes_list;
         GtkWidget       *never_default;
diff --git a/panels/network/connection-editor/ce-page-ip6.c b/panels/network/connection-editor/ce-page-ip6.c
index c67f4a1..0e70e64 100644
--- a/panels/network/connection-editor/ce-page-ip6.c
+++ b/panels/network/connection-editor/ce-page-ip6.c
@@ -70,7 +70,7 @@ method_changed (GtkToggleButton *button, CEPageIP6 *page)
 
         widget = GTK_WIDGET (gtk_builder_get_object (CE_PAGE (page)->builder, "address_section"));
         gtk_widget_set_visible (widget, addr_enabled);
-        gtk_widget_set_sensitive (page->dns_list, dns_enabled);
+        gtk_widget_set_sensitive (page->dns_entry, dns_enabled);
         gtk_widget_set_sensitive (page->routes_list, routes_enabled);
         gtk_widget_set_sensitive (page->never_default, routes_enabled);
 
@@ -307,94 +307,30 @@ add_address_section (CEPageIP6 *page)
 }
 
 static void
-add_dns_row (CEPageIP6   *page,
-             const gchar *address)
-{
-        GtkWidget *row;
-        GtkWidget *row_box;
-        GtkWidget *label;
-        GtkWidget *widget;
-        GtkWidget *delete_button;
-        GtkWidget *image;
-
-        row = gtk_list_box_row_new ();
-        gtk_widget_set_can_focus (row, FALSE);
-
-        row_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-        label = gtk_label_new (_("Server"));
-        gtk_widget_set_halign (label, GTK_ALIGN_END);
-        gtk_box_pack_start (GTK_BOX (row_box), label, FALSE, FALSE, 0);
-        widget = gtk_entry_new ();
-        gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
-        g_signal_connect_swapped (widget, "changed", G_CALLBACK (ce_page_changed), page);
-        g_object_set_data (G_OBJECT (row), "address", widget);
-        gtk_entry_set_text (GTK_ENTRY (widget), address);
-        gtk_widget_set_margin_start (widget, 10);
-        gtk_widget_set_margin_end (widget, 10);
-        gtk_widget_set_hexpand (widget, TRUE);
-        gtk_box_pack_start (GTK_BOX (row_box), widget, TRUE, TRUE, 0);
-
-        delete_button = gtk_button_new ();
-        gtk_style_context_add_class (gtk_widget_get_style_context (delete_button), "image-button");
-        g_signal_connect (delete_button, "clicked", G_CALLBACK (remove_row), page);
-        image = gtk_image_new_from_icon_name ("user-trash-symbolic", GTK_ICON_SIZE_MENU);
-        atk_object_set_name (gtk_widget_get_accessible (delete_button), _("Delete DNS Server"));
-        gtk_button_set_image (GTK_BUTTON (delete_button), image);
-        gtk_box_pack_start (GTK_BOX (row_box), delete_button, FALSE, FALSE, 0);
-        g_object_set_data (G_OBJECT (row), "delete-button", delete_button);
-
-        gtk_widget_set_margin_start (row_box, 10);
-        gtk_widget_set_margin_end (row_box, 10);
-        gtk_widget_set_margin_top (row_box, 10);
-        gtk_widget_set_margin_bottom (row_box, 10);
-        gtk_widget_set_halign (row_box, GTK_ALIGN_FILL);
-
-        gtk_container_add (GTK_CONTAINER (row), row_box);
-        gtk_widget_show_all (row);
-        gtk_container_add (GTK_CONTAINER (page->dns_list), row);
-
-        update_row_sensitivity (page, page->dns_list);
-}
-
-static void
-add_empty_dns_row (CEPageIP6 *page)
-{
-        add_dns_row (page, "");
-}
-
-static void
 add_dns_section (CEPageIP6 *page)
 {
-        GtkWidget *widget;
-        GtkWidget *frame;
-        GtkWidget *list;
+        GtkEntry *entry;
+        GString *string;
         gint i;
 
-        widget = GTK_WIDGET (gtk_builder_get_object (CE_PAGE (page)->builder, "dns_section"));
-
-        frame = gtk_frame_new (NULL);
-        gtk_container_add (GTK_CONTAINER (widget), frame);
-        page->dns_list = list = gtk_list_box_new ();
-        gtk_list_box_set_selection_mode (GTK_LIST_BOX (list), GTK_SELECTION_NONE);
-        gtk_list_box_set_header_func (GTK_LIST_BOX (list), cc_list_box_update_header_func, NULL, NULL);
-        gtk_list_box_set_sort_func (GTK_LIST_BOX (list), (GtkListBoxSortFunc)sort_first_last, NULL, NULL);
-        gtk_container_add (GTK_CONTAINER (frame), list);
-        page->auto_dns = GTK_SWITCH (gtk_builder_get_object (CE_PAGE (page)->builder, "auto_dns_switch"));
-        gtk_switch_set_active (page->auto_dns, !nm_setting_ip_config_get_ignore_auto_dns (page->setting));
-        g_signal_connect (page->auto_dns, "notify::active", G_CALLBACK (switch_toggled), page);
-
-        add_section_toolbar (page, widget, G_CALLBACK (add_empty_dns_row));
+        entry = GTK_ENTRY (gtk_builder_get_object (CE_PAGE (page)->builder, "dns_entry"));
+        string = g_string_new ("");
 
         for (i = 0; i < nm_setting_ip_config_get_num_dns (page->setting); i++) {
                 const char *address;
 
                 address = nm_setting_ip_config_get_dns (page->setting, i);
-                add_dns_row (page, address);
+
+                if (i > 0)
+                        g_string_append (string, ", ");
+
+                g_string_append (string, address);
+
         }
-        if (nm_setting_ip_config_get_num_dns (page->setting) == 0)
-                add_empty_dns_row (page);
 
-        gtk_widget_show_all (widget);
+        gtk_entry_set_text (entry, string->str);
+
+        g_string_free (string, TRUE);
 }
 
 static void
@@ -588,6 +524,9 @@ connect_ip6_page (CEPageIP6 *page)
                 method = IP6_METHOD_IGNORE;
         }
 
+        page->dns_entry = GTK_WIDGET (gtk_builder_get_object (CE_PAGE (page)->builder, "dns_entry"));
+        g_signal_connect_swapped (page->dns_entry, "notify::text", G_CALLBACK (ce_page_changed), page);
+
         page->never_default = GTK_WIDGET (gtk_builder_get_object (CE_PAGE (page)->builder, 
"never_default_check"));
         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (page->never_default),
                                       nm_setting_ip_config_get_never_default (page->setting));
@@ -636,6 +575,9 @@ ui_to_setting (CEPageIP6 *page)
         gboolean never_default;
         GList *children, *l;
         gboolean ret = TRUE;
+        GStrv dns_adresses = NULL;
+        gchar *dns_text = NULL;
+        guint i;
 
         if (gtk_toggle_button_get_active (page->disabled)) {
                 method = NM_SETTING_IP6_CONFIG_METHOD_IGNORE;
@@ -724,39 +666,35 @@ ui_to_setting (CEPageIP6 *page)
         g_list_free (children);
 
         nm_setting_ip_config_clear_dns (page->setting);
+        dns_text = g_strstrip (g_strdup (gtk_entry_get_text (GTK_ENTRY (page->dns_entry))));
+
         if (g_str_equal (method, NM_SETTING_IP6_CONFIG_METHOD_AUTO) ||
             g_str_equal (method, NM_SETTING_IP6_CONFIG_METHOD_DHCP) ||
             g_str_equal (method, NM_SETTING_IP6_CONFIG_METHOD_MANUAL))
-                children = gtk_container_get_children (GTK_CONTAINER (page->dns_list));
+                dns_adresses = g_strsplit (dns_text, ", ", -1);
         else
-                children = NULL;
+                dns_adresses = NULL;
 
-        for (l = children; l; l = l->next) {
-                GtkWidget *row = l->data;
-                GtkEntry *entry;
+        for (i = 0; dns_adresses && dns_adresses[i]; i++) {
                 const gchar *text;
                 struct in6_addr tmp_addr;
 
-                entry = GTK_ENTRY (g_object_get_data (G_OBJECT (row), "address"));
-                if (!entry)
-                        continue;
-
-                text = gtk_entry_get_text (entry);
+                text = g_strstrip (dns_adresses[i]);
                 if (!*text) {
                         /* ignore empty rows */
-                        widget_unset_error (GTK_WIDGET (entry));
+                        widget_unset_error (page->dns_entry);
                         continue;
                 }
 
                 if (inet_pton (AF_INET6, text, &tmp_addr) <= 0) {
-                        widget_set_error (GTK_WIDGET (entry));
+                        widget_set_error (page->dns_entry);
                         ret = FALSE;
                 } else {
-                        widget_unset_error (GTK_WIDGET (entry));
+                        widget_unset_error (page->dns_entry);
                         nm_setting_ip_config_add_dns (page->setting, text);
                 }
         }
-        g_list_free (children);
+        g_clear_pointer (&dns_adresses, g_strfreev);
 
         nm_setting_ip_config_clear_routes (page->setting);
         if (g_str_equal (method, NM_SETTING_IP6_CONFIG_METHOD_AUTO) ||
@@ -843,7 +781,7 @@ ui_to_setting (CEPageIP6 *page)
         if (!ret)
                 goto out;
 
-        ignore_auto_dns = !gtk_switch_get_active (page->auto_dns);
+        ignore_auto_dns = g_utf8_strlen (dns_text, -1) > 0;
         ignore_auto_routes = !gtk_switch_get_active (page->auto_routes);
         never_default = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (page->never_default));
 
@@ -855,6 +793,7 @@ ui_to_setting (CEPageIP6 *page)
                       NULL);
 
 out:
+        g_clear_pointer (&dns_text, g_free);
 
         return ret;
 }
diff --git a/panels/network/connection-editor/ce-page-ip6.h b/panels/network/connection-editor/ce-page-ip6.h
index 93ec846..b06464b 100644
--- a/panels/network/connection-editor/ce-page-ip6.h
+++ b/panels/network/connection-editor/ce-page-ip6.h
@@ -47,8 +47,7 @@ struct _CEPageIP6
 
         GtkToggleButton *disabled;
         GtkWidget       *address_list;
-        GtkSwitch       *auto_dns;
-        GtkWidget       *dns_list;
+        GtkWidget       *dns_entry;
         GtkSwitch       *auto_routes;
         GtkWidget       *routes_list;
         GtkWidget       *never_default;
diff --git a/panels/network/connection-editor/ip4-page.ui b/panels/network/connection-editor/ip4-page.ui
index 61e7afd..fa9e392 100644
--- a/panels/network/connection-editor/ip4-page.ui
+++ b/panels/network/connection-editor/ip4-page.ui
@@ -114,82 +114,45 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkBox" id="box1">
+                  <object class="GtkLabel" id="heading_dns">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">DNS</property>
                     <property name="margin_top">24</property>
                     <property name="margin_bottom">6</property>
-                    <property name="spacing">6</property>
-                    <child>
-                      <object class="GtkLabel" id="heading_dns">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">DNS</property>
-                        <attributes>
-                          <attribute name="weight" value="bold"/>
-                        </attributes>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label1">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="hexpand">True</property>
-                        <property name="xalign">1</property>
-                        <property name="label" translatable="yes">Automatic</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkSwitch" id="auto_dns_switch">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="halign">end</property>
-                        <child internal-child="accessible">
-                          <object class="AtkObject" id="auto_dns_switch-accessible">
-                            <property name="accessible-name" translatable="yes">Automatic DNS</property>
-                          </object>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">2</property>
-                      </packing>
-                    </child>
+                    <attributes>
+                      <attribute name="weight" value="bold"/>
+                    </attributes>
                   </object>
                   <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
                     <property name="position">2</property>
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkBox" id="dns_section">
+                  <object class="GtkEntry" id="dns_entry">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="orientation">vertical</property>
-                    <child>
-                      <placeholder/>
-                    </child>
-                  </object>
+                    <property name="can_focus">True</property>
+                    </object>
                   <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
                     <property name="position">3</property>
                   </packing>
                 </child>
                 <child>
+                  <object class="GtkLabel">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">Separate IP addresses with commas</property>
+                    <style>
+                      <class name="dim-label" />
+                    </style>
+                    <attributes>
+                      <attribute name="scale" value="0.8"/>
+                    </attributes>
+                  </object>
+                </child>
+                <child>
                   <object class="GtkBox" id="box3">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
@@ -246,7 +209,7 @@
                   <packing>
                     <property name="expand">False</property>
                     <property name="fill">True</property>
-                    <property name="position">4</property>
+                    <property name="position">5</property>
                   </packing>
                 </child>
                 <child>
@@ -261,7 +224,7 @@
                   <packing>
                     <property name="expand">False</property>
                     <property name="fill">True</property>
-                    <property name="position">5</property>
+                    <property name="position">6</property>
                   </packing>
                 </child>
                 <child>
diff --git a/panels/network/connection-editor/ip6-page.ui b/panels/network/connection-editor/ip6-page.ui
index 0c44f41..cb4e356 100644
--- a/panels/network/connection-editor/ip6-page.ui
+++ b/panels/network/connection-editor/ip6-page.ui
@@ -128,82 +128,43 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkBox" id="box1">
+                  <object class="GtkLabel" id="heading_dns">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="margin_top">24</property>
-                    <property name="margin_bottom">6</property>
-                    <property name="spacing">6</property>
-                    <child>
-                      <object class="GtkLabel" id="heading_dns">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">DNS</property>
-                        <attributes>
-                          <attribute name="weight" value="bold"/>
-                        </attributes>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label1">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="hexpand">True</property>
-                        <property name="xalign">1</property>
-                        <property name="label" translatable="yes">Automatic</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkSwitch" id="auto_dns_switch">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="halign">end</property>
-                        <child internal-child="accessible">
-                          <object class="AtkObject" id="auto_dns_switch-accessible">
-                            <property name="accessible-name" translatable="yes">Automatic DNS</property>
-                          </object>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">2</property>
-                      </packing>
-                    </child>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">DNS</property>
+                    <attributes>
+                      <attribute name="weight" value="bold"/>
+                    </attributes>
                   </object>
                   <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
                     <property name="position">2</property>
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkBox" id="dns_section">
+                  <object class="GtkEntry" id="dns_entry">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="orientation">vertical</property>
-                    <child>
-                      <placeholder/>
-                    </child>
-                  </object>
+                    <property name="can_focus">True</property>
+                    </object>
                   <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
                     <property name="position">3</property>
                   </packing>
                 </child>
                 <child>
+                  <object class="GtkLabel">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">Separate IP addresses with commas</property>
+                    <style>
+                      <class name="dim-label" />
+                    </style>
+                    <attributes>
+                      <attribute name="scale" value="0.8"/>
+                    </attributes>
+                  </object>
+                </child>
+                <child>
                   <object class="GtkBox" id="box3">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
@@ -260,7 +221,7 @@
                   <packing>
                     <property name="expand">False</property>
                     <property name="fill">True</property>
-                    <property name="position">4</property>
+                    <property name="position">5</property>
                   </packing>
                 </child>
                 <child>
@@ -275,7 +236,7 @@
                   <packing>
                     <property name="expand">False</property>
                     <property name="fill">True</property>
-                    <property name="position">5</property>
+                    <property name="position">6</property>
                   </packing>
                 </child>
                 <child>


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