[Xfce4-commits] [xfce/xfce4-settings] 02/37: display: Preparations for colord support

noreply at xfce.org noreply at xfce.org
Fri Feb 15 00:27:31 CET 2019


This is an automated email from the git hooks/post-receive script.

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       o   c   h   o   s   i   /   c   o   l   o   r   d   
   in repository xfce/xfce4-settings.

commit 4d2096acd5843f5aad78a3861a0a44fbf10e6418
Author: Simon Steinbeiß <simon.steinbeiss at tttech.com>
Date:   Sat Feb 2 23:41:49 2019 +0100

    display: Preparations for colord support
---
 configure.ac.in                               | 12 +++++++++++
 dialogs/display-settings/Makefile.am          |  9 ++++++++
 dialogs/display-settings/display-dialog.glade | 30 +++++++++++++++++++++++++++
 dialogs/display-settings/main.c               |  8 +++++--
 dialogs/display-settings/xfce-randr.c         |  4 ++--
 5 files changed, 59 insertions(+), 4 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index e57e790..148093d 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -158,6 +158,13 @@ dnl **************************************
 XDT_CHECK_OPTIONAL_PACKAGE([LIBNOTIFY], [libnotify], [0.1.3],
                            [libnotify], [Notification support])
 
+dnl **************************************
+dnl *** Optional support for colord ***
+dnl **************************************
+XDT_CHECK_OPTIONAL_PACKAGE([COLORD], [colord], [1.0.2],
+                          [colord], [colord support])
+
+
 dnl *********************
 dnl *** Mime settings ***
 dnl *********************
@@ -285,6 +292,11 @@ echo "* Libnotify support:         yes"
 else
 echo "* Libnotify support:         no"
 fi
+if test x"$COLORD_FOUND" = x"yes"; then
+echo "* colord support:            yes"
+else
+echo "* colord support:            no"
+fi
 if test x"$XCURSOR_FOUND" = x"yes"; then
 echo "* Xcursor support:           yes"
 else
diff --git a/dialogs/display-settings/Makefile.am b/dialogs/display-settings/Makefile.am
index 42351de..bd588a2 100644
--- a/dialogs/display-settings/Makefile.am
+++ b/dialogs/display-settings/Makefile.am
@@ -48,6 +48,15 @@ xfce4_display_settings_LDADD = \
 	$(XRANDR_LIBS) \
 	$(GLIB_LIBS)
 
+# Optional support for colord
+if HAVE_COLORD
+xfce4_display_settings_CFLAGS += \
+	$(COLORD_CFLAGS)
+
+xfce4_display_settings_LDADD += \
+	$(COLORD_LIBS)
+endif
+
 if MAINTAINER_MODE
 
 BUILT_SOURCES = \
diff --git a/dialogs/display-settings/display-dialog.glade b/dialogs/display-settings/display-dialog.glade
index 719164c..e54f965 100644
--- a/dialogs/display-settings/display-dialog.glade
+++ b/dialogs/display-settings/display-dialog.glade
@@ -3,6 +3,7 @@
 <interface>
   <requires lib="gtk+" version="3.20"/>
   <requires lib="libxfce4ui-2" version="4.13"/>
+  <object class="GtkListStore" id="color-profiles"/>
   <object class="GtkImage" id="image1">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
@@ -481,6 +482,35 @@
                               </packing>
                             </child>
                             <child>
+                              <object class="GtkLabel" id="label-color">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="label" translatable="yes">Color Profile:</property>
+                                <property name="xalign">0</property>
+                              </object>
+                              <packing>
+                                <property name="left_attach">1</property>
+                                <property name="top_attach">6</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkComboBox" id="colord-profile">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="model">color-profiles</property>
+                              </object>
+                              <packing>
+                                <property name="left_attach">2</property>
+                                <property name="top_attach">6</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
                               <placeholder/>
                             </child>
                             <child>
diff --git a/dialogs/display-settings/main.c b/dialogs/display-settings/main.c
index 6912cb1..6b6d75d 100644
--- a/dialogs/display-settings/main.c
+++ b/dialogs/display-settings/main.c
@@ -36,6 +36,10 @@
 #include <gdk/gdkx.h>
 #include <gdk/gdkkeysyms.h>
 
+#ifdef HAVE_COLORD
+#include <colord.h>
+#endif
+
 #include <xfconf/xfconf.h>
 #include <exo/exo.h>
 #include <libxfce4ui/libxfce4ui.h>
@@ -1269,7 +1273,7 @@ display_settings_get_profiles (void)
             gchar **display_infos_tokens;
 
             display_infos_tokens = g_strsplit (display_infos[m], "/", 2);
-            property = g_strdup_printf ("/%s/%s/EDID", buf, display_infos_tokens[0]);
+            property = g_strdup_printf ("/%s/%s/OutputEdidMd5", buf, display_infos_tokens[0]);
             current_edid = xfconf_channel_get_string (display_channel, property, NULL);
             output_edid = g_strdup_printf ("%s/%s", display_infos_tokens[0], current_edid);
             if (current_edid)
@@ -1628,7 +1632,7 @@ display_settings_profile_create_cb (GtkWidget *widget, GtkBuilder *builder)
         gchar *property;
         gchar *profile_hash;
 
-        profile_hash = g_compute_checksum_for_string (G_CHECKSUM_SHA1, profile_name, strlen(profile_name));
+        profile_hash = g_compute_checksum_for_string (G_CHECKSUM_MD5, profile_name, strlen(profile_name));
         property = g_strdup_printf ("/%s", profile_hash);
         for (i = 0; i < xfce_randr->noutput; i++)
             xfce_randr_save_output (xfce_randr, profile_hash, display_channel, i);
diff --git a/dialogs/display-settings/xfce-randr.c b/dialogs/display-settings/xfce-randr.c
index 98ccb59..07e1b2a 100644
--- a/dialogs/display-settings/xfce-randr.c
+++ b/dialogs/display-settings/xfce-randr.c
@@ -425,7 +425,7 @@ xfce_randr_save_output (XfceRandr     *randr,
                 randr->priv->output_info[output]->name);
     xfconf_channel_set_bool (channel, property, mode != NULL);
 
-    g_snprintf (property, sizeof (property), "/%s/%s/EDID", scheme,
+    g_snprintf (property, sizeof (property), "/%s/%s/OutputEdidMd5", scheme,
                 randr->priv->output_info[output]->name);
     xfconf_channel_set_string (channel, property, randr->priv->edid[output]);
 
@@ -564,7 +564,7 @@ xfce_randr_friendly_name (XfceRandr *randr,
 
     if (edid_data) {
         info = decode_edid (edid_data);
-        randr->priv->edid[output] = g_compute_checksum_for_data (G_CHECKSUM_SHA1 , edid_data, 128);
+        randr->priv->edid[output] = g_compute_checksum_for_data (G_CHECKSUM_MD5 , edid_data, 128);
     }
 
     /* special case, a laptop */

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list