Add ability to export to an external editor within the same folder as the original file - issue 6195 (#6232)

* import and change the art code -thanks to Alberto

* Possible fixed for white space in folder

* Added verbose when white-space

* Replace WS only if windows and Gimp

* Fixed Windows and Gimp bug for external editor - thanks to Lawrence37

* Fix LGTM alert for reused variable name

Co-authored-by: Thanatomanic <6567747+Thanatomanic@users.noreply.github.com>
This commit is contained in:
Desmis
2021-05-13 12:41:22 +02:00
committed by GitHub
parent 3cb6e88ea4
commit eb8f121709
9 changed files with 149 additions and 12 deletions

View File

@@ -415,6 +415,10 @@ void Options::setDefaults()
customEditorProg = "";
CPBKeys = CPBKT_TID;
editorToSendTo = 1;
editor_out_dir = EDITOR_OUT_DIR_TEMP;
editor_custom_out_dir = "";
editor_float32 = false;
editor_bypass_output_profile = false;
favoriteDirs.clear();
tpOpen.clear();
autoSaveTpOpen = true;
@@ -824,6 +828,28 @@ void Options::readFromFile(Glib::ustring fname)
if (keyFile.has_key("External Editor", "CustomEditor")) {
customEditorProg = keyFile.get_string("External Editor", "CustomEditor");
}
if (keyFile.has_key("External Editor", "OutputDir")) {
int v = keyFile.get_integer("External Editor", "OutputDir");
if (v < int(EDITOR_OUT_DIR_TEMP) || v > int(EDITOR_OUT_DIR_CUSTOM)) {
editor_out_dir = EDITOR_OUT_DIR_TEMP;
} else {
editor_out_dir = EditorOutDir(v);
}
}
if (keyFile.has_key("External Editor", "CustomOutputDir")) {
editor_custom_out_dir = keyFile.get_string("External Editor", "CustomOutputDir");
}
if (keyFile.has_key("External Editor", "Float32")) {
editor_float32 = keyFile.get_boolean("External Editor", "Float32");
}
if (keyFile.has_key("External Editor", "BypassOutputProfile")) {
editor_bypass_output_profile = keyFile.get_boolean("External Editor", "BypassOutputProfile");
}
}
if (keyFile.has_group("Output")) {
@@ -2115,6 +2141,10 @@ void Options::saveToFile(Glib::ustring fname)
keyFile.set_string("External Editor", "GimpDir", gimpDir);
keyFile.set_string("External Editor", "PhotoshopDir", psDir);
keyFile.set_string("External Editor", "CustomEditor", customEditorProg);
keyFile.set_integer("External Editor", "OutputDir", int(editor_out_dir));
keyFile.set_string("External Editor", "CustomOutputDir", editor_custom_out_dir);
keyFile.set_boolean("External Editor", "Float32", editor_float32);
keyFile.set_boolean("External Editor", "BypassOutputProfile", editor_bypass_output_profile);
keyFile.set_boolean("File Browser", "BrowseOnlyRaw", fbOnlyRaw);
keyFile.set_boolean("File Browser", "BrowserShowsDate", fbShowDateTime);