[gnome-color-manager] trivial: add a modal message dialog when the calibration command failed. Fixes #610491



commit a5fc9802cba0bb3fcfb2778953e8e8f67740d103
Author: Richard Hughes <richard hughsie com>
Date:   Fri Feb 19 20:57:21 2010 +0000

    trivial: add a modal message dialog when the calibration command failed. Fixes #610491

 src/gcm-calibrate-argyll.c |   31 +++++++++++++++++++++++++------
 src/gcm-prefs.c            |    3 ++-
 2 files changed, 27 insertions(+), 7 deletions(-)
---
diff --git a/src/gcm-calibrate-argyll.c b/src/gcm-calibrate-argyll.c
index 9ebfb75..5da5644 100644
--- a/src/gcm-calibrate-argyll.c
+++ b/src/gcm-calibrate-argyll.c
@@ -393,7 +393,10 @@ gcm_calibrate_argyll_display_neutralise (GcmCalibrateArgyll *calibrate_argyll, G
 		goto out;
 	}
 	if (priv->response == GTK_RESPONSE_REJECT) {
-		g_set_error_literal (error, 1, 0, "command failed to run successfully");
+		gchar *vte_text;
+		vte_text = vte_terminal_get_text (VTE_TERMINAL(priv->terminal), NULL, NULL, NULL);
+		g_set_error (error, 1, 0, "command failed to run successfully: %s", vte_text);
+		g_free (vte_text);
 		ret = FALSE;
 		goto out;
 	}
@@ -470,7 +473,10 @@ gcm_calibrate_argyll_display_generate_patches (GcmCalibrateArgyll *calibrate_arg
 		goto out;
 	}
 	if (priv->response == GTK_RESPONSE_REJECT) {
-		g_set_error_literal (error, 1, 0, "command failed to run successfully");
+		gchar *vte_text;
+		vte_text = vte_terminal_get_text (VTE_TERMINAL(priv->terminal), NULL, NULL, NULL);
+		g_set_error (error, 1, 0, "command failed to run successfully: %s", vte_text);
+		g_free (vte_text);
 		ret = FALSE;
 		goto out;
 	}
@@ -552,7 +558,10 @@ gcm_calibrate_argyll_display_draw_and_measure (GcmCalibrateArgyll *calibrate_arg
 		goto out;
 	}
 	if (priv->response == GTK_RESPONSE_REJECT) {
-		g_set_error_literal (error, 1, 0, "command failed to run successfully");
+		gchar *vte_text;
+		vte_text = vte_terminal_get_text (VTE_TERMINAL(priv->terminal), NULL, NULL, NULL);
+		g_set_error (error, 1, 0, "command failed to run successfully: %s", vte_text);
+		g_free (vte_text);
 		ret = FALSE;
 		goto out;
 	}
@@ -655,10 +664,14 @@ gcm_calibrate_argyll_display_generate_profile (GcmCalibrateArgyll *calibrate_arg
 		goto out;
 	}
 	if (priv->response == GTK_RESPONSE_REJECT) {
-		g_set_error_literal (error, 1, 0, "command failed to run successfully");
+		gchar *vte_text;
+		vte_text = vte_terminal_get_text (VTE_TERMINAL(priv->terminal), NULL, NULL, NULL);
+		g_set_error (error, 1, 0, "command failed to run successfully: %s", vte_text);
+		g_free (vte_text);
 		ret = FALSE;
 		goto out;
 	}
+
 out:
 	if (array != NULL)
 		g_ptr_array_unref (array);
@@ -861,7 +874,10 @@ gcm_calibrate_argyll_device_measure (GcmCalibrateArgyll *calibrate_argyll, GErro
 		goto out;
 	}
 	if (priv->response == GTK_RESPONSE_REJECT) {
-		g_set_error_literal (error, 1, 0, "command failed to run successfully");
+		gchar *vte_text;
+		vte_text = vte_terminal_get_text (VTE_TERMINAL(priv->terminal), NULL, NULL, NULL);
+		g_set_error (error, 1, 0, "command failed to run successfully: %s", vte_text);
+		g_free (vte_text);
 		ret = FALSE;
 		goto out;
 	}
@@ -972,7 +988,10 @@ gcm_calibrate_argyll_device_generate_profile (GcmCalibrateArgyll *calibrate_argy
 		goto out;
 	}
 	if (priv->response == GTK_RESPONSE_REJECT) {
-		g_set_error_literal (error, 1, 0, "command failed to run successfully");
+		gchar *vte_text;
+		vte_text = vte_terminal_get_text (VTE_TERMINAL(priv->terminal), NULL, NULL, NULL);
+		g_set_error (error, 1, 0, "command failed to run successfully: %s", vte_text);
+		g_free (vte_text);
 		ret = FALSE;
 		goto out;
 	}
diff --git a/src/gcm-prefs.c b/src/gcm-prefs.c
index 6cb5954..c410eae 100644
--- a/src/gcm-prefs.c
+++ b/src/gcm-prefs.c
@@ -311,7 +311,8 @@ gcm_prefs_calibrate_device (GcmCalibrate *calibrate)
 	window = GTK_WINDOW(gtk_builder_get_object (builder, "dialog_prefs"));
 	ret = gcm_calibrate_device (calibrate, window, &error);
 	if (!ret) {
-		egg_warning ("failed to calibrate: %s", error->message);
+		/* TRANSLATORS: could not calibrate */
+		gcm_prefs_error_dialog (_("Failed to calibrate"), error->message);
 		g_error_free (error);
 		goto out;
 	}



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