From e215ad4c6c94539007bfeaf1bda5e0233b69db56 Mon Sep 17 00:00:00 2001 From: Alberto Griggio Date: Tue, 11 Apr 2017 11:44:39 +0200 Subject: [PATCH 1/3] print LCP error messages about missing vignette/CA correction only when settings->verbose --- rtengine/lcp.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/rtengine/lcp.cc b/rtengine/lcp.cc index d2d18b7d8..e367633f2 100644 --- a/rtengine/lcp.cc +++ b/rtengine/lcp.cc @@ -28,11 +28,18 @@ #include #endif +#include "settings.h" using namespace std; using namespace rtengine; +namespace rtengine { + +extern const Settings* settings; + +} + LCPModelCommon::LCPModelCommon() : foc_len_x(-1.0f), foc_len_y(-1.0f), @@ -603,7 +610,9 @@ void LCPProfile::calcParams(int mode, float focalLength, float focusDist, float //printf("LCP mode=%i, dist: %g found frames: Fno %g-%g; FocLen %g-%g; Dist %g-%g with weight %g\n", mode, focusDist, pLow->aperture, pHigh->aperture, pLow->focLen, pHigh->focLen, pLow->focDist, pHigh->focDist, facLow); } else { - printf("Error: LCP file contained no %s parameters\n", mode == 0 ? "vignette" : mode == 1 ? "distortion" : "CA" ); + if (settings->verbose) { + printf("Error: LCP file contained no %s parameters\n", mode == 0 ? "vignette" : mode == 1 ? "distortion" : "CA" ); + } } } From b625eafb68bab95083e9da8a4acc26adfc448a52 Mon Sep 17 00:00:00 2001 From: Alberto Griggio Date: Tue, 11 Apr 2017 15:21:12 +0200 Subject: [PATCH 2/3] do not disable auto-fill when enabling LCP distortion correction This was a workaround for an old bug (#1791 and #3765) that is no longer necessary --- rtgui/lensgeom.cc | 25 ------------------------- rtgui/lensgeom.h | 1 - rtgui/lensprofile.cc | 10 ---------- 3 files changed, 36 deletions(-) diff --git a/rtgui/lensgeom.cc b/rtgui/lensgeom.cc index 5bcbf5494..fc1b0a1bd 100644 --- a/rtgui/lensgeom.cc +++ b/rtgui/lensgeom.cc @@ -119,28 +119,3 @@ void LensGeometry::setBatchMode (bool batchMode) removeIfThere (this, autoCrop); } -void LensGeometry::disableAutoFillIfActive () -{ - const auto func = [](gpointer data) -> gboolean { - GThreadLock lock; // Is this really needed? - - LensGeometry* const instance = static_cast(data); - - if (!instance->batchMode) { - if (instance->fill->get_active()) { - instance->fillConn.block(true); - instance->fill->set_active(false); - - if (instance->listener) { - instance->listener->panelChanged (EvTransAutoFill, M("GENERAL_DISABLED")); - } - - instance->fillConn.block(false); - } - } - - return FALSE; - }; - - idle_register.add(func, this); -} diff --git a/rtgui/lensgeom.h b/rtgui/lensgeom.h index 697fc73ce..29b0c7f20 100644 --- a/rtgui/lensgeom.h +++ b/rtgui/lensgeom.h @@ -54,7 +54,6 @@ public: { rlistener = l; } - void disableAutoFillIfActive (); private: IdleRegister idle_register; diff --git a/rtgui/lensprofile.cc b/rtgui/lensprofile.cc index 2f4526cad..cae283e9e 100644 --- a/rtgui/lensprofile.cc +++ b/rtgui/lensprofile.cc @@ -144,10 +144,6 @@ void LensProfilePanel::write( rtengine::procparams::ProcParams* pp, ParamsEdited void LensProfilePanel::onLCPFileChanged() { - - // Disable Auto-Fill when enabling LCP Distortion Correction, #1791 - lensgeomLcpFill->disableAutoFillIfActive(); - lcpFileChanged = true; updateDisabled(lcpStore->isValidLCPFileName(fcbLCPFile->get_filename())); @@ -170,12 +166,6 @@ void LensProfilePanel::onLCPFileReset() void LensProfilePanel::onUseDistChanged() { - - // Disable Auto-Fill when enabling LCP Distortion Correction, #1791 - if (ckbUseDist->get_active()) { - lensgeomLcpFill->disableAutoFillIfActive(); - } - useDistChanged = true; if (listener) { From 63c57ca43cea302a09fff90d40a3b9cb9c7ecffb Mon Sep 17 00:00:00 2001 From: Alberto Griggio Date: Tue, 11 Apr 2017 15:22:50 +0200 Subject: [PATCH 3/3] remember the last LCP directory across RT restarts --- rtgui/lensprofile.cc | 6 +++++- rtgui/options.cc | 3 +++ rtgui/options.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/rtgui/lensprofile.cc b/rtgui/lensprofile.cc index cae283e9e..79a0dc19f 100644 --- a/rtgui/lensprofile.cc +++ b/rtgui/lensprofile.cc @@ -48,7 +48,10 @@ LensProfilePanel::LensProfilePanel () : FoldableToolPanel(this, "lensprof", M("T fcbLCPFile->set_show_hidden(true); // ProgramData is hidden on Windows #endif fcbLCPFile->set_current_folder(defDir); + } else if (!options.lastLensProfileDir.empty()) { + fcbLCPFile->set_current_folder(options.lastLensProfileDir); } + bindCurrentFolder(*fcbLCPFile, options.lastLensProfileDir); hbLCPFile->pack_start(*fcbLCPFile); @@ -89,8 +92,9 @@ void LensProfilePanel::read(const rtengine::procparams::ProcParams* pp, const Pa fcbLCPFile->unselect_filename(fname); } else { Glib::ustring lastFolder = fcbLCPFile->get_current_folder(); - fcbLCPFile->set_filename(""); fcbLCPFile->set_current_folder(lastFolder); + fcbLCPFile->set_filename(lastFolder + "/."); + bindCurrentFolder(*fcbLCPFile, options.lastLensProfileDir); } updateDisabled(false); diff --git a/rtgui/options.cc b/rtgui/options.cc index 8c9ce61a6..55b257ec8 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -711,6 +711,7 @@ void Options::setDefaults () lastVibranceCurvesDir = ""; lastProfilingReferenceDir = ""; lastBWCurvesDir = ""; + lastLensProfileDir = ""; maxRecentFolders = 15; } @@ -1806,6 +1807,7 @@ int Options::readFromFile (Glib::ustring fname) safeDirGet (keyFile, "Dialogs", "LastToneCurvesDir", lastToneCurvesDir); safeDirGet (keyFile, "Dialogs", "LastVibranceCurvesDir", lastVibranceCurvesDir); safeDirGet (keyFile, "Dialogs", "LastProfilingReferenceDir", lastProfilingReferenceDir); + safeDirGet (keyFile, "Dialogs", "LastLensProfileDir", lastLensProfileDir); } // -------------------------------------------------------------------------------------------------------- @@ -2162,6 +2164,7 @@ int Options::saveToFile (Glib::ustring fname) keyFile.set_string ("Dialogs", "LastToneCurvesDir", lastToneCurvesDir); keyFile.set_string ("Dialogs", "LastVibranceCurvesDir", lastVibranceCurvesDir); keyFile.set_string ("Dialogs", "LastProfilingReferenceDir", lastProfilingReferenceDir); + keyFile.set_string ("Dialogs", "LastLensProfileDir", lastLensProfileDir); keyData = keyFile.to_data (); diff --git a/rtgui/options.h b/rtgui/options.h index d25a6bde8..1a5ae21ed 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -306,6 +306,7 @@ public: Glib::ustring lastVibranceCurvesDir; Glib::ustring lastProfilingReferenceDir; Glib::ustring lastBWCurvesDir; + Glib::ustring lastLensProfileDir; size_t maxRecentFolders; // max. number of recent folders stored in options file std::vector recentFolders; // List containing all recent folders