Camera and Lens profiles directories

In "Preferences", added the possibility to define a "Camera profiles directory" and a "Lens profiles directory" as base paths which enable storing relative paths in the .pp3 files.
This commit is contained in:
Bezierr
2022-07-20 12:14:05 +02:00
parent 19a4720ec7
commit 1450b9bb7a
7 changed files with 86 additions and 6 deletions

View File

@@ -566,6 +566,9 @@ void Options::setDefaults()
rtSettings.darkFramesPath = "";
rtSettings.flatFieldsPath = "";
rtSettings.cameraProfilesPath = "";
rtSettings.lensProfilesPath = "";
#ifdef WIN32
const gchar* sysRoot = g_getenv("SystemRoot"); // Returns e.g. "c:\Windows"
@@ -663,6 +666,8 @@ void Options::setDefaults()
lastIccDir = rtSettings.iccDirectory;
lastDarkframeDir = rtSettings.darkFramesPath;
lastFlatfieldDir = rtSettings.flatFieldsPath;
lastCameraProfilesDir = rtSettings.cameraProfilesPath;
lastLensProfilesDir = rtSettings.lensProfilesPath;
// rtSettings.bw_complementary = true;
// There is no reasonable default for curves. We can still suppose that they will take place
// in a subdirectory of the user's own ProcParams presets, i.e. in a subdirectory
@@ -791,6 +796,14 @@ void Options::readFromFile(Glib::ustring fname)
rtSettings.flatFieldsPath = keyFile.get_string("General", "FlatFieldsPath");
}
if (keyFile.has_key("General", "CameraProfilesPath")) {
rtSettings.cameraProfilesPath = keyFile.get_string("General", "CameraProfilesPath");
}
if (keyFile.has_key("General", "LensProfilesPath")) {
rtSettings.lensProfilesPath = keyFile.get_string("General", "LensProfilesPath");
}
if (keyFile.has_key("General", "Verbose")) {
rtSettings.verbose = keyFile.get_boolean("General", "Verbose");
}
@@ -2047,6 +2060,8 @@ void Options::readFromFile(Glib::ustring fname)
safeDirGet(keyFile, "Dialogs", "LastIccDir", lastIccDir);
safeDirGet(keyFile, "Dialogs", "LastDarkframeDir", lastDarkframeDir);
safeDirGet(keyFile, "Dialogs", "LastFlatfieldDir", lastFlatfieldDir);
safeDirGet(keyFile, "Dialogs", "LastCameraProfilesDir", lastCameraProfilesDir);
safeDirGet(keyFile, "Dialogs", "LastLensProfilesDir", lastLensProfilesDir);
safeDirGet(keyFile, "Dialogs", "LastRgbCurvesDir", lastRgbCurvesDir);
safeDirGet(keyFile, "Dialogs", "LastLabCurvesDir", lastLabCurvesDir);
safeDirGet(keyFile, "Dialogs", "LastRetinexDir", lastRetinexDir);
@@ -2150,6 +2165,8 @@ void Options::saveToFile(Glib::ustring fname)
keyFile.set_string("General", "Version", RTVERSION);
keyFile.set_string("General", "DarkFramesPath", rtSettings.darkFramesPath);
keyFile.set_string("General", "FlatFieldsPath", rtSettings.flatFieldsPath);
keyFile.set_string("General", "CameraProfilesPath", rtSettings.cameraProfilesPath);
keyFile.set_string("General", "LensProfilesPath", rtSettings.lensProfilesPath);
keyFile.set_boolean("General", "Verbose", rtSettings.verbose);
keyFile.set_integer("General", "Cropsleep", rtSettings.cropsleep);
keyFile.set_double("General", "Reduchigh", rtSettings.reduchigh);
@@ -2484,6 +2501,8 @@ void Options::saveToFile(Glib::ustring fname)
keyFile.set_string("Dialogs", "LastIccDir", lastIccDir);
keyFile.set_string("Dialogs", "LastDarkframeDir", lastDarkframeDir);
keyFile.set_string("Dialogs", "LastFlatfieldDir", lastFlatfieldDir);
keyFile.set_string("Dialogs", "LastCameraProfilesDir", lastCameraProfilesDir);
keyFile.set_string("Dialogs", "LastLensProfilesDir", lastLensProfilesDir);
keyFile.set_string("Dialogs", "LastRgbCurvesDir", lastRgbCurvesDir);
keyFile.set_string("Dialogs", "LastLabCurvesDir", lastLabCurvesDir);
keyFile.set_string("Dialogs", "LastRetinexDir", lastRetinexDir);