merge with dev

This commit is contained in:
Desmis
2017-06-27 10:28:35 +02:00
45 changed files with 1074 additions and 400 deletions

View File

@@ -60,7 +60,9 @@ Glib::ustring argv0;
Glib::ustring creditsPath;
Glib::ustring licensePath;
Glib::ustring argv1;
bool simpleEditor;
Glib::ustring argv2;
bool simpleEditor = false;
bool gimpPlugin = false;
Glib::RefPtr<Gtk::CssProvider> cssForced;
Glib::RefPtr<Gtk::CssProvider> cssRT;
//Glib::Threads::Thread* mainThread;
@@ -292,12 +294,21 @@ int main (int argc, char **argv)
#endif
simpleEditor = false;
if ( !argv1.empty() )
if ( Glib::file_test (argv1, Glib::FILE_TEST_EXISTS) && !Glib::file_test (argv1, Glib::FILE_TEST_IS_DIR)) {
if (!argv1.empty()) {
if( Glib::file_test(argv1, Glib::FILE_TEST_EXISTS) && !Glib::file_test(argv1, Glib::FILE_TEST_IS_DIR)) {
simpleEditor = true;
}
}
if (gimpPlugin) {
if (!Glib::file_test(argv1, Glib::FILE_TEST_EXISTS) || Glib::file_test(argv1, Glib::FILE_TEST_IS_DIR)) {
printf("Error: argv1 doesn't exist\n");
return 1;
}
if (argv2.empty()) {
printf("Error: -gimp requires two arguments\n");
return 1;
}
}
Gtk::Main m (&argc, &argv);
@@ -390,7 +401,18 @@ int main (int argc, char **argv)
// opening the main window
m.run (*rtWindow);
if (gimpPlugin && rtWindow->epanel && rtWindow->epanel->isRealized()) {
SaveFormat sf;
sf.format = "tif";
sf.tiffBits = 16;
sf.tiffUncompressed = true;
sf.saveParams = true;
rtWindow->epanel->saveImmediately(argv2, sf);
}
gdk_threads_leave ();
delete rtWindow;
rtengine::cleanup();
@@ -433,6 +455,16 @@ int processLineParams ( int argc, char **argv )
case 'w': // This case is handled outside this function
break;
#endif
case 'g':
if (currParam == "-gimp") {
simpleEditor = true;
gimpPlugin = true;
break;
}
// no break here on purpose
case 'v':
return 0;
case 'h':
case '?':
@@ -459,16 +491,24 @@ int processLineParams ( int argc, char **argv )
#ifdef WIN32
std::cout << " -w Do not open the Windows console" << std::endl;
#endif
std::cout << " -h -? Display this help message" << std::endl;
return -1;
}
std::cout << " -v Print RawTherapee version number and exit" << std::endl;
std::cout << " -h -? Display this help message" << std::endl;
return -1;
}
}
} else {
argv1 = Glib::ustring(fname_to_utf8(argv[iArg]));
if (argv1.empty()) {
argv1 = Glib::ustring(fname_to_utf8(argv[iArg]));
#if ECLIPSE_ARGS
argv1 = argv1.substr(1, argv1.length()-2);
argv1 = argv1.substr(1, argv1.length()-2);
#endif
break;
} else if (gimpPlugin) {
argv2 = Glib::ustring(fname_to_utf8(argv[iArg]));
break;
}
if (!gimpPlugin) {
break;
}
}
}