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
aa26bcb0
Commit
aa26bcb0
authored
Nov 09, 2019
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
1c68e56f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
22 deletions
+41
-22
MainRootWindow.qml
src/ui/MainRootWindow.qml
+41
-22
No files found.
src/ui/MainRootWindow.qml
View file @
aa26bcb0
...
...
@@ -196,47 +196,66 @@ ApplicationWindow {
mainWindow
.
close
()
}
// On attempting an application close we check for:
// Unsaved missions - then
// Pending parameter writes - then
// Active connections
onClosing
:
{
if
(
!
_forceClose
)
{
unsavedMissionCloseDialog
.
check
()
close
.
accepted
=
false
}
}
MessageDialog
{
id
:
activeConnections
CloseDialog
id
:
unsavedMission
CloseDialog
title
:
qsTr
(
"
%1 close
"
).
arg
(
QGroundControl
.
appName
)
text
:
qsTr
(
"
There are still active connections to vehicles. Are you sure you want to exit
?
"
)
standardButtons
:
StandardButton
.
Yes
|
StandardButton
.
Cancel
text
:
qsTr
(
"
You have a mission edit in progress which has not been saved/sent. If you close you will lose changes. Are you sure you want to close
?
"
)
standardButtons
:
StandardButton
.
Yes
|
StandardButton
.
No
modality
:
Qt
.
ApplicationModal
visible
:
false
onYes
:
finishCloseProcess
()
onYes
:
pendingParameterWritesCloseDialog
.
check
()
function
check
()
{
if
(
QGroundControl
.
multiVehicleManager
.
activeVehicle
)
{
activeConnections
CloseDialog
.
open
()
if
(
planMasterControllerPlan
&&
planMasterControllerPlan
.
dirty
)
{
unsavedMission
CloseDialog
.
open
()
}
else
{
finishCloseProcess
()
pendingParameterWritesCloseDialog
.
check
()
}
}
}
//-------------------------------------------------------------------------
//-- Check for unsaved missions
onClosing
:
{
// Check first for unsaved missions and active connections
if
(
!
_forceClose
)
{
unsavedMissionCloseDialog
.
check
()
close
.
accepted
=
false
MessageDialog
{
id
:
pendingParameterWritesCloseDialog
title
:
qsTr
(
"
%1 close
"
).
arg
(
QGroundControl
.
appName
)
text
:
qsTr
(
"
You have pending parameter updates to a vehicle. If you close you will lose changes. Are you sure you want to close?
"
)
standardButtons
:
StandardButton
.
Yes
|
StandardButton
.
No
modality
:
Qt
.
ApplicationModal
visible
:
false
onYes
:
activeConnectionsCloseDialog
.
check
()
function
check
()
{
for
(
var
index
=
0
;
index
<
QGroundControl
.
multiVehicleManager
.
vehicles
.
count
;
index
++
)
{
if
(
QGroundControl
.
multiVehicleManager
.
vehicles
.
get
(
index
).
parameterManager
.
pendingWrites
)
{
pendingParameterWritesCloseDialog
.
open
()
return
}
}
activeConnectionsCloseDialog
.
check
()
}
}
MessageDialog
{
id
:
unsavedMission
CloseDialog
id
:
activeConnections
CloseDialog
title
:
qsTr
(
"
%1 close
"
).
arg
(
QGroundControl
.
appName
)
text
:
qsTr
(
"
You have a mission edit in progress which has not been saved/sent. If you close you will lose changes. Are you sure you want to close
?
"
)
standardButtons
:
StandardButton
.
Yes
|
StandardButton
.
No
text
:
qsTr
(
"
There are still active connections to vehicles. Are you sure you want to exit
?
"
)
standardButtons
:
StandardButton
.
Yes
|
StandardButton
.
Cancel
modality
:
Qt
.
ApplicationModal
visible
:
false
onYes
:
activeConnectionsCloseDialog
.
check
()
onYes
:
finishCloseProcess
()
function
check
()
{
if
(
planMasterControllerPlan
&&
planMasterControllerPlan
.
dirty
)
{
unsavedMission
CloseDialog
.
open
()
if
(
QGroundControl
.
multiVehicleManager
.
activeVehicle
)
{
activeConnections
CloseDialog
.
open
()
}
else
{
activeConnectionsCloseDialog
.
check
()
finishCloseProcess
()
}
}
}
...
...
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