diff --git a/rtgui/lensgeom.h b/rtgui/lensgeom.h index 29b0c7f20..aa473cb91 100644 --- a/rtgui/lensgeom.h +++ b/rtgui/lensgeom.h @@ -44,6 +44,8 @@ public: return packBox; } + Gtk::CheckButton *getFill() { return fill; } + void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr); void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = nullptr); void setBatchMode (bool batchMode); diff --git a/rtgui/lensprofile.cc b/rtgui/lensprofile.cc index 4fffbe7df..5ddfdfa56 100644 --- a/rtgui/lensprofile.cc +++ b/rtgui/lensprofile.cc @@ -210,16 +210,8 @@ void LensProfilePanel::read(const rtengine::procparams::ProcParams* pp, const Pa if (corrLensfunManual->get_active() && !checkLensfunCanCorrect(false)) { corrOff->set_active(true); } - // if (metadata) { - // std::unique_ptr mod(LFDatabase::findModifier(pp->lensProf, metadata, 100, 100, pp->coarse, -1)); - // if (!mod) { - // if (pp->lensProf.useLensfun) { - // corrOff->set_active(true); - // } - // corrLensfunAuto->set_sensitive(false); - // } - // } + setAutoFill(); enableListener (); conUseDist.block(false); } @@ -514,6 +506,8 @@ void LensProfilePanel::onCorrModeChanged() mode = M("GENERAL_UNCHANGED"); } + + setAutoFill(); if (listener) { listener->panelChanged(EvLensCorrMode, mode); @@ -534,6 +528,23 @@ bool LensProfilePanel::checkLensfunCanCorrect(bool automatch) } +void LensProfilePanel::setAutoFill() +{ + if (lensgeomLcpFill) { + bool b = lensgeomLcpFill->disableListener(); + if (corrLensfunAuto->get_active() || corrLensfunManual->get_active()) { + lensgeomLcpFill->getFill()->set_active(true); + lensgeomLcpFill->getFill()->set_sensitive(false); + } else { + lensgeomLcpFill->getFill()->set_sensitive(true); + } + if (b) { + lensgeomLcpFill->enableListener(); + } + } +} + + //----------------------------------------------------------------------------- // LFDbHelper //----------------------------------------------------------------------------- diff --git a/rtgui/lensprofile.h b/rtgui/lensprofile.h index feda2a259..9475792ae 100644 --- a/rtgui/lensprofile.h +++ b/rtgui/lensprofile.h @@ -87,6 +87,7 @@ protected: bool setLensfunCamera(const Glib::ustring &make, const Glib::ustring &model); bool setLensfunLens(const Glib::ustring &lens); bool checkLensfunCanCorrect(bool automatch); + void setAutoFill(); public: