[gnome-color-manager] Default to not bothering the user with notification



commit 79a2cf2a639e735a4d0488735456535d17881150
Author: Richard Hughes <richard hughsie com>
Date:   Fri May 21 14:31:06 2010 +0100

    Default to not bothering the user with notification

 data/org.gnome.color-manager.gschema.xml |    5 +++++
 src/gcm-session.c                        |    6 ++++++
 src/gcm-utils.h                          |    1 +
 3 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/data/org.gnome.color-manager.gschema.xml b/data/org.gnome.color-manager.gschema.xml
index cd0246e..ce2c1fb 100644
--- a/data/org.gnome.color-manager.gschema.xml
+++ b/data/org.gnome.color-manager.gschema.xml
@@ -5,6 +5,11 @@
       <summary>The default gamma to use for monitors with no previous value set</summary>
       <description>Gamma is adjusted to affect the color of the attached monitor. Traditionally Linux has used a gamma value of 1.0, but this makes monitors look washed out compared Windows XP or OS X. Apple traditionally used a value of 1.8 for a long time, but now use the same value as Microsoft. Microsoft has always used a value of 2.2.</description>
     </key>
+    <key name="show-notifications" type="b">
+      <default>false</default>
+      <summary>If notifications should be shown</summary>
+      <description>If set to TRUE then notifications and messages will be used.</description>
+    </key>
     <key name="global-display-correction" type="b">
       <default>true</default>
       <summary>Whether the display should be globally corrected or left to applications</summary>
diff --git a/src/gcm-session.c b/src/gcm-session.c
index 07f9b2c..eff516c 100644
--- a/src/gcm-session.c
+++ b/src/gcm-session.c
@@ -212,6 +212,7 @@ gcm_session_added_cb (GcmClient *client, GcmDevice *device, gpointer user_data)
 	GcmDeviceKind kind;
 	const gchar *profile;
 	gchar *basename = NULL;
+	gboolean allow_notifications;
 
 	/* check we care */
 	kind = gcm_device_get_kind (device);
@@ -233,6 +234,11 @@ gcm_session_added_cb (GcmClient *client, GcmDevice *device, gpointer user_data)
 		goto out;
 	}
 
+	/* do we allow notifications */
+	allow_notifications = g_settings_get_boolean (settings, GCM_SETTINGS_SHOW_NOTIFICATIONS);
+	if (!allow_notifications)
+		goto out;
+
 	/* handle device */
 	gcm_session_notify_device (device);
 out:
diff --git a/src/gcm-utils.h b/src/gcm-utils.h
index 66386ce..3f9e5e0 100644
--- a/src/gcm-utils.h
+++ b/src/gcm-utils.h
@@ -46,6 +46,7 @@
 #define GCM_SETTINGS_USE_PROFILES_FROM_VOLUMES		"use-profiles-from-volumes"
 #define GCM_SETTINGS_CALIBRATION_LENGTH			"calibration-length"
 #define GCM_SETTINGS_SHOW_FINE_TUNING			"show-fine-tuning"
+#define GCM_SETTINGS_SHOW_NOTIFICATIONS			"show-notifications"
 
 #define GCM_SETTINGS_RECALIBRATE_PRINTER_THRESHOLD	"recalibrate-printer-threshold"
 #define GCM_SETTINGS_RECALIBRATE_DISPLAY_THRESHOLD	"recalibrate-display-threshold"



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