remember the last LCP directory across RT restarts

This commit is contained in:
Alberto Griggio 2017-04-11 15:22:50 +02:00
parent b625eafb68
commit 63c57ca43c
3 changed files with 9 additions and 1 deletions

View File

@ -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);

View File

@ -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 ();

View File

@ -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<Glib::ustring> recentFolders; // List containing all recent folders