[gnome-color-manager] Set the calibrate button insensitive if VTE is unavailable
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-color-manager] Set the calibrate button insensitive if VTE is unavailable
- Date: Thu, 17 Jun 2010 14:56:07 +0000 (UTC)
commit 4ec4793564ee0b1fc796854913dd790870d7c8f1
Author: Richard Hughes <richard hughsie com>
Date: Thu Jun 17 15:55:50 2010 +0100
Set the calibrate button insensitive if VTE is unavailable
configure.ac | 20 +++++---------------
src/gcm-prefs.c | 26 +++++++++++++++++++-------
2 files changed, 24 insertions(+), 22 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 99eab0f..bc30f15 100644
--- a/configure.ac
+++ b/configure.ac
@@ -99,29 +99,19 @@ AM_GLIB_GNU_GETTEXT
GLIB_GSETTINGS
dnl ---------------------------------------------------------------------------
-dnl - Library dependencies
-dnl ---------------------------------------------------------------------------
-GLIB_REQUIRED=2.14.0
-GTK_REQUIRED=2.90.0
-GNOMEDESKTOP_REQUIRED=2.90.0
-VTE_REQUIRED=0.25.1
-CANBERRA_REQUIRED=0.10
-GIO_REQUIRED=2.25.8
-
-dnl ---------------------------------------------------------------------------
dnl - Check library dependencies
dnl ---------------------------------------------------------------------------
-PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED gobject-2.0 gthread-2.0 gio-2.0 >= $GIO_REQUIRED)
+PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.14.0 gobject-2.0 gthread-2.0 gio-2.0 >= 2.25.8)
PKG_CHECK_MODULES(XORG, xxf86vm xrandr)
-PKG_CHECK_MODULES(GTK, gtk+-3.0 >= $GTK_REQUIRED)
-PKG_CHECK_MODULES(GNOMEDESKTOP, gnome-desktop-3.0 >= $GNOMEDESKTOP_REQUIRED)
+PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 2.90.0)
+PKG_CHECK_MODULES(GNOMEDESKTOP, gnome-desktop-3.0 >= 2.90.0)
PKG_CHECK_MODULES(GUDEV, gudev-1.0)
PKG_CHECK_MODULES(LCMS, lcms)
PKG_CHECK_MODULES(X11, x11)
PKG_CHECK_MODULES(NOTIFY, libnotify)
dnl **** Check for VTE ****
-PKG_CHECK_MODULES(VTE, vte3 >= $VTE_REQUIRED, has_vte=yes, has_vte=no)
+PKG_CHECK_MODULES(VTE, vte3 >= 0.25.1, has_vte=yes, has_vte=no)
AM_CONDITIONAL(GCM_USE_VTE, test x$has_vte = xyes)
if test x$has_vte = xyes; then
AC_DEFINE(GCM_USE_VTE,1,[Use VTE terminal widget])
@@ -159,7 +149,7 @@ if test x$enable_exiv = xyes; then
AC_DEFINE(GCM_USE_EXIV,1,[Use EXIV support for detecting scanners])
fi
-PKG_CHECK_MODULES(CANBERRA, libcanberra-gtk3 >= $CANBERRA_REQUIRED)
+PKG_CHECK_MODULES(CANBERRA, libcanberra-gtk3 >= 0.10)
PKG_CHECK_MODULES(EXIF, libexif)
AC_CHECK_LIB(tiff, TIFFReadRGBAImageOriented,
diff --git a/src/gcm-prefs.c b/src/gcm-prefs.c
index db326dc..8150a30 100644
--- a/src/gcm-prefs.c
+++ b/src/gcm-prefs.c
@@ -1575,6 +1575,7 @@ gcm_prefs_set_calibrate_button_sensitivity (void)
GcmDeviceKind kind;
gboolean connected;
gboolean xrandr_fallback;
+ gboolean has_vte = TRUE;
/* TRANSLATORS: this is when the button is sensitive */
tooltip = _("Create a color profile for the selected device");
@@ -1582,7 +1583,18 @@ gcm_prefs_set_calibrate_button_sensitivity (void)
/* no device selected */
if (current_device == NULL) {
/* TRANSLATORS: this is when the button is insensitive */
- tooltip = _("Cannot profile: No device is selected");
+ tooltip = _("Cannot create profile: No device is selected");
+ goto out;
+ }
+
+#ifndef GCM_USE_VTE
+ has_vte = FALSE;
+#endif
+
+ /* no VTE support */
+ if (!has_vte) {
+ /* TRANSLATORS: this is when the button is insensitive because the distro compiled GCM without VTE */
+ tooltip = _("Cannot create profile: Virtual console support is missing");
goto out;
}
@@ -1594,7 +1606,7 @@ gcm_prefs_set_calibrate_button_sensitivity (void)
connected = gcm_device_get_connected (current_device);
if (!connected) {
/* TRANSLATORS: this is when the button is insensitive */
- tooltip = _("Cannot calibrate: The display device is not connected");
+ tooltip = _("Cannot create profile: The display device is not connected");
goto out;
}
@@ -1602,7 +1614,7 @@ gcm_prefs_set_calibrate_button_sensitivity (void)
xrandr_fallback = gcm_device_xrandr_get_fallback (GCM_DEVICE_XRANDR (current_device));
if (xrandr_fallback) {
/* TRANSLATORS: this is when the button is insensitive */
- tooltip = _("Cannot calibrate: The display driver does not support XRandR 1.3");
+ tooltip = _("Cannot create profile: The display driver does not support XRandR 1.3");
goto out;
}
@@ -1610,7 +1622,7 @@ gcm_prefs_set_calibrate_button_sensitivity (void)
ret = gcm_colorimeter_get_present (colorimeter);
if (!ret) {
/* TRANSLATORS: this is when the button is insensitive */
- tooltip = _("Cannot calibrate: The measuring instrument is not plugged in");
+ tooltip = _("Cannot create profile: The measuring instrument is not plugged in");
goto out;
}
} else if (kind == GCM_DEVICE_KIND_SCANNER ||
@@ -1625,7 +1637,7 @@ gcm_prefs_set_calibrate_button_sensitivity (void)
ret = gcm_colorimeter_get_present (colorimeter);
if (!ret) {
/* TRANSLATORS: this is when the button is insensitive */
- tooltip = _("Cannot profile: The measuring instrument is not plugged in");
+ tooltip = _("Cannot create profile: The measuring instrument is not plugged in");
goto out;
}
@@ -1633,14 +1645,14 @@ gcm_prefs_set_calibrate_button_sensitivity (void)
ret = gcm_colorimeter_supports_printer (colorimeter);
if (!ret) {
/* TRANSLATORS: this is when the button is insensitive */
- tooltip = _("Cannot profile: The measuring instrument does not support printer profiling");
+ tooltip = _("Cannot create profile: The measuring instrument does not support printer profiling");
goto out;
}
} else {
/* TRANSLATORS: this is when the button is insensitive */
- tooltip = _("Cannot profile this type of device");
+ tooltip = _("Cannot create a profile for this type of device");
}
out:
/* control the tooltip and sensitivity of the button */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]