Commit a312b956 authored by Don Gagne's avatar Don Gagne

Hide splash screen now handled by QGCFileDialog|QGCMessageBox apis

parent 0f05862d
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "QGCFileDialog.h" #include "QGCFileDialog.h"
#include "QGCApplication.h" #include "QGCApplication.h"
#include "MainWindow.h"
#ifdef QT_DEBUG #ifdef QT_DEBUG
#include "UnitTest.h" #include "UnitTest.h"
#endif #endif
...@@ -113,4 +114,8 @@ void QGCFileDialog::_validate(QString* selectedFilter, Options& options) ...@@ -113,4 +114,8 @@ void QGCFileDialog::_validate(QString* selectedFilter, Options& options)
// On OSX native dialog can hang so we always use Qt dialogs // On OSX native dialog can hang so we always use Qt dialogs
options |= DontUseNativeDialog; options |= DontUseNativeDialog;
if (MainWindow::instance()) {
MainWindow::instance()->hideSplashScreen();
}
} }
...@@ -1106,14 +1106,12 @@ void MainWindow::showStatusMessage(const QString& status) ...@@ -1106,14 +1106,12 @@ void MainWindow::showStatusMessage(const QString& status)
void MainWindow::showCriticalMessage(const QString& title, const QString& message) void MainWindow::showCriticalMessage(const QString& title, const QString& message)
{ {
_hideSplashScreen();
qDebug() << "Critical" << title << message; qDebug() << "Critical" << title << message;
QGCMessageBox::critical(title, message); QGCMessageBox::critical(title, message);
} }
void MainWindow::showInfoMessage(const QString& title, const QString& message) void MainWindow::showInfoMessage(const QString& title, const QString& message)
{ {
_hideSplashScreen();
qDebug() << "Information" << title << message; qDebug() << "Information" << title << message;
QGCMessageBox::information(title, message); QGCMessageBox::information(title, message);
} }
...@@ -1621,8 +1619,6 @@ void MainWindow::handleMisconfiguration(UASInterface* uas) ...@@ -1621,8 +1619,6 @@ void MainWindow::handleMisconfiguration(UASInterface* uas)
} }
} }
_hideSplashScreen();
// Ask user if he wants to handle this now // Ask user if he wants to handle this now
QMessageBox::StandardButton button = QGCMessageBox::question(tr("Missing or Invalid Onboard Configuration"), QMessageBox::StandardButton button = QGCMessageBox::question(tr("Missing or Invalid Onboard Configuration"),
tr("The onboard system configuration is missing or incomplete. Do you want to resolve this now?"), tr("The onboard system configuration is missing or incomplete. Do you want to resolve this now?"),
...@@ -1737,7 +1733,6 @@ bool MainWindow::dockWidgetTitleBarsEnabled() const ...@@ -1737,7 +1733,6 @@ bool MainWindow::dockWidgetTitleBarsEnabled() const
void MainWindow::_saveTempFlightDataLog(QString tempLogfile) void MainWindow::_saveTempFlightDataLog(QString tempLogfile)
{ {
if (qgcApp()->promptFlightDataSave()) { if (qgcApp()->promptFlightDataSave()) {
_hideSplashScreen();
QString saveFilename = QGCFileDialog::getSaveFileName(this, QString saveFilename = QGCFileDialog::getSaveFileName(this,
tr("Select file to save Flight Data Log"), tr("Select file to save Flight Data Log"),
qgcApp()->mavlinkLogFilesLocation(), qgcApp()->mavlinkLogFilesLocation(),
...@@ -1750,7 +1745,7 @@ void MainWindow::_saveTempFlightDataLog(QString tempLogfile) ...@@ -1750,7 +1745,7 @@ void MainWindow::_saveTempFlightDataLog(QString tempLogfile)
} }
/// @brief Hides the spash screen if it is currently being shown /// @brief Hides the spash screen if it is currently being shown
void MainWindow::_hideSplashScreen(void) void MainWindow::hideSplashScreen(void)
{ {
if (_splashScreen) { if (_splashScreen) {
_splashScreen->hide(); _splashScreen->hide();
......
...@@ -159,6 +159,8 @@ public: ...@@ -159,6 +159,8 @@ public:
QList<QAction*> listLinkMenuActions(); QList<QAction*> listLinkMenuActions();
void hideSplashScreen(void);
public slots: public slots:
/** @brief Shows a status message on the bottom status bar */ /** @brief Shows a status message on the bottom status bar */
void showStatusMessage(const QString& status, int timeout); void showStatusMessage(const QString& status, int timeout);
...@@ -467,7 +469,6 @@ private: ...@@ -467,7 +469,6 @@ private:
/// Constructor is private since all creation should be through MainWindow::_create /// Constructor is private since all creation should be through MainWindow::_create
MainWindow(QSplashScreen* splashScreen, enum MainWindow::CUSTOM_MODE mode); MainWindow(QSplashScreen* splashScreen, enum MainWindow::CUSTOM_MODE mode);
void _hideSplashScreen(void);
void _openUrl(const QString& url, const QString& errorMessage); void _openUrl(const QString& url, const QString& errorMessage);
QList<QObject*> commsWidgetList; QList<QObject*> commsWidgetList;
......
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