[gnome-control-center] color: Get the target whitepoint from the colord schema



commit 7e6ca7f5201a0e0d4d8ef8d58f0fbff76d4af878
Author: Richard Hughes <richard hughsie com>
Date:   Fri Jan 18 16:05:18 2013 +0000

    color: Get the target whitepoint from the colord schema

 panels/color/cc-color-calibrate.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/panels/color/cc-color-calibrate.c b/panels/color/cc-color-calibrate.c
index 3932d82..41e0a3c 100644
--- a/panels/color/cc-color-calibrate.c
+++ b/panels/color/cc-color-calibrate.c
@@ -58,6 +58,8 @@ struct _CcColorCalibratePrivate
 
 #define CD_SESSION_ERROR   cc_color_calibrate_error_quark()
 
+#define COLORD_SETTINGS_SCHEMA  "org.freedesktop.ColorHelper"
+
 G_DEFINE_TYPE (CcColorCalibrate, cc_color_calibrate, G_TYPE_OBJECT)
 
 static GQuark
@@ -1016,6 +1018,7 @@ cc_color_calibrate_init (CcColorCalibrate *calibrate)
   CcColorCalibratePrivate *priv = calibrate->priv;
   GError *error = NULL;
   gint retval;
+  GSettings *settings;
   GtkBox *box;
   GtkWidget *widget;
   GtkWindow *window;
@@ -1046,8 +1049,10 @@ cc_color_calibrate_init (CcColorCalibrate *calibrate)
   gtk_widget_set_vexpand (priv->sample_widget, FALSE);
   gtk_widget_set_hexpand (priv->sample_widget, FALSE);
 
-  /* get default: FIXME: get from colord */
-  calibrate->priv->target_whitepoint = 6500;
+  /* get defaults */
+  settings = g_settings_new (COLORD_SETTINGS_SCHEMA);
+  calibrate->priv->target_whitepoint = g_settings_get_int (settings, "display-whitepoint");
+  g_object_unref (settings);
 
   /* connect to buttons */
   widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,



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