[gnome-color-manager] prefs: make the 'Set for all users' button device specific
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-color-manager] prefs: make the 'Set for all users' button device specific
- Date: Fri, 25 Mar 2011 15:43:18 +0000 (UTC)
commit 1fa3e5fd2b1f2b3436e3f06fb51e06c35fbe7209
Author: Richard Hughes <richard hughsie com>
Date: Fri Mar 25 15:42:36 2011 +0000
prefs: make the 'Set for all users' button device specific
data/gcm-prefs.ui | 52 +++++++++++++++++++++----------------------------
src/gcm-prefs.c | 55 ++++++++++++++++++++++------------------------------
2 files changed, 45 insertions(+), 62 deletions(-)
---
diff --git a/data/gcm-prefs.ui b/data/gcm-prefs.ui
index dcb3bd8..e7f8083 100644
--- a/data/gcm-prefs.ui
+++ b/data/gcm-prefs.ui
@@ -151,42 +151,18 @@
<action-widget response="0">button_assign_ok</action-widget>
</action-widgets>
</object>
- <object class="GtkDialog" id="dialog_prefs">
+ <object class="GtkWindow" id="dialog_prefs">
<property name="can_focus">False</property>
<property name="border_width">12</property>
<property name="title" translatable="yes">Color Management</property>
<property name="window_position">center</property>
<property name="icon_name">preferences-system</property>
- <property name="type_hint">normal</property>
- <child internal-child="vbox">
+ <child>
<object class="GtkBox" id="dialog-vbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
- <child internal-child="action_area">
- <object class="GtkButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="layout_style">end</property>
- <child>
- <object class="GtkButton" id="button_default">
- <property name="label" translatable="yes" comments="This is when the settings are set for all users, unless they have per-user settings themselves">_Set for all users</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="tooltip_text" translatable="yes">Save these profiles for all users</property>
- <property name="use_action_appearance">False</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- </object>
- </child>
<child>
<object class="GtkNotebook" id="notebook_prefs">
<property name="visible">True</property>
@@ -288,6 +264,25 @@
</packing>
</child>
<child>
+ <object class="GtkButton" id="button_default">
+ <property name="label" translatable="yes" comments="This is when the settings are set for all users, unless they have per-user settings themselves">_Set for all users</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip_markup" translatable="yes">Save these profiles for all users</property>
+ <property name="tooltip_text" translatable="yes">Save these profiles for all users</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ <property name="secondary">True</property>
+ </packing>
+ </child>
+ <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">Calibrate</property>
<property name="visible">True</property>
@@ -299,7 +294,7 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
- <property name="position">2</property>
+ <property name="position">3</property>
<property name="secondary">True</property>
</packing>
</child>
@@ -793,9 +788,6 @@
</child>
</object>
</child>
- <action-widgets>
- <action-widget response="0">button_default</action-widget>
- </action-widgets>
</object>
<object class="GtkDialog" id="dialog_virtual">
<property name="can_focus">False</property>
diff --git a/src/gcm-prefs.c b/src/gcm-prefs.c
index 1329bf6..234a192 100644
--- a/src/gcm-prefs.c
+++ b/src/gcm-prefs.c
@@ -155,47 +155,28 @@ gcm_prefs_combobox_add_profile (GtkWidget *widget,
static void
gcm_prefs_default_cb (GtkWidget *widget, GcmPrefsPriv *prefs)
{
- GPtrArray *array = NULL;
- CdDevice *device;
CdProfile *profile;
gboolean ret;
- guint i;
GError *error = NULL;
- /* set for each output */
- array = cd_client_get_devices_sync (prefs->client,
- prefs->cancellable,
- &error);
- if (array == NULL) {
- g_warning ("failed to get devices: %s",
+ /* TODO: check if the profile is already systemwide */
+ profile = cd_device_get_default_profile (prefs->current_device);
+ if (profile == NULL)
+ goto out;
+
+ /* install somewhere out of $HOME */
+ ret = cd_profile_install_system_wide_sync (profile,
+ prefs->cancellable,
+ &error);
+ if (!ret) {
+ g_warning ("failed to set profile system-wide: %s",
error->message);
g_error_free (error);
goto out;
}
- for (i=0; i<array->len; i++) {
- device = g_ptr_array_index (array, i);
-
- /* TODO: check if the profile is already systemwide */
- profile = cd_device_get_default_profile (device);
- if (profile == NULL)
- continue;
-
- /* install somewhere out of $HOME */
- ret = cd_profile_install_system_wide_sync (profile,
- prefs->cancellable,
- &error);
- if (!ret) {
- g_warning ("failed to set profile system-wide: %s",
- error->message);
- g_object_unref (profile);
- g_error_free (error);
- goto out;
- }
- g_object_unref (profile);
- }
out:
- if (array != NULL)
- g_ptr_array_unref (array);
+ if (profile != NULL)
+ g_object_unref (profile);
}
/**
@@ -2435,6 +2416,11 @@ gcm_viewer_startup_cb (GApplication *application, GcmPrefsPriv *prefs)
gcm_prefs_add_devices_columns (prefs, GTK_TREE_VIEW (widget));
gtk_tree_view_columns_autosize (GTK_TREE_VIEW (widget));
+ /* force to be at least 3 rows high */
+ widget = GTK_WIDGET (gtk_builder_get_object (prefs->builder,
+ "scrolledwindow1"));
+ gtk_widget_set_size_request (widget, 450, 36 * 3);
+
/* create assign tree view */
widget = GTK_WIDGET (gtk_builder_get_object (prefs->builder,
"treeview_assign"));
@@ -2455,6 +2441,11 @@ gcm_viewer_startup_cb (GApplication *application, GcmPrefsPriv *prefs)
gtk_tree_view_set_tooltip_column (GTK_TREE_VIEW (widget),
GCM_LIST_STORE_PROFILES_COLUMN_TOOLTIP);
+ /* force to be at least 2 rows high */
+ widget = GTK_WIDGET (gtk_builder_get_object (prefs->builder,
+ "scrolledwindow_assign"));
+ gtk_widget_set_size_request (widget, 450, 36 * 3);
+
widget = GTK_WIDGET (gtk_builder_get_object (prefs->builder,
"button_default"));
g_signal_connect (widget, "clicked",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]