[gnome-initial-setup] Move split out page structs into private structs



commit 9fcbc5137700cedb5df4f5c030b84892f7c1561c
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Jun 12 09:48:08 2012 -0400

    Move split out page structs into private structs
    
    Now that we're using pimpls to SetupData, we don't need this.

 gnome-initial-setup/gis-eula-pages.c      |    3 +--
 gnome-initial-setup/gis-eula-pages.h      |    8 +-------
 gnome-initial-setup/gis-goa-page.c        |   13 +++++++++++--
 gnome-initial-setup/gis-goa-page.h        |   10 +---------
 gnome-initial-setup/gis-location-page.c   |   16 ++++++++++++++--
 gnome-initial-setup/gis-location-page.h   |   13 +------------
 gnome-initial-setup/gis-network-page.c    |   21 +++++++++++++++++++--
 gnome-initial-setup/gis-network-page.h    |   18 +-----------------
 gnome-initial-setup/gis-welcome-page.c    |    3 +--
 gnome-initial-setup/gis-welcome-page.h    |    8 +-------
 gnome-initial-setup/gnome-initial-setup.c |   27 +++++----------------------
 11 files changed, 56 insertions(+), 84 deletions(-)
---
diff --git a/gnome-initial-setup/gis-eula-pages.c b/gnome-initial-setup/gis-eula-pages.c
index cd50376..0e40ff9 100644
--- a/gnome-initial-setup/gis-eula-pages.c
+++ b/gnome-initial-setup/gis-eula-pages.c
@@ -121,14 +121,13 @@ build_eula_page (SetupData *setup,
 }
 
 void
-gis_prepare_eula_pages (EulasData *data)
+gis_prepare_eula_pages (SetupData *setup)
 {
   gchar *eulas_dir_path;
   GFile *eulas_dir;
   GError *error = NULL;
   GFileEnumerator *enumerator = NULL;
   GFileInfo *info;
-  SetupData *setup = data->setup;
 
   eulas_dir_path = g_build_filename (UIDIR, "eulas", NULL);
   eulas_dir = g_file_new_for_path (eulas_dir_path);
diff --git a/gnome-initial-setup/gis-eula-pages.h b/gnome-initial-setup/gis-eula-pages.h
index 5bd2f6b..a8ddf14 100644
--- a/gnome-initial-setup/gis-eula-pages.h
+++ b/gnome-initial-setup/gis-eula-pages.h
@@ -7,13 +7,7 @@
 
 G_BEGIN_DECLS
 
-typedef struct _EulasData EulasData;
-
-struct _EulasData {
-  SetupData *setup;
-};
-
-void gis_prepare_eula_pages (EulasData *data);
+void gis_prepare_eula_pages (SetupData *setup);
 
 G_END_DECLS
 
diff --git a/gnome-initial-setup/gis-goa-page.c b/gnome-initial-setup/gis-goa-page.c
index 130a0fa..bfb41fa 100644
--- a/gnome-initial-setup/gis-goa-page.c
+++ b/gnome-initial-setup/gis-goa-page.c
@@ -8,6 +8,14 @@
 #include <glib/gi18n.h>
 #include <gio/gio.h>
 
+typedef struct _GoaData GoaData;
+
+struct _GoaData {
+  SetupData *setup;
+  /* online data */
+  GoaClient *goa_client;
+};
+
 static GtkWidget *
 create_provider_button (const gchar *type, const gchar *name, GIcon *icon)
 {
@@ -330,11 +338,12 @@ goa_account_removed (GoaClient *client, GoaObject *object, gpointer user_data)
 }
 
 void
-gis_prepare_online_page (GoaData *data)
+gis_prepare_online_page (SetupData *setup)
 {
   GtkWidget *button;
   GError *error = NULL;
-  SetupData *setup = data->setup;
+  GoaData *data = g_slice_new (GoaData);
+  data->setup = setup;
 
   data->goa_client = goa_client_new_sync (NULL, &error);
   if (data->goa_client == NULL)
diff --git a/gnome-initial-setup/gis-goa-page.h b/gnome-initial-setup/gis-goa-page.h
index 1c72779..dee5737 100644
--- a/gnome-initial-setup/gis-goa-page.h
+++ b/gnome-initial-setup/gis-goa-page.h
@@ -12,15 +12,7 @@
 
 G_BEGIN_DECLS
 
-typedef struct _GoaData GoaData;
-
-struct _GoaData {
-  SetupData *setup;
-  /* online data */
-  GoaClient *goa_client;
-};
-
-void gis_prepare_online_page (GoaData *data);
+void gis_prepare_online_page (SetupData *setup);
 
 G_END_DECLS
 
diff --git a/gnome-initial-setup/gis-location-page.c b/gnome-initial-setup/gis-location-page.c
index fee854b..f15b98b 100644
--- a/gnome-initial-setup/gis-location-page.c
+++ b/gnome-initial-setup/gis-location-page.c
@@ -16,6 +16,17 @@
 
 #define DEFAULT_TZ "Europe/London"
 
+typedef struct _LocationData LocationData;
+
+struct _LocationData {
+  SetupData *setup;
+
+  /* location data */
+  CcTimezoneMap *map;
+  TzLocation *current_location;
+  Timedate1 *dtm;
+};
+
 static void
 set_timezone_cb (GObject      *source,
                  GAsyncResult *res,
@@ -217,13 +228,14 @@ determine_location (GtkWidget    *widget,
 #endif
 
 void
-gis_prepare_location_page (LocationData *data)
+gis_prepare_location_page (SetupData *setup)
 {
   GtkWidget *frame, *map, *entry;
   GWeatherLocation *world;
   GError *error;
   const gchar *timezone;
-  SetupData *setup = data->setup;
+  LocationData *data = g_slice_new (LocationData);
+  data->setup = setup;
 
   frame = WID("location-map-frame");
 
diff --git a/gnome-initial-setup/gis-location-page.h b/gnome-initial-setup/gis-location-page.h
index e5fc77d..1bdd338 100644
--- a/gnome-initial-setup/gis-location-page.h
+++ b/gnome-initial-setup/gis-location-page.h
@@ -13,18 +13,7 @@
 
 G_BEGIN_DECLS
 
-typedef struct _LocationData LocationData;
-
-struct _LocationData {
-  SetupData *setup;
-
-  /* location data */
-  CcTimezoneMap *map;
-  TzLocation *current_location;
-  Timedate1 *dtm;
-};
-
-void gis_prepare_location_page (LocationData *data);
+void gis_prepare_location_page (SetupData *setup);
 
 G_END_DECLS
 
diff --git a/gnome-initial-setup/gis-network-page.c b/gnome-initial-setup/gis-network-page.c
index aa30b46..1f42740 100644
--- a/gnome-initial-setup/gis-network-page.c
+++ b/gnome-initial-setup/gis-network-page.c
@@ -14,6 +14,22 @@
 #include "panel-cell-renderer-mode.h"
 #include "panel-cell-renderer-security.h"
 
+typedef struct _NetworkData NetworkData;
+
+struct _NetworkData {
+  SetupData *setup;
+
+  /* network data */
+  NMClient *nm_client;
+  NMRemoteSettings *nm_settings;
+  NMDevice *nm_device;
+  GtkListStore *ap_list;
+  gboolean refreshing;
+
+  GtkTreeRowReference *row;
+  guint pulse;
+};
+
 enum {
   PANEL_WIRELESS_COLUMN_ID,
   PANEL_WIRELESS_COLUMN_TITLE,
@@ -596,7 +612,7 @@ bump_pulse (gpointer user_data)
 }
 
 void
-gis_prepare_network_page (NetworkData *data)
+gis_prepare_network_page (SetupData *setup)
 {
   GtkTreeViewColumn *col;
   GtkCellRenderer *cell;
@@ -607,7 +623,8 @@ gis_prepare_network_page (NetworkData *data)
   guint i;
   DBusGConnection *bus;
   GError *error;
-  SetupData *setup = data->setup;
+  NetworkData *data = g_slice_new (NetworkData);
+  data->setup = setup;
 
   col = OBJ(GtkTreeViewColumn*, "network-list-column");
 
diff --git a/gnome-initial-setup/gis-network-page.h b/gnome-initial-setup/gis-network-page.h
index 5dc45dd..cd18fb3 100644
--- a/gnome-initial-setup/gis-network-page.h
+++ b/gnome-initial-setup/gis-network-page.h
@@ -13,23 +13,7 @@
 
 G_BEGIN_DECLS
 
-typedef struct _NetworkData NetworkData;
-
-struct _NetworkData {
-  SetupData *setup;
-
-  /* network data */
-  NMClient *nm_client;
-  NMRemoteSettings *nm_settings;
-  NMDevice *nm_device;
-  GtkListStore *ap_list;
-  gboolean refreshing;
-
-  GtkTreeRowReference *row;
-  guint pulse;
-};
-
-void gis_prepare_network_page (NetworkData *data);
+void gis_prepare_network_page (SetupData *setup);
 
 G_END_DECLS
 
diff --git a/gnome-initial-setup/gis-welcome-page.c b/gnome-initial-setup/gis-welcome-page.c
index b3c0fbb..50b6f13 100644
--- a/gnome-initial-setup/gis-welcome-page.c
+++ b/gnome-initial-setup/gis-welcome-page.c
@@ -11,10 +11,9 @@
 #include <gtk/gtk.h>
 
 void
-gis_prepare_welcome_page (WelcomeData *data)
+gis_prepare_welcome_page (SetupData *setup)
 {
   gchar *s;
-  SetupData *setup = data->setup;
   GKeyFile *overrides = gis_get_overrides (setup);
 
   s = g_key_file_get_locale_string (overrides,
diff --git a/gnome-initial-setup/gis-welcome-page.h b/gnome-initial-setup/gis-welcome-page.h
index a94a0d8..d67eecf 100644
--- a/gnome-initial-setup/gis-welcome-page.h
+++ b/gnome-initial-setup/gis-welcome-page.h
@@ -7,13 +7,7 @@
 
 G_BEGIN_DECLS
 
-typedef struct _WelcomeData WelcomeData;
-
-struct _WelcomeData {
-  SetupData *setup;
-};
-
-void gis_prepare_welcome_page (WelcomeData *data);
+void gis_prepare_welcome_page (SetupData *setup);
 
 G_END_DECLS
 
diff --git a/gnome-initial-setup/gnome-initial-setup.c b/gnome-initial-setup/gnome-initial-setup.c
index 6e87b5a..55572b1 100644
--- a/gnome-initial-setup/gnome-initial-setup.c
+++ b/gnome-initial-setup/gnome-initial-setup.c
@@ -60,12 +60,6 @@ struct _SetupData {
         GtkWidget *photo_dialog;
         GdkPixbuf *avatar_pixbuf;
         gchar *avatar_filename;
-
-        WelcomeData welcome_data;
-        EulasData eulas_data;
-        LocationData location_data;
-        NetworkData network_data;
-        GoaData goa_data;
 };
 
 #include "gis-account-page.c"
@@ -103,23 +97,12 @@ prepare_assistant (SetupData *setup)
         /* connect to gdm slave */
         connect_to_slave (setup);
 
-        setup->welcome_data.setup = setup;
-        gis_prepare_welcome_page (&setup->welcome_data);
-
-        setup->eulas_data.setup = setup;
-        gis_prepare_eula_pages (&setup->eulas_data);
-
-        setup->network_data.setup = setup;
-        gis_prepare_network_page (&setup->network_data);
-
+        gis_prepare_welcome_page (setup);
+        gis_prepare_eula_pages (setup);
+        gis_prepare_network_page (setup);
         prepare_account_page (setup);
-
-        setup->location_data.setup = setup;
-        gis_prepare_location_page (&setup->location_data);
-
-        setup->goa_data.setup = setup;
-        gis_prepare_online_page (&setup->goa_data);
-
+        gis_prepare_location_page (setup);
+        gis_prepare_online_page (setup);
         prepare_summary_page (setup);
 }
 



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