[gnome-initial-setup] gis-assistant: Add a next-page signal



commit e0d1915b4669812695f6128fd2c41fdb1c91a777
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Oct 12 13:30:16 2012 -0400

    gis-assistant: Add a next-page signal
    
    This will be used by the account page to create the account

 gnome-initial-setup/gis-assistant.c |   29 ++++++++++++++++++++++++++++-
 gnome-initial-setup/gis-assistant.h |    2 ++
 2 files changed, 30 insertions(+), 1 deletions(-)
---
diff --git a/gnome-initial-setup/gis-assistant.c b/gnome-initial-setup/gis-assistant.c
index bfc3d5c..86e7522 100644
--- a/gnome-initial-setup/gis-assistant.c
+++ b/gnome-initial-setup/gis-assistant.c
@@ -45,6 +45,7 @@ static GParamSpec *obj_props[PROP_LAST];
 
 enum {
   PREPARE,
+  NEXT_PAGE,
   LAST_SIGNAL,
 };
 
@@ -134,6 +135,15 @@ void
 gis_assistant_next_page (GisAssistant *assistant)
 {
   GisAssistantPrivate *priv = assistant->priv;
+  g_signal_emit (assistant, signals[NEXT_PAGE], 0,
+                 priv->current_page->widget);
+}
+
+static void
+gis_assistant_real_next_page (GisAssistant *assistant,
+                              GtkWidget    *leaving_page)
+{
+  GisAssistantPrivate *priv = assistant->priv;
   PageData *next_page;
 
   g_return_if_fail (priv->current_page != NULL);
@@ -154,7 +164,7 @@ gis_assistant_previous_page (GisAssistant *assistant)
   gis_assistant_switch_to (assistant, prev_page->widget);
 }
 
-static void
+ static void
 update_navigation_buttons (GisAssistant *assistant,
                            GtkWidget    *page)
 {
@@ -423,6 +433,7 @@ gis_assistant_class_init (GisAssistantClass *klass)
   gobject_class->finalize = gis_assistant_finalize;
 
   klass->prepare = gis_assistant_prepare;
+  klass->next_page = gis_assistant_real_next_page;
 
   obj_props[PROP_TITLE] =
     g_param_spec_string ("title",
@@ -431,6 +442,22 @@ gis_assistant_class_init (GisAssistantClass *klass)
                          G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
 
   /**
+   * GisAssistant::next-page:
+   * @assistant: the #GisAssistant
+   * @page: the page we're leaving
+   *
+   * The ::next-page signal is emitted when we're leaving
+   * a page, allowing a page to do something when it's left.
+   */
+  signals[NEXT_PAGE] =
+    g_signal_new ("next-page",
+                  G_TYPE_FROM_CLASS (gobject_class),
+                  G_SIGNAL_RUN_LAST,
+                  G_STRUCT_OFFSET (GisAssistantClass, next_page),
+                  NULL, NULL, NULL,
+                  G_TYPE_NONE, 1, GTK_TYPE_WIDGET);
+
+  /**
    * GisAssistant::prepare:
    * @assistant: the #GisAssistant
    * @page: the current page
diff --git a/gnome-initial-setup/gis-assistant.h b/gnome-initial-setup/gis-assistant.h
index e364313..1544b7c 100644
--- a/gnome-initial-setup/gis-assistant.h
+++ b/gnome-initial-setup/gis-assistant.h
@@ -32,6 +32,8 @@ struct _GisAssistantClass
   GtkBoxClass parent_class;
 
   void (* prepare) (GisAssistant *assistant, GtkWidget *page);
+  void (* next_page) (GisAssistant *assistant, GtkWidget *page);
+
   void (* switch_to) (GisAssistant *assistant, GtkWidget *page);
   void (* add_page) (GisAssistant *assistant, GtkWidget *page);
 };



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