Commit b5572934 authored by Don Gagne's avatar Don Gagne

Hide splash screen

Also restructured code to remove duplication
parent a312b956
......@@ -87,48 +87,35 @@ private:
return (parent == NULL) ? MainWindow::instance() : parent;
}
#ifdef Q_OS_MAC
static StandardButton _messageBox(Icon icon, const QString& title, const QString& text, StandardButtons buttons, StandardButton defaultButton, QWidget* parent)
{
// You can't use QGCMessageBox if QGCApplication is not created yet.
Q_ASSERT(qgcApp());
parent = _validateParameters(buttons, &defaultButton, parent);
if (MainWindow::instance()) {
MainWindow::instance()->hideSplashScreen();
}
#ifdef QT_DEBUG
if (qgcApp()->runningUnitTests()) {
return UnitTest::_messageBox(icon, title, text, buttons, defaultButton);
} else
#endif // QT_DEBUG
#endif
{
#ifdef Q_OS_MAC
QString emptyTitle;
QMessageBox box(icon, emptyTitle, title, buttons, parent);
box.setDefaultButton(defaultButton);
box.setInformativeText(text);
return static_cast<QMessageBox::StandardButton>(box.exec());
}
}
#else
static StandardButton _messageBox(Icon icon, const QString& title, const QString& text, StandardButtons buttons, StandardButton defaultButton, QWidget* parent)
{
// You can't use QGCMessageBox if QGCApplication is not created yet.
Q_ASSERT(qgcApp());
parent = _validateParameters(buttons, &defaultButton, parent);
#ifdef QT_DEBUG
if (qgcApp()->runningUnitTests()) {
return UnitTest::_messageBox(icon, title, text, buttons, defaultButton);
} else
#endif // QT_DEBUG
{
QMessageBox box(icon, title, text, buttons, parent);
box.setDefaultButton(defaultButton);
#endif
return static_cast<QMessageBox::StandardButton>(box.exec());
}
}
#endif // Q_OS_MAC
};
#endif
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