[gnome-initial-setup] summary: Clean up a bit



commit 60b19b34b858b993ab9d9fe75fcc4002cf7e6fa7
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Oct 12 13:25:40 2012 -0400

    summary: Clean up a bit
    
    Don't use string comparisons to check if this is our widget

 .../pages/summary/gis-summary-page.c               |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/gnome-initial-setup/pages/summary/gis-summary-page.c b/gnome-initial-setup/pages/summary/gis-summary-page.c
index 8b1191a..c98edfc 100644
--- a/gnome-initial-setup/pages/summary/gis-summary-page.c
+++ b/gnome-initial-setup/pages/summary/gis-summary-page.c
@@ -20,9 +20,11 @@
 typedef struct _SummaryData SummaryData;
 
 struct _SummaryData {
+  SetupData *setup;
+  GtkWidget *widget;
+
   ActUser *user_account;
   const gchar *user_password;
-  SetupData *setup;
 };
 
 static gboolean
@@ -311,7 +313,7 @@ install_overrides (SetupData  *setup,
 static void
 prepare_cb (GisAssistant *assistant, GtkWidget *page, SummaryData *data)
 {
-  if (g_strcmp0 (gtk_widget_get_name (page), "summary-page") == 0)
+  if (page == data->widget)
     {
       gis_get_user_permissions (data->setup,
                                 &data->user_account,
@@ -328,6 +330,7 @@ gis_prepare_summary_page (SetupData *setup)
 
   data = g_slice_new0 (SummaryData);
   data->setup = setup;
+  data->widget = WID ("summary-page");
 
   g_signal_connect (assistant, "prepare", G_CALLBACK (prepare_cb), data);
 
@@ -336,7 +339,7 @@ gis_prepare_summary_page (SetupData *setup)
   g_signal_connect (WID("summary-start-button"), "clicked", G_CALLBACK (byebye_cb), data);
   g_signal_connect (WID("summary-tour-button"), "clicked", G_CALLBACK (tour_cb), data);
 
-  gis_assistant_add_page (assistant, WID ("summary-page"));
-  gis_assistant_set_page_title (assistant, WID ("summary-page"), _("Thank You"));
-  gis_assistant_set_page_complete (assistant, WID ("summary-page"), TRUE);
+  gis_assistant_add_page (assistant, data->widget);
+  gis_assistant_set_page_title (assistant, data->widget, _("Thank You"));
+  gis_assistant_set_page_complete (assistant, data->widget, TRUE);
 }



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