[gnome-color-manager] trivial: detect colorimeter devices that are not registered in usb.ids



commit decd326554e6332c0307182f4fc580aaf00c857e
Author: Richard Hughes <richard hughsie com>
Date:   Mon Feb 22 11:45:12 2010 +0000

    trivial: detect colorimeter devices that are not registered in usb.ids

 src/gcm-colorimeter.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/src/gcm-colorimeter.c b/src/gcm-colorimeter.c
index bc2cb62..b6a3536 100644
--- a/src/gcm-colorimeter.c
+++ b/src/gcm-colorimeter.c
@@ -313,7 +313,7 @@ gcm_colorimeter_device_add (GcmColorimeter *colorimeter, GUdevDevice *device)
 		priv->colorimeter_kind = GCM_COLORIMETER_KIND_COLOR_MUNKI;
 	} else if (g_strcmp0 (priv->model, "SpyderXXX") == 0) {
 		priv->colorimeter_kind = GCM_COLORIMETER_KIND_SPYDER;
-	} else {
+	} else if (priv->model != NULL) {
 		egg_warning ("Failed to recognise color device: %s", priv->model);
 
 		/* show dialog, in order to help the project */
@@ -331,6 +331,24 @@ gcm_colorimeter_device_add (GcmColorimeter *colorimeter, GUdevDevice *device)
 		gtk_dialog_run (GTK_DIALOG (dialog));
 		gtk_widget_destroy (dialog);
 		priv->colorimeter_kind = GCM_COLORIMETER_KIND_UNKNOWN;
+	} else {
+		egg_warning ("Failed to recognise color device");
+
+		/* show dialog, in order to help the project */
+		dialog = gtk_message_dialog_new (NULL,
+						 GTK_DIALOG_MODAL,
+						 GTK_MESSAGE_INFO,
+						 GTK_BUTTONS_OK,
+						 /* TRANSLATORS: this is when the device is not recognised */
+						 _("Colorimeter not registered"));
+		gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+							  "The device has not been registered in usb.ids. "
+							  "It should work okay, but if you want to help the project, "
+							  "please visit %s and supply the required information.",
+							  "http://live.gnome.org/GnomeColorManager/Help";);
+		gtk_dialog_run (GTK_DIALOG (dialog));
+		gtk_widget_destroy (dialog);
+		priv->colorimeter_kind = GCM_COLORIMETER_KIND_UNKNOWN;
 	}
 
 	/* signal the addition */



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