From b0c6e5e8454fe7aac5e3d1db2d9319a22e371ce9 Mon Sep 17 00:00:00 2001 From: joncruz Date: Thu, 27 Nov 2008 09:58:19 +0000 Subject: [PATCH] List color profile search locations in preference tooltip --- src/color-profile.cpp | 8 +++++++- src/color-profile.h | 1 + src/ui/dialog/inkscape-preferences.cpp | 17 ++++++++++++++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/color-profile.cpp b/src/color-profile.cpp index fbfa8efb1..2aec6c2f0 100644 --- a/src/color-profile.cpp +++ b/src/color-profile.cpp @@ -562,7 +562,7 @@ Glib::ustring Inkscape::get_path_for_profile(Glib::ustring const& name) return result; } -static void findThings() { +std::list ColorProfile::getProfileDirs() { std::list sources; gchar* base = profile_path("XXX"); @@ -584,6 +584,12 @@ static void findThings() { sources.push_back(g_build_filename(dataDirs[i], "color", "icc", NULL)); } + return sources; +} + +static void findThings() { + std::list sources = ColorProfile::getProfileDirs(); + while (!sources.empty()) { gchar *dirname = sources.front(); if ( g_file_test( dirname, G_FILE_TEST_EXISTS ) && g_file_test( dirname, G_FILE_TEST_IS_DIR ) ) { diff --git a/src/color-profile.h b/src/color-profile.h index 7fbc7812e..0c4ec8e09 100644 --- a/src/color-profile.h +++ b/src/color-profile.h @@ -34,6 +34,7 @@ struct ColorProfile : public SPObject { #if ENABLE_LCMS static cmsHPROFILE getSRGBProfile(); + static std::list getProfileDirs(); icColorSpaceSignature getColorSpace() const {return _profileSpace;} icProfileClassSignature getProfileClass() const {return _profileClass;} diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index e680115fe..cfca21247 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -39,6 +39,7 @@ #include "display/nr-filter-gaussian.h" #include "display/nr-filter-types.h" #include "color-profile-fns.h" +#include "color-profile.h" #include "display/canvas-grid.h" namespace Inkscape { @@ -815,8 +816,22 @@ void InkscapePreferences::initPageCMS() _page_cms.add_group_header( _("Display adjustment")); + Glib::ustring tmpStr; + std::list sources = ColorProfile::getProfileDirs(); + while (!sources.empty()) { + gchar* dirname = sources.front(); + gchar* part = g_strdup_printf("\n%s", dirname); + tmpStr += part; + g_free(part); + g_free(dirname); + sources.pop_front(); + } + + gchar* profileTip = g_strdup_printf(_("The ICC profile to use to calibrate display output.\nSearched directories:%s"), tmpStr.c_str()); _page_cms.add_line( false, _("Display profile:"), _cms_display_profile, "", - _("The ICC profile to use to calibrate display output."), false); + profileTip, false); + g_free(profileTip); + profileTip = 0; _cms_from_display.init( _("Retrieve profile from display"), "/options/displayprofile/from_display", false); _page_cms.add_line( false, "", _cms_from_display, "", -- 2.30.2