Merge branch 'dev' into metadata-exiv2

This commit is contained in:
Lawrence Lee 2023-04-09 17:10:54 -07:00
commit c4245b5106
No known key found for this signature in database
GPG Key ID: 048FF2B76A63895F
12 changed files with 180 additions and 30 deletions

View File

@ -14,7 +14,7 @@ env:
publish_pre_dev_labels: '["Beep6581:metadata-exiv2"]'
jobs:
build:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:

View File

@ -188,15 +188,15 @@ jobs:
echo "Copying Adwaita theme."
mkdir -p "$BUILD_DIR/share/icons/Adwaita"
cd 'share/icons/Adwaita/'
mkdir -p "$BUILD_DIR/share/icons/Adwaita/scalable"
mkdir -p "$BUILD_DIR/share/icons/Adwaita/symbolic"
cp -r \
"scalable/actions" \
"scalable/devices" \
"scalable/mimetypes" \
"scalable/places" \
"scalable/status" \
"scalable/ui" \
"$BUILD_DIR/share/icons/Adwaita/scalable"
"symbolic/actions" \
"symbolic/devices" \
"symbolic/mimetypes" \
"symbolic/places" \
"symbolic/status" \
"symbolic/ui" \
"$BUILD_DIR/share/icons/Adwaita/symbolic"
cp 'index.theme' "$BUILD_DIR/share/icons/Adwaita"
mkdir -p "$BUILD_DIR/share/icons/Adwaita/cursors"
cp -r \

View File

@ -5,6 +5,7 @@ Project initiator:
Development contributors, in last name alphabetical order:
Harald Aust
Roel Baars
Richard E Barber
Martin Burri

View File

@ -1827,6 +1827,7 @@ PREFERENCES_CACHECLEAR_SAFETY;Only files in the cache are cleared. Processing pr
PREFERENCES_CACHEMAXENTRIES;Maximum number of cache entries
PREFERENCES_CACHEOPTS;Cache Options
PREFERENCES_CACHETHUMBHEIGHT;Maximum thumbnail height
PREFERENCES_CAMERAPROFILESDIR;Camera profiles directory
PREFERENCES_CHUNKSIZES;Tiles per thread
PREFERENCES_CHUNKSIZE_RAW_AMAZE;AMaZE demosaic
PREFERENCES_CHUNKSIZE_RAW_CA;Raw CA correction
@ -1914,6 +1915,7 @@ PREFERENCES_INTENT_SATURATION;Saturation
PREFERENCES_INTERNALTHUMBIFUNTOUCHED;Show embedded JPEG thumbnail if raw is unedited
PREFERENCES_LANG;Language
PREFERENCES_LANGAUTODETECT;Use system language
PREFERENCES_LENSPROFILESDIR;Lens profiles directory
PREFERENCES_MAXRECENTFOLDERS;Maximum number of recent folders
PREFERENCES_MENUGROUPEXTPROGS;Group 'Open with'
PREFERENCES_MENUGROUPFILEOPERATIONS;Group 'File operations'

View File

@ -224,7 +224,7 @@ CameraConst* CameraConst::parseEntry(const void *cJSON_, const char *make_model)
const auto get_masked_areas =
[](int w, int h, const cJSON *ji, CameraConst *cc) -> bool
{
std::array<std::array<int, 4>, 2> rm;
std::array<std::array<int, 4>, 2> rm = {};
if (ji->type != cJSON_Array) {
//fprintf(stderr, "\"masked_areas\" must be an array\n");
@ -505,7 +505,15 @@ bool CameraConst::has_rawMask(int raw_width, int raw_height, int idx) const
return false;
}
return raw_mask.find(std::make_pair(raw_width, raw_height)) != raw_mask.end() || raw_mask.find(std::make_pair(0, 0)) != raw_mask.end();
auto it = raw_mask.find(std::make_pair(raw_width, raw_height));
if (it == raw_mask.end()) {
it = raw_mask.find(std::make_pair(0, 0));
}
if (it != raw_mask.end()) {
return (it->second[idx][0] | it->second[idx][1] | it->second[idx][2] | it->second[idx][3]) != 0;
} else {
return false;
}
}

View File

@ -21,6 +21,7 @@
#include <stdlib.h>
#include <glibmm/regex.h>
#include <glibmm/fileutils.h>
#include <glibmm/miscutils.h>
#include <glibmm/keyfile.h>
@ -220,6 +221,22 @@ bool DynamicProfileRules::loadRules()
try {
rule.profilepath = kf.get_string (group, "profilepath");
#if defined (WIN32)
// if this is Windows, replace any "/" in the path with "\\"
size_t pos = rule.profilepath.find("/");
while (pos != Glib::ustring::npos) {
rule.profilepath.replace(pos, 1, "\\");
pos = rule.profilepath.find("/", pos);
}
#endif
#if !defined (WIN32)
// if this is not Windows, replace any "\\" in the path with "/"
size_t pos = rule.profilepath.find("\\");
while (pos != Glib::ustring::npos) {
rule.profilepath.replace(pos, 1, "/");
pos = rule.profilepath.find("\\", pos);
}
#endif
} catch (Glib::KeyFileError &) {
dynamicRules.pop_back();
}
@ -254,7 +271,14 @@ bool DynamicProfileRules::storeRules()
kf.set_string (group, "profilepath", rule.profilepath);
}
return kf.save_to_file (Glib::build_filename (Options::rtdir, "dynamicprofile.cfg"));
std::string fn = Glib::build_filename (Options::rtdir, "dynamicprofile.cfg");
if (Glib::file_test(fn, Glib::FILE_TEST_IS_SYMLINK)) {
// file is symlink; use target instead
// symlinks apparently are not recognízed on Windows
return kf.save_to_file (g_file_read_link (fn.c_str(), NULL));
} else {
return kf.save_to_file (fn);
}
}
const std::vector<DynamicProfileRule> &DynamicProfileRules::getRules()

View File

@ -65,6 +65,40 @@ Glib::ustring expandRelativePath(const Glib::ustring &procparams_fname, const Gl
return absPath;
}
Glib::ustring expandRelativePath2(const Glib::ustring &procparams_fname, const Glib::ustring &procparams_fname2, const Glib::ustring &prefix, Glib::ustring embedded_fname)
{
#if defined (WIN32)
// if this is Windows, replace any "/" in the filename with "\\"
size_t pos = embedded_fname.find("/");
while (pos != string::npos) {
embedded_fname.replace(pos, 1, "\\");
pos = embedded_fname.find("/", pos);
}
#endif
#if !defined (WIN32)
// if this is not Windows, replace any "\\" in the filename with "/"
size_t pos = embedded_fname.find("\\");
while (pos != string::npos) {
embedded_fname.replace(pos, 1, "/");
pos = embedded_fname.find("\\", pos);
}
#endif
// if embedded_fname is not already an absolute path,
// try to convert it using procparams_fname (the directory of the raw file) as prefix
Glib::ustring rPath = expandRelativePath(procparams_fname, prefix, embedded_fname);
if (rPath.length() >= prefix.length()
&& !Glib::file_test(rPath.substr(prefix.length()), Glib::FILE_TEST_IS_REGULAR)
&& !procparams_fname2.empty()
&& Glib::path_is_absolute(procparams_fname2)) {
// embedded_fname is not a valid path;
// try with procparams_fname2 (the path defined in Preferences) as a prefix
rPath = expandRelativePath(procparams_fname2 + G_DIR_SEPARATOR_S, prefix, embedded_fname);
}
return(rPath);
}
Glib::ustring relativePathIfInside(const Glib::ustring &procparams_fname, bool fnameAbsolute, Glib::ustring embedded_fname)
{
if (fnameAbsolute || embedded_fname.empty() || !Glib::path_is_absolute(procparams_fname)) {
@ -93,6 +127,25 @@ Glib::ustring relativePathIfInside(const Glib::ustring &procparams_fname, bool f
return prefix + embedded_fname.substr(dir1.length());
}
Glib::ustring relativePathIfInside2(const Glib::ustring &procparams_fname, const Glib::ustring &procparams_fname2, bool fnameAbsolute, Glib::ustring embedded_fname)
{
// try to convert embedded_fname to a path relative to procparams_fname
// (the directory of the raw file)
// (note: fnameAbsolute seems to be always true, so this will never return a relative path)
Glib::ustring rPath = relativePathIfInside(procparams_fname, fnameAbsolute, embedded_fname);
if ((Glib::path_is_absolute(rPath)
|| (rPath.length() >= 5 && rPath.substr(0, 5) == "file:" && Glib::path_is_absolute(rPath.substr(5))))
&& !procparams_fname2.empty()
&& Glib::path_is_absolute(procparams_fname2)) {
// if path is not relative to the directory of the raw file,
// try to convert embedded_fname to a path relative to procparams_fname2
// (the path defined in Preferences)
rPath = relativePathIfInside(procparams_fname2 + G_DIR_SEPARATOR_S, false, embedded_fname);
}
return(rPath);
}
void getFromKeyfile(
const Glib::KeyFile& keyfile,
const Glib::ustring& group_name,
@ -6427,7 +6480,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
// Lens profile
saveToKeyfile(!pedited || pedited->lensProf.lcMode, "LensProfile", "LcMode", lensProf.getMethodString(lensProf.lcMode), keyFile);
saveToKeyfile(!pedited || pedited->lensProf.lcpFile, "LensProfile", "LCPFile", relativePathIfInside(fname, fnameAbsolute, lensProf.lcpFile), keyFile);
saveToKeyfile(!pedited || pedited->lensProf.lcpFile, "LensProfile", "LCPFile", relativePathIfInside2(fname, options.rtSettings.lensProfilesPath, fnameAbsolute, lensProf.lcpFile), keyFile);
saveToKeyfile(!pedited || pedited->lensProf.useDist, "LensProfile", "UseDistortion", lensProf.useDist, keyFile);
saveToKeyfile(!pedited || pedited->lensProf.useVign, "LensProfile", "UseVignette", lensProf.useVign, keyFile);
saveToKeyfile(!pedited || pedited->lensProf.useCA, "LensProfile", "UseCA", lensProf.useCA, keyFile);
@ -7247,7 +7300,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
saveToKeyfile(!pedited || pedited->prsharpening.deconviter, "PostResizeSharpening", "DeconvIterations", prsharpening.deconviter, keyFile);
// Color management
saveToKeyfile(!pedited || pedited->icm.inputProfile, "Color Management", "InputProfile", relativePathIfInside(fname, fnameAbsolute, icm.inputProfile), keyFile);
saveToKeyfile(!pedited || pedited->icm.inputProfile, "Color Management", "InputProfile", relativePathIfInside2(fname, options.rtSettings.cameraProfilesPath, fnameAbsolute, icm.inputProfile), keyFile);
saveToKeyfile(!pedited || pedited->icm.toneCurve, "Color Management", "ToneCurve", icm.toneCurve, keyFile);
saveToKeyfile(!pedited || pedited->icm.applyLookTable, "Color Management", "ApplyLookTable", icm.applyLookTable, keyFile);
saveToKeyfile(!pedited || pedited->icm.applyBaselineExposureOffset, "Color Management", "ApplyBaselineExposureOffset", icm.applyBaselineExposureOffset, keyFile);
@ -7620,9 +7673,9 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
saveToKeyfile(!pedited || pedited->colorToning.labregionsShowMask, "ColorToning", "LabRegionsShowMask", colorToning.labregionsShowMask, keyFile);
// Raw
saveToKeyfile(!pedited || pedited->raw.darkFrame, "RAW", "DarkFrame", relativePathIfInside(fname, fnameAbsolute, raw.dark_frame), keyFile);
saveToKeyfile(!pedited || pedited->raw.darkFrame, "RAW", "DarkFrame", relativePathIfInside2(fname, options.rtSettings.darkFramesPath, fnameAbsolute, raw.dark_frame), keyFile);
saveToKeyfile(!pedited || pedited->raw.df_autoselect, "RAW", "DarkFrameAuto", raw.df_autoselect, keyFile);
saveToKeyfile(!pedited || pedited->raw.ff_file, "RAW", "FlatFieldFile", relativePathIfInside(fname, fnameAbsolute, raw.ff_file), keyFile);
saveToKeyfile(!pedited || pedited->raw.ff_file, "RAW", "FlatFieldFile", relativePathIfInside2(fname, options.rtSettings.flatFieldsPath, fnameAbsolute, raw.ff_file), keyFile);
saveToKeyfile(!pedited || pedited->raw.ff_AutoSelect, "RAW", "FlatFieldAutoSelect", raw.ff_AutoSelect, keyFile);
saveToKeyfile(!pedited || pedited->raw.ff_FromMetaData, "RAW", "FlatFieldFromMetaData", raw.ff_FromMetaData, keyFile);
saveToKeyfile(!pedited || pedited->raw.ff_BlurRadius, "RAW", "FlatFieldBlurRadius", raw.ff_BlurRadius, keyFile);
@ -8528,7 +8581,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
}
if (keyFile.has_key("LensProfile", "LCPFile")) {
lensProf.lcpFile = expandRelativePath(fname, "", keyFile.get_string("LensProfile", "LCPFile"));
lensProf.lcpFile = expandRelativePath2(fname, options.rtSettings.lensProfilesPath, "", keyFile.get_string("LensProfile", "LCPFile"));
if (pedited) {
pedited->lensProf.lcpFile = true;
@ -9566,13 +9619,12 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
if (keyFile.has_group("Color Management")) {
if (keyFile.has_key("Color Management", "InputProfile")) {
icm.inputProfile = expandRelativePath(fname, "file:", keyFile.get_string("Color Management", "InputProfile"));
icm.inputProfile = expandRelativePath2(fname, options.rtSettings.cameraProfilesPath, "file:", keyFile.get_string("Color Management", "InputProfile"));
if (pedited) {
pedited->icm.inputProfile = true;
}
}
assignFromKeyfile(keyFile, "Color Management", "ToneCurve", pedited, icm.toneCurve, pedited->icm.toneCurve);
assignFromKeyfile(keyFile, "Color Management", "ApplyLookTable", pedited, icm.applyLookTable, pedited->icm.applyLookTable);
assignFromKeyfile(keyFile, "Color Management", "ApplyBaselineExposureOffset", pedited, icm.applyBaselineExposureOffset, pedited->icm.applyBaselineExposureOffset);
@ -10155,6 +10207,22 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
if (keyFile.has_group("Film Simulation")) {
assignFromKeyfile(keyFile, "Film Simulation", "Enabled", pedited, filmSimulation.enabled, pedited->filmSimulation.enabled);
assignFromKeyfile(keyFile, "Film Simulation", "ClutFilename", pedited, filmSimulation.clutFilename, pedited->filmSimulation.clutFilename);
#if defined (WIN32)
// if this is Windows, replace any "/" in the filename with "\\"
size_t pos = filmSimulation.clutFilename.find("/");
while (pos != string::npos) {
filmSimulation.clutFilename.replace(pos, 1, "\\");
pos = filmSimulation.clutFilename.find("/", pos);
}
#endif
#if !defined (WIN32)
// if this is not Windows, replace any "\\" in the filename with "/"
size_t pos = filmSimulation.clutFilename.find("\\");
while (pos != string::npos) {
filmSimulation.clutFilename.replace(pos, 1, "/");
pos = filmSimulation.clutFilename.find("\\", pos);
}
#endif
if (keyFile.has_key("Film Simulation", "Strength")) {
if (ppVersion < 321) {
@ -10329,23 +10397,20 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
if (keyFile.has_group("RAW")) {
if (keyFile.has_key("RAW", "DarkFrame")) {
raw.dark_frame = expandRelativePath(fname, "", keyFile.get_string("RAW", "DarkFrame"));
raw.dark_frame = expandRelativePath2(fname, options.rtSettings.darkFramesPath, "", keyFile.get_string("RAW", "DarkFrame"));
if (pedited) {
pedited->raw.darkFrame = true;
}
}
assignFromKeyfile(keyFile, "RAW", "DarkFrameAuto", pedited, raw.df_autoselect, pedited->raw.df_autoselect);
if (keyFile.has_key("RAW", "FlatFieldFile")) {
raw.ff_file = expandRelativePath(fname, "", keyFile.get_string("RAW", "FlatFieldFile"));
raw.ff_file = expandRelativePath2(fname, options.rtSettings.flatFieldsPath, "", keyFile.get_string("RAW", "FlatFieldFile"));
if (pedited) {
pedited->raw.ff_file = true;
}
}
assignFromKeyfile(keyFile, "RAW", "FlatFieldAutoSelect", pedited, raw.ff_AutoSelect, pedited->raw.ff_AutoSelect);
assignFromKeyfile(keyFile, "RAW", "FlatFieldFromMetaData", pedited, raw.ff_FromMetaData, pedited->raw.ff_FromMetaData);
assignFromKeyfile(keyFile, "RAW", "FlatFieldBlurRadius", pedited, raw.ff_BlurRadius, pedited->raw.ff_BlurRadius);

View File

@ -49,6 +49,8 @@ public:
bool verbose;
Glib::ustring darkFramesPath; ///< The default directory for dark frames
Glib::ustring flatFieldsPath; ///< The default directory for flat fields
Glib::ustring cameraProfilesPath; ///< The default directory for camera profiles
Glib::ustring lensProfilesPath; ///< The default directory for lens profiles
Glib::ustring adobe; // filename of AdobeRGB1998 profile (default to the bundled one)
Glib::ustring prophoto; // filename of Prophoto profile (default to the bundled one)

View File

@ -570,6 +570,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"
@ -652,12 +655,14 @@ void Options::setDefaults()
rtSettings.leveldnautsimpl = 0;
// rtSettings.colortoningab =0.7;
//rtSettings.decaction =0.3;
// rtSettings.decaction =0.3;
// rtSettings.ciebadpixgauss=false;
rtSettings.rgbcurveslumamode_gamut = true;
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
@ -794,6 +799,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");
}
@ -2191,6 +2204,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);
@ -2315,6 +2330,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);
@ -2664,6 +2681,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);

View File

@ -450,6 +450,8 @@ public:
Glib::ustring lastIccDir;
Glib::ustring lastDarkframeDir;
Glib::ustring lastFlatfieldDir;
Glib::ustring lastCameraProfilesDir;
Glib::ustring lastLensProfilesDir;
Glib::ustring lastRgbCurvesDir;
Glib::ustring lastLabCurvesDir;
Glib::ustring lastRetinexDir;

View File

@ -636,6 +636,7 @@ Gtk::Widget* Preferences::getImageProcessingPanel ()
Gtk::Grid* dirgrid = Gtk::manage(new Gtk::Grid());
setExpandAlignProperties(dirgrid, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER);
// Dark Frames Dir
Gtk::Label *dfLab = Gtk::manage(new Gtk::Label(M("PREFERENCES_DIRDARKFRAMES") + ":"));
setExpandAlignProperties(dfLab, false, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER);
darkFrameDir = Gtk::manage(new MyFileChooserButton(M("PREFERENCES_DIRDARKFRAMES"), Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER));
@ -649,7 +650,7 @@ Gtk::Widget* Preferences::getImageProcessingPanel ()
dfconn = darkFrameDir->signal_selection_changed().connect ( sigc::mem_fun (*this, &Preferences::darkFrameChanged));
// FLATFIELD
// Flatfield Dir
Gtk::Label *ffLab = Gtk::manage(new Gtk::Label(M("PREFERENCES_FLATFIELDSDIR") + ":"));
setExpandAlignProperties(ffLab, false, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER);
flatFieldDir = Gtk::manage(new MyFileChooserButton(M("PREFERENCES_FLATFIELDSDIR"), Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER));
@ -675,6 +676,25 @@ Gtk::Widget* Preferences::getImageProcessingPanel ()
dirgrid->attach_next_to(*clutsDir, *clutsDirLabel, Gtk::POS_RIGHT, 1, 1);
dirgrid->attach_next_to(*clutsRestartNeeded, *clutsDir, Gtk::POS_RIGHT, 1, 1);
//Camera Profiles Dir
Gtk::Label *cameraProfilesDirLabel = Gtk::manage(new Gtk::Label(M("PREFERENCES_CAMERAPROFILESDIR") + ":"));
setExpandAlignProperties(cameraProfilesDirLabel, false, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER);
cameraProfilesDir = Gtk::manage(new MyFileChooserButton(M("PREFERENCES_CAMERAPROFILESDIR"), Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER));
setExpandAlignProperties(cameraProfilesDir, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER);
dirgrid->attach_next_to(*cameraProfilesDirLabel, *clutsDirLabel, Gtk::POS_BOTTOM, 1, 1);
dirgrid->attach_next_to(*cameraProfilesDir, *cameraProfilesDirLabel, Gtk::POS_RIGHT, 1, 1);
//Lens Profiles Dir
Gtk::Label *lensProfilesDirLabel = Gtk::manage(new Gtk::Label(M("PREFERENCES_LENSPROFILESDIR") + ":"));
setExpandAlignProperties(lensProfilesDirLabel, false, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER);
lensProfilesDir = Gtk::manage(new MyFileChooserButton(M("PREFERENCES_LENSPROFILESDIR"), Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER));
setExpandAlignProperties(lensProfilesDir, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER);
dirgrid->attach_next_to(*lensProfilesDirLabel, *cameraProfilesDirLabel, Gtk::POS_BOTTOM, 1, 1);
dirgrid->attach_next_to(*lensProfilesDir, *lensProfilesDirLabel, Gtk::POS_RIGHT, 1, 1);
//Pack directories to Image Processing panel
cdf->add(*dirgrid);
vbImageProcessing->pack_start (*cdf, Gtk::PACK_SHRINK, 4 );
@ -1874,8 +1894,9 @@ void Preferences::storePreferences()
moptions.rtSettings.darkFramesPath = darkFrameDir->get_filename();
moptions.rtSettings.flatFieldsPath = flatFieldDir->get_filename();
moptions.clutsDir = clutsDir->get_filename();
moptions.rtSettings.cameraProfilesPath = cameraProfilesDir->get_filename();
moptions.rtSettings.lensProfilesPath = lensProfilesDir->get_filename();
moptions.baBehav.resize(ADDSET_PARAM_NUM);
@ -2136,6 +2157,10 @@ void Preferences::fillPreferences()
clutsDir->set_current_folder(moptions.clutsDir);
cameraProfilesDir->set_current_folder(moptions.rtSettings.cameraProfilesPath);
lensProfilesDir->set_current_folder(moptions.rtSettings.lensProfilesPath);
addc.block(true);
setc.block(true);

View File

@ -115,6 +115,8 @@ class Preferences final :
MyFileChooserButton* darkFrameDir;
MyFileChooserButton* flatFieldDir;
MyFileChooserButton* clutsDir;
MyFileChooserButton* cameraProfilesDir;
MyFileChooserButton* lensProfilesDir;
Gtk::Label *dfLabel;
Gtk::Label *ffLabel;