diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2007-10-01 03:55:20 +0000 |
|---|---|---|
| committer | joncruz <joncruz@users.sourceforge.net> | 2007-10-01 03:55:20 +0000 |
| commit | f9740d35c3f06b08349cac436ddf1d00e02fdc9d (patch) | |
| tree | 623ec42f0fb8c9b717079dc0e078d896cc0521ae /src/ui | |
| parent | Convolve Matrix Filter: (diff) | |
| download | inkscape-f9740d35c3f06b08349cac436ddf1d00e02fdc9d.tar.gz inkscape-f9740d35c3f06b08349cac436ddf1d00e02fdc9d.zip | |
Added searching for icc profiles in standard locations, and preference to combo box.
(bzr r3819)
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/dialog/inkscape-preferences.cpp | 35 | ||||
| -rw-r--r-- | src/ui/dialog/inkscape-preferences.h | 4 |
2 files changed, 33 insertions, 6 deletions
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 436d5cce6..59132349f 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -37,6 +37,7 @@ #include "xml/repr.h" #include "ui/widget/style-swatch.h" #include "display/nr-filter-gaussian.h" +#include "color-profile-fns.h" namespace Inkscape { namespace UI { @@ -632,8 +633,20 @@ static void forceUpdates() { (*it)->requestRedraw(); } } + +static void profileComboChanged( Gtk::ComboBoxText* combo ) +{ + Glib::ustring active = combo->get_active_text(); + + Glib::ustring path = get_path_for_profile(active); + if ( !path.empty() ) { + prefs_set_string_attribute( "options.displayprofile", "uri", path.c_str() ); + forceUpdates(); + } +} #endif // ENABLE_LCMS + void InkscapePreferences::initPageMisc() { _misc_comment.init( _("Add label comments to printing output"), "printing.debug", "show-label-comments", false); @@ -647,14 +660,28 @@ void InkscapePreferences::initPageMisc() _misc_cms_display.init( _("Enable display calibration"), "options.displayprofile", "enable", false); _page_misc.add_line( false, "", _misc_cms_display, "", _("Enables application of the display using an ICC profile."), true); - _misc_cms_display_profile.init("options.displayprofile", "uri"); + _page_misc.add_line( false, _("Display profile:"), _misc_cms_display_profile, "", - _("The ICC profile to use to calibrate display output."), true); + _("The ICC profile to use to calibrate display output."), true); #if ENABLE_LCMS - _misc_cms_display.signal_toggled().connect( sigc::ptr_fun(forceUpdates) ); + { + std::vector<Glib::ustring> names = ::Inkscape::colorprofile_get_display_names(); + Glib::ustring current = prefs_get_string_attribute( "options.displayprofile", "uri" ); + + gint index = 0; + for ( std::vector<Glib::ustring>::iterator it = names.begin(); it != names.end(); ++it ) { + _misc_cms_display_profile.append_text( *it ); + Glib::ustring path = get_path_for_profile(*it); + if ( !path.empty() && path == current ) { + _misc_cms_display_profile.set_active(index); + } + index++; + } + } - _misc_cms_display_profile.signal_selection_changed().connect( sigc::ptr_fun(forceUpdates) ); + _misc_cms_display.signal_toggled().connect( sigc::ptr_fun(forceUpdates) ); + _misc_cms_display_profile.signal_changed().connect( sigc::bind( sigc::ptr_fun(profileComboChanged), &_misc_cms_display_profile) ); #else // disable it, but leave it visible _misc_cms_display.set_sensitive( false ); diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h index eff068569..5dafd4051 100644 --- a/src/ui/dialog/inkscape-preferences.h +++ b/src/ui/dialog/inkscape-preferences.h @@ -162,8 +162,8 @@ protected: PrefCheckButton _misc_small_toolbar; PrefCombo _misc_overs_bitmap; - PrefCheckButton _misc_cms_display; - PrefFileButton _misc_cms_display_profile; + PrefCheckButton _misc_cms_display; + Gtk::ComboBoxText _misc_cms_display_profile; PrefEntryButtonHBox _importexport_ocal_url; PrefEntry _importexport_ocal_username; |
