[network-manager-netbook] Grow the expanded pane size to use the whole screen.



commit dd254a5ce3d25e72c956e32ffb1ef44ce567f0a2
Author: Tambet Ingo <tambet gmail com>
Date:   Fri Aug 28 15:26:40 2009 +0300

    Grow the expanded pane size to use the whole screen.

 src/Makefile.am              |    2 +
 src/nmn-connection-details.c |   25 +++++++++++-
 src/nmn-item-advanced.c      |   89 ++++++++++++++++++++++++++++++++++++++++++
 src/nmn-item-advanced.h      |   32 +++++++++++++++
 src/nmn-plug.c               |    2 +-
 5 files changed, 148 insertions(+), 2 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index fdd09fc..838be1d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -33,6 +33,8 @@ network_manager_netbook_SOURCES = \
 	nmn-icon-cache.h \
 	nmn-item.c \
 	nmn-item.h \
+	nmn-item-advanced.c \
+	nmn-item-advanced.h \
 	nmn-list.c \
 	nmn-list.h \
 	nmn-mobile-providers.c \
diff --git a/src/nmn-connection-details.c b/src/nmn-connection-details.c
index 3358a44..101fec5 100644
--- a/src/nmn-connection-details.c
+++ b/src/nmn-connection-details.c
@@ -4,8 +4,12 @@
 #include <arpa/inet.h>
 #include <nm-utils.h>
 #include "nmn-connection-details.h"
+#include "nmn-item-advanced.h"
 
-G_DEFINE_TYPE (NmnConnectionDetails, nmn_connection_details, GTK_TYPE_TABLE)
+static void item_advanced_init (NmnItemAdvanced *item_advanced_class);
+
+G_DEFINE_TYPE_EXTENDED (NmnConnectionDetails, nmn_connection_details, GTK_TYPE_TABLE, 0,
+                        G_IMPLEMENT_INTERFACE (NMN_TYPE_ITEM_ADVANCED, item_advanced_init))
 
 enum {
     PROP_0,
@@ -205,6 +209,25 @@ nmn_connection_details_set_config (NmnConnectionDetails *self,
     g_free (str);
 }
 
+static gboolean
+verify (NmnItemAdvanced *item_advanced)
+{
+    return FALSE;
+}
+
+static void
+save (NmnItemAdvanced *item_advanced)
+{
+}
+
+static void
+item_advanced_init (NmnItemAdvanced *item_advanced_class)
+{
+    /* interface implementation */
+    item_advanced_class->verify = verify;
+    item_advanced_class->save = save;
+}
+
 static void
 nmn_connection_details_init (NmnConnectionDetails *details)
 {
diff --git a/src/nmn-item-advanced.c b/src/nmn-item-advanced.c
new file mode 100644
index 0000000..caa36b8
--- /dev/null
+++ b/src/nmn-item-advanced.c
@@ -0,0 +1,89 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+
+#include <gtk/gtk.h>
+#include "nmn-item-advanced.h"
+
+enum {
+    CHANGED,
+
+    LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
+
+gboolean
+nmn_item_advanced_verify (NmnItemAdvanced *self)
+{
+    gboolean verified;
+
+    g_return_val_if_fail (NMN_IS_ITEM_ADVANCED (self), FALSE);
+
+    if (NMN_ITEM_ADVANCED_GET_INTERFACE (self)->verify)
+        verified = NMN_ITEM_ADVANCED_GET_INTERFACE (self)->verify (self);
+    else
+        verified = FALSE;
+
+    return verified;
+}
+
+void
+nmn_item_advanced_save (NmnItemAdvanced *self)
+{
+    g_return_if_fail (NMN_IS_ITEM_ADVANCED (self));
+
+    if (NMN_ITEM_ADVANCED_GET_INTERFACE (self)->save)
+        NMN_ITEM_ADVANCED_GET_INTERFACE (self)->save (self);
+}
+
+/*****************************************************************************/
+
+static void
+nmn_item_advanced_init (gpointer g_iface)
+{
+    GType iface_type = G_TYPE_FROM_INTERFACE (g_iface);
+    static gboolean initialized = FALSE;
+
+    if (initialized)
+        return;
+
+    /* Signals */
+    signals[CHANGED] =
+        g_signal_new ("changed",
+                      iface_type,
+                      G_SIGNAL_RUN_FIRST,
+                      G_STRUCT_OFFSET (NmnItemAdvanced, changed),
+                      NULL, NULL,
+                      g_cclosure_marshal_VOID__BOOLEAN,
+                      G_TYPE_NONE, 1,
+                      G_TYPE_BOOLEAN);
+
+    initialized = TRUE;
+}
+
+GType
+nmn_item_advanced_get_type (void)
+{
+    static GType type = 0;
+
+    if (!G_UNLIKELY (type)) {
+        const GTypeInfo info = {
+            sizeof (NmnItemAdvanced), /* class_size */
+            nmn_item_advanced_init,   /* base_init */
+            NULL,       /* base_finalize */
+            NULL,
+            NULL,       /* class_finalize */
+            NULL,       /* class_data */
+            0,
+            0,              /* n_preallocs */
+            NULL
+        };
+
+        type = g_type_register_static (G_TYPE_INTERFACE,
+                                       "NmnItemAdvanced",
+                                       &info, 0);
+
+        g_type_interface_add_prerequisite (type, GTK_TYPE_WIDGET);
+    }
+
+    return type;
+}
diff --git a/src/nmn-item-advanced.h b/src/nmn-item-advanced.h
new file mode 100644
index 0000000..a8a1d2a
--- /dev/null
+++ b/src/nmn-item-advanced.h
@@ -0,0 +1,32 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+
+#ifndef NMN_ITEM_ADVANCED_H
+#define NMN_ITEM_ADVANCED_H
+
+#include <glib-object.h>
+
+#define NMN_TYPE_ITEM_ADVANCED      (nmn_item_advanced_get_type ())
+#define NMN_ITEM_ADVANCED(obj)      (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMN_TYPE_ITEM_ADVANCED, NmnItemAdvanced))
+#define NMN_IS_ITEM_ADVANCED(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NMN_TYPE_ITEM_ADVANCED))
+#define NMN_ITEM_ADVANCED_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NMN_TYPE_ITEM_ADVANCED, NmnItemAdvanced))
+
+typedef struct _NmnItemAdvanced NmnItemAdvanced;
+
+struct _NmnItemAdvanced {
+    GTypeInterface g_iface;
+
+    /* Methods */
+    gboolean (*verify) (NmnItemAdvanced *self);
+    void (*save) (NmnItemAdvanced *self);
+
+    /* Signals */
+    void (*changed) (NmnItemAdvanced *self,
+                     gboolean complete);
+};
+
+GType nmn_item_advanced_get_type (void);
+
+gboolean nmn_item_advanced_verify (NmnItemAdvanced *self);
+void     nmn_item_advanced_save   (NmnItemAdvanced *self);
+
+#endif /* NMN_ITEM_ADVANCED_H */
diff --git a/src/nmn-plug.c b/src/nmn-plug.c
index 1e93feb..344dbd9 100644
--- a/src/nmn-plug.c
+++ b/src/nmn-plug.c
@@ -44,7 +44,7 @@ nmn_plug_push (NmnPlug *self,
         screen = gtk_widget_get_screen (GTK_WIDGET (self));
         gtk_widget_set_size_request (widget,
                                      gdk_screen_get_width (screen) - 2 * PADDING,
-                                     300);
+                                     500);
     }
 
     gtk_container_add (GTK_CONTAINER (self), widget);



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