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
c2d5bb78
Commit
c2d5bb78
authored
Dec 11, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fork window close handling for Native/Hybrid
parent
256a5ab7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
19 deletions
+45
-19
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/ui/MainWindowHybrid.qml
View file @
c2d5bb78
...
@@ -23,6 +23,7 @@ along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
...
@@ -23,6 +23,7 @@ along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
import
QtQuick
2.5
import
QtQuick
2.5
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Dialogs
1.2
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Controls
1.0
...
@@ -41,7 +42,7 @@ Item {
...
@@ -41,7 +42,7 @@ Item {
}
}
function
showWindowCloseMessage
()
{
function
showWindowCloseMessage
()
{
mainWindowInner
.
item
.
showWindowCloseMessage
()
windowCloseDialog
.
open
()
}
}
// The following are use for unit testing only
// The following are use for unit testing only
...
@@ -71,5 +72,16 @@ Item {
...
@@ -71,5 +72,16 @@ Item {
anchors.fill
:
parent
anchors.fill
:
parent
source
:
"
MainWindowInner.qml
"
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 @
c2d5bb78
...
@@ -64,7 +64,7 @@ Item {
...
@@ -64,7 +64,7 @@ Item {
flightView
.
visible
=
true
flightView
.
visible
=
true
setupViewLoader
.
visible
=
false
setupViewLoader
.
visible
=
false
planViewLoader
.
visible
=
false
planViewLoader
.
visible
=
false
tool
b
ar
.
checkFlyButton
()
tool
B
ar
.
checkFlyButton
()
}
}
function
showPlanView
()
{
function
showPlanView
()
{
...
@@ -93,10 +93,6 @@ Item {
...
@@ -93,10 +93,6 @@ Item {
toolBar
.
checkSetupButton
()
toolBar
.
checkSetupButton
()
}
}
function
showWindowCloseMessage
()
{
windowCloseDialog
.
open
()
}
// The following are use for unit testing only
// The following are use for unit testing only
function
showSetupFirmware
()
{
function
showSetupFirmware
()
{
...
@@ -204,17 +200,6 @@ Item {
...
@@ -204,17 +200,6 @@ Item {
currentPopUp
=
indicatorDropdown
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
//-- Left Settings Menu
Loader
{
Loader
{
id
:
leftPanel
id
:
leftPanel
...
...
src/ui/MainWindowNative.qml
View file @
c2d5bb78
...
@@ -23,12 +23,14 @@ along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
...
@@ -23,12 +23,14 @@ along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
import
QtQuick
2.5
import
QtQuick
2.5
import
QtQuick
.
Window
2.2
import
QtQuick
.
Window
2.2
import
QtQuick
.
Dialogs
1.2
import
QGroundControl
1.0
import
QGroundControl
1.0
/// Native QML top level window
/// Native QML top level window
Window
{
Window
{
visible
:
true
id
:
_rootWindow
visible
:
true
onClosing
:
{
onClosing
:
{
// Disallow window close if there are active connections
// Disallow window close if there are active connections
...
@@ -56,7 +58,7 @@ Window {
...
@@ -56,7 +58,7 @@ Window {
}
}
function
showWindowCloseMessage
()
{
function
showWindowCloseMessage
()
{
mainWindowInner
.
item
.
showWindowCloseMessage
()
windowCloseDialog
.
open
()
}
}
// The following are use for unit testing only
// The following are use for unit testing only
...
@@ -86,5 +88,32 @@ Window {
...
@@ -86,5 +88,32 @@ Window {
anchors.fill
:
parent
anchors.fill
:
parent
source
:
"
MainWindowInner.qml
"
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