[gnome-color-manager/gnome-3-2] trivial: show the nautilus window only when the calibration has *completed*



commit c0b15fc8ebce31744624b5f03386f73865238ed8
Author: Richard Hughes <richard hughsie com>
Date:   Thu May 10 10:35:27 2012 +0100

    trivial: show the nautilus window only when the calibration has *completed*

 src/gcm-calibrate-main.c |  107 +++++++++++++++++++++++-----------------------
 1 files changed, 54 insertions(+), 53 deletions(-)
---
diff --git a/src/gcm-calibrate-main.c b/src/gcm-calibrate-main.c
index c653dc6..25a7792 100644
--- a/src/gcm-calibrate-main.c
+++ b/src/gcm-calibrate-main.c
@@ -562,6 +562,54 @@ gcm_calib_assistant_page_forward_cb (gint current_page, gpointer user_data)
 }
 
 /**
+ * gcm_calibrate_show_profile_location:
+ **/
+static void
+gcm_calibrate_show_profile_location (void)
+{
+	gboolean ret;
+	gchar *command_line;
+	GError *error = NULL;
+
+	/* just hardcode nautilus to open the folder */
+	command_line = g_strdup_printf ("nautilus %s/%s",
+					g_get_user_data_dir (),
+					"icc");
+	ret = g_spawn_command_line_async (command_line, &error);
+	if (!ret) {
+		g_warning ("failed to show profile: %s", error->message);
+		g_error_free (error);
+		goto out;
+	}
+out:
+	g_free (command_line);
+}
+
+/**
+ * gcm_calibrate_is_livecd:
+ **/
+static gboolean
+gcm_calibrate_is_livecd (void)
+{
+	gboolean ret;
+	gchar *data = NULL;
+	GError *error = NULL;
+
+	/* get the kernel commandline */
+	ret = g_file_get_contents ("/proc/cmdline", &data, NULL, &error);
+	if (!ret) {
+		g_warning ("failed to get kernel command line: %s",
+			   error->message);
+		g_error_free (error);
+		goto out;
+	}
+	ret = g_strstr_len (data, -1, "liveimg") != NULL;
+out:
+	g_free (data);
+	return ret;
+}
+
+/**
  * gcm_calib_assistant_prepare_cb:
  **/
 static gboolean
@@ -569,12 +617,18 @@ gcm_calib_assistant_prepare_cb (GtkAssistant *assistant,
 				GtkWidget *page_widget,
 				GcmCalibratePriv *calib)
 {
+	gboolean ret;
 	calib->current_page = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (page_widget),
 								   "GcmCalibrateMain::Index"));
 	switch (calib->current_page) {
 	case GCM_CALIBRATE_PAGE_LAST:
 		gcm_calib_device_uninihibit (calib);
 		gcm_calib_play_sound (calib);
+
+		/* show the user the profile to copy off the live system */
+		ret = gcm_calibrate_is_livecd ();
+		if (ret)
+			gcm_calibrate_show_profile_location ();
 		break;
 	case GCM_CALIBRATE_PAGE_ACTION:
 		g_debug ("lights! camera! action!");
@@ -764,54 +818,6 @@ gcm_calib_setup_page_intro (GcmCalibratePriv *calib)
 }
 
 /**
- * gcm_calibrate_is_livecd:
- **/
-static gboolean
-gcm_calibrate_is_livecd (void)
-{
-	gboolean ret;
-	gchar *data = NULL;
-	GError *error = NULL;
-
-	/* get the kernel commandline */
-	ret = g_file_get_contents ("/proc/cmdline", &data, NULL, &error);
-	if (!ret) {
-		g_warning ("failed to get kernel command line: %s",
-			   error->message);
-		g_error_free (error);
-		goto out;
-	}
-	ret = g_strstr_len (data, -1, "liveimg") != NULL;
-out:
-	g_free (data);
-	return ret;
-}
-
-/**
- * gcm_calibrate_show_profile_location:
- **/
-static void
-gcm_calibrate_show_profile_location (void)
-{
-	gboolean ret;
-	gchar *command_line;
-	GError *error = NULL;
-
-	/* just hardcode nautilus to open the folder */
-	command_line = g_strdup_printf ("nautilus %s/%s",
-					g_get_user_data_dir (),
-					"icc");
-	ret = g_spawn_command_line_async (command_line, &error);
-	if (!ret) {
-		g_warning ("failed to show profile: %s", error->message);
-		g_error_free (error);
-		goto out;
-	}
-out:
-	g_free (command_line);
-}
-
-/**
  * gcm_calib_setup_page_summary:
  **/
 static void
@@ -873,11 +879,6 @@ gcm_calib_setup_page_summary (GcmCalibratePriv *calib)
 			   "GcmCalibrateMain::Index",
 			   GUINT_TO_POINTER (GCM_CALIBRATE_PAGE_LAST));
 
-	/* show the user the profile to copy off the live system */
-	ret = gcm_calibrate_is_livecd ();
-	if (ret)
-		gcm_calibrate_show_profile_location ();
-
 	/* show page */
 	gtk_widget_show_all (vbox);
 }



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