[gnome-initial-setup] gis-assistant: Don't store the current action



commit fdfe331d91814f0bdc8fa1ed55dc914bc165fbad
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Feb 25 13:58:32 2013 -0500

    gis-assistant: Don't store the current action
    
    Just a simple cleanup.

 gnome-initial-setup/gis-assistant.c |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/gnome-initial-setup/gis-assistant.c b/gnome-initial-setup/gis-assistant.c
index 847ab45..a6ab465 100644
--- a/gnome-initial-setup/gis-assistant.c
+++ b/gnome-initial-setup/gis-assistant.c
@@ -58,7 +58,6 @@ struct _GisAssistantPrivate
   GtkWidget *main_layout;
   GtkWidget *action_area;
   GtkWidget *page_action_widget_area;
-  GtkWidget *current_action;
 
   GList *pages;
   GisPage *current_page;
@@ -140,18 +139,26 @@ gis_assistant_previous_page (GisAssistant *assistant)
 }
 
 static void
+remove_from_page_action_area (GtkWidget *widget,
+                              gpointer   user_data)
+{
+  GisAssistantPrivate *priv = user_data;
+  gtk_container_remove (GTK_CONTAINER (priv->page_action_widget_area), widget);
+}
+
+static void
 update_action_widget (GisAssistant *assistant)
 {
   GisAssistantPrivate *priv = assistant->priv;
+  GtkWidget *action;
 
-  if (priv->current_action)
-    gtk_container_remove (GTK_CONTAINER (priv->page_action_widget_area),
-                          priv->current_action);
+  gtk_container_foreach (GTK_CONTAINER (priv->page_action_widget_area),
+                         remove_from_page_action_area, priv);
 
-  priv->current_action = gis_page_get_action_widget (priv->current_page);
-  if (priv->current_action)
+  action = gis_page_get_action_widget (priv->current_page);
+  if (action)
     gtk_container_add (GTK_CONTAINER (priv->page_action_widget_area),
-                       priv->current_action);
+                       action);
 }
 
 static void


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