added preferences to control the behaviour of the crop tool

This commit is contained in:
Alberto Griggio
2018-01-03 15:44:34 +01:00
parent 0ac3bafbca
commit 8168611c23
9 changed files with 96 additions and 10 deletions

View File

@@ -614,6 +614,8 @@ void Options::setDefaults ()
gimpPluginShowInfoDialog = true;
maxRecentFolders = 15;
rtSettings.lensfunDbDirectory = ""; // set also in main.cc and main-cli.cc
cropGuides = CROP_GUIDE_FULL;
cropAutoFit = false;
}
Options* Options::copyFrom (Options* other)
@@ -1386,6 +1388,12 @@ void Options::readFromFile (Glib::ustring fname)
if (keyFile.has_key ("Crop Settings", "PPI")) {
cropPPI = keyFile.get_integer ("Crop Settings", "PPI");
}
if (keyFile.has_key("Crop Settings", "GuidesMode")) {
cropGuides = CropGuidesMode(std::max(int(CROP_GUIDE_NONE), std::min(keyFile.get_integer("Crop Settings", "GuidesMode"), int(CROP_GUIDE_FULL))));
}
if (keyFile.has_key("Crop Settings", "AutoFit")) {
cropAutoFit = keyFile.get_boolean("Crop Settings", "AutoFit");
}
}
if (keyFile.has_group ("Color Management")) {
@@ -2018,6 +2026,8 @@ void Options::saveToFile (Glib::ustring fname)
//keyFile.set_integer_list ("GUI", "CurvePanelsExpanded", crvopen);
keyFile.set_integer ("Crop Settings", "PPI", cropPPI);
keyFile.set_integer("Crop Settings", "GuidesMode", cropGuides);
keyFile.set_boolean("Crop Settings", "AutoFit", cropAutoFit);
keyFile.set_string ("Color Management", "PrinterProfile", rtSettings.printerProfile);
keyFile.set_integer ("Color Management", "PrinterIntent", rtSettings.printerIntent);