[gnome-color-manager] Make a few UI corrections suggested by Matthias



commit b80690733fb22ee7c69570465491bffda287a2a1
Author: Richard Hughes <richard hughsie com>
Date:   Tue Dec 29 12:54:38 2009 +0000

    Make a few UI corrections suggested by Matthias

 data/gcm-prefs.ui |   81 +++++++++++++++++++++-------------------------------
 src/gcm-prefs.c   |   72 +++++++++++++++++++---------------------------
 2 files changed, 63 insertions(+), 90 deletions(-)
---
diff --git a/data/gcm-prefs.ui b/data/gcm-prefs.ui
index 0c95045..9929bfa 100644
--- a/data/gcm-prefs.ui
+++ b/data/gcm-prefs.ui
@@ -81,7 +81,7 @@
                                 <child>
                                   <object class="GtkLabel" id="label_device">
                                     <property name="visible">True</property>
-                                    <property name="label" translatable="yes" comments="Section heading for device settings">Device:</property>
+                                    <property name="label" translatable="yes" comments="Section heading for device settings">Device</property>
                                     <attributes>
                                       <attribute name="weight" value="bold"/>
                                     </attributes>
@@ -139,6 +139,7 @@
                                                   <object class="GtkLabel" id="label_manufacturer">
                                                     <property name="visible">True</property>
                                                     <property name="label">manufacturer</property>
+                                                    <property name="selectable">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="expand">False</property>
@@ -185,6 +186,7 @@
                                                   <object class="GtkLabel" id="label_model">
                                                     <property name="visible">True</property>
                                                     <property name="label">model</property>
+                                                    <property name="selectable">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="expand">False</property>
@@ -231,6 +233,7 @@
                                                   <object class="GtkLabel" id="label_serial">
                                                     <property name="visible">True</property>
                                                     <property name="label">serial</property>
+                                                    <property name="selectable">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="expand">False</property>
@@ -278,7 +281,7 @@
                                 <child>
                                   <object class="GtkLabel" id="label_profile">
                                     <property name="visible">True</property>
-                                    <property name="label" translatable="yes" comments="Section heading for device profile settings">Color Profile:</property>
+                                    <property name="label" translatable="yes" comments="Section heading for device profile settings">Color Profile</property>
                                     <attributes>
                                       <attribute name="weight" value="bold"/>
                                     </attributes>
@@ -477,7 +480,7 @@
                             <child type="label">
                               <object class="GtkLabel" id="label4">
                                 <property name="visible">True</property>
-                                <property name="label" translatable="yes" comments="Settings that users don't normally have to touch">Fine tuning:</property>
+                                <property name="label" translatable="yes" comments="Settings that users don't normally have to touch">Fine tuning</property>
                                 <attributes>
                                   <attribute name="weight" value="bold"/>
                                 </attributes>
@@ -500,16 +503,16 @@
                         <property name="spacing">6</property>
                         <child>
                           <object class="GtkButton" id="button_calibrate">
-                            <property name="label" translatable="yes" comments="This is a button to calibrate the device by creating an ICC profile file using a hardware device or a reference image">_Create profile for device</property>
+                            <property name="label" translatable="yes" comments="This is a button to calibrate the device by creating an ICC profile file using a hardware device or a reference image">Create _profile for device</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">True</property>
+                            <property name="tooltip_text" translatable="yes">Create a color profile for the selected device</property>
                             <property name="use_underline">True</property>
                           </object>
                           <packing>
                             <property name="expand">False</property>
-                            <property name="pack_type">end</property>
-                            <property name="position">1</property>
+                            <property name="position">0</property>
                           </packing>
                         </child>
                         <child>
@@ -518,13 +521,13 @@
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">True</property>
+                            <property name="tooltip_text" translatable="yes">Remove disconnected hardware from the device list</property>
                             <property name="use_underline">True</property>
                           </object>
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">False</property>
-                            <property name="pack_type">end</property>
-                            <property name="position">0</property>
+                            <property name="position">1</property>
                           </packing>
                         </child>
                       </object>
@@ -614,7 +617,7 @@
                                 <child>
                                   <object class="GtkLabel" id="label_profile1">
                                     <property name="visible">True</property>
-                                    <property name="label" translatable="yes" comments="Section heading for device profile settings">Color Profile:</property>
+                                    <property name="label" translatable="yes" comments="Section heading for device profile settings">Color Profile</property>
                                     <attributes>
                                       <attribute name="weight" value="bold"/>
                                     </attributes>
@@ -675,6 +678,7 @@
                                                     <property name="label">input</property>
                                                     <property name="use_markup">True</property>
                                                     <property name="wrap">True</property>
+                                                    <property name="selectable">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="expand">False</property>
@@ -726,6 +730,7 @@
                                                     <property name="label">colorspace</property>
                                                     <property name="use_markup">True</property>
                                                     <property name="wrap">True</property>
+                                                    <property name="selectable">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="expand">False</property>
@@ -777,6 +782,7 @@
                                                     <property name="label">datetime</property>
                                                     <property name="use_markup">True</property>
                                                     <property name="wrap">True</property>
+                                                    <property name="selectable">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="expand">False</property>
@@ -828,6 +834,7 @@
                                                     <property name="label">manufacturer</property>
                                                     <property name="use_markup">True</property>
                                                     <property name="wrap">True</property>
+                                                    <property name="selectable">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="expand">False</property>
@@ -879,6 +886,7 @@
                                                     <property name="label">model</property>
                                                     <property name="use_markup">True</property>
                                                     <property name="wrap">True</property>
+                                                    <property name="selectable">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="expand">False</property>
@@ -930,6 +938,7 @@
                                                     <property name="label">non-free</property>
                                                     <property name="use_markup">True</property>
                                                     <property name="wrap">True</property>
+                                                    <property name="selectable">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="expand">False</property>
@@ -981,6 +990,7 @@
                                                     <property name="label">input</property>
                                                     <property name="use_markup">True</property>
                                                     <property name="wrap">True</property>
+                                                    <property name="selectable">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="expand">False</property>
@@ -1032,6 +1042,7 @@
                                                     <property name="label">filename</property>
                                                     <property name="use_markup">True</property>
                                                     <property name="wrap">True</property>
+                                                    <property name="selectable">True</property>
                                                   </object>
                                                   <packing>
                                                     <property name="expand">False</property>
@@ -1075,7 +1086,7 @@
                                     <child>
                                       <object class="GtkLabel" id="label_cie_title">
                                         <property name="visible">True</property>
-                                        <property name="label" translatable="yes" comments="Section heading for CIE and TRC graphs">Profile Graphs:</property>
+                                        <property name="label" translatable="yes" comments="Section heading for CIE and TRC graphs">Profile Graphs</property>
                                         <attributes>
                                           <attribute name="weight" value="bold"/>
                                         </attributes>
@@ -1180,6 +1191,7 @@
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">True</property>
+                            <property name="tooltip_text" translatable="yes">Import a color profile</property>
                             <property name="use_underline">True</property>
                           </object>
                           <packing>
@@ -1189,10 +1201,11 @@
                         </child>
                         <child>
                           <object class="GtkButton" id="button_profile_delete">
-                            <property name="label" translatable="yes">Delete profile</property>
+                            <property name="label" translatable="yes">_Delete profile</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">True</property>
+                            <property name="tooltip_text" translatable="yes">Permanently delete the selected profile</property>
                             <property name="use_underline">True</property>
                           </object>
                           <packing>
@@ -1239,7 +1252,7 @@
                     <child>
                       <object class="GtkLabel" id="label1">
                         <property name="visible">True</property>
-                        <property name="label" translatable="yes">Display:</property>
+                        <property name="label" translatable="yes">Display</property>
                         <attributes>
                           <attribute name="weight" value="bold"/>
                         </attributes>
@@ -1265,61 +1278,33 @@
                         <property name="orientation">vertical</property>
                         <property name="spacing">3</property>
                         <child>
-                          <object class="GtkRadioButton" id="radiobutton_ouput_disable">
-                            <property name="label" translatable="yes" comments="Radio buttons in the prefs dialog">Do not enable display correction</property>
+                          <object class="GtkCheckButton" id="checkbutton_display">
+                            <property name="label" translatable="yes">_Apply display correction</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">False</property>
+                            <property name="tooltip_text" translatable="yes">Applies global correction to all windows</property>
                             <property name="use_underline">True</property>
                             <property name="draw_indicator">True</property>
-                            <property name="group">radiobutton_ouput_global</property>
                           </object>
                           <packing>
                             <property name="position">0</property>
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkRadioButton" id="radiobutton_ouput_global">
-                            <property name="label" translatable="yes" comments="Radio buttons in the prefs dialog">Apply _global display correction</property>
+                          <object class="GtkCheckButton" id="checkbutton_profile">
+                            <property name="label" translatable="yes">_Set profile for color managed applications</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">False</property>
+                            <property name="tooltip_text" translatable="yes">Inform color-aware applications that a videocard gamma profile has been set</property>
                             <property name="use_underline">True</property>
-                            <property name="active">True</property>
                             <property name="draw_indicator">True</property>
                           </object>
                           <packing>
                             <property name="position">1</property>
                           </packing>
                         </child>
-                        <child>
-                          <object class="GtkRadioButton" id="radiobutton_ouput_atom">
-                            <property name="label" translatable="yes" comments="Radio buttons in the prefs dialog">_Set profile only for color managed applications</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="use_underline">True</property>
-                            <property name="draw_indicator">True</property>
-                            <property name="group">radiobutton_ouput_global</property>
-                          </object>
-                          <packing>
-                            <property name="position">2</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkRadioButton" id="radiobutton_ouput_both">
-                            <property name="label" translatable="yes" comments="Radio buttons in the prefs dialog">Do global correction and set profile for color managed applications</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="use_underline">True</property>
-                            <property name="draw_indicator">True</property>
-                            <property name="group">radiobutton_ouput_global</property>
-                          </object>
-                          <packing>
-                            <property name="position">3</property>
-                          </packing>
-                        </child>
                       </object>
                     </child>
                   </object>
@@ -1334,7 +1319,7 @@
                     <child>
                       <object class="GtkLabel" id="label5">
                         <property name="visible">True</property>
-                        <property name="label" translatable="yes">Working spaces:</property>
+                        <property name="label" translatable="yes">Working space</property>
                         <attributes>
                           <attribute name="weight" value="bold"/>
                         </attributes>
@@ -1452,7 +1437,7 @@
                     <child>
                       <object class="GtkLabel" id="label2">
                         <property name="visible">True</property>
-                        <property name="label" translatable="yes">Rendering intent:</property>
+                        <property name="label" translatable="yes">Rendering intent</property>
                         <attributes>
                           <attribute name="weight" value="bold"/>
                         </attributes>
diff --git a/src/gcm-prefs.c b/src/gcm-prefs.c
index 329cbe5..2c7f912 100644
--- a/src/gcm-prefs.c
+++ b/src/gcm-prefs.c
@@ -2190,29 +2190,36 @@ gcm_prefs_reset_devices_idle_cb (gpointer user_data)
 }
 
 /**
- * gcm_prefs_radio_cb:
+ * gcm_prefs_checkbutton_global_cb:
  **/
 static void
-gcm_prefs_radio_cb (GtkWidget *widget, gpointer user_data)
+gcm_prefs_checkbutton_global_cb (GtkWidget *widget, gpointer user_data)
 {
-	const gchar *name;
-	gboolean use_global = FALSE;
-	gboolean use_atom = FALSE;
+	gboolean ret;
 
-	/* find out what button was pressed */
-	name = gtk_widget_get_name (widget);
-	if (g_strcmp0 (name, "radiobutton_ouput_both") == 0) {
-		use_global = TRUE;
-		use_atom = TRUE;
-	} else if (g_strcmp0 (name, "radiobutton_ouput_global") == 0) {
-		use_global = TRUE;
-	} else if (g_strcmp0 (name, "radiobutton_ouput_atom") == 0) {
-		use_atom = TRUE;
-	}
+	/* get state */
+	ret = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(widget));
+
+	/* save new preference */
+	gconf_client_set_bool (gconf_client, GCM_SETTINGS_GLOBAL_DISPLAY_CORRECTION, ret, NULL);
+
+	/* set the new setting */
+	g_idle_add ((GSourceFunc) gcm_prefs_reset_devices_idle_cb, NULL);
+}
+
+/**
+ * gcm_prefs_checkbutton_profile_cb:
+ **/
+static void
+gcm_prefs_checkbutton_profile_cb (GtkWidget *widget, gpointer user_data)
+{
+	gboolean ret;
+
+	/* get state */
+	ret = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(widget));
 
 	/* save new preference */
-	gconf_client_set_bool (gconf_client, GCM_SETTINGS_GLOBAL_DISPLAY_CORRECTION, use_global, NULL);
-	gconf_client_set_bool (gconf_client, GCM_SETTINGS_SET_ICC_PROFILE_ATOM, use_atom, NULL);
+	gconf_client_set_bool (gconf_client, GCM_SETTINGS_SET_ICC_PROFILE_ATOM, ret, NULL);
 
 	/* set the new setting */
 	g_idle_add ((GSourceFunc) gcm_prefs_reset_devices_idle_cb, NULL);
@@ -2614,33 +2621,14 @@ main (int argc, char **argv)
 	gconf_client = gconf_client_get_default ();
 	use_global = gconf_client_get_bool (gconf_client, GCM_SETTINGS_GLOBAL_DISPLAY_CORRECTION, NULL);
 	use_atom = gconf_client_get_bool (gconf_client, GCM_SETTINGS_SET_ICC_PROFILE_ATOM, NULL);
-	if (use_global && use_atom) {
-		widget = GTK_WIDGET (gtk_builder_get_object (builder, "radiobutton_ouput_both"));
-		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
-	} else if (use_global) {
-		widget = GTK_WIDGET (gtk_builder_get_object (builder, "radiobutton_ouput_global"));
-		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
-	} else if (use_atom) {
-		widget = GTK_WIDGET (gtk_builder_get_object (builder, "radiobutton_ouput_atom"));
-		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
-	} else {
-		widget = GTK_WIDGET (gtk_builder_get_object (builder, "radiobutton_ouput_disable"));
-		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
-	}
-
-	/* now connect radiobuttons */
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "radiobutton_ouput_global"));
-	g_signal_connect (widget, "clicked",
-			  G_CALLBACK (gcm_prefs_radio_cb), NULL);
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "radiobutton_ouput_atom"));
-	g_signal_connect (widget, "clicked",
-			  G_CALLBACK (gcm_prefs_radio_cb), NULL);
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "radiobutton_ouput_both"));
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "checkbutton_display"));
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), use_global);
 	g_signal_connect (widget, "clicked",
-			  G_CALLBACK (gcm_prefs_radio_cb), NULL);
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "radiobutton_ouput_disable"));
+			  G_CALLBACK (gcm_prefs_checkbutton_global_cb), NULL);
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "checkbutton_profile"));
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), use_atom);
 	g_signal_connect (widget, "clicked",
-			  G_CALLBACK (gcm_prefs_radio_cb), NULL);
+			  G_CALLBACK (gcm_prefs_checkbutton_profile_cb), NULL);
 
 	/* do all this after the window has been set up */
 	g_idle_add (gcm_prefs_startup_phase1_idle_cb, NULL);



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