Commit d467604b authored by Dirk Wilden's avatar Dirk Wilden

nogui protection / batch mode

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5555 383ad7c9-94d9-4d36-a494-682f7c89f535
parent e0d52426
......@@ -658,6 +658,9 @@ void Core::updateView() {
}
}
if ( !OpenFlipper::Options::gui() )
return;
if ( OpenFlipper::Options::restrictFrameRate() ) {
int elapsed = redrawTime_->elapsed ();
......@@ -682,7 +685,7 @@ void Core::updateView() {
redrawTime_->restart ();
if ( OpenFlipper::Options::gui() && !OpenFlipper::Options::loadingSettings() && !OpenFlipper::Options::redrawDisabled() ) {
if ( !OpenFlipper::Options::loadingSettings() && !OpenFlipper::Options::redrawDisabled() ) {
for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i )
coreWidget_->examiner_widgets_[i]->updateGL();
......
......@@ -588,12 +588,12 @@ void Core::openIniFile( QString _filename,
resetScenegraph();
for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i ) {
PluginFunctions::viewerProperties(i).drawMode( OpenFlipper::Options::standardDrawMode() );
coreWidget_->examiner_widgets_[i]->viewAll();
}
if ( OpenFlipper::Options::gui() ){
for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i ) {
PluginFunctions::viewerProperties(i).drawMode( OpenFlipper::Options::standardDrawMode() );
coreWidget_->examiner_widgets_[i]->viewAll();
}
if ( OpenFlipper::Options::gui() ) {
coreWidget_->statusMessage( "Loading ini File " + _filename + " ... Done", 4000);
coreWidget_->setStatus(ApplicationStatus::READY );
}
......
......@@ -59,7 +59,8 @@ void Core::resetScenegraph() {
}
// Update the draw Modes Menu
coreWidget_->slotUpdateGlobalDrawMenu();
if ( OpenFlipper::Options::gui() )
coreWidget_->slotUpdateGlobalDrawMenu();
}
//========================================================================================
......@@ -104,6 +105,8 @@ void Core::slotCommandLineOpen() {
emit executeFileScript(commandLineScriptNames_[i]);
}
if ( !OpenFlipper::Options::gui() && !OpenFlipper::Options::remoteControl())
exitApplication();
}
/// Load object by guessing DataType depending on the files extension
......
......@@ -246,7 +246,7 @@ bool parseCommandLineOptions(CSimpleOpt& args){
OpenFlipper::Options::splash(false);
break;
case OPT_REMOTE:
remoteControl = true;
OpenFlipper::Options::remoteControl(true);
break;
case OPT_HELP:
showHelp();
......@@ -280,17 +280,15 @@ int main(int argc, char **argv)
OpenFlipper::Options::argc(&argc);
OpenFlipper::Options::argv(&argv);
//print arguments
std::fstream filestr ("/Users/moebius/param.log", std::fstream::out);
for (int i=0; i < argc; i++)
filestr << argv[i] << " ";
filestr << std::endl;
filestr.close();
CSimpleOpt args(argc, argv, g_rgOptions);
//check only batchMode before the core is created
while (args.Next())
if (args.OptionId() == OPT_BATCH ){
OpenFlipper::Options::nogui(true);
break;
}
// Only Install signal handler if not running in debug version, otherwise gdb will get confused
// #ifndef DEBUG
// Set a handler for segfaults
......@@ -349,8 +347,7 @@ int main(int argc, char **argv)
for ( int i = 0 ; i < args.FileCount(); ++i )
w->commandLineScript(args.File(i));
if ( remoteControl )
return app.exec();
return app.exec();
}
return 0;
......
......@@ -195,6 +195,8 @@ static int* argc_;
static char *** argv_;
static bool remoteControl_ = false;
# if __WORDSIZE == 64
const bool is64 = true;
#else
......@@ -680,6 +682,14 @@ void argv( char*** _argv) {
argv_ = _argv;
}
bool remoteControl(){
return remoteControl_;
}
void remoteControl(bool _remote){
remoteControl_ = _remote;
}
void doSlotDebugging( bool _debugging ) {
doSlotDebugging_ = _debugging;
}
......
......@@ -609,7 +609,13 @@ void argc( int* _argc );
DLLEXPORT
void argv( char*** _argv);
/// is the core remoteControlled?
DLLEXPORT
bool remoteControl();
/// is the core remoteControlled?
DLLEXPORT
void remoteControl( bool _remote );
//===========================================================================
/** @name Debugging Options
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment