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
125f125a
Commit
125f125a
authored
Dec 08, 2014
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
Showing
1 changed file
with
27 additions
and
10 deletions
+27
-10
MainWindow.cc
src/ui/MainWindow.cc
+27
-10
No files found.
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
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