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
03e24506
Commit
03e24506
authored
Dec 11, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2377 from DonLakeFlyer/AppClose
Tablet app close
parents
9f86fc06
c2d5bb78
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
22 deletions
+46
-22
MissionController.cc
src/MissionManager/MissionController.cc
+1
-3
MainWindowHybrid.qml
src/ui/MainWindowHybrid.qml
+13
-1
MainWindowInner.qml
src/ui/MainWindowInner.qml
+1
-16
MainWindowNative.qml
src/ui/MainWindowNative.qml
+31
-2
No files found.
src/MissionManager/MissionController.cc
View file @
03e24506
...
...
@@ -52,9 +52,7 @@ MissionController::MissionController(QObject *parent)
MissionController
::~
MissionController
()
{
// Start with empty list
_missionItems
=
new
QmlObjectListModel
(
this
);
_initAllMissionItems
();
}
void
MissionController
::
start
(
bool
editMode
)
...
...
src/ui/MainWindowHybrid.qml
View file @
03e24506
...
...
@@ -23,6 +23,7 @@ along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
import
QtQuick
2.5
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Dialogs
1.2
import
QGroundControl
.
Controls
1.0
...
...
@@ -41,7 +42,7 @@ Item {
}
function
showWindowCloseMessage
()
{
mainWindowInner
.
item
.
showWindowCloseMessage
()
windowCloseDialog
.
open
()
}
// The following are use for unit testing only
...
...
@@ -71,5 +72,16 @@ Item {
anchors.fill
:
parent
source
:
"
MainWindowInner.qml
"
}
MessageDialog
{
id
:
windowCloseDialog
title
:
"
QGroundControl close
"
text
:
"
There are still active connections to vehicles. Do you want to disconnect these before closing?
"
standardButtons
:
StandardButton
.
Yes
|
StandardButton
.
Cancel
modality
:
Qt
.
ApplicationModal
visible
:
false
onYes
:
controller
.
acceptWindowClose
()
}
}
src/ui/MainWindowInner.qml
View file @
03e24506
...
...
@@ -64,7 +64,7 @@ Item {
flightView
.
visible
=
true
setupViewLoader
.
visible
=
false
planViewLoader
.
visible
=
false
tool
b
ar
.
checkFlyButton
()
tool
B
ar
.
checkFlyButton
()
}
function
showPlanView
()
{
...
...
@@ -93,10 +93,6 @@ Item {
toolBar
.
checkSetupButton
()
}
function
showWindowCloseMessage
()
{
windowCloseDialog
.
open
()
}
// The following are use for unit testing only
function
showSetupFirmware
()
{
...
...
@@ -204,17 +200,6 @@ Item {
currentPopUp
=
indicatorDropdown
}
MessageDialog
{
id
:
windowCloseDialog
title
:
"
QGroundControl close
"
text
:
"
There are still active connections to vehicles. Do you want to disconnect these before closing?
"
standardButtons
:
StandardButton
.
Yes
|
StandardButton
.
Cancel
modality
:
Qt
.
ApplicationModal
visible
:
false
onYes
:
controller
.
acceptWindowClose
()
}
//-- Left Settings Menu
Loader
{
id
:
leftPanel
...
...
src/ui/MainWindowNative.qml
View file @
03e24506
...
...
@@ -23,12 +23,14 @@ along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
import
QtQuick
2.5
import
QtQuick
.
Window
2.2
import
QtQuick
.
Dialogs
1.2
import
QGroundControl
1.0
/// Native QML top level window
Window
{
visible
:
true
id
:
_rootWindow
visible
:
true
onClosing
:
{
// Disallow window close if there are active connections
...
...
@@ -56,7 +58,7 @@ Window {
}
function
showWindowCloseMessage
()
{
mainWindowInner
.
item
.
showWindowCloseMessage
()
windowCloseDialog
.
open
()
}
// The following are use for unit testing only
...
...
@@ -86,5 +88,32 @@ Window {
anchors.fill
:
parent
source
:
"
MainWindowInner.qml
"
}
MessageDialog
{
id
:
windowCloseDialog
title
:
"
QGroundControl close
"
text
:
"
There are still active connections to vehicles. Do you want to disconnect these before closing?
"
standardButtons
:
StandardButton
.
Yes
|
StandardButton
.
Cancel
modality
:
Qt
.
ApplicationModal
visible
:
false
onYes
:
{
QGroundControl
.
linkManager
.
shutdown
()
// The above shutdown causes a flurry of activity as the vehicle components are removed. This in turn
// causes the Windows Version of Qt to crash if you allow the close event to be accepted. In order to prevent
// the crash, we ignore the close event and setup a delayed timer to close the window after things settle down.
delayedWindowCloseTimer
.
start
()
}
}
Timer
{
id
:
delayedWindowCloseTimer
interval
:
1500
running
:
false
repeat
:
false
onTriggered
:
_rootWindow
.
close
()
}
}
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