103
104
if (entry_type == GCM_PREFS_ENTRY_TYPE_IMPORT)
105
106
/* TRANSLATORS: this is where the user can click and import a profile */
106
description = _("Other profile…");
107
string = g_string_new (_("Other profile…"));
110
description = cd_profile_get_title (profile);
111
string = g_string_new (cd_profile_get_title (profile));
113
/* any source prefix? */
114
id = cd_profile_get_metadata_item (profile,
115
CD_PROFILE_METADATA_DATA_SOURCE);
116
if (g_strcmp0 (id, CD_PROFILE_METADATA_DATA_SOURCE_EDID) == 0)
118
/* TRANSLATORS: this is a profile prefix to signify the
119
* profile has been auto-generated for this hardware */
120
g_string_prepend (string, _("Default: "));
122
#if CD_CHECK_VERSION(0,1,14)
123
if (g_strcmp0 (id, CD_PROFILE_METADATA_DATA_SOURCE_STANDARD) == 0)
125
/* TRANSLATORS: this is a profile prefix to signify the
126
* profile his a standard space like AdobeRGB */
127
g_string_prepend (string, _("Colorspace: "));
129
if (g_strcmp0 (id, CD_PROFILE_METADATA_DATA_SOURCE_TEST) == 0)
131
/* TRANSLATORS: this is a profile prefix to signify the
132
* profile is a test profile */
133
g_string_prepend (string, _("Test profile: "));
113
138
/* also add profile */
114
139
model = gtk_combo_box_get_model (GTK_COMBO_BOX(widget));
115
140
gtk_list_store_append (GTK_LIST_STORE(model), iter);
116
141
gtk_list_store_set (GTK_LIST_STORE(model), iter,
117
GCM_PREFS_COMBO_COLUMN_TEXT, description,
142
GCM_PREFS_COMBO_COLUMN_TEXT, string->str,
118
143
GCM_PREFS_COMBO_COLUMN_PROFILE, profile,
119
144
GCM_PREFS_COMBO_COLUMN_TYPE, entry_type,
146
g_string_free (string, TRUE);
408
434
gcm_prefs_is_profile_suitable_for_device (CdProfile *profile,
409
435
CdDevice *device)
437
#if CD_CHECK_VERSION(0,1,14)
438
const gchar *data_source;
411
440
CdProfileKind profile_kind_tmp;
412
441
CdProfileKind profile_kind;
413
442
CdColorspace profile_colorspace;
428
457
if (profile_kind_tmp != profile_kind)
460
#if CD_CHECK_VERSION(0,1,14)
461
/* ignore the colorspace profiles */
462
data_source = cd_profile_get_metadata_item (profile,
463
CD_PROFILE_METADATA_DATA_SOURCE);
464
if (g_strcmp0 (data_source, CD_PROFILE_METADATA_DATA_SOURCE_STANDARD) == 0)
574
612
profile = cd_device_get_default_profile (priv->current_device);
575
613
gcm_prefs_add_profiles_suitable_for_devices (prefs, widget, profile);
616
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,
617
"label_assign_title"));
618
switch (cd_device_get_kind (priv->current_device)) {
619
case CD_DEVICE_KIND_DISPLAY:
620
/* TRANSLATORS: this is the dialog title in the 'Add profile' UI */
621
title = _("Available Profiles for Displays");
623
case CD_DEVICE_KIND_SCANNER:
624
/* TRANSLATORS: this is the dialog title in the 'Add profile' UI */
625
title = _("Available Profiles for Scanners");
627
case CD_DEVICE_KIND_PRINTER:
628
/* TRANSLATORS: this is the dialog title in the 'Add profile' UI */
629
title = _("Available Profiles for Printers");
631
case CD_DEVICE_KIND_CAMERA:
632
/* TRANSLATORS: this is the dialog title in the 'Add profile' UI */
633
title = _("Available Profiles for Cameras");
635
case CD_DEVICE_KIND_WEBCAM:
636
/* TRANSLATORS: this is the dialog title in the 'Add profile' UI */
637
title = _("Available Profiles for Webcams");
640
/* TRANSLATORS: this is the dialog title in the 'Add profile' UI
641
* where the device type is not recognised */
642
title = _("Available Profiles");
645
gtk_label_set_label (GTK_LABEL (widget), title);
577
647
/* show the dialog */
578
648
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,
579
649
"dialog_assign"));
701
771
gcm_prefs_run_maybe_install (xid, viewer_filename, argv);
704
g_ptr_array_unref (argv);
773
g_ptr_array_unref (argv);
705
774
g_free (options);
706
775
if (profile != NULL)
707
776
g_object_unref (profile);
1194
1263
g_object_set (renderer,
1195
1264
"ellipsize", PANGO_ELLIPSIZE_END,
1196
1265
"wrap-mode", PANGO_WRAP_WORD_CHAR,
1199
1267
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_box), renderer, TRUE);
1200
1268
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box), renderer,
1335
1403
static const gchar *
1336
1404
gcm_prefs_device_kind_to_icon_name (CdDeviceKind kind)
1338
if (kind == CD_DEVICE_KIND_DISPLAY)
1407
case CD_DEVICE_KIND_DISPLAY:
1339
1408
return "video-display";
1340
if (kind == CD_DEVICE_KIND_SCANNER)
1409
case CD_DEVICE_KIND_SCANNER:
1341
1410
return "scanner";
1342
if (kind == CD_DEVICE_KIND_PRINTER)
1411
case CD_DEVICE_KIND_PRINTER:
1343
1412
return "printer";
1344
if (kind == CD_DEVICE_KIND_CAMERA)
1345
return "camera-photo";
1346
if (kind == CD_DEVICE_KIND_CAMERA)
1347
return "camera-photo";
1348
if (kind == CD_DEVICE_KIND_WEBCAM)
1413
case CD_DEVICE_KIND_CAMERA:
1414
return "camera-photo";
1415
case CD_DEVICE_KIND_WEBCAM:
1349
1416
return "camera-web";
1350
return "image-missing";
1354
gcm_prefs_profile_is_based_from_edid (CdProfile *profile)
1356
if (cd_profile_get_kind (profile) != CD_PROFILE_KIND_DISPLAY_DEVICE)
1358
if (cd_profile_get_metadata_item (profile, "EDID_md5") == NULL)
1418
return "image-missing";
1363
1422
static GString *
1364
1423
gcm_prefs_get_profile_age_as_string (CdProfile *profile)
1427
GString *string = NULL;
1369
1429
if (profile == NULL)
1436
/* don't show details for EDID, colorspace or test profiles */
1437
id = cd_profile_get_metadata_item (profile,
1438
CD_PROFILE_METADATA_DATA_SOURCE);
1439
if (g_strcmp0 (id, CD_PROFILE_METADATA_DATA_SOURCE_EDID) == 0)
1441
#if CD_CHECK_VERSION(0,1,14)
1442
if (g_strcmp0 (id, CD_PROFILE_METADATA_DATA_SOURCE_STANDARD) == 0)
1444
if (g_strcmp0 (id, CD_PROFILE_METADATA_DATA_SOURCE_TEST) == 0)
1377
1449
age = cd_profile_get_age (profile);
1661
1733
status = gcm_prefs_get_profile_age_as_string (profile);
1736
status = g_string_new (_("Uncalibrated"));
1737
g_string_prepend (status, "<span foreground='gray'><i>");
1738
g_string_append (status, "</i></span>");
1663
1741
/* greater than the calibration threshold for the device type */
1664
1742
age = cd_profile_get_age (profile);
1702
1780
profile_tmp = g_ptr_array_index (profiles, i);
1703
1781
title_tmp = gcm_prefs_get_profile_title (prefs, profile_tmp);
1705
/* don't show details for EDID profiles */
1706
if (gcm_prefs_profile_is_based_from_edid (profile_tmp))
1783
/* get profile age */
1784
date_tmp = gcm_prefs_get_profile_age_as_string (profile_tmp);
1785
if (date_tmp == NULL)
1708
1787
/* TRANSLATORS: this is when the calibration profile age is not
1709
1788
* specified as it has been autogenerated from the hardware */
1711
1790
g_string_prepend (date_tmp, "<span foreground='gray'><i>");
1712
1791
g_string_append (date_tmp, "</i></span>");
1716
date_tmp = gcm_prefs_get_profile_age_as_string (profile_tmp);
1718
1793
sort_tmp = gcm_prefs_get_profile_created_for_sort (profile_tmp);
1720
1795
/* get an existing profile, or create a new one */