diff --git a/rtengine/iccstore.cc b/rtengine/iccstore.cc index 89090ce21..3bcc8515e 100644 --- a/rtengine/iccstore.cc +++ b/rtengine/iccstore.cc @@ -302,6 +302,8 @@ public: if (loadAll) { loadProfiles(stdProfilesDir, nullptr, nullptr, &fileStdProfilesFileNames, true); } + + defaultMonitorProfile = settings->monitorProfile; } cmsHPROFILE workingSpace(const Glib::ustring& name) const @@ -534,6 +536,16 @@ public: return getProofIntents(getProfile(name)); } + Glib::ustring getDefaultMonitorProfileName() const + { + return defaultMonitorProfile; + } + + void setDefaultMonitorProfileName(const Glib::ustring &name) + { + defaultMonitorProfile = name; + } + private: using ProfileMap = std::map; using MatrixMap = std::map; @@ -617,6 +629,18 @@ rtengine::ProfileContent rtengine::ICCStore::getContent(const Glib::ustring& nam return implementation->getContent(name); } + +Glib::ustring rtengine::ICCStore::getDefaultMonitorProfileName() const +{ + return implementation->getDefaultMonitorProfileName(); +} + + +void rtengine::ICCStore::setDefaultMonitorProfileName(const Glib::ustring &name) +{ + implementation->setDefaultMonitorProfileName(name); +} + cmsHPROFILE rtengine::ICCStore::getXYZProfile() const { return implementation->getXYZProfile(); diff --git a/rtengine/iccstore.h b/rtengine/iccstore.h index 6231e22ae..48efae087 100644 --- a/rtengine/iccstore.h +++ b/rtengine/iccstore.h @@ -78,6 +78,9 @@ public: cmsHPROFILE getStdProfile(const Glib::ustring& name) const; ProfileContent getContent(const Glib::ustring& name) const; + Glib::ustring getDefaultMonitorProfileName() const; + void setDefaultMonitorProfileName(const Glib::ustring &name); + cmsHPROFILE getXYZProfile() const; cmsHPROFILE getsRGBProfile() const; diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index 00b660036..798964275 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -1040,7 +1040,7 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, int rhei ImProcFunctions ipf (¶ms, false); ipf.setScale (sqrt(double(fw * fw + fh * fh)) / sqrt(double(thumbImg->getWidth() * thumbImg->getWidth() + thumbImg->getHeight() * thumbImg->getHeight()))*scale); - ipf.updateColorProfiles (options.rtSettings.monitorProfile, options.rtSettings.monitorIntent, false, false); + ipf.updateColorProfiles (ICCStore::getInstance()->getDefaultMonitorProfileName(), options.rtSettings.monitorIntent, false, false); LUTu hist16 (65536); diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 55db072a4..459abbe5b 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -160,7 +160,12 @@ private: Glib::ustring defprofname; if (find_default_monitor_profile(profileBox.get_root_window()->gobj(), defprof, defprofname)) { profileBox.append (M ("MONITOR_PROFILE_SYSTEM") + " (" + defprofname + ")"); - profileBox.set_active (options.rtSettings.autoMonitorProfile ? 1 : 0); + if (options.rtSettings.autoMonitorProfile) { + rtengine::ICCStore::getInstance()->setDefaultMonitorProfileName(defprof); + profileBox.set_active(1); + } else { + profileBox.set_active(0); + } } else { profileBox.set_active (0); } @@ -402,7 +407,7 @@ public: ConnectionBlocker profileBlocker (profileConn); if (!defprof.empty() && options.rtSettings.autoMonitorProfile) { - setActiveTextOrIndex (profileBox, options.rtSettings.monitorProfile, 1); + profileBox.set_active(1); } else { setActiveTextOrIndex (profileBox, options.rtSettings.monitorProfile, 0); } @@ -426,6 +431,23 @@ public: updateParameters (); } + void defaultMonitorProfileChanged(const Glib::ustring &profile_name, bool auto_monitor_profile) + { + ConnectionBlocker profileBlocker (profileConn); + + if (auto_monitor_profile && !defprof.empty()) { + rtengine::ICCStore::getInstance()->setDefaultMonitorProfileName(defprof); +#ifndef __APPLE__ + profileBox.set_active(1); +#endif + } else { + rtengine::ICCStore::getInstance()->setDefaultMonitorProfileName(profile_name); +#ifndef __APPLE__ + setActiveTextOrIndex(profileBox, profile_name, 0); +#endif + } + } + }; EditorPanel::EditorPanel (FilePanel* filePanel) @@ -2214,3 +2236,10 @@ void EditorPanel::updateHistogramPosition (int oldPosition, int newPosition) iareapanel->imageArea->setPointerMotionHListener (histogramPanel); } + + +void EditorPanel::defaultMonitorProfileChanged(const Glib::ustring &profile_name, bool auto_monitor_profile) +{ + colorMgmtToolBar->defaultMonitorProfileChanged(profile_name, auto_monitor_profile); +} + diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index 4434a660e..6cfedb634 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -129,6 +129,8 @@ public: void updateTabsUsesIcons (bool useIcons); void updateHistogramPosition (int oldPosition, int newPosition); + void defaultMonitorProfileChanged(const Glib::ustring &profile_name, bool auto_monitor_profile); + Gtk::Paned* catalogPane; private: diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index f33a1c385..11350faaf 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -742,7 +742,9 @@ Gtk::Widget* Preferences::getColorManagementPanel () const std::vector profiles = rtengine::ICCStore::getInstance ()->getProfiles (rtengine::ICCStore::ProfileType::MONITOR); for (const auto profile : profiles) { - monProfile->append (profile); + if (profile.find("file:") != 0) { + monProfile->append (profile); + } } // same order as the enum diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index b9209a38b..ccf0b26e2 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -657,6 +657,12 @@ void RTWindow::showPreferences () delete pref; fpanel->optionsChanged (); + if (epanel) { + epanel->defaultMonitorProfileChanged(options.rtSettings.monitorProfile, options.rtSettings.autoMonitorProfile); + } + for (const auto &p : epanels) { + p.second->defaultMonitorProfileChanged(options.rtSettings.monitorProfile, options.rtSettings.autoMonitorProfile); + } } void RTWindow::setProgress (double p)