Fix the "Send to editor" bug on Windows ; for a reminder : you have to select the Gimp's base installation directory, not the "bin" subdir
This commit is contained in:
@@ -879,46 +879,69 @@ bool EditorPanel::idle_sentToGimp(ProgressConnector<int> *pc,rtengine::IImage16*
|
|||||||
parent->setProgress(0.);
|
parent->setProgress(0.);
|
||||||
bool success=false;
|
bool success=false;
|
||||||
Glib::ustring cmdLine;
|
Glib::ustring cmdLine;
|
||||||
|
Glib::ustring executable;
|
||||||
// start gimp
|
// start gimp
|
||||||
if (options.editorToSendTo==1) {
|
if (options.editorToSendTo==1) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
cmdLine = Glib::ustring("\"") + Glib::build_filename (Glib::build_filename(options.gimpDir,"bin"), "gimp-win-remote") + "\" gimp-2.4.exe" + " \"" + filename + "\"";
|
executable = Glib::build_filename (Glib::build_filename(options.gimpDir,"bin"), "gimp-win-remote");
|
||||||
|
cmdLine = Glib::ustring("\"") + executable + Glib::ustring("\" gimp-2.4.exe ") + Glib::ustring("\"") + filename + Glib::ustring("\"");
|
||||||
|
if ( Glib::file_test(executable, (Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_EXECUTABLE)) ) {
|
||||||
|
success = safe_spawn_command_line_async (cmdLine);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
cmdLine = Glib::ustring("gimp-remote ") + " \"" + filename + "\"";
|
cmdLine = Glib::ustring("gimp-remote ") + Glib::ustring(" \"") + filename + Glib::ustring("\"");
|
||||||
#endif
|
|
||||||
success = safe_spawn_command_line_async (cmdLine);
|
success = safe_spawn_command_line_async (cmdLine);
|
||||||
|
#endif
|
||||||
if (!success){
|
if (!success){
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
int ver = 12;
|
int ver = 12;
|
||||||
while (!success && ver) {
|
while (!success && ver) {
|
||||||
cmdLine = Glib::ustring("\"") + Glib::build_filename (Glib::build_filename(options.gimpDir,"bin"), Glib::ustring::compose("gimp-2.%1.exe",ver)) + "\" \"" + filename + "\"";
|
executable = Glib::build_filename (Glib::build_filename(options.gimpDir,"bin"), Glib::ustring::compose(Glib::ustring("gimp-2.%1.exe"),ver));
|
||||||
|
if ( Glib::file_test(executable, (Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_EXECUTABLE)) ) {
|
||||||
|
cmdLine = Glib::ustring("\"") + executable + Glib::ustring("\" \"") + filename + Glib::ustring("\"");
|
||||||
|
success = safe_spawn_command_line_async (cmdLine);
|
||||||
|
}
|
||||||
ver--;
|
ver--;
|
||||||
success = safe_spawn_command_line_async (cmdLine);
|
|
||||||
}
|
}
|
||||||
#elif defined __APPLE__
|
#elif defined __APPLE__
|
||||||
cmdLine = Glib::ustring("gimp ") + " \"" + filename + "\"";
|
cmdLine = Glib::ustring("gimp \"") + filename + Glib::ustring("\"");
|
||||||
success = safe_spawn_command_line_async (cmdLine);
|
success = safe_spawn_command_line_async (cmdLine);
|
||||||
#else
|
#else
|
||||||
cmdLine = Glib::ustring("gimp ") + " \"" + filename + "\"";
|
cmdLine = Glib::ustring("gimp \"") + filename + Glib::ustring("\"");
|
||||||
success = safe_spawn_command_line_async (cmdLine);
|
success = safe_spawn_command_line_async (cmdLine);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (options.editorToSendTo==2) {
|
else if (options.editorToSendTo==2) {
|
||||||
#ifdef __APPLE__
|
#ifdef _WIN32
|
||||||
cmdLine = Glib::ustring("open -a \'") + Glib::build_filename(options.psDir,"Photoshop.app\' ") + "\'" + filename + "\'";
|
executable = Glib::build_filename(options.psDir,"Photoshop.exe");
|
||||||
|
if ( Glib::file_test(executable, (Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_EXECUTABLE)) ) {
|
||||||
|
cmdLine = Glib::ustring("\"") + executable + Glib::ustring("\" \"") + filename + Glib::ustring("\"");
|
||||||
|
success = safe_spawn_command_line_async (cmdLine);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
cmdLine = Glib::ustring("\"") + Glib::build_filename(options.psDir,"Photoshop.exe") + "\" \"" + filename + "\"";
|
#ifdef defined __APPLE__
|
||||||
#endif
|
cmdLine = Glib::ustring("open -a \'") + Glib::build_filename(options.psDir,"Photoshop.app\' ") + Glib::ustring("\'") + filename + Glib::ustring("\'");
|
||||||
|
#else
|
||||||
|
cmdLine = Glib::ustring("\"") + Glib::build_filename(options.psDir,"Photoshop.exe") + Glib::ustring("\" \"") + filename + Glib::ustring("\"");
|
||||||
|
#endif
|
||||||
success = safe_spawn_command_line_async (cmdLine);
|
success = safe_spawn_command_line_async (cmdLine);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else if (options.editorToSendTo==3) {
|
else if (options.editorToSendTo==3) {
|
||||||
#ifdef __APPLE__
|
#ifdef _WIN32
|
||||||
cmdLine = Glib::ustring("") + options.customEditorProg + filename;
|
if ( Glib::file_test(options.customEditorProg, (Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_EXECUTABLE)) ) {
|
||||||
|
cmdLine = Glib::ustring("\"") + options.customEditorProg + Glib::ustring("\" \"") + filename + Glib::ustring("\"");
|
||||||
|
success = safe_spawn_command_line_async (cmdLine);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
cmdLine = Glib::ustring("\"") + options.customEditorProg + "\" \"" + filename + "\"";
|
#ifdef __APPLE__
|
||||||
#endif
|
cmdLine = options.customEditorProg + filename;
|
||||||
|
#else
|
||||||
|
cmdLine = Glib::ustring("\"") + options.customEditorProg + Glib::ustring("\" \"") + filename + Glib::ustring("\"");
|
||||||
|
#endif
|
||||||
success = safe_spawn_command_line_async (cmdLine);
|
success = safe_spawn_command_line_async (cmdLine);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
@@ -1011,4 +1034,4 @@ void EditorPanel::histogramChanged (unsigned int* rh, unsigned int* gh, unsigned
|
|||||||
|
|
||||||
histogramPanel->histogramChanged (rh, gh, bh, lh);
|
histogramPanel->histogramChanged (rh, gh, bh, lh);
|
||||||
tpc->updateCurveBackgroundHistogram (bcrgb, bcl);
|
tpc->updateCurveBackgroundHistogram (bcrgb, bcl);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user