[gnome-color-manager] Add the profile datetime and colorspace into the UI



commit 43146dc7627149e57cc5c1481fa549b64433ea6a
Author: Richard Hughes <richard hughsie com>
Date:   Thu Dec 3 13:01:45 2009 +0000

    Add the profile datetime and colorspace into the UI

 data/gcm-prefs.ui |  162 +++++++++++++++++++++++++++++++++++++++++++----------
 src/gcm-prefs.c   |   87 ++++++++++++++++++++++++++++-
 2 files changed, 218 insertions(+), 31 deletions(-)
---
diff --git a/data/gcm-prefs.ui b/data/gcm-prefs.ui
index 03cc861..ba775a4 100644
--- a/data/gcm-prefs.ui
+++ b/data/gcm-prefs.ui
@@ -644,16 +644,16 @@
                                         <property name="visible">True</property>
                                         <property name="orientation">vertical</property>
                                         <child>
-                                          <object class="GtkHBox" id="hbox_profile_manufacturer">
+                                          <object class="GtkHBox" id="hbox_type">
                                             <property name="visible">True</property>
                                             <property name="spacing">9</property>
                                             <child>
-                                              <object class="GtkHBox" id="hbox5">
+                                              <object class="GtkHBox" id="hbox6">
                                                 <property name="visible">True</property>
                                                 <child>
-                                                  <object class="GtkLabel" id="label_title_profile_manufacturer">
+                                                  <object class="GtkLabel" id="label_title_type">
                                                     <property name="visible">True</property>
-                                                    <property name="label" translatable="yes" comments="The manufacturer of the profile">Device manufacturer:</property>
+                                                    <property name="label" translatable="yes" comments="The type of profile, e.g. display, scanner, etc.">Profile type:</property>
                                                   </object>
                                                   <packing>
                                                     <property name="expand">False</property>
@@ -667,12 +667,12 @@
                                               </packing>
                                             </child>
                                             <child>
-                                              <object class="GtkHBox" id="hbox11">
+                                              <object class="GtkHBox" id="hbox18">
                                                 <property name="visible">True</property>
                                                 <child>
-                                                  <object class="GtkLabel" id="label_profile_manufacturer">
+                                                  <object class="GtkLabel" id="label_type">
                                                     <property name="visible">True</property>
-                                                    <property name="label">manufacturer</property>
+                                                    <property name="label">input</property>
                                                     <property name="use_markup">True</property>
                                                     <property name="wrap">True</property>
                                                   </object>
@@ -695,16 +695,16 @@
                                           </packing>
                                         </child>
                                         <child>
-                                          <object class="GtkHBox" id="hbox_profile_model">
+                                          <object class="GtkHBox" id="hbox_colorspace">
                                             <property name="visible">True</property>
                                             <property name="spacing">9</property>
                                             <child>
-                                              <object class="GtkHBox" id="hbox34">
+                                              <object class="GtkHBox" id="hbox39">
                                                 <property name="visible">True</property>
                                                 <child>
-                                                  <object class="GtkLabel" id="label_title_profile_model">
+                                                  <object class="GtkLabel" id="label_title_colorspace">
                                                     <property name="visible">True</property>
-                                                    <property name="label" translatable="yes" comments="The manufacturer of the profile">Device model:</property>
+                                                    <property name="label" translatable="yes" comments="The profile colorspace, e.g. RGB">Colorspace:</property>
                                                   </object>
                                                   <packing>
                                                     <property name="expand">False</property>
@@ -718,12 +718,12 @@
                                               </packing>
                                             </child>
                                             <child>
-                                              <object class="GtkHBox" id="hbox35">
+                                              <object class="GtkHBox" id="hbox40">
                                                 <property name="visible">True</property>
                                                 <child>
-                                                  <object class="GtkLabel" id="label_profile_model">
+                                                  <object class="GtkLabel" id="label_colorspace">
                                                     <property name="visible">True</property>
-                                                    <property name="label">model</property>
+                                                    <property name="label">colorspace</property>
                                                     <property name="use_markup">True</property>
                                                     <property name="wrap">True</property>
                                                   </object>
@@ -746,16 +746,16 @@
                                           </packing>
                                         </child>
                                         <child>
-                                          <object class="GtkHBox" id="hbox_copyright">
+                                          <object class="GtkHBox" id="hbox_datetime">
                                             <property name="visible">True</property>
                                             <property name="spacing">9</property>
                                             <child>
-                                              <object class="GtkHBox" id="hbox10">
+                                              <object class="GtkHBox" id="hbox36">
                                                 <property name="visible">True</property>
                                                 <child>
-                                                  <object class="GtkLabel" id="label_title_copyright">
+                                                  <object class="GtkLabel" id="label_title_datetime">
                                                     <property name="visible">True</property>
-                                                    <property name="label" translatable="yes" comments="The licence of the profile, normally non-free">License:</property>
+                                                    <property name="label" translatable="yes" comments="When the profile was created">Created:</property>
                                                   </object>
                                                   <packing>
                                                     <property name="expand">False</property>
@@ -769,12 +769,12 @@
                                               </packing>
                                             </child>
                                             <child>
-                                              <object class="GtkHBox" id="hbox12">
+                                              <object class="GtkHBox" id="hbox37">
                                                 <property name="visible">True</property>
                                                 <child>
-                                                  <object class="GtkLabel" id="label_copyright">
+                                                  <object class="GtkLabel" id="label_datetime">
                                                     <property name="visible">True</property>
-                                                    <property name="label">non-free</property>
+                                                    <property name="label">datetime</property>
                                                     <property name="use_markup">True</property>
                                                     <property name="wrap">True</property>
                                                   </object>
@@ -797,16 +797,16 @@
                                           </packing>
                                         </child>
                                         <child>
-                                          <object class="GtkHBox" id="hbox_type">
+                                          <object class="GtkHBox" id="hbox_profile_manufacturer">
                                             <property name="visible">True</property>
                                             <property name="spacing">9</property>
                                             <child>
-                                              <object class="GtkHBox" id="hbox6">
+                                              <object class="GtkHBox" id="hbox5">
                                                 <property name="visible">True</property>
                                                 <child>
-                                                  <object class="GtkLabel" id="label_title_type">
+                                                  <object class="GtkLabel" id="label_title_profile_manufacturer">
                                                     <property name="visible">True</property>
-                                                    <property name="label" translatable="yes" comments="The type of profile, e.g. display, scanner, etc.">Profile type:</property>
+                                                    <property name="label" translatable="yes" comments="The manufacturer of the profile">Device manufacturer:</property>
                                                   </object>
                                                   <packing>
                                                     <property name="expand">False</property>
@@ -820,12 +820,12 @@
                                               </packing>
                                             </child>
                                             <child>
-                                              <object class="GtkHBox" id="hbox18">
+                                              <object class="GtkHBox" id="hbox11">
                                                 <property name="visible">True</property>
                                                 <child>
-                                                  <object class="GtkLabel" id="label_type">
+                                                  <object class="GtkLabel" id="label_profile_manufacturer">
                                                     <property name="visible">True</property>
-                                                    <property name="label">input</property>
+                                                    <property name="label">manufacturer</property>
                                                     <property name="use_markup">True</property>
                                                     <property name="wrap">True</property>
                                                   </object>
@@ -848,6 +848,108 @@
                                           </packing>
                                         </child>
                                         <child>
+                                          <object class="GtkHBox" id="hbox_profile_model">
+                                            <property name="visible">True</property>
+                                            <property name="spacing">9</property>
+                                            <child>
+                                              <object class="GtkHBox" id="hbox34">
+                                                <property name="visible">True</property>
+                                                <child>
+                                                  <object class="GtkLabel" id="label_title_profile_model">
+                                                    <property name="visible">True</property>
+                                                    <property name="label" translatable="yes" comments="The manufacturer of the profile">Device model:</property>
+                                                  </object>
+                                                  <packing>
+                                                    <property name="expand">False</property>
+                                                    <property name="position">0</property>
+                                                  </packing>
+                                                </child>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <object class="GtkHBox" id="hbox35">
+                                                <property name="visible">True</property>
+                                                <child>
+                                                  <object class="GtkLabel" id="label_profile_model">
+                                                    <property name="visible">True</property>
+                                                    <property name="label">model</property>
+                                                    <property name="use_markup">True</property>
+                                                    <property name="wrap">True</property>
+                                                  </object>
+                                                  <packing>
+                                                    <property name="expand">False</property>
+                                                    <property name="position">0</property>
+                                                  </packing>
+                                                </child>
+                                              </object>
+                                              <packing>
+                                                <property name="position">1</property>
+                                              </packing>
+                                            </child>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="padding">3</property>
+                                            <property name="position">4</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkHBox" id="hbox_copyright">
+                                            <property name="visible">True</property>
+                                            <property name="spacing">9</property>
+                                            <child>
+                                              <object class="GtkHBox" id="hbox10">
+                                                <property name="visible">True</property>
+                                                <child>
+                                                  <object class="GtkLabel" id="label_title_copyright">
+                                                    <property name="visible">True</property>
+                                                    <property name="label" translatable="yes" comments="The licence of the profile, normally non-free">License:</property>
+                                                  </object>
+                                                  <packing>
+                                                    <property name="expand">False</property>
+                                                    <property name="position">0</property>
+                                                  </packing>
+                                                </child>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <object class="GtkHBox" id="hbox12">
+                                                <property name="visible">True</property>
+                                                <child>
+                                                  <object class="GtkLabel" id="label_copyright">
+                                                    <property name="visible">True</property>
+                                                    <property name="label">non-free</property>
+                                                    <property name="use_markup">True</property>
+                                                    <property name="wrap">True</property>
+                                                  </object>
+                                                  <packing>
+                                                    <property name="expand">False</property>
+                                                    <property name="position">0</property>
+                                                  </packing>
+                                                </child>
+                                              </object>
+                                              <packing>
+                                                <property name="position">1</property>
+                                              </packing>
+                                            </child>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="padding">3</property>
+                                            <property name="position">5</property>
+                                          </packing>
+                                        </child>
+                                        <child>
                                           <object class="GtkHBox" id="hbox_size">
                                             <property name="visible">True</property>
                                             <property name="spacing">9</property>
@@ -895,7 +997,7 @@
                                             <property name="expand">False</property>
                                             <property name="fill">False</property>
                                             <property name="padding">3</property>
-                                            <property name="position">4</property>
+                                            <property name="position">6</property>
                                           </packing>
                                         </child>
                                         <child>
@@ -946,7 +1048,7 @@
                                             <property name="expand">False</property>
                                             <property name="fill">False</property>
                                             <property name="padding">3</property>
-                                            <property name="position">5</property>
+                                            <property name="position">7</property>
                                           </packing>
                                         </child>
                                       </object>
diff --git a/src/gcm-prefs.c b/src/gcm-prefs.c
index bc0500d..c2f11ad 100644
--- a/src/gcm-prefs.c
+++ b/src/gcm-prefs.c
@@ -1335,6 +1335,56 @@ gcm_prefs_profile_type_to_text (GcmProfileType type)
 }
 
 /**
+ * gcm_prefs_profile_colorspace_to_text:
+ **/
+static gchar *
+gcm_prefs_profile_colorspace_to_text (GcmProfileType type)
+{
+	if (type == GCM_PROFILE_COLORSPACE_XYZ) {
+		/* TRANSLATORS: this the ICC colorspace type */
+		return _("XYZ");
+	}
+	if (type == GCM_PROFILE_COLORSPACE_LAB) {
+		/* TRANSLATORS: this the ICC colorspace type */
+		return _("LAB");
+	}
+	if (type == GCM_PROFILE_COLORSPACE_LUV) {
+		/* TRANSLATORS: this the ICC colorspace type */
+		return _("LUV");
+	}
+	if (type == GCM_PROFILE_COLORSPACE_YCBCR) {
+		/* TRANSLATORS: this the ICC colorspace type */
+		return _("YCbCr");
+	}
+	if (type == GCM_PROFILE_COLORSPACE_YXY) {
+		/* TRANSLATORS: this the ICC colorspace type */
+		return _("Yxy");
+	}
+	if (type == GCM_PROFILE_COLORSPACE_RGB) {
+		/* TRANSLATORS: this the ICC colorspace type */
+		return _("RGB");
+	}
+	if (type == GCM_PROFILE_COLORSPACE_GRAY) {
+		/* TRANSLATORS: this the ICC colorspace type */
+		return _("Gray");
+	}
+	if (type == GCM_PROFILE_COLORSPACE_HSV) {
+		/* TRANSLATORS: this the ICC colorspace type */
+		return _("HSV");
+	}
+	if (type == GCM_PROFILE_COLORSPACE_CMYK) {
+		/* TRANSLATORS: this the ICC colorspace type */
+		return _("CMYK");
+	}
+	if (type == GCM_PROFILE_COLORSPACE_CMY) {
+		/* TRANSLATORS: this the ICC colorspace type */
+		return _("CMY");
+	}
+	/* TRANSLATORS: this the ICC colorspace type */
+	return _("Unknown");
+}
+
+/**
  * gcm_prefs_profiles_treeview_clicked_cb:
  **/
 static void
@@ -1351,11 +1401,14 @@ gcm_prefs_profiles_treeview_clicked_cb (GtkTreeSelection *selection, gpointer us
 	gchar *profile_copyright = NULL;
 	gchar *profile_manufacturer = NULL;
 	gchar *profile_model = NULL;
+	gchar *profile_datetime = NULL;
 	gchar *filename = NULL;
 	gchar *basename = NULL;
 	gchar *size_text = NULL;
-	GcmProfileType profile_type = GCM_PROFILE_TYPE_UNKNOWN;
+	GcmProfileType profile_type;
+	GcmProfileColorspace profile_colorspace;
 	const gchar *profile_type_text;
+	const gchar *profile_colorspace_text;
 	gboolean ret;
 	guint size;
 
@@ -1377,7 +1430,9 @@ gcm_prefs_profiles_treeview_clicked_cb (GtkTreeSelection *selection, gpointer us
 		      "copyright", &profile_copyright,
 		      "manufacturer", &profile_manufacturer,
 		      "model", &profile_model,
+		      "datetime", &profile_datetime,
 		      "type", &profile_type,
+		      "colorspace", &profile_colorspace,
 		      "white-point", &white,
 		      "luminance-red", &red,
 		      "luminance-green", &green,
@@ -1409,6 +1464,17 @@ gcm_prefs_profiles_treeview_clicked_cb (GtkTreeSelection *selection, gpointer us
 		gtk_label_set_label (GTK_LABEL (widget), profile_type_text);
 	}
 
+	/* set colorspace */
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox_colorspace"));
+	if (profile_colorspace == GCM_PROFILE_COLORSPACE_UNKNOWN) {
+		gtk_widget_hide (widget);
+	} else {
+		gtk_widget_show (widget);
+		widget = GTK_WIDGET (gtk_builder_get_object (builder, "label_colorspace"));
+		profile_colorspace_text = gcm_prefs_profile_colorspace_to_text (profile_colorspace);
+		gtk_label_set_label (GTK_LABEL (widget), profile_colorspace_text);
+	}
+
 	/* set basename */
 	widget = GTK_WIDGET (gtk_builder_get_object (builder, "label_filename"));
 	basename = g_path_get_basename (filename);
@@ -1455,6 +1521,16 @@ gcm_prefs_profiles_treeview_clicked_cb (GtkTreeSelection *selection, gpointer us
 		gtk_label_set_label (GTK_LABEL(widget), profile_model);
 	}
 
+	/* set new datetime */
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox_datetime"));
+	if (profile_datetime == NULL) {
+		gtk_widget_hide (widget);
+	} else {
+		gtk_widget_show (widget);
+		widget = GTK_WIDGET (gtk_builder_get_object (builder, "label_datetime"));
+		gtk_label_set_label (GTK_LABEL(widget), profile_datetime);
+	}
+
 	/* set delete sensitivity */
 	ret = (filename != NULL && g_str_has_prefix (filename, "/home/"));
 	egg_debug ("filename: %s", filename);
@@ -1471,6 +1547,7 @@ gcm_prefs_profiles_treeview_clicked_cb (GtkTreeSelection *selection, gpointer us
 	g_free (profile_copyright);
 	g_free (profile_manufacturer);
 	g_free (profile_model);
+	g_free (profile_datetime);
 }
 
 /**
@@ -2285,6 +2362,10 @@ main (int argc, char **argv)
 	gtk_size_group_add_widget (size_group, widget);
 	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox34"));
 	gtk_size_group_add_widget (size_group, widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox36"));
+	gtk_size_group_add_widget (size_group, widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox39"));
+	gtk_size_group_add_widget (size_group, widget);
 
 	/* set alignment for right */
 	size_group2 = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
@@ -2306,6 +2387,10 @@ main (int argc, char **argv)
 	gtk_size_group_add_widget (size_group2, widget);
 	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox35"));
 	gtk_size_group_add_widget (size_group2, widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox37"));
+	gtk_size_group_add_widget (size_group2, widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox40"));
+	gtk_size_group_add_widget (size_group2, widget);
 
 	/* get screen */
 	rr_screen = gnome_rr_screen_new (gdk_screen_get_default (), NULL, NULL, &error);



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