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
125f125a
Commit
125f125a
authored
Dec 08, 2014
by
Don Gagne
Browse files
Disallow close if active connections
Also moved log file settings save check to mavlink protocol
parent
9b7b32b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ui/MainWindow.cc
View file @
125f125a
...
...
@@ -778,12 +778,31 @@ void MainWindow::showHILConfigurationWidget(UASInterface* uas)
void
MainWindow
::
closeEvent
(
QCloseEvent
*
event
)
{
// Disallow window close if there are active connections
bool
foundConnections
=
false
;
foreach
(
LinkInterface
*
link
,
LinkManager
::
instance
()
->
getLinks
())
{
if
(
link
->
isConnected
())
{
foundConnections
=
true
;
break
;
}
}
if
(
foundConnections
)
{
QGCMessageBox
::
warning
(
tr
(
"QGroundControl close"
),
tr
(
"There are still active connections to vehicles. Please disconnect all connections before closing QGroundControl."
));
event
->
ignore
();
return
;
}
// Should not be any active connections
foreach
(
LinkInterface
*
link
,
LinkManager
::
instance
()
->
getLinks
())
{
Q_ASSERT
(
!
link
->
isConnected
());
}
storeViewState
();
storeSettings
();
mavlink
->
storeSettings
();
UASManager
::
instance
()
->
storeSettings
();
// FIXME: If connected links, should prompt before close
LinkManager
::
instance
()
->
disconnectAll
();
event
->
accept
();
}
...
...
@@ -1734,14 +1753,12 @@ bool MainWindow::dockWidgetTitleBarsEnabled() const
void
MainWindow
::
_saveTempFlightDataLog
(
QString
tempLogfile
)
{
if
(
qgcApp
()
->
promptFlightDataSave
())
{
QString
saveFilename
=
QGCFileDialog
::
getSaveFileName
(
this
,
tr
(
"Select file to save Flight Data Log"
),
qgcApp
()
->
mavlinkLogFilesLocation
(),
tr
(
"Flight Data Log (*.mavlink)"
));
if
(
!
saveFilename
.
isEmpty
())
{
QFile
::
copy
(
tempLogfile
,
saveFilename
);
}
QString
saveFilename
=
QGCFileDialog
::
getSaveFileName
(
this
,
tr
(
"Select file to save Flight Data Log"
),
qgcApp
()
->
mavlinkLogFilesLocation
(),
tr
(
"Flight Data Log (*.mavlink)"
));
if
(
!
saveFilename
.
isEmpty
())
{
QFile
::
copy
(
tempLogfile
,
saveFilename
);
}
QFile
::
remove
(
tempLogfile
);
}
...
...
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