[Xfce4-commits] [xfce/xfce4-settings] 57/57: color: Indentation fixes
noreply at xfce.org
noreply at xfce.org
Thu Mar 21 22:14:45 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 m a s t e r
in repository xfce/xfce4-settings.
commit 40410bc319c7dc48a80cdcbcce097988972dabc6
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date: Tue Mar 12 23:53:04 2019 +0100
color: Indentation fixes
---
dialogs/color-settings/color-device.c | 464 ++++++++++++++++-----------------
dialogs/color-settings/color-device.h | 18 +-
dialogs/color-settings/color-profile.c | 446 +++++++++++++++----------------
dialogs/color-settings/color-profile.h | 14 +-
dialogs/color-settings/main.c | 43 ++-
5 files changed, 484 insertions(+), 501 deletions(-)
diff --git a/dialogs/color-settings/color-device.c b/dialogs/color-settings/color-device.c
index 4b3ce28..d8469b3 100644
--- a/dialogs/color-settings/color-device.c
+++ b/dialogs/color-settings/color-device.c
@@ -28,30 +28,30 @@
struct _ColorDevice
{
- GtkListBoxRow parent_instance;
-
- CdDevice *device;
- gboolean enabled;
- gchar *sortable;
- GtkWidget *widget_description;
- GtkWidget *widget_icon;
- GtkWidget *widget_switch;
- guint device_changed_id;
+ GtkListBoxRow parent_instance;
+
+ CdDevice *device;
+ gboolean enabled;
+ gchar *sortable;
+ GtkWidget *widget_description;
+ GtkWidget *widget_icon;
+ GtkWidget *widget_switch;
+ guint device_changed_id;
};
G_DEFINE_TYPE (ColorDevice, color_device, GTK_TYPE_LIST_BOX_ROW)
enum
{
- SIGNAL_ENABLED_CHANGED,
- SIGNAL_LAST
+ SIGNAL_ENABLED_CHANGED,
+ SIGNAL_LAST
};
enum
{
- PROP_0,
- PROP_DEVICE,
- PROP_LAST
+ PROP_0,
+ PROP_DEVICE,
+ PROP_LAST
};
static guint signals [SIGNAL_LAST] = { 0 };
@@ -59,172 +59,170 @@ static guint signals [SIGNAL_LAST] = { 0 };
gchar *
color_device_get_kind (CdDevice *device)
{
- if (cd_device_get_kind (device) == CD_DEVICE_KIND_DISPLAY)
- /* TRANSLATORS: an externally connected display, where %s is either the
- * model, vendor or ID, e.g. 'LP2480zx Monitor' */
- return _("Monitor");
- else if (cd_device_get_kind (device) == CD_DEVICE_KIND_SCANNER)
- /* TRANSLATORS: a flatbed scanner device, e.g. 'Epson Scanner' */
- return _("Scanner");
- else if (cd_device_get_kind (device) == CD_DEVICE_KIND_CAMERA)
- /* TRANSLATORS: a camera device, e.g. 'Nikon D60 Camera' */
- return _("Camera");
- else if (cd_device_get_kind (device) == CD_DEVICE_KIND_PRINTER)
- /* TRANSLATORS: a printer device, e.g. 'Epson Photosmart Printer' */
- return _("Printer");
- else if (cd_device_get_kind (device) == CD_DEVICE_KIND_WEBCAM)
- /* TRANSLATORS: a webcam device, e.g. 'Philips HiDef Camera' */
- return _("Webcam");
- else
- return NULL;
+ if (cd_device_get_kind (device) == CD_DEVICE_KIND_DISPLAY)
+ /* TRANSLATORS: an externally connected display, where %s is either the
+ * model, vendor or ID, e.g. 'LP2480zx Monitor' */
+ return _("Monitor");
+ else if (cd_device_get_kind (device) == CD_DEVICE_KIND_SCANNER)
+ /* TRANSLATORS: a flatbed scanner device, e.g. 'Epson Scanner' */
+ return _("Scanner");
+ else if (cd_device_get_kind (device) == CD_DEVICE_KIND_CAMERA)
+ /* TRANSLATORS: a camera device, e.g. 'Nikon D60 Camera' */
+ return _("Camera");
+ else if (cd_device_get_kind (device) == CD_DEVICE_KIND_PRINTER)
+ /* TRANSLATORS: a printer device, e.g. 'Epson Photosmart Printer' */
+ return _("Printer");
+ else if (cd_device_get_kind (device) == CD_DEVICE_KIND_WEBCAM)
+ /* TRANSLATORS: a webcam device, e.g. 'Philips HiDef Camera' */
+ return _("Webcam");
+ else
+ return NULL;
}
gchar *
color_device_get_title (CdDevice *device)
{
- const gchar *tmp;
- GString *string;
+ const gchar *tmp;
+ GString *string;
- string = g_string_new ("");
+ string = g_string_new ("");
- /* is laptop panel */
- if (cd_device_get_kind (device) == CD_DEVICE_KIND_DISPLAY &&
- cd_device_get_embedded (device))
- {
- /* TRANSLATORS: This refers to the TFT display on a laptop */
- g_string_append (string, _("Laptop Screen"));
- goto out;
+ /* is laptop panel */
+ if (cd_device_get_kind (device) == CD_DEVICE_KIND_DISPLAY &&
+ cd_device_get_embedded (device)) {
+ /* TRANSLATORS: This refers to the TFT display on a laptop */
+ g_string_append (string, _("Laptop Screen"));
+ goto out;
}
- /* is internal webcam */
- if (cd_device_get_kind (device) == CD_DEVICE_KIND_WEBCAM &&
- cd_device_get_embedded (device))
- {
- /* TRANSLATORS: This refers to the embedded webcam on a laptop */
- g_string_append (string, _("Built-in Webcam"));
- goto out;
+ /* is internal webcam */
+ if (cd_device_get_kind (device) == CD_DEVICE_KIND_WEBCAM &&
+ cd_device_get_embedded (device)) {
+ /* TRANSLATORS: This refers to the embedded webcam on a laptop */
+ g_string_append (string, _("Built-in Webcam"));
+ goto out;
}
- /* get the display model, falling back to something sane */
- tmp = cd_device_get_model (device);
- if (tmp == NULL)
- tmp = cd_device_get_vendor (device);
- if (tmp == NULL)
- tmp = cd_device_get_id (device);
+ /* get the display model, falling back to something sane */
+ tmp = cd_device_get_model (device);
+ if (tmp == NULL)
+ tmp = cd_device_get_vendor (device);
+ if (tmp == NULL)
+ tmp = cd_device_get_id (device);
- if (color_device_get_kind (device))
- g_string_append_printf (string, "%s %s", tmp, color_device_get_kind (device));
- else
- g_string_append (string, tmp);
+ if (color_device_get_kind (device))
+ g_string_append_printf (string, "%s %s", tmp, color_device_get_kind (device));
+ else
+ g_string_append (string, tmp);
out:
- return g_string_free (string, FALSE);
+ return g_string_free (string, FALSE);
}
static const gchar *
color_device_kind_to_sort (CdDevice *device)
{
- CdDeviceKind kind = cd_device_get_kind (device);
- if (kind == CD_DEVICE_KIND_DISPLAY)
- return "4";
- if (kind == CD_DEVICE_KIND_SCANNER)
- return "3";
- if (kind == CD_DEVICE_KIND_CAMERA)
- return "2";
- if (kind == CD_DEVICE_KIND_WEBCAM)
- return "1";
- if (kind == CD_DEVICE_KIND_PRINTER)
- return "0";
- return "9";
+ CdDeviceKind kind = cd_device_get_kind (device);
+ if (kind == CD_DEVICE_KIND_DISPLAY)
+ return "4";
+ if (kind == CD_DEVICE_KIND_SCANNER)
+ return "3";
+ if (kind == CD_DEVICE_KIND_CAMERA)
+ return "2";
+ if (kind == CD_DEVICE_KIND_WEBCAM)
+ return "1";
+ if (kind == CD_DEVICE_KIND_PRINTER)
+ return "0";
+ return "9";
}
const gchar *
color_device_get_type_icon (CdDevice *device)
{
- CdDeviceKind kind = cd_device_get_kind (device);
- if (kind == CD_DEVICE_KIND_DISPLAY)
- return "video-display";
- if (kind == CD_DEVICE_KIND_SCANNER)
- return "scanner";
- if (kind == CD_DEVICE_KIND_CAMERA)
- return "camera-photo";
- if (kind == CD_DEVICE_KIND_WEBCAM)
- return "camera-web";
- if (kind == CD_DEVICE_KIND_PRINTER)
- return "printer";
- return "dialog-question";
+ CdDeviceKind kind = cd_device_get_kind (device);
+ if (kind == CD_DEVICE_KIND_DISPLAY)
+ return "video-display";
+ if (kind == CD_DEVICE_KIND_SCANNER)
+ return "scanner";
+ if (kind == CD_DEVICE_KIND_CAMERA)
+ return "camera-photo";
+ if (kind == CD_DEVICE_KIND_WEBCAM)
+ return "camera-web";
+ if (kind == CD_DEVICE_KIND_PRINTER)
+ return "printer";
+ return "dialog-question";
}
gchar *
color_device_get_sortable_base (CdDevice *device)
{
- g_autofree gchar *title = color_device_get_title (device);
- return g_strdup_printf ("%s-%s-%s",
- color_device_kind_to_sort (device),
- cd_device_get_id (device),
- title);
+ g_autofree gchar *title = color_device_get_title (device);
+ return g_strdup_printf ("%s-%s-%s",
+ color_device_kind_to_sort (device),
+ cd_device_get_id (device),
+ title);
}
static void
color_device_refresh (ColorDevice *color_device)
{
- g_autofree gchar *title = NULL;
- g_autoptr(GPtrArray) profiles = NULL;
- AtkObject *accessible;
- g_autofree gchar *name1 = NULL;
- g_autofree gchar *device_icon = NULL;
-
- /* add switch and expander if there are profiles, otherwise use a label */
- profiles = cd_device_get_profiles (color_device->device);
- if (profiles == NULL)
- return;
-
- title = color_device_get_title (color_device->device);
- gtk_label_set_label (GTK_LABEL (color_device->widget_description), title);
- gtk_widget_set_visible (color_device->widget_description, TRUE);
-
- device_icon = g_strdup_printf ("%s-symbolic", color_device_get_type_icon (color_device->device));
- gtk_image_set_from_icon_name (GTK_IMAGE (color_device->widget_icon),
- device_icon,
- GTK_ICON_SIZE_MENU);
- gtk_widget_set_visible (color_device->widget_icon, TRUE);
- gtk_widget_set_visible (color_device->widget_switch, profiles->len > 0);
-
- gtk_switch_set_active (GTK_SWITCH (color_device->widget_switch),
- cd_device_get_enabled (color_device->device));
-
- accessible = gtk_widget_get_accessible (color_device->widget_switch);
- name1 = g_strdup_printf (_("Enable color management for %s"), title);
- atk_object_set_name (accessible, name1);
+ g_autofree gchar *title = NULL;
+ g_autoptr(GPtrArray) profiles = NULL;
+ AtkObject *accessible;
+ g_autofree gchar *name1 = NULL;
+ g_autofree gchar *device_icon = NULL;
+
+ /* add switch and expander if there are profiles, otherwise use a label */
+ profiles = cd_device_get_profiles (color_device->device);
+ if (profiles == NULL)
+ return;
+
+ title = color_device_get_title (color_device->device);
+ gtk_label_set_label (GTK_LABEL (color_device->widget_description), title);
+ gtk_widget_set_visible (color_device->widget_description, TRUE);
+
+ device_icon = g_strdup_printf ("%s-symbolic", color_device_get_type_icon (color_device->device));
+ gtk_image_set_from_icon_name (GTK_IMAGE (color_device->widget_icon),
+ device_icon,
+ GTK_ICON_SIZE_MENU);
+ gtk_widget_set_visible (color_device->widget_icon, TRUE);
+ gtk_widget_set_visible (color_device->widget_switch, profiles->len > 0);
+
+ gtk_switch_set_active (GTK_SWITCH (color_device->widget_switch),
+ cd_device_get_enabled (color_device->device));
+
+ accessible = gtk_widget_get_accessible (color_device->widget_switch);
+ name1 = g_strdup_printf (_("Enable color management for %s"), title);
+ atk_object_set_name (accessible, name1);
}
CdDevice *
color_device_get_device (ColorDevice *color_device)
{
- g_return_val_if_fail (SETTINGS_IS_COLOR_DEVICE (color_device), NULL);
- return color_device->device;
+ g_return_val_if_fail (SETTINGS_IS_COLOR_DEVICE (color_device), NULL);
+ return color_device->device;
}
const gchar *
color_device_get_sortable (ColorDevice *color_device)
{
- g_return_val_if_fail (SETTINGS_IS_COLOR_DEVICE (color_device), NULL);
- return color_device->sortable;
+ g_return_val_if_fail (SETTINGS_IS_COLOR_DEVICE (color_device), NULL);
+ return color_device->sortable;
}
static void
color_device_get_property (GObject *object, guint param_id,
- GValue *value, GParamSpec *pspec)
+ GValue *value, GParamSpec *pspec)
{
- ColorDevice *color_device = SETTINGS_COLOR_DEVICE (object);
- switch (param_id)
+ ColorDevice *color_device = SETTINGS_COLOR_DEVICE (object);
+ switch (param_id)
{
- case PROP_DEVICE:
- g_value_set_object (value, color_device->device);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
+ case PROP_DEVICE:
+ g_value_set_object (value, color_device->device);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+ break;
}
}
@@ -232,48 +230,48 @@ static void
color_device_set_property (GObject *object, guint param_id,
const GValue *value, GParamSpec *pspec)
{
- ColorDevice *color_device = SETTINGS_COLOR_DEVICE (object);
+ ColorDevice *color_device = SETTINGS_COLOR_DEVICE (object);
- switch (param_id)
+ switch (param_id)
{
- case PROP_DEVICE:
- color_device->device = g_value_dup_object (value);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
+ case PROP_DEVICE:
+ color_device->device = g_value_dup_object (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+ break;
}
}
static void
color_device_finalize (GObject *object)
{
- ColorDevice *color_device = SETTINGS_COLOR_DEVICE (object);
+ ColorDevice *color_device = SETTINGS_COLOR_DEVICE (object);
- if (color_device->device_changed_id > 0)
- g_signal_handler_disconnect (color_device->device, color_device->device_changed_id);
+ if (color_device->device_changed_id > 0)
+ g_signal_handler_disconnect (color_device->device, color_device->device_changed_id);
- g_free (color_device->sortable);
- g_object_unref (color_device->device);
+ g_free (color_device->sortable);
+ g_object_unref (color_device->device);
- G_OBJECT_CLASS (color_device_parent_class)->finalize (object);
+ G_OBJECT_CLASS (color_device_parent_class)->finalize (object);
}
void
color_device_set_enabled (ColorDevice *color_device,
gboolean enabled)
{
- /* same as before */
- if (color_device->enabled == enabled)
- return;
+ /* same as before */
+ if (color_device->enabled == enabled)
+ return;
- /* refresh */
- color_device->enabled = enabled;
+ /* refresh */
+ color_device->enabled = enabled;
- g_signal_emit (color_device,
- signals[SIGNAL_ENABLED_CHANGED], 0,
- color_device->enabled);
- color_device_refresh (color_device);
+ g_signal_emit (color_device,
+ signals[SIGNAL_ENABLED_CHANGED], 0,
+ color_device->enabled);
+ color_device_refresh (color_device);
}
static void
@@ -281,115 +279,115 @@ color_device_notify_enable_device_cb (GtkSwitch *sw,
GParamSpec *pspec,
gpointer user_data)
{
- ColorDevice *color_device = SETTINGS_COLOR_DEVICE (user_data);
- gboolean enable;
- gboolean ret;
- g_autoptr(GError) error = NULL;
-
- enable = gtk_switch_get_active (sw);
- g_debug ("Set %s to %i", cd_device_get_id (color_device->device), enable);
- ret = cd_device_set_enabled_sync (color_device->device,
- enable, NULL, &error);
- if (!ret)
- g_warning ("failed to %s to the device: %s",
- enable ? "enable" : "disable", error->message);
-
- /* if enabled, close */
- color_device_set_enabled (color_device, enable);
+ ColorDevice *color_device = SETTINGS_COLOR_DEVICE (user_data);
+ gboolean enable;
+ gboolean ret;
+ g_autoptr(GError) error = NULL;
+
+ enable = gtk_switch_get_active (sw);
+ g_debug ("Set %s to %i", cd_device_get_id (color_device->device), enable);
+ ret = cd_device_set_enabled_sync (color_device->device,
+ enable, NULL, &error);
+ if (!ret)
+ g_warning ("failed to %s to the device: %s",
+ enable ? "enable" : "disable", error->message);
+
+ /* if enabled, close */
+ color_device_set_enabled (color_device, enable);
}
static void
color_device_changed_cb (CdDevice *device,
ColorDevice *color_device)
{
- color_device_refresh (color_device);
+ color_device_refresh (color_device);
}
static void
color_device_constructed (GObject *object)
{
- ColorDevice *color_device = SETTINGS_COLOR_DEVICE (object);
- g_autofree gchar *sortable_tmp = NULL;
+ ColorDevice *color_device = SETTINGS_COLOR_DEVICE (object);
+ g_autofree gchar *sortable_tmp = NULL;
- /* watch the device for changes */
- color_device->device_changed_id =
- g_signal_connect (color_device->device, "changed",
- G_CALLBACK (color_device_changed_cb), color_device);
+ /* watch the device for changes */
+ color_device->device_changed_id =
+ g_signal_connect (color_device->device, "changed",
+ G_CALLBACK (color_device_changed_cb), color_device);
- /* calculate sortable -- FIXME: we have to hack this as EggListBox
- * does not let us specify a GtkSortType:
- * https://bugzilla.gnome.org/show_bug.cgi?id=691341 */
- sortable_tmp = color_device_get_sortable_base (color_device->device);
- color_device->sortable = g_strdup_printf ("%sXX", sortable_tmp);
+ /* calculate sortable -- FIXME: we have to hack this as EggListBox
+ * does not let us specify a GtkSortType:
+ * https://bugzilla.gnome.org/show_bug.cgi?id=691341 */
+ sortable_tmp = color_device_get_sortable_base (color_device->device);
+ color_device->sortable = g_strdup_printf ("%sXX", sortable_tmp);
- color_device->enabled = cd_device_get_enabled (color_device->device);
+ color_device->enabled = cd_device_get_enabled (color_device->device);
- color_device_refresh (color_device);
+ color_device_refresh (color_device);
- /* watch to see if the user flicked the switch */
- g_signal_connect (G_OBJECT (color_device->widget_switch), "notify::active",
- G_CALLBACK (color_device_notify_enable_device_cb),
- color_device);
+ /* watch to see if the user flicked the switch */
+ g_signal_connect (G_OBJECT (color_device->widget_switch), "notify::active",
+ G_CALLBACK (color_device_notify_enable_device_cb),
+ color_device);
}
static void
color_device_class_init (ColorDeviceClass *klass)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->get_property = color_device_get_property;
- object_class->set_property = color_device_set_property;
- object_class->constructed = color_device_constructed;
- object_class->finalize = color_device_finalize;
-
- g_object_class_install_property (object_class, PROP_DEVICE,
- g_param_spec_object ("device", NULL,
- NULL,
- CD_TYPE_DEVICE,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
- signals [SIGNAL_ENABLED_CHANGED] =
- g_signal_new ("enabled-changed",
- G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
- 0,
- NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN,
- G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ object_class->get_property = color_device_get_property;
+ object_class->set_property = color_device_set_property;
+ object_class->constructed = color_device_constructed;
+ object_class->finalize = color_device_finalize;
+
+ g_object_class_install_property (object_class, PROP_DEVICE,
+ g_param_spec_object ("device", NULL,
+ NULL,
+ CD_TYPE_DEVICE,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+
+ signals [SIGNAL_ENABLED_CHANGED] =
+ g_signal_new ("enabled-changed",
+ G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN,
+ G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
}
static void
color_device_init (ColorDevice *color_device)
{
- GtkWidget *box;
-
- /* description */
- box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 9);
- color_device->widget_icon = gtk_image_new ();
- gtk_widget_set_margin_start (color_device->widget_icon, 12);
- gtk_widget_set_margin_end (color_device->widget_icon, 3);
- gtk_box_pack_start (GTK_BOX (box), color_device->widget_icon, FALSE , FALSE, 0);
-
- color_device->widget_description = gtk_label_new ("");
- gtk_widget_set_margin_top (color_device->widget_description, 12);
- gtk_widget_set_margin_bottom (color_device->widget_description, 12);
- gtk_widget_set_halign (color_device->widget_description, GTK_ALIGN_START);
- gtk_label_set_ellipsize (GTK_LABEL (color_device->widget_description), PANGO_ELLIPSIZE_END);
- gtk_label_set_xalign (GTK_LABEL (color_device->widget_description), 0);
- gtk_box_pack_start (GTK_BOX (box), color_device->widget_description, TRUE, TRUE, 0);
-
- /* switch */
- color_device->widget_switch = gtk_switch_new ();
- gtk_widget_set_valign (color_device->widget_switch, GTK_ALIGN_CENTER);
- gtk_widget_set_margin_end (color_device->widget_switch, 12);
- gtk_box_pack_start (GTK_BOX (box), color_device->widget_switch, FALSE, FALSE, 0);
-
- /* refresh */
- gtk_container_add (GTK_CONTAINER (color_device), box);
- gtk_widget_set_visible (box, TRUE);
+ GtkWidget *box;
+
+ /* description */
+ box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 9);
+ color_device->widget_icon = gtk_image_new ();
+ gtk_widget_set_margin_start (color_device->widget_icon, 12);
+ gtk_widget_set_margin_end (color_device->widget_icon, 3);
+ gtk_box_pack_start (GTK_BOX (box), color_device->widget_icon, FALSE , FALSE, 0);
+
+ color_device->widget_description = gtk_label_new ("");
+ gtk_widget_set_margin_top (color_device->widget_description, 12);
+ gtk_widget_set_margin_bottom (color_device->widget_description, 12);
+ gtk_widget_set_halign (color_device->widget_description, GTK_ALIGN_START);
+ gtk_label_set_ellipsize (GTK_LABEL (color_device->widget_description), PANGO_ELLIPSIZE_END);
+ gtk_label_set_xalign (GTK_LABEL (color_device->widget_description), 0);
+ gtk_box_pack_start (GTK_BOX (box), color_device->widget_description, TRUE, TRUE, 0);
+
+ /* switch */
+ color_device->widget_switch = gtk_switch_new ();
+ gtk_widget_set_valign (color_device->widget_switch, GTK_ALIGN_CENTER);
+ gtk_widget_set_margin_end (color_device->widget_switch, 12);
+ gtk_box_pack_start (GTK_BOX (box), color_device->widget_switch, FALSE, FALSE, 0);
+
+ /* refresh */
+ gtk_container_add (GTK_CONTAINER (color_device), box);
+ gtk_widget_set_visible (box, TRUE);
}
GtkWidget *
color_device_new (CdDevice *device)
{
- return g_object_new (TYPE_COLOR_DEVICE,
- "device", device,
- NULL);
+ return g_object_new (TYPE_COLOR_DEVICE,
+ "device", device,
+ NULL);
}
diff --git a/dialogs/color-settings/color-device.h b/dialogs/color-settings/color-device.h
index c71f5a5..a198f84 100644
--- a/dialogs/color-settings/color-device.h
+++ b/dialogs/color-settings/color-device.h
@@ -29,14 +29,14 @@ G_BEGIN_DECLS
#define TYPE_COLOR_DEVICE (color_device_get_type ())
G_DECLARE_FINAL_TYPE (ColorDevice, color_device, SETTINGS, COLOR_DEVICE, GtkListBoxRow)
-gchar *color_device_get_kind (CdDevice *device);
-gchar *color_device_get_sortable_base (CdDevice *device);
-gchar *color_device_get_title (CdDevice *device);
-GtkWidget *color_device_new (CdDevice *device);
-CdDevice *color_device_get_device (ColorDevice *color_device);
-const gchar *color_device_get_type_icon (CdDevice *device);
-const gchar *color_device_get_sortable (ColorDevice *color_device);
-void color_device_set_enabled (ColorDevice *color_device,
- gboolean enabled);
+gchar *color_device_get_kind (CdDevice *device);
+gchar *color_device_get_sortable_base (CdDevice *device);
+gchar *color_device_get_title (CdDevice *device);
+GtkWidget *color_device_new (CdDevice *device);
+CdDevice *color_device_get_device (ColorDevice *color_device);
+const gchar *color_device_get_type_icon (CdDevice *device);
+const gchar *color_device_get_sortable (ColorDevice *color_device);
+void color_device_set_enabled (ColorDevice *color_device,
+ gboolean enabled);
G_END_DECLS
diff --git a/dialogs/color-settings/color-profile.c b/dialogs/color-settings/color-profile.c
index b66418b..7dc171e 100644
--- a/dialogs/color-settings/color-profile.c
+++ b/dialogs/color-settings/color-profile.c
@@ -28,21 +28,18 @@
struct _ColorProfile
{
- GtkListBoxRow parent_instance;
-
- GtkWidget *box;
- CdDevice *device;
- CdProfile *profile;
- gboolean is_default;
- GtkWidget *widget_description;
- GtkWidget *widget_image;
- guint device_changed_id;
- guint profile_changed_id;
+ GtkListBoxRow parent_instance;
+
+ GtkWidget *box;
+ CdDevice *device;
+ CdProfile *profile;
+ gboolean is_default;
+ GtkWidget *widget_description;
+ GtkWidget *widget_image;
+ guint device_changed_id;
+ guint profile_changed_id;
};
-#define GCM_SETTINGS_RECALIBRATE_PRINTER_THRESHOLD "recalibrate-printer-threshold"
-#define GCM_SETTINGS_RECALIBRATE_DISPLAY_THRESHOLD "recalibrate-display-threshold"
-
#define IMAGE_WIDGET_PADDING 9
@@ -50,193 +47,182 @@ G_DEFINE_TYPE (ColorProfile, color_profile, GTK_TYPE_LIST_BOX_ROW)
enum
{
- PROP_0,
- PROP_DEVICE,
- PROP_PROFILE,
- PROP_IS_DEFAULT,
- PROP_LAST
+ PROP_0,
+ PROP_DEVICE,
+ PROP_PROFILE,
+ PROP_IS_DEFAULT,
+ PROP_LAST
};
static gchar *
color_profile_get_profile_date (CdProfile *profile)
{
- gint64 created;
- g_autoptr(GDateTime) dt = NULL;
-
- /* get profile age */
- created = cd_profile_get_created (profile);
- if (created == 0)
- return NULL;
- dt = g_date_time_new_from_unix_utc (created);
- if (dt)
- return g_date_time_format (dt, "%x");
- else
- return NULL;
+ gint64 created;
+ g_autoptr(GDateTime) dt = NULL;
+
+ /* get profile age */
+ created = cd_profile_get_created (profile);
+ if (created == 0)
+ return NULL;
+ dt = g_date_time_new_from_unix_utc (created);
+ if (dt)
+ return g_date_time_format (dt, "%x");
+ else
+ return NULL;
}
static gchar *
gcm_prefs_get_profile_title (CdProfile *profile)
{
- CdColorspace colorspace;
- const gchar *tmp;
- GString *str;
-
- str = g_string_new ("");
-
- /* add date only if it's a calibration profile or the profile has
- * not been tagged with this data */
- tmp = cd_profile_get_metadata_item (profile, CD_PROFILE_METADATA_DATA_SOURCE);
- if (tmp == NULL || g_strcmp0 (tmp, CD_PROFILE_METADATA_DATA_SOURCE_CALIB) == 0)
- {
- tmp = color_profile_get_profile_date (profile);
- if (tmp != NULL)
- g_string_append_printf (str, "%s - ", tmp);
+ CdColorspace colorspace;
+ const gchar *tmp;
+ GString *str;
+
+ str = g_string_new ("");
+
+ /* add date only if it's a calibration profile or the profile has
+ * not been tagged with this data */
+ tmp = cd_profile_get_metadata_item (profile, CD_PROFILE_METADATA_DATA_SOURCE);
+ if (tmp == NULL || g_strcmp0 (tmp, CD_PROFILE_METADATA_DATA_SOURCE_CALIB) == 0) {
+ tmp = color_profile_get_profile_date (profile);
+ if (tmp != NULL)
+ g_string_append_printf (str, "%s - ", tmp);
}
- else if (g_strcmp0 (tmp, CD_PROFILE_METADATA_DATA_SOURCE_STANDARD) == 0)
- {
- /* TRANSLATORS: standard spaces are well known colorspaces like
- * sRGB, AdobeRGB and ProPhotoRGB */
- g_string_append_printf (str, "%s - ", _("Standard Space"));
+ else if (g_strcmp0 (tmp, CD_PROFILE_METADATA_DATA_SOURCE_STANDARD) == 0) {
+ /* TRANSLATORS: standard spaces are well known colorspaces like
+ * sRGB, AdobeRGB and ProPhotoRGB */
+ g_string_append_printf (str, "%s - ", _("Standard Space"));
}
- else if (g_strcmp0 (tmp, CD_PROFILE_METADATA_DATA_SOURCE_TEST) == 0)
- {
- /* TRANSLATORS: test profiles do things like changing the screen
- * a different color, or swap the red and green channels */
- g_string_append_printf (str, "%s - ", _("Test Profile"));
+ else if (g_strcmp0 (tmp, CD_PROFILE_METADATA_DATA_SOURCE_TEST) == 0) {
+ /* TRANSLATORS: test profiles do things like changing the screen
+ * a different color, or swap the red and green channels */
+ g_string_append_printf (str, "%s - ", _("Test Profile"));
}
- else if (g_strcmp0 (tmp, CD_PROFILE_METADATA_DATA_SOURCE_EDID) == 0)
- {
- /* TRANSLATORS: automatic profiles are generated automatically
- * by the color management system based on manufacturing data,
- * for instance the default monitor profile is created from the
- * primaries specified in the monitor EDID */
- g_string_append_printf (str, "%s - ", C_("Automatically generated profile", "Automatic"));
+ else if (g_strcmp0 (tmp, CD_PROFILE_METADATA_DATA_SOURCE_EDID) == 0) {
+ /* TRANSLATORS: automatic profiles are generated automatically
+ * by the color management system based on manufacturing data,
+ * for instance the default monitor profile is created from the
+ * primaries specified in the monitor EDID */
+ g_string_append_printf (str, "%s - ", C_("Automatically generated profile", "Automatic"));
}
- /* add quality if it exists */
- tmp = cd_profile_get_metadata_item (profile, CD_PROFILE_METADATA_QUALITY);
- if (g_strcmp0 (tmp, CD_PROFILE_METADATA_QUALITY_LOW) == 0)
- {
- /* TRANSLATORS: the profile quality - low quality profiles take
- * much less time to generate but may be a poor reflection of the
- * device capability */
- g_string_append_printf (str, "%s - ", C_("Profile quality", "Low Quality"));
+ /* add quality if it exists */
+ tmp = cd_profile_get_metadata_item (profile, CD_PROFILE_METADATA_QUALITY);
+ if (g_strcmp0 (tmp, CD_PROFILE_METADATA_QUALITY_LOW) == 0) {
+ /* TRANSLATORS: the profile quality - low quality profiles take
+ * much less time to generate but may be a poor reflection of the
+ * device capability */
+ g_string_append_printf (str, "%s - ", C_("Profile quality", "Low Quality"));
}
- else if (g_strcmp0 (tmp, CD_PROFILE_METADATA_QUALITY_MEDIUM) == 0)
- {
- /* TRANSLATORS: the profile quality */
- g_string_append_printf (str, "%s - ", C_("Profile quality", "Medium Quality"));
+ else if (g_strcmp0 (tmp, CD_PROFILE_METADATA_QUALITY_MEDIUM) == 0) {
+ /* TRANSLATORS: the profile quality */
+ g_string_append_printf (str, "%s - ", C_("Profile quality", "Medium Quality"));
}
- else if (g_strcmp0 (tmp, CD_PROFILE_METADATA_QUALITY_HIGH) == 0)
- {
- /* TRANSLATORS: the profile quality - high quality profiles take
- * a *long* time, and have the best calibration and
- * characterisation data. */
- g_string_append_printf (str, "%s - ", C_("Profile quality", "High Quality"));
+ else if (g_strcmp0 (tmp, CD_PROFILE_METADATA_QUALITY_HIGH) == 0) {
+ /* TRANSLATORS: the profile quality - high quality profiles take
+ * a *long* time, and have the best calibration and
+ * characterisation data. */
+ g_string_append_printf (str, "%s - ", C_("Profile quality", "High Quality"));
}
- /* add profile description */
- tmp = cd_profile_get_title (profile);
- if (tmp != NULL)
- {
- g_string_append (str, tmp);
- goto out;
+ /* add profile description */
+ tmp = cd_profile_get_title (profile);
+ if (tmp != NULL) {
+ g_string_append (str, tmp);
+ goto out;
}
- /* some meta profiles do not have ICC profiles */
- colorspace = cd_profile_get_colorspace (profile);
- if (colorspace == CD_COLORSPACE_RGB)
- {
- /* TRANSLATORS: this default RGB space is used for printers that
- * do not have additional printer profiles specified in the PPD */
- g_string_append (str, C_("Colorspace fallback", "Default RGB"));
- goto out;
+ /* some meta profiles do not have ICC profiles */
+ colorspace = cd_profile_get_colorspace (profile);
+ if (colorspace == CD_COLORSPACE_RGB) {
+ /* TRANSLATORS: this default RGB space is used for printers that
+ * do not have additional printer profiles specified in the PPD */
+ g_string_append (str, C_("Colorspace fallback", "Default RGB"));
+ goto out;
}
- if (colorspace == CD_COLORSPACE_CMYK)
- {
- /* TRANSLATORS: this default CMYK space is used for printers that
- * do not have additional printer profiles specified in the PPD */
- g_string_append (str, C_("Colorspace fallback", "Default CMYK"));
- goto out;
+ if (colorspace == CD_COLORSPACE_CMYK) {
+ /* TRANSLATORS: this default CMYK space is used for printers that
+ * do not have additional printer profiles specified in the PPD */
+ g_string_append (str, C_("Colorspace fallback", "Default CMYK"));
+ goto out;
}
- if (colorspace == CD_COLORSPACE_GRAY)
- {
- /* TRANSLATORS: this default gray space is used for printers that
- * do not have additional printer profiles specified in the PPD */
- g_string_append (str, C_("Colorspace fallback", "Default Gray"));
- goto out;
+ if (colorspace == CD_COLORSPACE_GRAY) {
+ /* TRANSLATORS: this default gray space is used for printers that
+ * do not have additional printer profiles specified in the PPD */
+ g_string_append (str, C_("Colorspace fallback", "Default Gray"));
+ goto out;
}
- /* fall back to ID, ick */
- tmp = g_strdup (cd_profile_get_id (profile));
- g_string_append (str, tmp);
+ /* fall back to ID, ick */
+ tmp = g_strdup (cd_profile_get_id (profile));
+ g_string_append (str, tmp);
out:
- return g_string_free (str, FALSE);
+ return g_string_free (str, FALSE);
}
static void
color_profile_refresh (ColorProfile *color_profile)
{
- g_autofree gchar *title = NULL;
+ g_autofree gchar *title = NULL;
- /* show the image if the profile is default */
- gtk_widget_set_visible (color_profile->widget_image, color_profile->is_default);
- gtk_widget_set_margin_start (color_profile->widget_description,
- color_profile->is_default ? 0 : IMAGE_WIDGET_PADDING * 2 + 16);
+ /* show the image if the profile is default */
+ gtk_widget_set_visible (color_profile->widget_image, color_profile->is_default);
+ gtk_widget_set_margin_start (color_profile->widget_description,
+ color_profile->is_default ? 0 : IMAGE_WIDGET_PADDING * 2 + 16);
- /* set the title */
- title = gcm_prefs_get_profile_title (color_profile->profile);
- gtk_label_set_markup (GTK_LABEL (color_profile->widget_description), title);
+ /* set the title */
+ title = gcm_prefs_get_profile_title (color_profile->profile);
+ gtk_label_set_markup (GTK_LABEL (color_profile->widget_description), title);
}
CdDevice *
color_profile_get_device (ColorProfile *color_profile)
{
- g_return_val_if_fail (SETTINGS_IS_COLOR_PROFILE (color_profile), NULL);
- return color_profile->device;
+ g_return_val_if_fail (SETTINGS_IS_COLOR_PROFILE (color_profile), NULL);
+ return color_profile->device;
}
CdProfile *
color_profile_get_profile (ColorProfile *color_profile)
{
- g_return_val_if_fail (SETTINGS_IS_COLOR_PROFILE (color_profile), NULL);
- return color_profile->profile;
+ g_return_val_if_fail (SETTINGS_IS_COLOR_PROFILE (color_profile), NULL);
+ return color_profile->profile;
}
gboolean
color_profile_get_is_default (ColorProfile *color_profile)
{
- g_return_val_if_fail (SETTINGS_IS_COLOR_PROFILE (color_profile), 0);
- return color_profile->is_default;
+ g_return_val_if_fail (SETTINGS_IS_COLOR_PROFILE (color_profile), 0);
+ return color_profile->is_default;
}
void
color_profile_set_is_default (ColorProfile *color_profile, gboolean is_default)
{
- g_return_if_fail (SETTINGS_IS_COLOR_PROFILE (color_profile));
- color_profile->is_default = is_default;
- color_profile_refresh (color_profile);
+ g_return_if_fail (SETTINGS_IS_COLOR_PROFILE (color_profile));
+ color_profile->is_default = is_default;
+ color_profile_refresh (color_profile);
}
static void
color_profile_get_property (GObject *object, guint param_id,
GValue *value, GParamSpec *pspec)
{
- ColorProfile *color_profile = SETTINGS_COLOR_PROFILE (object);
- switch (param_id)
+ ColorProfile *color_profile = SETTINGS_COLOR_PROFILE (object);
+ switch (param_id)
{
- case PROP_DEVICE:
- g_value_set_object (value, color_profile->device);
- break;
- case PROP_PROFILE:
- g_value_set_object (value, color_profile->profile);
- break;
- case PROP_IS_DEFAULT:
- g_value_set_boolean (value, color_profile->is_default);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
+ case PROP_DEVICE:
+ g_value_set_object (value, color_profile->device);
+ break;
+ case PROP_PROFILE:
+ g_value_set_object (value, color_profile->profile);
+ break;
+ case PROP_IS_DEFAULT:
+ g_value_set_boolean (value, color_profile->is_default);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+ break;
}
}
@@ -244,125 +230,125 @@ static void
color_profile_set_property (GObject *object, guint param_id,
const GValue *value, GParamSpec *pspec)
{
- ColorProfile *color_profile = SETTINGS_COLOR_PROFILE (object);
+ ColorProfile *color_profile = SETTINGS_COLOR_PROFILE (object);
- switch (param_id)
+ switch (param_id)
{
- case PROP_DEVICE:
- color_profile->device = g_value_dup_object (value);
- break;
- case PROP_PROFILE:
- color_profile->profile = g_value_dup_object (value);
- break;
- case PROP_IS_DEFAULT:
- color_profile->is_default = g_value_get_boolean (value);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
+ case PROP_DEVICE:
+ color_profile->device = g_value_dup_object (value);
+ break;
+ case PROP_PROFILE:
+ color_profile->profile = g_value_dup_object (value);
+ break;
+ case PROP_IS_DEFAULT:
+ color_profile->is_default = g_value_get_boolean (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+ break;
}
}
static void
color_profile_finalize (GObject *object)
{
- ColorProfile *color_profile = SETTINGS_COLOR_PROFILE (object);
+ ColorProfile *color_profile = SETTINGS_COLOR_PROFILE (object);
- if (color_profile->device_changed_id > 0)
- g_signal_handler_disconnect (color_profile->device, color_profile->device_changed_id);
- if (color_profile->profile_changed_id > 0)
- g_signal_handler_disconnect (color_profile->profile, color_profile->profile_changed_id);
+ if (color_profile->device_changed_id > 0)
+ g_signal_handler_disconnect (color_profile->device, color_profile->device_changed_id);
+ if (color_profile->profile_changed_id > 0)
+ g_signal_handler_disconnect (color_profile->profile, color_profile->profile_changed_id);
- g_object_unref (color_profile->device);
- g_object_unref (color_profile->profile);
+ g_object_unref (color_profile->device);
+ g_object_unref (color_profile->profile);
- G_OBJECT_CLASS (color_profile_parent_class)->finalize (object);
+ G_OBJECT_CLASS (color_profile_parent_class)->finalize (object);
}
static void
color_profile_changed_cb (CdDevice *device,
ColorProfile *color_profile)
{
- g_autoptr(CdProfile) profile = NULL;
+ g_autoptr(CdProfile) profile = NULL;
- /* check to see if the default has changed */
- profile = cd_device_get_default_profile (device);
- if (profile != NULL)
- color_profile->is_default = g_strcmp0 (cd_profile_get_object_path (profile),
- cd_profile_get_object_path (color_profile->profile)) == 0;
+ /* check to see if the default has changed */
+ profile = cd_device_get_default_profile (device);
+ if (profile != NULL)
+ color_profile->is_default = g_strcmp0 (cd_profile_get_object_path (profile),
+ cd_profile_get_object_path (color_profile->profile)) == 0;
- color_profile_refresh (color_profile);
+ color_profile_refresh (color_profile);
}
static void
color_profile_constructed (GObject *object)
{
- ColorProfile *color_profile = SETTINGS_COLOR_PROFILE (object);
- g_autofree gchar *title = NULL;
-
- /* watch to see if the default changes */
- color_profile->device_changed_id =
- g_signal_connect (color_profile->device, "changed",
- G_CALLBACK (color_profile_changed_cb), color_profile);
- color_profile->profile_changed_id =
- g_signal_connect (color_profile->profile, "changed",
- G_CALLBACK (color_profile_changed_cb), color_profile);
-
- color_profile_refresh (color_profile);
+ ColorProfile *color_profile = SETTINGS_COLOR_PROFILE (object);
+ g_autofree gchar *title = NULL;
+
+ /* watch to see if the default changes */
+ color_profile->device_changed_id =
+ g_signal_connect (color_profile->device, "changed",
+ G_CALLBACK (color_profile_changed_cb), color_profile);
+ color_profile->profile_changed_id =
+ g_signal_connect (color_profile->profile, "changed",
+ G_CALLBACK (color_profile_changed_cb), color_profile);
+
+ color_profile_refresh (color_profile);
}
static void
color_profile_class_init (ColorProfileClass *klass)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->get_property = color_profile_get_property;
- object_class->set_property = color_profile_set_property;
- object_class->constructed = color_profile_constructed;
- object_class->finalize = color_profile_finalize;
-
- g_object_class_install_property (object_class, PROP_DEVICE,
- g_param_spec_object ("device", NULL,
- NULL,
- CD_TYPE_DEVICE,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
- g_object_class_install_property (object_class, PROP_PROFILE,
- g_param_spec_object ("profile", NULL,
- NULL,
- CD_TYPE_PROFILE,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
- g_object_class_install_property (object_class, PROP_IS_DEFAULT,
- g_param_spec_boolean ("is-default", NULL,
- NULL,
- FALSE,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ object_class->get_property = color_profile_get_property;
+ object_class->set_property = color_profile_set_property;
+ object_class->constructed = color_profile_constructed;
+ object_class->finalize = color_profile_finalize;
+
+ g_object_class_install_property (object_class, PROP_DEVICE,
+ g_param_spec_object ("device", NULL,
+ NULL,
+ CD_TYPE_DEVICE,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+ g_object_class_install_property (object_class, PROP_PROFILE,
+ g_param_spec_object ("profile", NULL,
+ NULL,
+ CD_TYPE_PROFILE,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+ g_object_class_install_property (object_class, PROP_IS_DEFAULT,
+ g_param_spec_boolean ("is-default", NULL,
+ NULL,
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
}
static void
color_profile_init (ColorProfile *color_profile)
{
- GtkWidget *box;
-
- box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 9);
-
- /* default tick */
- color_profile->widget_image = gtk_image_new_from_icon_name ("object-select-symbolic", GTK_ICON_SIZE_MENU);
- gtk_widget_set_margin_start (color_profile->widget_image, IMAGE_WIDGET_PADDING);
- //gtk_widget_set_margin_end (color_profile->widget_image, IMAGE_WIDGET_PADDING);
- gtk_box_pack_start (GTK_BOX (box), color_profile->widget_image, FALSE, FALSE, 0);
-
- /* description */
- color_profile->widget_description = gtk_label_new ("");
- gtk_widget_set_margin_top (color_profile->widget_description, 9);
- gtk_widget_set_margin_bottom (color_profile->widget_description, 9);
- gtk_widget_set_halign (color_profile->widget_description, GTK_ALIGN_START);
- gtk_label_set_ellipsize (GTK_LABEL (color_profile->widget_description), PANGO_ELLIPSIZE_END);
- gtk_label_set_xalign (GTK_LABEL (color_profile->widget_description), 0);
- gtk_box_pack_start (GTK_BOX (box), color_profile->widget_description, TRUE, TRUE, 0);
- gtk_widget_show (color_profile->widget_description);
-
- /* refresh */
- gtk_container_add (GTK_CONTAINER (color_profile), box);
- gtk_widget_set_visible (box, TRUE);
+ GtkWidget *box;
+
+ box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 9);
+
+ /* default tick */
+ color_profile->widget_image = gtk_image_new_from_icon_name ("object-select-symbolic", GTK_ICON_SIZE_MENU);
+ gtk_widget_set_margin_start (color_profile->widget_image, IMAGE_WIDGET_PADDING);
+ //gtk_widget_set_margin_end (color_profile->widget_image, IMAGE_WIDGET_PADDING);
+ gtk_box_pack_start (GTK_BOX (box), color_profile->widget_image, FALSE, FALSE, 0);
+
+ /* description */
+ color_profile->widget_description = gtk_label_new ("");
+ gtk_widget_set_margin_top (color_profile->widget_description, 9);
+ gtk_widget_set_margin_bottom (color_profile->widget_description, 9);
+ gtk_widget_set_halign (color_profile->widget_description, GTK_ALIGN_START);
+ gtk_label_set_ellipsize (GTK_LABEL (color_profile->widget_description), PANGO_ELLIPSIZE_END);
+ gtk_label_set_xalign (GTK_LABEL (color_profile->widget_description), 0);
+ gtk_box_pack_start (GTK_BOX (box), color_profile->widget_description, TRUE, TRUE, 0);
+ gtk_widget_show (color_profile->widget_description);
+
+ /* refresh */
+ gtk_container_add (GTK_CONTAINER (color_profile), box);
+ gtk_widget_set_visible (box, TRUE);
}
GtkWidget *
@@ -370,9 +356,9 @@ color_profile_new (CdDevice *device,
CdProfile *profile,
gboolean is_default)
{
- return g_object_new (TYPE_COLOR_PROFILE,
- "device", device,
- "profile", profile,
- "is-default", is_default,
- NULL);
+ return g_object_new (TYPE_COLOR_PROFILE,
+ "device", device,
+ "profile", profile,
+ "is-default", is_default,
+ NULL);
}
diff --git a/dialogs/color-settings/color-profile.h b/dialogs/color-settings/color-profile.h
index 57ee9b4..84a24c5 100644
--- a/dialogs/color-settings/color-profile.h
+++ b/dialogs/color-settings/color-profile.h
@@ -30,12 +30,12 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (ColorProfile, color_profile, SETTINGS, COLOR_PROFILE, GtkListBoxRow)
GtkWidget *color_profile_new (CdDevice *device,
- CdProfile *profile,
- gboolean is_default);
-gboolean color_profile_get_is_default (ColorProfile *color_profile);
-void color_profile_set_is_default (ColorProfile *color_profile,
- gboolean profile_is_default);
-CdDevice *color_profile_get_device (ColorProfile *color_profile);
-CdProfile *color_profile_get_profile (ColorProfile *color_profile);
+ CdProfile *profile,
+ gboolean is_default);
+gboolean color_profile_get_is_default (ColorProfile *color_profile);
+void color_profile_set_is_default (ColorProfile *color_profile,
+ gboolean profile_is_default);
+CdDevice *color_profile_get_device (ColorProfile *color_profile);
+CdProfile *color_profile_get_profile (ColorProfile *color_profile);
G_END_DECLS
diff --git a/dialogs/color-settings/main.c b/dialogs/color-settings/main.c
index 5c8cd08..b894627 100644
--- a/dialogs/color-settings/main.c
+++ b/dialogs/color-settings/main.c
@@ -600,10 +600,10 @@ color_settings_device_calibrate_cb (CdProfile *profile, ColorSettings *settings)
app_info = g_app_info_create_from_commandline (cli, "Gnome Color Manager Calibration",
G_APP_INFO_CREATE_NONE, NULL);
if (!g_app_info_launch (app_info, NULL, NULL, &error)) {
- if (error != NULL) {
- g_warning ("gcm-calibrate could not be launched. %s", error->message);
- g_error_free (error);
- }
+ if (error != NULL) {
+ g_warning ("gcm-calibrate could not be launched. %s", error->message);
+ g_error_free (error);
+ }
}
g_free (cli);
@@ -631,10 +631,10 @@ color_settings_profile_info_view (CdProfile *profile, ColorSettings *settings)
app_info = g_app_info_create_from_commandline (cli, "Gnome Color Manager Viewer",
G_APP_INFO_CREATE_NONE, NULL);
if (!g_app_info_launch (app_info, NULL, NULL, &error)) {
- if (error != NULL) {
- g_warning ("gcm-viewer could not be launched. %s", error->message);
- g_error_free (error);
- }
+ if (error != NULL) {
+ g_warning ("gcm-viewer could not be launched. %s", error->message);
+ g_error_free (error);
+ }
}
g_free (cli);
@@ -885,8 +885,7 @@ color_settings_profiles_list_box_row_activated_cb (GtkListBox *list_box,
GtkListBoxRow *row,
ColorSettings *settings)
{
- if (SETTINGS_IS_COLOR_PROFILE (row))
- {
+ if (SETTINGS_IS_COLOR_PROFILE (row)) {
color_settings_device_profile_enable_cb (NULL, settings);
}
}
@@ -1012,12 +1011,12 @@ color_settings_device_changed_cb (CdDevice *device,
/* add anything in Device.Profiles that's not in the list view */
for (i = 0; i < profiles->len; i++) {
- profile_tmp = g_ptr_array_index (profiles, i);
- ret = color_settings_find_widget_by_object_path (list,
- cd_device_get_object_path (device),
- cd_profile_get_object_path (profile_tmp));
- if (!ret)
- color_settings_add_device_profile (settings, device, profile_tmp, i == 0);
+ profile_tmp = g_ptr_array_index (profiles, i);
+ ret = color_settings_find_widget_by_object_path (list,
+ cd_device_get_object_path (device),
+ cd_profile_get_object_path (profile_tmp));
+ if (!ret)
+ color_settings_add_device_profile (settings, device, profile_tmp, i == 0);
}
color_settings_update_profile_list_extra_entry (settings);
@@ -1135,13 +1134,13 @@ color_settings_sort_func (GtkListBoxRow *a,
GtkListBoxRow *b,
gpointer user_data)
{
- const gchar *sort_a = NULL;
- const gchar *sort_b = NULL;
+ const gchar *sort_a = NULL;
+ const gchar *sort_b = NULL;
- sort_a = color_device_get_sortable (SETTINGS_COLOR_DEVICE (a));
- sort_b = color_device_get_sortable (SETTINGS_COLOR_DEVICE (b));
+ sort_a = color_device_get_sortable (SETTINGS_COLOR_DEVICE (a));
+ sort_b = color_device_get_sortable (SETTINGS_COLOR_DEVICE (b));
- return g_strcmp0 (sort_b, sort_a);
+ return g_strcmp0 (sort_b, sort_a);
}
@@ -1355,7 +1354,7 @@ main (gint argc, gchar **argv)
xfce_textdomain (GETTEXT_PACKAGE, LOCALEDIR, "UTF-8");
/* initialize Gtk+ */
- if(!gtk_init_with_args (&argc, &argv, "", entries, PACKAGE, &error)) {
+ if (!gtk_init_with_args (&argc, &argv, "", entries, PACKAGE, &error)) {
if (G_LIKELY (error)) {
/* print error */
g_print ("%s: %s.\n", G_LOG_DOMAIN, error->message);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list