Skip to content

Commit 8466264

Browse files
committed
optional quitting if initial load fails #21 fix #18221
1 parent 305ef1c commit 8466264

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/netedit/GNEApplicationWindow.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,6 +1350,10 @@ GNEApplicationWindow::handleEvent_FileLoaded(GUIEvent* e) {
13501350
// write info
13511351
WRITE_ERROR(failureMessage);
13521352
setStatusBarText(failureMessage);
1353+
if (OptionsCont::getOptions().getBool("quit-on-fail")) {
1354+
closeAllWindows(true);
1355+
getApp()->exit(1);
1356+
}
13531357
} else {
13541358
// report success
13551359
std::string successMessage;

src/netedit/GNELoadThread.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,9 @@ GNELoadThread::fillOptions(OptionsCont& neteditOptions) {
542542
neteditOptions.doRegister("gui-testing.setting-output", new Option_FileName());
543543
neteditOptions.addDescription("gui-testing.setting-output", "Visualisation", TL("Save gui settings in the given settings-output file"));
544544

545+
neteditOptions.doRegister("quit-on-fail", 'Q', new Option_Bool(false));
546+
neteditOptions.addDescription("quit-on-fail", "Visualisation", TL("Quit the app if the initial net/config loading fails"));
547+
545548
// TOPIC: Time
546549

547550
// register the simulation settings (needed for GNERouteHandler)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
-c netedit_A.netecfg --test-file "test.py"
1+
-Q -c netedit_A.netecfg --test-file "test.py"

0 commit comments

Comments
 (0)