Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
f49c93db
Commit
f49c93db
authored
Oct 18, 2015
by
Lorenz Meier
Browse files
Remove splash screen
parent
9fcdda7b
Changes
6
Show whitespace changes
Inline
Side-by-side
src/QGCApplication.cc
View file @
f49c93db
...
...
@@ -31,7 +31,6 @@
#include
<QFile>
#include
<QFlags>
#include
<QSplashScreen>
#include
<QPixmap>
#include
<QDesktopWidget>
#include
<QPainter>
...
...
@@ -434,20 +433,11 @@ bool QGCApplication::_initForNormalAppBoot(void)
_styleIsDark
=
settings
.
value
(
_styleKey
,
_styleIsDark
).
toBool
();
_loadCurrentStyle
();
// Show splash screen
QPixmap
splashImage
(
":/res/SplashScreen"
);
QSplashScreen
*
splashScreen
=
new
QSplashScreen
(
splashImage
);
// Delete splash screen after mainWindow was displayed
splashScreen
->
setAttribute
(
Qt
::
WA_DeleteOnClose
);
splashScreen
->
show
();
processEvents
();
splashScreen
->
showMessage
(
tr
(
"Loading application fonts"
),
Qt
::
AlignLeft
|
Qt
::
AlignBottom
,
QColor
(
62
,
93
,
141
));
// Exit main application when last window is closed
connect
(
this
,
SIGNAL
(
lastWindowClosed
()),
this
,
SLOT
(
quit
()));
// Start the user interface
splashScreen
->
showMessage
(
tr
(
"Starting user interface"
),
Qt
::
AlignLeft
|
Qt
::
AlignBottom
,
QColor
(
62
,
93
,
141
));
MainWindow
*
mainWindow
=
MainWindow
::
_create
(
splashScreen
);
MainWindow
*
mainWindow
=
MainWindow
::
_create
();
Q_CHECK_PTR
(
mainWindow
);
// If we made it this far and we still don't have a location. Either the specfied location was invalid
...
...
@@ -461,10 +451,6 @@ bool QGCApplication::_initForNormalAppBoot(void)
mainWindow
->
showSettings
();
}
// Remove splash screen
splashScreen
->
finish
(
mainWindow
);
mainWindow
->
splashScreenFinished
();
#ifndef __mobile__
// Now that main window is up check for lost log files
connect
(
this
,
&
QGCApplication
::
checkForLostLogFiles
,
MAVLinkProtocol
::
instance
(),
&
MAVLinkProtocol
::
checkForLostLogFiles
);
...
...
src/QGCFileDialog.cc
View file @
f49c93db
...
...
@@ -228,6 +228,5 @@ void QGCFileDialog::_validate(Options& options)
options
|=
DontUseNativeDialog
;
#endif
if
(
MainWindow
::
instance
())
{
MainWindow
::
instance
()
->
hideSplashScreen
();
}
}
src/QGCMessageBox.h
View file @
f49c93db
...
...
@@ -101,7 +101,6 @@ private:
parent
=
_validateParameters
(
buttons
,
&
defaultButton
,
parent
);
if
(
MainWindow
::
instance
())
{
MainWindow
::
instance
()
->
hideSplashScreen
();
if
(
parent
==
NULL
)
{
parent
=
MainWindow
::
instance
();
}
...
...
src/apps/qgcvideo/QGCVideoApp.cc
View file @
f49c93db
...
...
@@ -33,7 +33,6 @@
#include
<QFile>
#include
<QFlags>
#include
<QThread>
#include
<QSplashScreen>
#include
<QPixmap>
#include
<QDesktopWidget>
#include
<QPainter>
...
...
src/ui/MainWindow.cc
View file @
f49c93db
...
...
@@ -32,7 +32,6 @@ This file is part of the QGROUNDCONTROL project
#include
<QDebug>
#include
<QTimer>
#include
<QHostInfo>
#include
<QSplashScreen>
#include
<QQuickView>
#include
<QDesktopWidget>
#include
<QScreen>
...
...
@@ -100,10 +99,10 @@ const char* MainWindow::_visibleWidgetsKey = "VisibleWidgets";
static
MainWindow
*
_instance
=
NULL
;
///< @brief MainWindow singleton
MainWindow
*
MainWindow
::
_create
(
QSplashScreen
*
splashScreen
)
MainWindow
*
MainWindow
::
_create
()
{
Q_ASSERT
(
_instance
==
NULL
);
new
MainWindow
(
splashScreen
);
new
MainWindow
();
// _instance is set in constructor
Q_ASSERT
(
_instance
);
return
_instance
;
...
...
@@ -122,20 +121,15 @@ void MainWindow::deleteInstance(void)
/// @brief Private constructor for MainWindow. MainWindow singleton is only ever created
/// by MainWindow::_create method. Hence no other code should have access to
/// constructor.
MainWindow
::
MainWindow
(
QSplashScreen
*
splashScreen
)
MainWindow
::
MainWindow
()
:
_autoReconnect
(
false
)
,
_lowPowerMode
(
false
)
,
_showStatusBar
(
false
)
,
_splashScreen
(
splashScreen
)
,
_mainQmlWidgetHolder
(
NULL
)
{
Q_ASSERT
(
_instance
==
NULL
);
_instance
=
this
;
if
(
splashScreen
)
{
connect
(
this
,
&
MainWindow
::
initStatusChanged
,
splashScreen
,
&
QSplashScreen
::
showMessage
);
}
// Qt 4/5 on Ubuntu does place the native menubar correctly so on Linux we revert back to in-window menu bar.
#ifdef Q_OS_LINUX
menuBar
()
->
setNativeMenuBar
(
false
);
...
...
@@ -595,15 +589,6 @@ void MainWindow::_storeCurrentViewState(void)
settings
.
setValue
(
_getWindowGeometryKey
(),
saveGeometry
());
}
/// @brief Hides the spash screen if it is currently being shown
void
MainWindow
::
hideSplashScreen
(
void
)
{
if
(
_splashScreen
)
{
_splashScreen
->
hide
();
_splashScreen
=
NULL
;
}
}
void
MainWindow
::
manageLinks
()
{
SettingsDialog
settings
(
this
,
SettingsDialog
::
ShowCommLinks
);
...
...
src/ui/MainWindow.h
View file @
f49c93db
...
...
@@ -55,7 +55,6 @@ This file is part of the QGROUNDCONTROL project
#include
"Mouse6dofInput.h"
#endif // QGC_MOUSE_ENABLED_WIN
class
QSplashScreen
;
class
QGCStatusBar
;
class
Linecharts
;
class
QGCDataPlot2D
;
...
...
@@ -77,10 +76,7 @@ public:
void
deleteInstance
(
void
);
/// @brief Creates the MainWindow singleton. Should only be called once by QGCApplication.
static
MainWindow
*
_create
(
QSplashScreen
*
splashScreen
);
/// @brief Called to indicate that splash screen is no longer being displayed.
void
splashScreenFinished
(
void
)
{
_splashScreen
=
NULL
;
}
static
MainWindow
*
_create
();
~
MainWindow
();
...
...
@@ -97,8 +93,6 @@ public:
return
_lowPowerMode
;
}
void
hideSplashScreen
(
void
);
/// @brief Saves the last used connection
void
saveLastUsedConnection
(
const
QString
connection
);
...
...
@@ -222,7 +216,7 @@ private slots:
private:
/// Constructor is private since all creation should be through MainWindow::_create
MainWindow
(
QSplashScreen
*
splashScreen
);
MainWindow
();
void
_openUrl
(
const
QString
&
url
,
const
QString
&
errorMessage
);
...
...
@@ -265,7 +259,6 @@ private:
bool
_lowPowerMode
;
///< If enabled, QGC reduces the update rates of all widgets
bool
_showStatusBar
;
QVBoxLayout
*
_centralLayout
;
QSplashScreen
*
_splashScreen
;
///< Splash screen, NULL is splash screen not currently being shown
Ui
::
MainWindow
_ui
;
QGCQmlWidgetHolder
*
_mainQmlWidgetHolder
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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