]> git.mxchange.org Git - flightgear.git/commitdiff
Fix bug #1845, closing the Qt launcher
authorJames Turner <zakalawe@mac.com>
Wed, 24 Feb 2016 19:50:37 +0000 (21:50 +0200)
committerJames Turner <zakalawe@mac.com>
Wed, 24 Feb 2016 19:50:48 +0000 (21:50 +0200)
Intercept the close event and quit the app instead of continuing to
run the main FlightGear application.

https://sourceforge.net/p/flightgear/codetickets/1845/

src/GUI/QtLauncher.cxx
src/GUI/QtLauncher_private.hxx

index 2a8b049c0b80b86db4755103fea305c2205b91ff..3cc0f201dba2fae489035467ecaef232a700735a 100644 (file)
@@ -725,6 +725,11 @@ void QtLauncher::setEnableDisableOptionFromCheckbox(QCheckBox* cbox, QString nam
     }
 }
 
+void QtLauncher::closeEvent(QCloseEvent *event)
+{
+    qApp->exit(-1);
+}
+
 void QtLauncher::onRun()
 {
     flightgear::Options* opt = flightgear::Options::sharedInstance();
index f5eea7adeab3022a46f90cd89267884139517dee..c2a06b6395136a4cadcd05ef18ba8bb71ce2a7be 100644 (file)
@@ -53,6 +53,10 @@ public:
 
     void setSceneryPaths();
 
+protected:
+    virtual void closeEvent(QCloseEvent *event);
+
+
 private slots:
     // run is used when the launcher is invoked before the main app is
     // started