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
d1bab199
Commit
d1bab199
authored
Nov 26, 2014
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix shutdown sequence
parent
23e9acf2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
22 deletions
+16
-22
QGCApplication.cc
src/QGCApplication.cc
+11
-14
QGCApplication.h
src/QGCApplication.h
+0
-2
main.cc
src/main.cc
+2
-0
MainWindow.cc
src/ui/MainWindow.cc
+3
-6
No files found.
src/QGCApplication.cc
View file @
d1bab199
...
...
@@ -85,8 +85,7 @@ const char* QGCApplication::_savedFileParameterDirectoryName = "SavedParameters"
QGCApplication
::
QGCApplication
(
int
&
argc
,
char
*
argv
[])
:
QApplication
(
argc
,
argv
),
_mainWindow
(
NULL
)
QApplication
(
argc
,
argv
)
{
Q_ASSERT
(
_app
==
NULL
);
_app
=
this
;
...
...
@@ -133,7 +132,6 @@ QGCApplication::QGCApplication(int &argc, char* argv[]) :
QGCApplication
::~
QGCApplication
()
{
destroySingletonsForUnitTest
();
delete
_mainWindow
;
}
void
QGCApplication
::
_initCommon
(
void
)
...
...
@@ -216,12 +214,12 @@ bool QGCApplication::_initForNormalAppBoot(void)
// Start the user interface
splashScreen
->
showMessage
(
tr
(
"Starting user interface"
),
Qt
::
AlignLeft
|
Qt
::
AlignBottom
,
QColor
(
62
,
93
,
141
));
_
mainWindow
=
new
MainWindow
(
splashScreen
,
mode
);
Q_CHECK_PTR
(
_
mainWindow
);
MainWindow
*
mainWindow
=
new
MainWindow
(
splashScreen
,
mode
);
Q_CHECK_PTR
(
mainWindow
);
UDPLink
*
udpLink
=
NULL
;
if
(
_
mainWindow
->
getCustomMode
()
==
MainWindow
::
CUSTOM_MODE_WIFI
)
if
(
mainWindow
->
getCustomMode
()
==
MainWindow
::
CUSTOM_MODE_WIFI
)
{
// Connect links
// to make sure that all components are initialized when the
...
...
@@ -241,8 +239,8 @@ bool QGCApplication::_initForNormalAppBoot(void)
#endif
// Remove splash screen
splashScreen
->
finish
(
_
mainWindow
);
_
mainWindow
->
splashScreenFinished
();
splashScreen
->
finish
(
mainWindow
);
mainWindow
->
splashScreenFinished
();
// If we made it this far and we still don't have a location. Either the specfied location was invalid
// or we coudn't create a default location. Either way, we need to let the user know and prompt for a new
...
...
@@ -250,11 +248,11 @@ bool QGCApplication::_initForNormalAppBoot(void)
if
(
savedFilesLocation
.
isEmpty
())
{
QGCMessageBox
::
warning
(
tr
(
"Bad save location"
),
tr
(
"The location to save files to is invalid, or cannot be written to. Please provide a new one."
));
_
mainWindow
->
showSettings
();
mainWindow
->
showSettings
();
}
if
(
settingsUpgraded
)
{
_
mainWindow
->
showInfoMessage
(
tr
(
"Settings Cleared"
),
mainWindow
->
showInfoMessage
(
tr
(
"Settings Cleared"
),
tr
(
"The format for QGroundControl saved settings has been modified. "
"Your saved settings have been reset to defaults."
));
}
...
...
@@ -270,7 +268,7 @@ bool QGCApplication::_initForNormalAppBoot(void)
if
(
button
==
QMessageBox
::
Yes
)
{
//mainWindow->close();
QTimer
::
singleShot
(
200
,
_
mainWindow
,
SLOT
(
close
()));
QTimer
::
singleShot
(
200
,
mainWindow
,
SLOT
(
close
()));
}
}
...
...
@@ -402,9 +400,8 @@ void QGCApplication::destroySingletonsForUnitTest(void)
singleton
->
deleteInstance
();
}
if
(
_mainWindow
)
{
_mainWindow
->
deleteInstance
();
_mainWindow
=
NULL
;
if
(
MainWindow
::
instance
())
{
delete
MainWindow
::
instance
();
}
_singletons
.
clear
();
...
...
src/QGCApplication.h
View file @
d1bab199
...
...
@@ -120,8 +120,6 @@ private:
static
const
char
*
_defaultSavedFileDirectoryName
;
///< Default name for user visible save file directory
static
const
char
*
_savedFileMavlinkLogDirectoryName
;
///< Name of mavlink log subdirectory
static
const
char
*
_savedFileParameterDirectoryName
;
///< Name of parameter subdirectory
MainWindow
*
_mainWindow
;
QList
<
QGCSingleton
*>
_singletons
;
///< List of registered global singletons
};
...
...
src/main.cc
View file @
d1bab199
...
...
@@ -161,5 +161,7 @@ int main(int argc, char *argv[])
delete
app
;
qDebug
()
<<
"After app delete"
;
return
exitCode
;
}
src/ui/MainWindow.cc
View file @
d1bab199
...
...
@@ -101,17 +101,12 @@ MainWindow* MainWindow::_create(QSplashScreen* splashScreen, enum MainWindow::CU
MainWindow
*
MainWindow
::
instance
(
void
)
{
// QGCAppication should have already called _create. Singleton is only created by call to _create
// not here.
Q_ASSERT
(
_instance
);
return
_instance
;
}
void
MainWindow
::
deleteInstance
(
void
)
{
delete
_instance
;
_instance
=
NULL
;
delete
this
;
}
/// @brief Private constructor for MainWindow. MainWindow singleton is only ever created
...
...
@@ -416,6 +411,8 @@ MainWindow::~MainWindow()
{
commsWidgetList
[
i
]
->
deleteLater
();
}
_instance
=
NULL
;
}
void
MainWindow
::
resizeEvent
(
QResizeEvent
*
event
)
...
...
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