Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
f9486d9a
Commit
f9486d9a
authored
Dec 03, 2014
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1058 from DonLakeFlyer/SplashScreen
Hiding splash screen now handled by QGCFileDialog/QGCMessageBox
parents
0f05862d
52a7daba
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
27 deletions
+15
-27
QGCFileDialog.cc
src/QGCFileDialog.cc
+5
-0
QGCMessageBox.h
src/QGCMessageBox.h
+7
-20
MainWindow.cc
src/ui/MainWindow.cc
+1
-6
MainWindow.h
src/ui/MainWindow.h
+2
-1
No files found.
src/QGCFileDialog.cc
View file @
f9486d9a
...
...
@@ -23,6 +23,7 @@
#include "QGCFileDialog.h"
#include "QGCApplication.h"
#include "MainWindow.h"
#ifdef QT_DEBUG
#include "UnitTest.h"
#endif
...
...
@@ -113,4 +114,8 @@ void QGCFileDialog::_validate(QString* selectedFilter, Options& options)
// On OSX native dialog can hang so we always use Qt dialogs
options
|=
DontUseNativeDialog
;
if
(
MainWindow
::
instance
())
{
MainWindow
::
instance
()
->
hideSplashScreen
();
}
}
src/QGCMessageBox.h
View file @
f9486d9a
...
...
@@ -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
src/ui/MainWindow.cc
View file @
f9486d9a
...
...
@@ -1106,14 +1106,12 @@ void MainWindow::showStatusMessage(const QString& status)
void
MainWindow
::
showCriticalMessage
(
const
QString
&
title
,
const
QString
&
message
)
{
_hideSplashScreen
();
qDebug
()
<<
"Critical"
<<
title
<<
message
;
QGCMessageBox
::
critical
(
title
,
message
);
}
void
MainWindow
::
showInfoMessage
(
const
QString
&
title
,
const
QString
&
message
)
{
_hideSplashScreen
();
qDebug
()
<<
"Information"
<<
title
<<
message
;
QGCMessageBox
::
information
(
title
,
message
);
}
...
...
@@ -1621,8 +1619,6 @@ void MainWindow::handleMisconfiguration(UASInterface* uas)
}
}
_hideSplashScreen
();
// Ask user if he wants to handle this now
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?"
),
...
...
@@ -1737,7 +1733,6 @@ bool MainWindow::dockWidgetTitleBarsEnabled() const
void
MainWindow
::
_saveTempFlightDataLog
(
QString
tempLogfile
)
{
if
(
qgcApp
()
->
promptFlightDataSave
())
{
_hideSplashScreen
();
QString
saveFilename
=
QGCFileDialog
::
getSaveFileName
(
this
,
tr
(
"Select file to save Flight Data Log"
),
qgcApp
()
->
mavlinkLogFilesLocation
(),
...
...
@@ -1750,7 +1745,7 @@ void MainWindow::_saveTempFlightDataLog(QString tempLogfile)
}
/// @brief Hides the spash screen if it is currently being shown
void
MainWindow
::
_
hideSplashScreen
(
void
)
void
MainWindow
::
hideSplashScreen
(
void
)
{
if
(
_splashScreen
)
{
_splashScreen
->
hide
();
...
...
src/ui/MainWindow.h
View file @
f9486d9a
...
...
@@ -158,6 +158,8 @@ public:
}
QList
<
QAction
*>
listLinkMenuActions
();
void
hideSplashScreen
(
void
);
public
slots
:
/** @brief Shows a status message on the bottom status bar */
...
...
@@ -467,7 +469,6 @@ private:
/// Constructor is private since all creation should be through MainWindow::_create
MainWindow
(
QSplashScreen
*
splashScreen
,
enum
MainWindow
::
CUSTOM_MODE
mode
);
void
_hideSplashScreen
(
void
);
void
_openUrl
(
const
QString
&
url
,
const
QString
&
errorMessage
);
QList
<
QObject
*>
commsWidgetList
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment