Code

List color profile search locations in preference tooltip
authorjoncruz <joncruz@users.sourceforge.net>
Thu, 27 Nov 2008 09:58:19 +0000 (09:58 +0000)
committerjoncruz <joncruz@users.sourceforge.net>
Thu, 27 Nov 2008 09:58:19 +0000 (09:58 +0000)
src/color-profile.cpp
src/color-profile.h
src/ui/dialog/inkscape-preferences.cpp

index fbfa8efb1697d910dda780cca834d912137b6e1e..2aec6c2f001c97c932072e01e6a6e4cf44573190 100644 (file)
@@ -562,7 +562,7 @@ Glib::ustring Inkscape::get_path_for_profile(Glib::ustring const& name)
     return result;
 }
 
-static void findThings() {
+std::list<gchar *> ColorProfile::getProfileDirs() {
     std::list<gchar *> 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<gchar *> 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 ) ) {
index 7fbc7812e5bbec1d8e75539cafacaa98f2be3a79..0c4ec8e09061a959c44b17f9900238389d3f90b3 100644 (file)
@@ -34,6 +34,7 @@ struct ColorProfile : public SPObject {
 
 #if ENABLE_LCMS
     static cmsHPROFILE getSRGBProfile();
+    static std::list<gchar *> getProfileDirs();
 
     icColorSpaceSignature getColorSpace() const {return _profileSpace;}
     icProfileClassSignature getProfileClass() const {return _profileClass;}
index e680115fec3e4fed697909f736953689d95ba7e1..cfca212472bd99437413d7bb7778c7b6d7c73d91 100644 (file)
@@ -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<gchar *> 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, "",