Browse Source

Merge pull request #6009 from DonLakeFlyer/DoubleClose

Fix double-close bug on OSX
QGC4.4
Don Gagne 7 years ago committed by GitHub
parent
commit
748b053121
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/ui/MainWindow.cc
  2. 3
      src/ui/MainWindow.h

3
src/ui/MainWindow.cc

@ -380,7 +380,7 @@ void MainWindow::showStatusBarCallback(bool checked)
checked ? statusBar()->show() : statusBar()->hide(); checked ? statusBar()->show() : statusBar()->hide();
} }
void MainWindow::reallyClose(void) void MainWindow::_reallyClose(void)
{ {
_forceClose = true; _forceClose = true;
close(); close();
@ -443,6 +443,7 @@ void MainWindow::connectCommonActions()
{ {
// Connect internal actions // Connect internal actions
connect(qgcApp()->toolbox()->multiVehicleManager(), &MultiVehicleManager::vehicleAdded, this, &MainWindow::_vehicleAdded); connect(qgcApp()->toolbox()->multiVehicleManager(), &MultiVehicleManager::vehicleAdded, this, &MainWindow::_vehicleAdded);
connect(this, &MainWindow::reallyClose, this, &MainWindow::_reallyClose, Qt::QueuedConnection); // Queued to allow closeEvent to fully unwind before _reallyClose is called
} }
void MainWindow::_openUrl(const QString& url, const QString& errorMessage) void MainWindow::_openUrl(const QString& url, const QString& errorMessage)

3
src/ui/MainWindow.h

@ -80,7 +80,7 @@ public:
void saveLastUsedConnection(const QString connection); void saveLastUsedConnection(const QString connection);
// Called from MainWindow.qml when the user accepts the window close dialog // Called from MainWindow.qml when the user accepts the window close dialog
Q_INVOKABLE void reallyClose(void); void _reallyClose(void);
/// @return Root qml object of main window QML /// @return Root qml object of main window QML
QObject* rootQmlObject(void); QObject* rootQmlObject(void);
@ -104,6 +104,7 @@ signals:
void initStatusChanged(const QString& message, int alignment, const QColor &color); void initStatusChanged(const QString& message, int alignment, const QColor &color);
/** Emitted when any value changes from any source */ /** Emitted when any value changes from any source */
void valueChanged(const int uasId, const QString& name, const QString& unit, const QVariant& value, const quint64 msec); void valueChanged(const int uasId, const QString& name, const QString& unit, const QVariant& value, const quint64 msec);
void reallyClose(void);
// Used for unit tests to know when the main window closes // Used for unit tests to know when the main window closes
void mainWindowClosed(void); void mainWindowClosed(void);

Loading…
Cancel
Save