[network-manager-netbook/MplPanelClient] Face lift



commit bec488383cf8489f30e681dfe561f0181dc1e127
Author: Tambet Ingo <tambet gmail com>
Date:   Fri Nov 13 09:33:40 2009 +0200

    Face lift
    
    Remove network-manager-netbook.ui file.

 po/POTFILES.in                 |    3 +-
 src/Makefile.am                |    2 +-
 src/network-manager-netbook.ui |  371 ----------------------------------------
 src/nmn-applet.c               |  151 +++++++++++------
 src/nmn-network-item.c         |    3 +-
 src/nmn-new-connection.c       |  135 +++++++++-------
 src/nmn-new-connection.h       |    8 +-
 7 files changed, 184 insertions(+), 489 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index af93827..b0b63d3 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,12 +1,13 @@
 src/main.c
+src/nmn-applet.c
 src/nmn-connection-details.c
 src/nmn-ethernet-item.c
 src/nmn-network-item.c
 src/nmn-networks.c
-[type: gettext/glade]src/network-manager-netbook.ui
 src/nmn-mobile-providers.c
 src/nmn-new-connection.c
 src/nmn-serial-item.c
+src/nmn-status-icon.c
 src/nmn-wifi-item.c
 src/wireless-dialog.c
 [type: gettext/glade]src/wireless-security.ui
diff --git a/src/Makefile.am b/src/Makefile.am
index 5dd2d8b..25f4425 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -70,7 +70,7 @@ network_manager_netbook_SOURCES = \
 	$(NULL)
 
 uidir = $(datadir)/network-manager-netbook
-ui_DATA = network-manager-netbook.ui wireless-security.ui
+ui_DATA = wireless-security.ui
 
 EXTRA_DIST = \
 	$(ui_DATA) \
diff --git a/src/nmn-applet.c b/src/nmn-applet.c
index eb207f2..1c5df3b 100644
--- a/src/nmn-applet.c
+++ b/src/nmn-applet.c
@@ -17,9 +17,10 @@
  * (C) Copyright 2009 Novell, Inc.
  */
 
+#include <glib/gi18n.h>
 #include <dbus/dbus-glib-lowlevel.h>
 #include <moblin-panel/mpl-panel-gtk.h>
-#include <nbtk/nbtk-gtk-light-switch.h>
+#include <nbtk/nbtk-gtk.h>
 #include "nmn-applet.h"
 #include "nmn-nm-data.h"
 #include "nmn-status-icon.h"
@@ -43,14 +44,14 @@ typedef struct {
     MplPanelClient *panel_client;
     GtkWindow *window;
     NmnStatusIcon *status_icon;
-    GtkBuilder *builder;
 
     GtkWidget *pane;
     GtkWidget *list;
-    GtkTable *switch_table;
     GtkWidget *enable_wifi;
     GtkWidget *enable_ethernet;
     GtkWidget *enable_3g;
+    GtkWidget *enable_wimax;
+    GtkWidget *enable_bt;
     GtkWidget *enable_network;
     GtkWidget *add_new_connection;
 
@@ -123,13 +124,6 @@ enable_wifi_setup (NmnApplet *applet)
 {
     NmnAppletPrivate *priv = GET_PRIVATE (applet);
 
-    priv->enable_wifi = nbtk_gtk_light_switch_new ();
-    gtk_table_attach (priv->switch_table,
-                      priv->enable_wifi,
-                      1, 2, 0, 1, 
-                      GTK_FILL, 0,
-                      0, 0);
-
     g_signal_connect (priv->enable_wifi, "switch-flipped", G_CALLBACK (enable_wifi_toggled), applet);
     gtk_widget_show (priv->enable_wifi);
 
@@ -166,13 +160,6 @@ enable_ethernet_setup (NmnApplet *applet)
 {
     NmnAppletPrivate *priv = GET_PRIVATE (applet);
 
-    priv->enable_ethernet = nbtk_gtk_light_switch_new ();
-    gtk_table_attach (priv->switch_table,
-                      priv->enable_ethernet,
-                      1, 2, 1, 2, 
-                      GTK_FILL, 0,
-                      0, 0);
- 
     g_signal_connect (priv->enable_ethernet, "switch-flipped", G_CALLBACK (enable_ethernet_toggled), applet);
     gtk_widget_show (priv->enable_ethernet);
 
@@ -209,12 +196,6 @@ enable_3g_setup (NmnApplet *applet)
 {
     NmnAppletPrivate *priv = GET_PRIVATE (applet);
 
-    priv->enable_3g = nbtk_gtk_light_switch_new ();
-    gtk_table_attach (priv->switch_table,
-                      priv->enable_3g,
-                      1, 2, 2, 3, 
-                      GTK_FILL, 0,
-                      0, 0);
     g_signal_connect (priv->enable_3g, "switch-flipped", G_CALLBACK (enable_3g_toggled), applet);
     gtk_widget_show (priv->enable_3g);
 
@@ -259,13 +240,6 @@ enable_network_setup (NmnApplet *applet)
 {
     NmnAppletPrivate *priv = GET_PRIVATE (applet);
 
-    priv->enable_network = nbtk_gtk_light_switch_new ();
-    gtk_table_attach (priv->switch_table,
-                      priv->enable_network,
-                      1, 2, 4, 5, 
-                      GTK_FILL, 0,
-                      0, 0);
-
     g_signal_connect (priv->enable_network, "switch-flipped", G_CALLBACK (enable_network_toggled), applet);
     gtk_widget_show (priv->enable_network);
 
@@ -300,12 +274,11 @@ add_new_connection_setup (NmnApplet *applet)
 {
     NmnAppletPrivate *priv = GET_PRIVATE (applet);
 
-    priv->new_dialog = nmn_new_connection_create (priv->builder, priv->nm_data);
+    priv->new_dialog = nmn_new_connection_create (priv->nm_data);
     g_object_ref_sink (priv->new_dialog);
     gtk_widget_modify_bg (priv->new_dialog, GTK_STATE_NORMAL, &gtk_widget_get_style (priv->new_dialog)->white);
     g_signal_connect (priv->new_dialog, "hide", G_CALLBACK (add_new_connection_hide), applet);
 
-    priv->add_new_connection = GTK_WIDGET (gtk_builder_get_object (priv->builder, "add_new_connection"));
     g_signal_connect (priv->add_new_connection, "clicked", G_CALLBACK (add_new_connection_show), applet);
 }
 
@@ -385,8 +358,11 @@ nmn_applet_init (NmnApplet *applet)
 {
     NmnAppletPrivate *priv = GET_PRIVATE (applet);
     DBusGConnection *bus;
-    GtkWidget *container;
-    GError *error = NULL;
+    GtkWidget *w;
+    GtkWidget *vbox;
+    GtkWidget *frame;
+    GtkWidget *table;
+    char *label;
 
     bus = init_dbus ();
     /* FIXME: Do something nicer here */
@@ -403,25 +379,99 @@ nmn_applet_init (NmnApplet *applet)
 
     nmn_status_icon_set_nm_client (priv->status_icon, NM_CLIENT (priv->nm_data));
 
-    priv->builder = gtk_builder_new ();
-    if (!gtk_builder_add_from_file (priv->builder, UIDIR "/network-manager-netbook.ui", &error)) {
-        g_warning ("%s: could not find UI resources: (%d) %s",
-                   __func__,
-                   error ? error->code : -1,
-                   error && error->message ? error->message : "(unknown)");
-        g_clear_error (&error);
-    }
-    priv->pane = GTK_WIDGET (gtk_builder_get_object (priv->builder, "main_container"));
-    g_object_ref (priv->pane);
-    gtk_widget_unparent (priv->pane);
+    priv->pane = gtk_hbox_new (FALSE, 6);
+    gtk_container_set_border_width (GTK_CONTAINER (priv->pane), 6);
 
-    priv->list = nmn_networks_new (priv->nm_data);
+    /* left side (Networks list, add new connection button) */
+    vbox = gtk_vbox_new (FALSE, 6);
+    gtk_box_pack_start (GTK_BOX (priv->pane), vbox, TRUE, TRUE, 0);
 
-    container = GTK_WIDGET (gtk_builder_get_object (priv->builder, "networks_container"));
-    gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (container), priv->list);
+    frame = nbtk_gtk_frame_new ();
+    gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
+
+    priv->add_new_connection = gtk_button_new_with_label (_("Add new connection"));
+    gtk_box_pack_start (GTK_BOX (vbox), priv->add_new_connection, FALSE, FALSE, 0);
+
+    vbox = gtk_vbox_new (FALSE, 6);
+    gtk_container_add (GTK_CONTAINER (frame), vbox);
+
+    label = g_strdup_printf ("<big><b>%s</b></big>", _("Networks"));
+    w = gtk_label_new (NULL);
+    gtk_label_set_markup (GTK_LABEL (w), label);
+    g_free (label);
+    gtk_misc_set_alignment (GTK_MISC (w), 0.0, 0.5);
+    gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0);
+
+    w = gtk_scrolled_window_new (NULL, NULL);
+    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (w), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+    priv->list = nmn_networks_new (priv->nm_data);
+    gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (w), priv->list);
     gtk_widget_show (priv->list);
+    gtk_box_pack_start (GTK_BOX (vbox), w, TRUE, TRUE, 0);
+
+
+    /* Right side, switches */
+    vbox = gtk_vbox_new (FALSE, 6);
+    gtk_box_pack_start (GTK_BOX (priv->pane), vbox, FALSE, FALSE, 0);
+
+    frame = nbtk_gtk_frame_new ();
+    gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
+
+    table = gtk_table_new (5, 2, TRUE);
+    gtk_table_set_row_spacings (GTK_TABLE (table), 6);
+    gtk_container_set_border_width (GTK_CONTAINER (table), 6);
+    gtk_container_add (GTK_CONTAINER (frame), table);
+
+    w = gtk_label_new (_("WiFi"));
+    gtk_misc_set_alignment (GTK_MISC (w), 0.2, 0.5);
+    gtk_table_attach_defaults (GTK_TABLE (table), w, 0, 1, 0, 1);
+    priv->enable_wifi = nbtk_gtk_light_switch_new ();
+    gtk_table_attach_defaults (GTK_TABLE (table), priv->enable_wifi, 1, 2, 0, 1);
+
+    w = gtk_label_new (_("Wired"));
+    gtk_misc_set_alignment (GTK_MISC (w), 0.2, 0.5);
+    gtk_table_attach_defaults (GTK_TABLE (table), w, 0, 1, 1, 2);
+    priv->enable_ethernet = nbtk_gtk_light_switch_new ();
+    gtk_table_attach_defaults (GTK_TABLE (table), priv->enable_ethernet, 1, 2, 1, 2);
+
+    w = gtk_label_new (_("3G"));
+    gtk_misc_set_alignment (GTK_MISC (w), 0.2, 0.5);
+    gtk_table_attach_defaults (GTK_TABLE (table), w, 0, 1, 2, 3);
+    priv->enable_3g = nbtk_gtk_light_switch_new ();
+    gtk_table_attach_defaults (GTK_TABLE (table), priv->enable_3g, 1, 2, 2, 3);
+
+    w = gtk_label_new (_("WiMAX"));
+    gtk_misc_set_alignment (GTK_MISC (w), 0.2, 0.5);
+    gtk_table_attach_defaults (GTK_TABLE (table), w, 0, 1, 3, 4);
+    priv->enable_wimax = nbtk_gtk_light_switch_new ();
+    gtk_widget_set_sensitive (priv->enable_wimax, FALSE);
+    gtk_table_attach_defaults (GTK_TABLE (table), priv->enable_wimax, 1, 2, 3, 4);
+
+    w = gtk_label_new (_("Bluetooth"));
+    gtk_misc_set_alignment (GTK_MISC (w), 0.2, 0.5);
+    gtk_table_attach_defaults (GTK_TABLE (table), w, 0, 1, 4, 5);
+    priv->enable_bt = nbtk_gtk_light_switch_new ();
+    gtk_widget_set_sensitive (priv->enable_bt, FALSE);
+    gtk_table_attach_defaults (GTK_TABLE (table), priv->enable_bt, 1, 2, 4, 5);
+
+
+    frame = nbtk_gtk_frame_new ();
+    gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
+
+    table = gtk_table_new (2, 2, TRUE);
+    gtk_container_add (GTK_CONTAINER (frame), table);
+
+    w = gtk_label_new (_("Offline mode"));
+    gtk_misc_set_alignment (GTK_MISC (w), 0.2, 0.5);
+    gtk_table_attach_defaults (GTK_TABLE (table), w, 0, 1, 0, 1);
+    priv->enable_network = nbtk_gtk_light_switch_new ();
+    gtk_table_attach_defaults (GTK_TABLE (table), priv->enable_network, 1, 2, 0, 1);
+
+    w = gtk_label_new (_("This will disable all your connections"));
+    gtk_table_attach_defaults (GTK_TABLE (table), w, 0, 2, 1, 2);
+
+    gtk_widget_show_all (priv->pane);
 
-    priv->switch_table = GTK_TABLE (gtk_builder_get_object (priv->builder, "switch_table"));
 
     enable_wifi_setup (applet);
     enable_ethernet_setup (applet);
@@ -545,9 +595,6 @@ dispose (GObject *object)
     if (priv->pane)
         g_object_unref (priv->pane);
 
-    if (priv->builder)
-        g_object_unref (priv->builder);
-
     if (priv->status_icon)
         g_object_unref (priv->status_icon);
 
diff --git a/src/nmn-network-item.c b/src/nmn-network-item.c
index 760c5ab..4b9a8eb 100644
--- a/src/nmn-network-item.c
+++ b/src/nmn-network-item.c
@@ -724,7 +724,8 @@ static gboolean
 leave_notify_event (GtkWidget *widget,
                     GdkEventCrossing *event)
 {
-    gtk_widget_modify_bg (widget, GTK_STATE_NORMAL, NULL);
+    if (event->detail != GDK_NOTIFY_INFERIOR)
+        gtk_widget_modify_bg (widget, GTK_STATE_NORMAL, NULL);
 
     return TRUE;
 }
diff --git a/src/nmn-new-connection.c b/src/nmn-new-connection.c
index c469ca6..4f97615 100644
--- a/src/nmn-new-connection.c
+++ b/src/nmn-new-connection.c
@@ -37,11 +37,10 @@
 #include "nmn-mobile-providers.h"
 #include "wireless-dialog.h"
 
-G_DEFINE_TYPE (NmnNewConnection, nmn_new_connection, GTK_TYPE_EVENT_BOX)
+G_DEFINE_TYPE (NmnNewConnection, nmn_new_connection, GTK_TYPE_VBOX)
 
 enum {
     PROP_0,
-    PROP_BUILDER,
     PROP_NM_DATA,
 
     LAST_PROP
@@ -50,12 +49,11 @@ enum {
 #define GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), NMN_TYPE_NEW_CONNECTION, NmnNewConnectionPrivate))
 
 typedef struct {
-    GtkBuilder *builder;
     NmnNMData *nm_data;
 
     /* WiFi widgets */
+    GtkWidget *wifi_list_container;
     GtkWidget *wifi_list;
-    GtkWidget *wifi_hidden_network;
 
     /* 3G widgets */
     GtkWidget *mobile_label;
@@ -64,20 +62,15 @@ typedef struct {
     gboolean mobile_list_populated;
     gulong mobile_toggled_id;
 
-    GtkWidget *close;
-
     gboolean disposed;
 } NmnNewConnectionPrivate;
 
 GtkWidget *
-nmn_new_connection_create (GtkBuilder *builder,
-                           NmnNMData *nm_data)
+nmn_new_connection_create (NmnNMData *nm_data)
 {
-    g_return_val_if_fail (GTK_IS_BUILDER (builder), NULL);
     g_return_val_if_fail (NMN_IS_NM_DATA (nm_data), NULL);
 
     return GTK_WIDGET (g_object_new (NMN_TYPE_NEW_CONNECTION,
-                                     NMN_NEW_CONNECTION_BUILDER, builder,
                                      NMN_NEW_CONNECTION_NM_DATA, nm_data,
                                      NULL));
 }
@@ -173,17 +166,11 @@ static void
 wifi_page_init (NmnNewConnection *connection)
 {
     NmnNewConnectionPrivate *priv = GET_PRIVATE (connection);
-    GtkWidget *container;
 
-    container = GTK_WIDGET (gtk_builder_get_object (priv->builder, "new_wifi_container"));
     priv->wifi_list = nmn_wifi_list_new (priv->nm_data);
     g_signal_connect (priv->wifi_list, "connect-requested", G_CALLBACK (connect_requested), connection);
-    gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (container), priv->wifi_list);
+    gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (priv->wifi_list_container), priv->wifi_list);
     gtk_widget_show_all (priv->wifi_list);
-
-    priv->wifi_hidden_network = GTK_WIDGET (gtk_builder_get_object (priv->builder, "new_wifi_hidden"));
-    g_signal_connect (priv->wifi_hidden_network, "clicked", G_CALLBACK (wifi_search), connection);
-    g_signal_connect (priv->wifi_hidden_network, "clicked", G_CALLBACK (connect_requested), connection);
 }
 
 /* Mobile */
@@ -556,15 +543,8 @@ static void
 mobile_page_init (NmnNewConnection *connection)
 {
     NmnNewConnectionPrivate *priv = GET_PRIVATE (connection);
-    GtkTreeSelection *selection;
 
     g_signal_connect (connection, "realize", G_CALLBACK (mobile_list_populate), NULL);
-
-    priv->mobile_label = GTK_WIDGET (gtk_builder_get_object (priv->builder, "new_3g_label"));
-    priv->mobile_list = GTK_WIDGET (gtk_builder_get_object (priv->builder, "new_3g_list"));
-    priv->mobile_save = GTK_WIDGET (gtk_builder_get_object (priv->builder, "new_3g_save"));
-    g_signal_connect (priv->mobile_save, "clicked", G_CALLBACK (mobile_save_clicked), connection);
-
     g_signal_connect (priv->nm_data, "device-added", G_CALLBACK (mobile_device_added), connection);
     g_signal_connect_swapped (priv->nm_data, "device-removed", G_CALLBACK (mobile_status_update), connection);
     
@@ -573,15 +553,82 @@ mobile_page_init (NmnNewConnection *connection)
                                                         connection);
 
     mobile_status_update (connection);
-
-	selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->mobile_list));
-	gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
-    g_signal_connect (selection, "changed", G_CALLBACK (mobile_tree_selection_changed), connection);
 }
 
 static void
-nmn_new_connection_init (NmnNewConnection *connection)
+nmn_new_connection_init (NmnNewConnection *self)
 {
+    NmnNewConnectionPrivate *priv = GET_PRIVATE (self);
+    GtkWidget *w;
+    GtkWidget *notebook;
+    GtkWidget *box;
+    GtkWidget *button;
+    GtkTreeSelection *selection;
+    char *label;
+
+    gtk_box_set_spacing (GTK_BOX (self), 6);
+    gtk_container_set_border_width (GTK_CONTAINER (self), 6);
+
+    label = g_strdup_printf ("<big><b>%s</b></big>", _("Add a new connection"));
+    w = gtk_label_new (NULL);
+    gtk_label_set_markup (GTK_LABEL (w), label);
+    g_free (label);
+    gtk_misc_set_alignment (GTK_MISC (w), 0.0, 0.5);
+    gtk_box_pack_start (GTK_BOX (self), w, FALSE, FALSE, 0);
+
+    notebook = gtk_notebook_new ();
+    gtk_notebook_set_tab_pos (GTK_NOTEBOOK (notebook), GTK_POS_LEFT);
+    gtk_box_pack_start (GTK_BOX (self), notebook, TRUE, TRUE, 0);
+
+    /* WiFi page */
+    box = gtk_vbox_new (FALSE, 6);
+    priv->wifi_list_container = gtk_scrolled_window_new (NULL, NULL);
+    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->wifi_list_container),
+                                    GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+    gtk_box_pack_start (GTK_BOX (box), priv->wifi_list_container, TRUE, TRUE, 0);
+
+    w = gtk_alignment_new (0.0, 0.5, 0.0, 1.0);
+    gtk_box_pack_start (GTK_BOX (box), w, FALSE, FALSE, 0);
+    button = gtk_button_new_with_label (_("Hidden network"));
+    gtk_container_add (GTK_CONTAINER (w), button);
+    g_signal_connect (button, "clicked", G_CALLBACK (wifi_search), self);
+    g_signal_connect (button, "clicked", G_CALLBACK (connect_requested), self);
+
+    gtk_notebook_append_page (GTK_NOTEBOOK (notebook), box, gtk_label_new (_("WiFi")));
+
+    /* 3G page */
+    box = gtk_vbox_new (FALSE, 6);
+    priv->mobile_label = gtk_label_new (NULL);
+    gtk_misc_set_alignment (GTK_MISC (priv->mobile_label), 0.0, 0.5);
+    gtk_box_pack_start (GTK_BOX (box), priv->mobile_label, FALSE, TRUE, 0);
+
+    w = gtk_scrolled_window_new (NULL, NULL);
+    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (w), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+    gtk_box_pack_start (GTK_BOX (box), w, TRUE, TRUE, 0);
+
+    priv->mobile_list = gtk_tree_view_new ();
+    gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (priv->mobile_list), FALSE);
+	selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->mobile_list));
+	gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
+    g_signal_connect (selection, "changed", G_CALLBACK (mobile_tree_selection_changed), self);
+    gtk_container_add (GTK_CONTAINER (w), priv->mobile_list);
+
+    w = gtk_alignment_new (0.0, 0.5, 0.0, 1.0);
+    gtk_box_pack_start (GTK_BOX (box), w, FALSE, FALSE, 0);
+    priv->mobile_save = gtk_button_new_with_label (_("Save connection"));
+    gtk_container_add (GTK_CONTAINER (w), priv->mobile_save);
+    g_signal_connect (priv->mobile_save, "clicked", G_CALLBACK (mobile_save_clicked), self);
+
+    gtk_notebook_append_page (GTK_NOTEBOOK (notebook), box, gtk_label_new (_("3G")));
+
+    /* Close button */
+    w = gtk_alignment_new (0.0, 0.5, 0.0, 1.0);
+    gtk_box_pack_start (GTK_BOX (self), w, FALSE, FALSE, 0);
+    button = gtk_button_new_with_label (_("Return to Networking"));
+    gtk_container_add (GTK_CONTAINER (w), button);
+    g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_hide), self);
+
+    gtk_widget_show_all (GTK_WIDGET (self));
 }
 
 static GObject*
@@ -591,7 +638,6 @@ constructor (GType type,
 {
     GObject *object;
     NmnNewConnectionPrivate *priv;
-    GtkWidget *container;
 
     object = G_OBJECT_CLASS (nmn_new_connection_parent_class)->constructor
         (type, n_construct_params, construct_params);
@@ -601,21 +647,15 @@ constructor (GType type,
 
     priv = GET_PRIVATE (object);
 
-    if (!priv->builder || !priv->nm_data) {
+    if (!priv->nm_data) {
         g_warning ("Missing constructor arguments");
         g_object_unref (object);
         return NULL;
     }
 
-    container = GTK_WIDGET (gtk_builder_get_object (priv->builder, "new_main_container"));
-    gtk_widget_reparent (container, GTK_WIDGET (object));
-
     wifi_page_init (NMN_NEW_CONNECTION (object));
     mobile_page_init (NMN_NEW_CONNECTION (object));
 
-    priv->close = GTK_WIDGET (gtk_builder_get_object (priv->builder, "new_close"));
-    g_signal_connect_swapped (priv->close, "clicked", G_CALLBACK (gtk_widget_hide), object);
-
     return object;
 }
 
@@ -626,10 +666,6 @@ set_property (GObject *object, guint prop_id,
     NmnNewConnectionPrivate *priv = GET_PRIVATE (object);
 
     switch (prop_id) {
-    case PROP_BUILDER:
-        /* Construct only */
-        priv->builder = g_value_dup_object (value);
-        break;
     case PROP_NM_DATA:
         /* Construct only */
         priv->nm_data = g_value_dup_object (value);
@@ -647,9 +683,6 @@ get_property (GObject *object, guint prop_id,
     NmnNewConnectionPrivate *priv = GET_PRIVATE (object);
 
     switch (prop_id) {
-    case PROP_BUILDER:
-        g_value_set_object (value, priv->builder);
-        break;
     case PROP_NM_DATA:
         g_value_set_object (value, priv->nm_data);
         break;
@@ -669,12 +702,6 @@ dispose (GObject *object)
 
     priv->disposed = TRUE;
 
-    if (priv->wifi_list)
-        gtk_widget_destroy (priv->wifi_list);
-
-    if (priv->builder)
-        g_object_unref (priv->builder);
-
     g_signal_handler_disconnect (priv->nm_data, priv->mobile_toggled_id);
 
     if (priv->nm_data)
@@ -698,14 +725,6 @@ nmn_new_connection_class_init (NmnNewConnectionClass *class)
 
     /* properties */
     g_object_class_install_property
-        (object_class, PROP_BUILDER,
-         g_param_spec_object (NMN_NEW_CONNECTION_BUILDER,
-                              "GtkBuilder",
-                              "GtkBuilder",
-                              GTK_TYPE_BUILDER,
-                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-    g_object_class_install_property
         (object_class, PROP_NM_DATA,
          g_param_spec_object (NMN_NEW_CONNECTION_NM_DATA,
                               "NmnNMData",
diff --git a/src/nmn-new-connection.h b/src/nmn-new-connection.h
index f844536..c0af684 100644
--- a/src/nmn-new-connection.h
+++ b/src/nmn-new-connection.h
@@ -30,20 +30,18 @@
 #define NMN_IS_NEW_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NMN_TYPE_NEW_CONNECTION))
 #define NMN_NEW_CONNECTION_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), NMN_TYPE_NEW_CONNECTION, NmnNewConnectionClass))
 
-#define NMN_NEW_CONNECTION_BUILDER "builder"
 #define NMN_NEW_CONNECTION_NM_DATA "nm-data"
 
 typedef struct {
-    GtkEventBox parent;
+    GtkVBox parent;
 } NmnNewConnection;
 
 typedef struct {
-    GtkEventBoxClass parent;
+    GtkVBoxClass parent;
 } NmnNewConnectionClass;
 
 GType nmn_new_connection_get_type (void);
 
-GtkWidget *nmn_new_connection_create (GtkBuilder *builder,
-                                      NmnNMData *nm_data);
+GtkWidget *nmn_new_connection_create (NmnNMData *nm_data);
 
 #endif /* NMN_NEW_CONNECTION_H */



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