[network-manager-applet] build: replace GtkTable with GtkGrid in the code



commit 702dd4fe08aeb0bcdcbd3fe2db3b712362fbbb15
Author: Dan Winship <danw gnome org>
Date:   Sun Feb 24 16:40:58 2013 +0100

    build: replace GtkTable with GtkGrid in the code
    
    This does not replace GtkTables in .ui files, except where those
    tables were manipulated by the code.

 src/applet-dialogs.c                  |  235 +++++++++++++++++----------------
 src/connection-editor/ce-page-bond.ui |   58 ++------
 src/connection-editor/page-bond.c     |   27 ----
 src/gsm-unlock.ui                     |   68 +++++-----
 src/libnm-gtk/nm-mobile-wizard.c      |   19 ++-
 5 files changed, 180 insertions(+), 227 deletions(-)
---
diff --git a/src/applet-dialogs.c b/src/applet-dialogs.c
index 326b697..34506af 100644
--- a/src/applet-dialogs.c
+++ b/src/applet-dialogs.c
@@ -196,6 +196,7 @@ create_info_label (const char *text, gboolean selectable)
        label = gtk_label_new (text ? text : "");
        gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
        gtk_label_set_selectable (GTK_LABEL (label), selectable);
+       gtk_widget_set_hexpand (label, selectable);
        return label;
 }
 
@@ -382,7 +383,7 @@ info_dialog_add_page (GtkNotebook *notebook,
                       gboolean is_default,
                       NMDevice *device)
 {
-       GtkTable *table;
+       GtkGrid *grid;
        guint32 speed = 0;
        char *str;
        const char *iface, *method = NULL;
@@ -399,10 +400,10 @@ info_dialog_add_page (GtkNotebook *notebook,
        const GSList *addresses;
        gboolean show_security = FALSE;
 
-       table = GTK_TABLE (gtk_table_new (12, 2, FALSE));
-       gtk_table_set_col_spacings (table, 12);
-       gtk_table_set_row_spacings (table, 6);
-       gtk_container_set_border_width (GTK_CONTAINER (table), 12);
+       grid = GTK_GRID (gtk_grid_new ());
+       gtk_grid_set_column_spacing (grid, 12);
+       gtk_grid_set_row_spacing (grid, 6);
+       gtk_container_set_border_width (GTK_CONTAINER (grid), 12);
 
        /* Interface */
        iface = nm_device_get_iface (device);
@@ -429,14 +430,14 @@ info_dialog_add_page (GtkNotebook *notebook,
 
 
        /*--- General ---*/
-       gtk_table_attach (table, create_info_group_label (_("General"), FALSE),
-                         0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+       gtk_grid_attach (grid, create_info_group_label (_("General"), FALSE),
+                        0, row, 1, 1);
        row++;
 
-       gtk_table_attach (table, create_info_label (_("Interface:"), FALSE),
-                         0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
-       gtk_table_attach (table, create_info_label (str, TRUE),
-                         1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+       gtk_grid_attach (grid, create_info_label (_("Interface:"), FALSE),
+                        0, row, 1, 1);
+       gtk_grid_attach (grid, create_info_label (str, TRUE),
+                        1, row, 1, 1);
        g_free (str);
        row++;
 
@@ -449,18 +450,18 @@ info_dialog_add_page (GtkNotebook *notebook,
        else if (NM_IS_DEVICE_WIMAX (device))
                str = g_strdup (nm_device_wimax_get_hw_address (NM_DEVICE_WIMAX (device)));
 
-       gtk_table_attach (table, create_info_label (_("Hardware Address:"), FALSE),
-                         0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
-       gtk_table_attach (table, create_info_label (str, TRUE),
-                         1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+       gtk_grid_attach (grid, create_info_label (_("Hardware Address:"), FALSE),
+                        0, row, 1, 1);
+       gtk_grid_attach (grid, create_info_label (str, TRUE),
+                        1, row, 1, 1);
        g_free (str);
        row++;
 
        /* Driver */
-       gtk_table_attach (table, create_info_label (_("Driver:"), FALSE),
-                         0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
-       gtk_table_attach (table, create_info_label (nm_device_get_driver (device), TRUE),
-                         1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+       gtk_grid_attach (grid, create_info_label (_("Driver:"), FALSE),
+                        0, row, 1, 1);
+       gtk_grid_attach (grid, create_info_label (nm_device_get_driver (device), TRUE),
+                        1, row, 1, 1);
        row++;
 
        speed_label = create_info_label ("", TRUE);
@@ -486,20 +487,20 @@ info_dialog_add_page (GtkNotebook *notebook,
        gtk_label_set_text (GTK_LABEL(speed_label), str ? str : C_("Speed", "Unknown"));
        g_free (str);
 
-       gtk_table_attach (table, create_info_label (_("Speed:"), FALSE),
-                         0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
-       gtk_table_attach (table, speed_label,
-                         1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+       gtk_grid_attach (grid, create_info_label (_("Speed:"), FALSE),
+                        0, row, 1, 1);
+       gtk_grid_attach (grid, speed_label,
+                        1, row, 1, 1);
        row++;
 
        /* Security */
        if (show_security) {
                sec_label = create_info_label_security (connection);
                if (sec_label) {
-                       gtk_table_attach (table, create_info_label (_("Security:"), FALSE),
-                                             0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
-                       gtk_table_attach (table, sec_label,
-                                             1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+                       gtk_grid_attach (grid, create_info_label (_("Security:"), FALSE),
+                                        0, row, 1, 1);
+                       gtk_grid_attach (grid, sec_label,
+                                        1, row, 1, 1);
                        row++;
                }
        }
@@ -509,10 +510,10 @@ info_dialog_add_page (GtkNotebook *notebook,
 
                /* CINR */
                cinr_label = create_info_label ("", TRUE);
-               gtk_table_attach (table, create_info_label (_("CINR:"), FALSE),
-                                     0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
-               gtk_table_attach (table, cinr_label,
-                                     1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+               gtk_grid_attach (grid, create_info_label (_("CINR:"), FALSE),
+                                    0, row, 1, 1);
+               gtk_grid_attach (grid, cinr_label,
+                                    1, row, 1, 1);
                label_info_new (device,
                                cinr_label,
                                "notify::" NM_DEVICE_WIMAX_CINR,
@@ -522,10 +523,10 @@ info_dialog_add_page (GtkNotebook *notebook,
 
                /* Base Station ID */
                bsid_label = create_info_label ("", TRUE);
-               gtk_table_attach (table, create_info_label (_("BSID:"), FALSE),
-                                     0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
-               gtk_table_attach (table, bsid_label,
-                                     1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+               gtk_grid_attach (grid, create_info_label (_("BSID:"), FALSE),
+                                    0, row, 1, 1);
+               gtk_grid_attach (grid, bsid_label,
+                                    1, row, 1, 1);
                label_info_new (device,
                                bsid_label,
                                "notify::" NM_DEVICE_WIMAX_BSID,
@@ -535,12 +536,12 @@ info_dialog_add_page (GtkNotebook *notebook,
        }
 
        /* Empty line */
-       gtk_table_attach (table, gtk_label_new (""), 0, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+       gtk_grid_attach (grid, gtk_label_new (""), 0, row, 2, 1);
        row++;
 
        /*--- IPv4 ---*/
-       gtk_table_attach (table, create_info_group_label (_("IPv4"), FALSE),
-                         0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+       gtk_grid_attach (grid, create_info_group_label (_("IPv4"), FALSE),
+                        0, row, 1, 1);
 
        row++;
 
@@ -550,11 +551,11 @@ info_dialog_add_page (GtkNotebook *notebook,
                def_addr = addresses->data;
 
        /* Address */
-       gtk_table_attach (table, create_info_label (_("IP Address:"), FALSE),
-                         0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+       gtk_grid_attach (grid, create_info_label (_("IP Address:"), FALSE),
+                        0, row, 1, 1);
        str = def_addr ? ip4_address_as_string (nm_ip4_address_get_address (def_addr)) : g_strdup 
(C_("Address", "Unknown"));
-       gtk_table_attach (table, create_info_label (str, TRUE),
-                         1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+       gtk_grid_attach (grid, create_info_label (str, TRUE),
+                        1, row, 1, 1);
        g_free (str);
        row++;
 
@@ -566,30 +567,30 @@ info_dialog_add_page (GtkNotebook *notebook,
                bcast = htonl (network | hostmask);
        }
 
-       gtk_table_attach (table, create_info_label (_("Broadcast Address:"), FALSE),
-                         0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+       gtk_grid_attach (grid, create_info_label (_("Broadcast Address:"), FALSE),
+                        0, row, 1, 1);
        str = def_addr ? ip4_address_as_string (bcast) : g_strdup (C_("Address", "Unknown"));
-       gtk_table_attach (table, create_info_label (str, TRUE),
-                         1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+       gtk_grid_attach (grid, create_info_label (str, TRUE),
+                        1, row, 1, 1);
        g_free (str);
        row++;
 
        /* Prefix */
-       gtk_table_attach (table, create_info_label (_("Subnet Mask:"), FALSE),
-                         0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+       gtk_grid_attach (grid, create_info_label (_("Subnet Mask:"), FALSE),
+                        0, row, 1, 1);
        str = def_addr ? ip4_address_as_string (netmask) : g_strdup (C_("Subnet Mask", "Unknown"));
-       gtk_table_attach (table, create_info_label (str, TRUE),
-                         1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+       gtk_grid_attach (grid, create_info_label (str, TRUE),
+                        1, row, 1, 1);
        g_free (str);
        row++;
 
        /* Gateway */
        if (def_addr && nm_ip4_address_get_gateway (def_addr)) {
-               gtk_table_attach (table, create_info_label (_("Default Route:"), FALSE),
-                                 0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+               gtk_grid_attach (grid, create_info_label (_("Default Route:"), FALSE),
+                                0, row, 1, 1);
                str = ip4_address_as_string (nm_ip4_address_get_gateway (def_addr));
-               gtk_table_attach (table, create_info_label (str, TRUE),
-                                 1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+               gtk_grid_attach (grid, create_info_label (str, TRUE),
+                                1, row, 1, 1);
                g_free (str);
                row++;
        }
@@ -597,42 +598,42 @@ info_dialog_add_page (GtkNotebook *notebook,
        /* DNS */
        dns = def_addr ? nm_ip4_config_get_nameservers (ip4_config) : NULL;
        if (dns && dns->len) {
-               gtk_table_attach (table, create_info_label (_("Primary DNS:"), FALSE),
-                                 0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+               gtk_grid_attach (grid, create_info_label (_("Primary DNS:"), FALSE),
+                                0, row, 1, 1);
                str = ip4_address_as_string (g_array_index (dns, guint32, 0));
-               gtk_table_attach (table, create_info_label (str, TRUE),
-                                 1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+               gtk_grid_attach (grid, create_info_label (str, TRUE),
+                                1, row, 1, 1);
                g_free (str);
                row++;
 
                if (dns->len > 1) {
-                       gtk_table_attach (table, create_info_label (_("Secondary DNS:"), FALSE),
-                                         0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+                       gtk_grid_attach (grid, create_info_label (_("Secondary DNS:"), FALSE),
+                                        0, row, 1, 1);
                        str = ip4_address_as_string (g_array_index (dns, guint32, 1));
-                       gtk_table_attach (table, create_info_label (str, TRUE),
-                                         1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+                       gtk_grid_attach (grid, create_info_label (str, TRUE),
+                                        1, row, 1, 1);
                        g_free (str);
                        row++;
                }
 
                if (dns->len > 2) {
-                       gtk_table_attach (table, create_info_label (_("Ternary DNS:"), FALSE),
-                                         0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+                       gtk_grid_attach (grid, create_info_label (_("Ternary DNS:"), FALSE),
+                                        0, row, 1, 1);
                        str = ip4_address_as_string (g_array_index (dns, guint32, 2));
-                       gtk_table_attach (table, create_info_label (str, TRUE),
-                                         1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+                       gtk_grid_attach (grid, create_info_label (str, TRUE),
+                                        1, row, 1, 1);
                        g_free (str);
                        row++;
                }
        }
 
        /* Empty line */
-       gtk_table_attach (table, gtk_label_new (""), 0, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+       gtk_grid_attach (grid, gtk_label_new (""), 0, row, 2, 1);
        row++;
 
        /*--- IPv6 ---*/
-       gtk_table_attach (table, create_info_group_label (_("IPv6"), FALSE),
-                         0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+       gtk_grid_attach (grid, create_info_group_label (_("IPv6"), FALSE),
+                        0, row, 1, 1);
        row++;
 
        s_ip6 = nm_connection_get_setting_ip6_config (connection);
@@ -640,8 +641,8 @@ info_dialog_add_page (GtkNotebook *notebook,
                 method = nm_setting_ip6_config_get_method (s_ip6);
 
        if (!method || !strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) {
-               gtk_table_attach (table, create_info_label (_("Ignored"), FALSE),
-                                 0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+               gtk_grid_attach (grid, create_info_label (_("Ignored"), FALSE),
+                                0, row, 1, 1);
                row++;
        }
 
@@ -657,26 +658,26 @@ info_dialog_add_page (GtkNotebook *notebook,
                char *tmp_addr;
                guint32 prefix;
 
-               gtk_table_attach (table, create_info_label (_("IP Address:"), FALSE),
-                                 0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+               gtk_grid_attach (grid, create_info_label (_("IP Address:"), FALSE),
+                                0, row, 1, 1);
                tmp_addr = ip6_address_as_string (nm_ip6_address_get_address (def6_addr));
                prefix = nm_ip6_address_get_prefix (def6_addr);
                str = g_strdup_printf ("%s/%d", tmp_addr, prefix);
                g_free (tmp_addr);
 
-               gtk_table_attach (table, create_info_label (str, TRUE),
-                                 1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+               gtk_grid_attach (grid, create_info_label (str, TRUE),
+                                1, row, 1, 1);
                g_free (str);
                row++;
        }
 
        /* Gateway */
        if (def6_addr && nm_ip6_address_get_gateway (def6_addr)) {
-               gtk_table_attach (table, create_info_label (_("Default Route:"), FALSE),
-                                 0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+               gtk_grid_attach (grid, create_info_label (_("Default Route:"), FALSE),
+                                0, row, 1, 1);
                str = ip6_address_as_string (nm_ip6_address_get_gateway (def6_addr));
-               gtk_table_attach (table, create_info_label (str, TRUE),
-                                 1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+               gtk_grid_attach (grid, create_info_label (str, TRUE),
+                                1, row, 1, 1);
                g_free (str);
                row++;
        }
@@ -687,19 +688,19 @@ info_dialog_add_page (GtkNotebook *notebook,
        for (i = 0; dns6 && i < 3 ; dns6 = g_slist_next (dns6), i++) {
                char *label[] = { "Primary DNS:", "Secondary DNS:", "Ternary DNS:" };
 
-               gtk_table_attach (table, create_info_label (_(label[i]), FALSE),
-                                 0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+               gtk_grid_attach (grid, create_info_label (_(label[i]), FALSE),
+                                0, row, 1, 1);
                str = ip6_address_as_string (dns6->data);
-               gtk_table_attach (table, create_info_label (str, TRUE),
-                                 1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+               gtk_grid_attach (grid, create_info_label (str, TRUE),
+                                1, row, 1, 1);
                g_free (str);
                row++;
        }
 
-       gtk_notebook_append_page (notebook, GTK_WIDGET (table),
+       gtk_notebook_append_page (notebook, GTK_WIDGET (grid),
                                  create_info_notebook_label (connection, is_default));
 
-       gtk_widget_show_all (GTK_WIDGET (table));
+       gtk_widget_show_all (GTK_WIDGET (grid));
 }
 
 static char *
@@ -777,56 +778,56 @@ info_dialog_add_page_for_vpn (GtkNotebook *notebook,
                               NMActiveConnection *active,
                               NMConnection *parent_con)
 {
-       GtkTable *table;
+       GtkGrid *grid;
        char *str;
        int row = 0;
        gboolean is_default = nm_active_connection_get_default (active);
 
-       table = GTK_TABLE (gtk_table_new (12, 2, FALSE));
-       gtk_table_set_col_spacings (table, 12);
-       gtk_table_set_row_spacings (table, 6);
-       gtk_container_set_border_width (GTK_CONTAINER (table), 12);
+       grid = GTK_GRID (gtk_grid_new ());
+       gtk_grid_set_column_spacing (grid, 12);
+       gtk_grid_set_row_spacing (grid, 6);
+       gtk_container_set_border_width (GTK_CONTAINER (grid), 12);
 
        /*--- General ---*/
-       gtk_table_attach (table, create_info_group_label (_("General"), FALSE),
-                         0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+       gtk_grid_attach (grid, create_info_group_label (_("General"), FALSE),
+                        0, row, 1, 1);
        row++;
 
        str = get_vpn_connection_type (connection);
-       gtk_table_attach (table, create_info_label (_("VPN Type:"), FALSE),
-                         0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
-       gtk_table_attach (table, create_info_label (str, TRUE),
-                         1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+       gtk_grid_attach (grid, create_info_label (_("VPN Type:"), FALSE),
+                        0, row, 1, 1);
+       gtk_grid_attach (grid, create_info_label (str, TRUE),
+                        1, row, 1, 1);
        g_free (str);
        row++;
 
-       gtk_table_attach (table, create_info_label (_("VPN Gateway:"), FALSE),
-                         0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
-       gtk_table_attach (table, create_info_label (get_vpn_data_item (connection, VPN_DATA_ITEM_GATEWAY), 
TRUE),
-                         1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+       gtk_grid_attach (grid, create_info_label (_("VPN Gateway:"), FALSE),
+                        0, row, 1, 1);
+       gtk_grid_attach (grid, create_info_label (get_vpn_data_item (connection, VPN_DATA_ITEM_GATEWAY), 
TRUE),
+                        1, row, 1, 1);
        row++;
 
-       gtk_table_attach (table, create_info_label (_("VPN Username:"), FALSE),
-                         0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
-       gtk_table_attach (table, create_info_label (get_vpn_data_item (connection, VPN_DATA_ITEM_USERNAME), 
TRUE),
-                         1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+       gtk_grid_attach (grid, create_info_label (_("VPN Username:"), FALSE),
+                        0, row, 1, 1);
+       gtk_grid_attach (grid, create_info_label (get_vpn_data_item (connection, VPN_DATA_ITEM_USERNAME), 
TRUE),
+                        1, row, 1, 1);
        row++;
 
-       gtk_table_attach (table, create_info_label (_("VPN Banner:"), FALSE),
-                         0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
-       gtk_table_attach (table, create_info_label (nm_vpn_connection_get_banner (NM_VPN_CONNECTION 
(active)), TRUE),
-                         1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+       gtk_grid_attach (grid, create_info_label (_("VPN Banner:"), FALSE),
+                        0, row, 1, 1);
+       gtk_grid_attach (grid, create_info_label (nm_vpn_connection_get_banner (NM_VPN_CONNECTION (active)), 
TRUE),
+                        1, row, 1, 1);
        row++;
 
-       gtk_table_attach (table, create_info_label (_("Base Connection:"), FALSE),
-                         0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
-       gtk_table_attach (table, create_info_label (parent_con ? nm_connection_get_id (parent_con) : 
_("Unknown"), TRUE),
-                         1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+       gtk_grid_attach (grid, create_info_label (_("Base Connection:"), FALSE),
+                        0, row, 1, 1);
+       gtk_grid_attach (grid, create_info_label (parent_con ? nm_connection_get_id (parent_con) : 
_("Unknown"), TRUE),
+                        1, row, 1, 1);
 
-       gtk_notebook_append_page (notebook, GTK_WIDGET (table),
+       gtk_notebook_append_page (notebook, GTK_WIDGET (grid),
                                  create_info_notebook_label (connection, is_default));
 
-       gtk_widget_show_all (GTK_WIDGET (table));
+       gtk_widget_show_all (GTK_WIDGET (grid));
 }
 
 static GtkWidget *
@@ -1384,11 +1385,11 @@ applet_mobile_pin_dialog_new (const char *unlock_required,
        }
 
        /* Make a single-entry dialog look better */
-       widget = GTK_WIDGET (gtk_builder_get_object (builder, "table14"));
+       widget = GTK_WIDGET (gtk_builder_get_object (builder, "grid14"));
        if (label2 || label3)
-               gtk_table_set_row_spacings (GTK_TABLE (widget), 6);
+               gtk_grid_set_row_spacing (GTK_GRID (widget), 6);
        else
-               gtk_table_set_row_spacings (GTK_TABLE (widget), 0);
+               gtk_grid_set_row_spacing (GTK_GRID (widget), 0);
 
        widget = GTK_WIDGET (gtk_builder_get_object (builder, "progress_hbox"));
        gtk_widget_hide (widget);
diff --git a/src/connection-editor/ce-page-bond.ui b/src/connection-editor/ce-page-bond.ui
index 10bbc06..8632d33 100644
--- a/src/connection-editor/ce-page-bond.ui
+++ b/src/connection-editor/ce-page-bond.ui
@@ -69,12 +69,10 @@
       <column type="gchararray"/>
     </columns>
   </object>
-  <object class="GtkTable" id="BondPage">
+  <object class="GtkGrid" id="BondPage">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
     <property name="border_width">12</property>
-    <property name="n_rows">9</property>
-    <property name="n_columns">2</property>
     <property name="column_spacing">12</property>
     <property name="row_spacing">6</property>
     <child>
@@ -86,11 +84,10 @@
         <property name="use_underline">True</property>
       </object>
       <packing>
-        <property name="right_attach">2</property>
+        <property name="left_attach">0</property>
         <property name="top_attach">1</property>
-        <property name="bottom_attach">2</property>
-        <property name="x_options">GTK_FILL</property>
-        <property name="y_options"/>
+        <property name="width">2</property>
+        <property name="height">1</property>
       </packing>
     </child>
     <child>
@@ -103,10 +100,8 @@
         <property name="mnemonic_widget">bond_mode</property>
       </object>
       <packing>
+        <property name="left_attach">0</property>
         <property name="top_attach">3</property>
-        <property name="bottom_attach">4</property>
-        <property name="x_options">GTK_FILL</property>
-        <property name="y_options"/>
       </packing>
     </child>
     <child>
@@ -123,10 +118,7 @@
       </object>
       <packing>
         <property name="left_attach">1</property>
-        <property name="right_attach">2</property>
         <property name="top_attach">3</property>
-        <property name="bottom_attach">4</property>
-        <property name="y_options"/>
       </packing>
     </child>
     <child>
@@ -225,9 +217,9 @@
         </child>
       </object>
       <packing>
-        <property name="right_attach">2</property>
+        <property name="left_attach">0</property>
         <property name="top_attach">2</property>
-        <property name="bottom_attach">3</property>
+        <property name="width">2</property>
       </packing>
     </child>
     <child>
@@ -240,9 +232,8 @@
         <property name="mnemonic_widget">bond_frequency</property>
       </object>
       <packing>
+        <property name="left_attach">0</property>
         <property name="top_attach">5</property>
-        <property name="bottom_attach">6</property>
-        <property name="y_options">GTK_FILL</property>
       </packing>
     </child>
     <child>
@@ -280,10 +271,7 @@
       </object>
       <packing>
         <property name="left_attach">1</property>
-        <property name="right_attach">2</property>
         <property name="top_attach">5</property>
-        <property name="bottom_attach">6</property>
-        <property name="y_options">GTK_FILL</property>
       </packing>
     </child>
     <child>
@@ -296,7 +284,8 @@
         <property name="mnemonic_widget">master_interface</property>
       </object>
       <packing>
-        <property name="y_options">GTK_FILL</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">0</property>
       </packing>
     </child>
     <child>
@@ -307,8 +296,7 @@
       </object>
       <packing>
         <property name="left_attach">1</property>
-        <property name="right_attach">2</property>
-        <property name="y_options">GTK_FILL</property>
+        <property name="top_attach">0</property>
       </packing>
     </child>
     <child>
@@ -321,9 +309,8 @@
         <property name="mnemonic_widget">bond_monitoring</property>
       </object>
       <packing>
+        <property name="left_attach">0</property>
         <property name="top_attach">4</property>
-        <property name="bottom_attach">5</property>
-        <property name="y_options">GTK_FILL</property>
       </packing>
     </child>
     <child>
@@ -340,10 +327,7 @@
       </object>
       <packing>
         <property name="left_attach">1</property>
-        <property name="right_attach">2</property>
         <property name="top_attach">4</property>
-        <property name="bottom_attach">5</property>
-        <property name="y_options">GTK_FILL</property>
       </packing>
     </child>
     <child>
@@ -356,9 +340,8 @@
         <property name="mnemonic_widget">bond_arp_targets</property>
       </object>
       <packing>
+        <property name="left_attach">0</property>
         <property name="top_attach">8</property>
-        <property name="bottom_attach">9</property>
-        <property name="y_options">GTK_FILL</property>
       </packing>
     </child>
     <child>
@@ -370,10 +353,7 @@
       </object>
       <packing>
         <property name="left_attach">1</property>
-        <property name="right_attach">2</property>
         <property name="top_attach">8</property>
-        <property name="bottom_attach">9</property>
-        <property name="y_options">GTK_FILL</property>
       </packing>
     </child>
     <child>
@@ -386,9 +366,8 @@
         <property name="mnemonic_widget">bond_updelay</property>
       </object>
       <packing>
+        <property name="left_attach">0</property>
         <property name="top_attach">6</property>
-        <property name="bottom_attach">7</property>
-        <property name="y_options">GTK_FILL</property>
       </packing>
     </child>
     <child>
@@ -401,9 +380,8 @@
         <property name="mnemonic_widget">bond_downdelay</property>
       </object>
       <packing>
+        <property name="left_attach">0</property>
         <property name="top_attach">7</property>
-        <property name="bottom_attach">8</property>
-        <property name="y_options">GTK_FILL</property>
       </packing>
     </child>
     <child>
@@ -443,10 +421,7 @@
       </object>
       <packing>
         <property name="left_attach">1</property>
-        <property name="right_attach">2</property>
         <property name="top_attach">6</property>
-        <property name="bottom_attach">7</property>
-        <property name="y_options">GTK_FILL</property>
       </packing>
     </child>
     <child>
@@ -486,10 +461,7 @@
       </object>
       <packing>
         <property name="left_attach">1</property>
-        <property name="right_attach">2</property>
         <property name="top_attach">7</property>
-        <property name="bottom_attach">8</property>
-        <property name="y_options">GTK_FILL</property>
       </packing>
     </child>
   </object>
diff --git a/src/connection-editor/page-bond.c b/src/connection-editor/page-bond.c
index a211f79..8538e91 100644
--- a/src/connection-editor/page-bond.c
+++ b/src/connection-editor/page-bond.c
@@ -56,13 +56,6 @@ typedef struct {
        GtkWidget *downdelay_box;
        GtkEntry *arp_targets;
        GtkWidget *arp_targets_label;
-
-       GtkTable *table;
-       int table_row_spacing;
-       int updelay_row;
-       int downdelay_row;
-       int arp_targets_row;
-
 } CEPageBondPrivate;
 
 #define MODE_BALANCE_RR    0
@@ -98,18 +91,6 @@ bond_private_init (CEPageBond *self)
 
        priv->toplevel = GTK_WINDOW (gtk_widget_get_ancestor (GTK_WIDGET (priv->mode),
                                                              GTK_TYPE_WINDOW));
-
-       priv->table = GTK_TABLE (gtk_builder_get_object (builder, "BondPage"));
-       priv->table_row_spacing = gtk_table_get_default_row_spacing (priv->table);
-       gtk_container_child_get (GTK_CONTAINER (priv->table), priv->updelay_label,
-                                "top-attach", &priv->updelay_row,
-                                NULL);
-       gtk_container_child_get (GTK_CONTAINER (priv->table), priv->downdelay_label,
-                                "top-attach", &priv->downdelay_row,
-                                NULL);
-       gtk_container_child_get (GTK_CONTAINER (priv->table), priv->arp_targets_label,
-                                "top-attach", &priv->arp_targets_row,
-                                NULL);
 }
 
 static void
@@ -164,10 +145,6 @@ monitoring_mode_changed (GtkComboBox *combo, gpointer user_data)
                gtk_widget_show (priv->downdelay_box);
                gtk_widget_hide (GTK_WIDGET (priv->arp_targets));
                gtk_widget_hide (priv->arp_targets_label);
-
-               gtk_table_set_row_spacing (priv->table, priv->updelay_row, priv->table_row_spacing);
-               gtk_table_set_row_spacing (priv->table, priv->downdelay_row, priv->table_row_spacing);
-               gtk_table_set_row_spacing (priv->table, priv->arp_targets_row, 0);
        } else {
                gtk_widget_hide (GTK_WIDGET (priv->updelay));
                gtk_widget_hide (priv->updelay_label);
@@ -177,10 +154,6 @@ monitoring_mode_changed (GtkComboBox *combo, gpointer user_data)
                gtk_widget_hide (priv->downdelay_box);
                gtk_widget_show (GTK_WIDGET (priv->arp_targets));
                gtk_widget_show (priv->arp_targets_label);
-
-               gtk_table_set_row_spacing (priv->table, priv->updelay_row, 0);
-               gtk_table_set_row_spacing (priv->table, priv->downdelay_row, 0);
-               gtk_table_set_row_spacing (priv->table, priv->arp_targets_row, priv->table_row_spacing);
        }
 }
 
diff --git a/src/gsm-unlock.ui b/src/gsm-unlock.ui
index 5f6068f..9bc5507 100644
--- a/src/gsm-unlock.ui
+++ b/src/gsm-unlock.ui
@@ -129,22 +129,11 @@
                     <property name="left_padding">12</property>
                     <property name="right_padding">12</property>
                     <child>
-                      <object class="GtkTable" id="table14">
+                      <object class="GtkGrid" id="grid14">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="n_rows">6</property>
-                        <property name="n_columns">2</property>
-                        <property name="column_spacing">6</property>
                         <property name="row_spacing">6</property>
-                        <child>
-                          <placeholder/>
-                        </child>
-                        <child>
-                          <placeholder/>
-                        </child>
-                        <child>
-                          <placeholder/>
-                        </child>
+                        <property name="column_spacing">6</property>
                         <child>
                           <object class="GtkLabel" id="code1_label">
                             <property name="visible">True</property>
@@ -153,7 +142,10 @@
                             <property name="label">label</property>
                           </object>
                           <packing>
-                            <property name="x_options">GTK_FILL</property>
+                            <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>
@@ -165,7 +157,9 @@
                           </object>
                           <packing>
                             <property name="left_attach">1</property>
-                            <property name="right_attach">2</property>
+                            <property name="top_attach">0</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
                           </packing>
                         </child>
                         <child>
@@ -176,9 +170,10 @@
                             <property name="label">label</property>
                           </object>
                           <packing>
+                            <property name="left_attach">0</property>
                             <property name="top_attach">1</property>
-                            <property name="bottom_attach">2</property>
-                            <property name="x_options">GTK_FILL</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
                           </packing>
                         </child>
                         <child>
@@ -189,9 +184,9 @@
                           </object>
                           <packing>
                             <property name="left_attach">1</property>
-                            <property name="right_attach">2</property>
                             <property name="top_attach">1</property>
-                            <property name="bottom_attach">2</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
                           </packing>
                         </child>
                         <child>
@@ -202,9 +197,10 @@
                             <property name="label">label</property>
                           </object>
                           <packing>
+                            <property name="left_attach">0</property>
                             <property name="top_attach">2</property>
-                            <property name="bottom_attach">3</property>
-                            <property name="x_options">GTK_FILL</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
                           </packing>
                         </child>
                         <child>
@@ -215,9 +211,9 @@
                           </object>
                           <packing>
                             <property name="left_attach">1</property>
-                            <property name="right_attach">2</property>
                             <property name="top_attach">2</property>
-                            <property name="bottom_attach">3</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
                           </packing>
                         </child>
                         <child>
@@ -231,15 +227,17 @@
                           </object>
                           <packing>
                             <property name="left_attach">1</property>
-                            <property name="right_attach">2</property>
                             <property name="top_attach">3</property>
-                            <property name="bottom_attach">4</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
                           </packing>
                         </child>
                         <child>
                           <object class="GtkHBox" id="progress_hbox">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
+                            <property name="margin_top">6</property>
+                            <property name="margin_bottom">6</property>
                             <property name="spacing">6</property>
                             <child>
                               <object class="GtkAlignment" id="spinner_alignment">
@@ -272,12 +270,9 @@
                           </object>
                           <packing>
                             <property name="left_attach">1</property>
-                            <property name="right_attach">2</property>
                             <property name="top_attach">5</property>
-                            <property name="bottom_attach">6</property>
-                            <property name="x_options">GTK_FILL</property>
-                            <property name="y_options">GTK_FILL</property>
-                            <property name="y_padding">6</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
                           </packing>
                         </child>
                         <child>
@@ -291,11 +286,20 @@
                           </object>
                           <packing>
                             <property name="left_attach">1</property>
-                            <property name="right_attach">2</property>
                             <property name="top_attach">4</property>
-                            <property name="bottom_attach">5</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
                           </packing>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
+                        <child>
+                          <placeholder/>
+                        </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </object>
                     </child>
                   </object>
diff --git a/src/libnm-gtk/nm-mobile-wizard.c b/src/libnm-gtk/nm-mobile-wizard.c
index d270acc..84bb377 100644
--- a/src/libnm-gtk/nm-mobile-wizard.c
+++ b/src/libnm-gtk/nm-mobile-wizard.c
@@ -723,7 +723,7 @@ get_provider_unlisted_type (NMAMobileWizard *self)
 static void
 providers_setup (NMAMobileWizard *self)
 {
-       GtkWidget *vbox, *scroll, *alignment, *unlisted_table, *label;
+       GtkWidget *vbox, *scroll, *alignment, *unlisted_grid, *label;
        GtkCellRenderer *renderer;
        GtkTreeViewColumn *column;
        GtkTreeSelection *selection;
@@ -777,21 +777,24 @@ providers_setup (NMAMobileWizard *self)
        gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 15, 0);
        gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0);
 
-       unlisted_table = gtk_table_new (2, 2, FALSE);
-       gtk_container_add (GTK_CONTAINER (alignment), unlisted_table);
+       unlisted_grid = gtk_grid_new ();
+       gtk_grid_set_row_spacing (GTK_GRID (unlisted_grid), 12);
+       gtk_grid_set_column_spacing (GTK_GRID (unlisted_grid), 12);
+       gtk_container_add (GTK_CONTAINER (alignment), unlisted_grid);
 
        label = gtk_label_new (_("Provider:"));
        gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
-       gtk_table_attach (GTK_TABLE (unlisted_table), label, 0, 1, 0, 1, 0, 0, 6, 6);
+       gtk_grid_attach (GTK_GRID (unlisted_grid), label, 0, 0, 1, 1);
 
        self->provider_unlisted_entry = gtk_entry_new ();
        gtk_entry_set_width_chars (GTK_ENTRY (self->provider_unlisted_entry), 40);
        g_signal_connect_swapped (self->provider_unlisted_entry, "changed", G_CALLBACK 
(providers_update_complete), self);
 
        alignment = gtk_alignment_new (0, 0.5, 0.66, 0);
+       gtk_widget_set_hexpand (alignment, TRUE);
        gtk_container_add (GTK_CONTAINER (alignment), self->provider_unlisted_entry);
-       gtk_table_attach (GTK_TABLE (unlisted_table), alignment,
-                         1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 6, 6);
+       gtk_grid_attach (GTK_GRID (unlisted_grid), alignment,
+                        1, 0, 1, 1);
 
        self->provider_unlisted_type_combo = gtk_combo_box_text_new ();
        gtk_label_set_mnemonic_widget (GTK_LABEL (label), self->provider_unlisted_type_combo);
@@ -801,8 +804,8 @@ providers_setup (NMAMobileWizard *self)
                                   _("My provider uses CDMA technology (1xRTT, EVDO)"));
        gtk_combo_box_set_active (GTK_COMBO_BOX (self->provider_unlisted_type_combo), 0);
 
-       gtk_table_attach (GTK_TABLE (unlisted_table), self->provider_unlisted_type_combo,
-                         1, 2, 1, 2, 0, 0, 6, 6);
+       gtk_grid_attach (GTK_GRID (unlisted_grid), self->provider_unlisted_type_combo,
+                        1, 1, 1, 1);
 
        /* Only show the CDMA/GSM combo if we don't know the device type */
        if (self->family != NMA_MOBILE_FAMILY_UNKNOWN)


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