[gnome-initial-setup] assistant: Remove next-page signal
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-initial-setup] assistant: Remove next-page signal
- Date: Tue, 19 Nov 2013 16:40:31 +0000 (UTC)
commit c97ae3ea8911724f19f3017d817d855ba282c02e
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Nov 5 20:06:26 2013 -0500
assistant: Remove next-page signal
gnome-initial-setup/gis-assistant.c | 78 +++++++++++-----------------------
gnome-initial-setup/gis-assistant.h | 2 -
2 files changed, 25 insertions(+), 55 deletions(-)
---
diff --git a/gnome-initial-setup/gis-assistant.c b/gnome-initial-setup/gis-assistant.c
index 26d8135..0080342 100644
--- a/gnome-initial-setup/gis-assistant.c
+++ b/gnome-initial-setup/gis-assistant.c
@@ -38,13 +38,6 @@ enum {
static GParamSpec *obj_props[PROP_LAST];
-enum {
- NEXT_PAGE,
- LAST_SIGNAL,
-};
-
-static guint signals[LAST_SIGNAL];
-
struct _GisAssistantPrivate
{
GtkWidget *forward;
@@ -94,17 +87,38 @@ gis_assistant_switch_to (GisAssistant *assistant,
gtk_stack_set_visible_child (GTK_STACK (priv->stack), GTK_WIDGET (page));
}
+static inline gboolean
+should_show_page (GList *l)
+{
+ return l != NULL && gtk_widget_get_visible (GTK_WIDGET (l->data));
+}
+
+static GisPage *
+find_next_page (GisPage *page)
+{
+ GList *l = page->assistant_priv->link->next;
+ while (!should_show_page (l)) {
+ l = l->next;
+ }
+ return GIS_PAGE (l->data);
+}
+
+static void
+switch_to_next_page (GisAssistant *assistant)
+{
+ GisAssistantPrivate *priv = gis_assistant_get_instance_private (assistant);
+ gis_assistant_switch_to (assistant, find_next_page (priv->current_page));
+}
+
static void
on_apply_done (GisPage *page,
gboolean valid,
gpointer user_data)
{
GisAssistant *assistant = GIS_ASSISTANT (user_data);
- GisAssistantPrivate *priv = gis_assistant_get_instance_private (assistant);
if (valid)
- g_signal_emit (assistant, signals[NEXT_PAGE], 0,
- priv->current_page);
+ switch_to_next_page (assistant);
g_object_unref (assistant);
}
@@ -117,31 +131,7 @@ gis_assistant_next_page (GisAssistant *assistant)
gis_page_apply_begin (priv->current_page, on_apply_done,
g_object_ref (assistant));
else
- g_signal_emit (assistant, signals[NEXT_PAGE], 0,
- priv->current_page);
-}
-
-static inline gboolean
-should_show_page (GList *l)
-{
- return l != NULL && gtk_widget_get_visible (GTK_WIDGET (l->data));
-}
-
-static GisPage *
-find_next_page (GisPage *page)
-{
- GList *l = page->assistant_priv->link->next;
- while (!should_show_page (l)) {
- l = l->next;
- }
- return GIS_PAGE (l->data);
-}
-
-static void
-gis_assistant_real_next_page (GisAssistant *assistant,
- GisPage *page)
-{
- gis_assistant_switch_to (assistant, find_next_page (page));
+ switch_to_next_page (assistant);
}
static GisPage *
@@ -467,8 +457,6 @@ gis_assistant_class_init (GisAssistantClass *klass)
gobject_class->get_property = gis_assistant_get_property;
- klass->next_page = gis_assistant_real_next_page;
-
obj_props[PROP_TITLE] =
g_param_spec_string ("title",
"", "",
@@ -476,20 +464,4 @@ gis_assistant_class_init (GisAssistantClass *klass)
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (gobject_class, PROP_LAST, obj_props);
-
- /**
- * 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, GIS_TYPE_PAGE);
}
diff --git a/gnome-initial-setup/gis-assistant.h b/gnome-initial-setup/gis-assistant.h
index f998b9c..c9d9465 100644
--- a/gnome-initial-setup/gis-assistant.h
+++ b/gnome-initial-setup/gis-assistant.h
@@ -46,8 +46,6 @@ struct _GisAssistant
struct _GisAssistantClass
{
GtkBoxClass parent_class;
-
- void (* next_page) (GisAssistant *assistant, GisPage *page);
};
GType gis_assistant_get_type (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]