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
a2fc9962
Unverified
Commit
a2fc9962
authored
Jul 05, 2019
by
Gus Grubba
Committed by
GitHub
Jul 05, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7565 from mavlink/qmlMenus
Use QtQuick.Controls 1.x menus
parents
7e6b14b1
cfeea168
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
93 additions
and
63 deletions
+93
-63
qgroundcontrol.qrc
qgroundcontrol.qrc
+3
-0
FlightDisplayViewMap.qml
src/FlightDisplay/FlightDisplayViewMap.qml
+3
-3
QGCMapPolygonVisuals.qml
src/MissionManager/QGCMapPolygonVisuals.qml
+9
-9
QGCMapPolylineVisuals.qml
src/MissionManager/QGCMapPolylineVisuals.qml
+5
-5
MissionItemEditor.qml
src/PlanView/MissionItemEditor.qml
+10
-10
PlanView.qml
src/PlanView/PlanView.qml
+1
-1
RallyPointItemEditor.qml
src/PlanView/RallyPointItemEditor.qml
+2
-2
SimpleItemEditor.qml
src/PlanView/SimpleItemEditor.qml
+5
-5
FlightModeMenu.qml
src/QmlControls/FlightModeMenu.qml
+2
-2
ParameterEditor.qml
src/QmlControls/ParameterEditor.qml
+11
-11
QGCComboBox.qml
src/QmlControls/QGCComboBox.qml
+2
-2
QGCFileDialog.qml
src/QmlControls/QGCFileDialog.qml
+4
-4
QGCMenu.qml
src/QmlControls/QGCMenu.qml
+8
-0
QGCMenuItem.qml
src/QmlControls/QGCMenuItem.qml
+8
-0
QGCMenuSeparator.qml
src/QmlControls/QGCMenuSeparator.qml
+8
-0
qmldir
src/QmlControls/QGroundControl/Controls/qmldir
+3
-0
QmlTest.qml
src/QmlControls/QmlTest.qml
+3
-3
LinkIndicator.qml
src/ui/toolbar/LinkIndicator.qml
+2
-2
ModeIndicator.qml
src/ui/toolbar/ModeIndicator.qml
+2
-2
MultiVehicleSelector.qml
src/ui/toolbar/MultiVehicleSelector.qml
+2
-2
No files found.
qgroundcontrol.qrc
View file @
a2fc9962
...
...
@@ -111,6 +111,9 @@
<file alias="QGroundControl/Controls/QGCMapLabel.qml">src/QmlControls/QGCMapLabel.qml</file>
<file alias="QGroundControl/Controls/QGCMapPolygonVisuals.qml">src/MissionManager/QGCMapPolygonVisuals.qml</file>
<file alias="QGroundControl/Controls/QGCMapPolylineVisuals.qml">src/MissionManager/QGCMapPolylineVisuals.qml</file>
<file alias="QGroundControl/Controls/QGCMenu.qml">src/QmlControls/QGCMenu.qml</file>
<file alias="QGroundControl/Controls/QGCMenuItem.qml">src/QmlControls/QGCMenuItem.qml</file>
<file alias="QGroundControl/Controls/QGCMenuSeparator.qml">src/QmlControls/QGCMenuSeparator.qml</file>
<file alias="QGroundControl/Controls/QGCMouseArea.qml">src/QmlControls/QGCMouseArea.qml</file>
<file alias="QGroundControl/Controls/QGCMovableItem.qml">src/QmlControls/QGCMovableItem.qml</file>
<file alias="QGroundControl/Controls/QGCPipable.qml">src/QmlControls/QGCPipable.qml</file>
...
...
src/FlightDisplay/FlightDisplayViewMap.qml
View file @
a2fc9962
...
...
@@ -415,12 +415,12 @@ FlightMap {
MouseArea
{
anchors.fill
:
parent
Menu
{
QGC
Menu
{
id
:
clickMenu
property
var
coord
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Go to location
"
)
visible
:
guidedActionsController
.
showGotoLocation
...
...
@@ -431,7 +431,7 @@ FlightMap {
}
}
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Orbit at location
"
)
visible
:
guidedActionsController
.
showOrbit
...
...
src/MissionManager/QGCMapPolygonVisuals.qml
View file @
a2fc9962
...
...
@@ -186,7 +186,7 @@ Item {
}
}
Menu
{
QGC
Menu
{
id
:
menu
property
int
_editingVertexIndex
:
-
1
...
...
@@ -201,7 +201,7 @@ Item {
menu
.
popup
()
}
MenuItem
{
QGC
MenuItem
{
id
:
removeVertexItem
visible
:
!
_circle
text
:
qsTr
(
"
Remove vertex
"
)
...
...
@@ -212,39 +212,39 @@ Item {
}
}
MenuSeparator
{
QGC
MenuSeparator
{
visible
:
removeVertexItem
.
visible
}
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Circle
"
)
onTriggered
:
resetCircle
()
}
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Polygon
"
)
onTriggered
:
resetPolygon
()
}
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Set radius...
"
)
visible
:
_circle
onTriggered
:
_editCircleRadius
=
true
}
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Edit position...
"
)
visible
:
_circle
onTriggered
:
mainWindow
.
showComponentDialog
(
editCenterPositionDialog
,
qsTr
(
"
Edit Center Position
"
),
mainWindow
.
showDialogDefaultWidth
,
StandardButton
.
Close
)
}
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Edit position...
"
)
visible
:
!
_circle
&&
menu
.
_editingVertexIndex
>=
0
onTriggered
:
mainWindow
.
showComponentDialog
(
editVertexPositionDialog
,
qsTr
(
"
Edit Vertex Position
"
),
mainWindow
.
showDialogDefaultWidth
,
StandardButton
.
Close
)
}
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Load KML/SHP...
"
)
onTriggered
:
kmlOrSHPLoadDialog
.
openForLoad
()
}
...
...
src/MissionManager/QGCMapPolylineVisuals.qml
View file @
a2fc9962
...
...
@@ -126,7 +126,7 @@ Item {
}
}
Menu
{
QGC
Menu
{
id
:
menu
property
int
_removeVertexIndex
...
...
@@ -136,22 +136,22 @@ Item {
menu
.
popup
()
}
MenuItem
{
QGC
MenuItem
{
id
:
removeVertexItem
text
:
qsTr
(
"
Remove vertex
"
)
onTriggered
:
mapPolyline
.
removeVertex
(
menu
.
_removeVertexIndex
)
}
MenuSeparator
{
QGC
MenuSeparator
{
visible
:
removeVertexItem
.
visible
}
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Edit position...
"
)
onTriggered
:
mainWindow
.
showComponentDialog
(
editPositionDialog
,
qsTr
(
"
Edit Position
"
),
mainWindow
.
showDialogDefaultWidth
,
StandardButton
.
Cancel
)
}
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Load KML...
"
)
onTriggered
:
kmlLoadDialog
.
openForLoad
()
}
...
...
src/PlanView/MissionItemEditor.qml
View file @
a2fc9962
...
...
@@ -100,15 +100,15 @@ Rectangle {
hamburgerMenu
.
popup
()
}
Menu
{
QGC
Menu
{
id
:
hamburgerMenu
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Insert waypoint
"
)
onTriggered
:
insertWaypoint
()
}
Menu
{
QGC
Menu
{
id
:
patternMenu
title
:
qsTr
(
"
Insert pattern
"
)
visible
:
!
_singleComplexItem
...
...
@@ -119,41 +119,41 @@ Rectangle {
onObjectAdded
:
patternMenu
.
insertItem
(
index
,
object
)
onObjectRemoved
:
patternMenu
.
removeItem
(
object
)
MenuItem
{
QGC
MenuItem
{
text
:
modelData
onTriggered
:
insertComplexItem
(
modelData
)
}
}
}
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Insert
"
)
+
_missionController
.
complexMissionItemNames
[
0
]
visible
:
_singleComplexItem
onTriggered
:
insertComplexItem
(
_missionController
.
complexMissionItemNames
[
0
])
}
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Delete
"
)
onTriggered
:
remove
()
}
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Change command...
"
)
onTriggered
:
commandPicker
.
clicked
()
visible
:
missionItem
.
isSimpleItem
&&
!
_waypointsOnlyMode
}
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Edit position...
"
)
visible
:
missionItem
.
specifiesCoordinate
onTriggered
:
mainWindow
.
showComponentDialog
(
editPositionDialog
,
qsTr
(
"
Edit Position
"
),
mainWindow
.
showDialogDefaultWidth
,
StandardButton
.
Close
)
}
MenuSeparator
{
QGC
MenuSeparator
{
visible
:
missionItem
.
isSimpleItem
&&
!
_waypointsOnlyMode
}
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Show all values
"
)
checkable
:
true
checked
:
missionItem
.
isSimpleItem
?
missionItem
.
rawEdit
:
false
...
...
src/PlanView/PlanView.qml
View file @
a2fc9962
...
...
@@ -180,7 +180,7 @@ Item {
id
:
_planMasterController
Component.onCompleted
:
{
start
(
false
/* flyView */
)
_planMasterController
.
start
(
false
/* flyView */
)
_missionController
.
setCurrentPlanViewIndex
(
0
,
true
)
mainWindow
.
planMasterControllerPlan
=
_planMasterController
}
...
...
src/PlanView/RallyPointItemEditor.qml
View file @
a2fc9962
...
...
@@ -65,10 +65,10 @@ Rectangle {
anchors.fill
:
parent
onClicked
:
hamburgerMenu
.
popup
()
Menu
{
QGC
Menu
{
id
:
hamburgerMenu
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Delete
"
)
onTriggered
:
controller
.
removePoint
(
rallyPoint
)
}
...
...
src/PlanView/SimpleItemEditor.qml
View file @
a2fc9962
...
...
@@ -137,17 +137,17 @@ Rectangle {
onClicked
:
altHamburgerMenu
.
popup
()
}
Menu
{
QGC
Menu
{
id
:
altHamburgerMenu
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Altitude Relative To Home
"
)
checkable
:
true
checked
:
missionItem
.
altitudeMode
===
QGroundControl
.
AltitudeModeRelative
onTriggered
:
missionItem
.
altitudeMode
=
QGroundControl
.
AltitudeModeRelative
}
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Altitude Above Mean Sea Level
"
)
checkable
:
true
checked
:
missionItem
.
altitudeMode
===
QGroundControl
.
AltitudeModeAbsolute
...
...
@@ -155,7 +155,7 @@ Rectangle {
onTriggered
:
missionItem
.
altitudeMode
=
QGroundControl
.
AltitudeModeAbsolute
}
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Altitude Above Terrain
"
)
checkable
:
true
checked
:
missionItem
.
altitudeMode
===
QGroundControl
.
AltitudeModeAboveTerrain
...
...
@@ -163,7 +163,7 @@ Rectangle {
visible
:
missionItem
.
specifiesCoordinate
}
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Terrain Frame
"
)
checkable
:
true
checked
:
missionItem
.
altitudeMode
===
QGroundControl
.
AltitudeModeTerrainFrame
...
...
src/QmlControls/FlightModeMenu.qml
View file @
a2fc9962
...
...
@@ -21,14 +21,14 @@ QGCLabel {
property
var
currentVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
Menu
{
QGC
Menu
{
id
:
flightModesMenu
}
Component
{
id
:
flightModeMenuItemComponent
MenuItem
{
QGC
MenuItem
{
onTriggered
:
currentVehicle
.
flightMode
=
text
}
}
...
...
src/QmlControls/ParameterEditor.qml
View file @
a2fc9962
...
...
@@ -101,24 +101,24 @@ Item {
onClicked
:
toolsMenu
.
popup
()
}
Menu
{
QGC
Menu
{
id
:
toolsMenu
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Refresh
"
)
onTriggered
:
controller
.
refresh
()
}
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Reset all to firmware's defaults
"
)
visible
:
!
activeVehicle
.
apmFirmware
onTriggered
:
mainWindow
.
showComponentDialog
(
resetToDefaultConfirmComponent
,
qsTr
(
"
Reset All
"
),
mainWindow
.
showDialogDefaultWidth
,
StandardButton
.
Cancel
|
StandardButton
.
Reset
)
}
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Reset to vehicle's configuration defaults
"
)
visible
:
!
activeVehicle
.
apmFirmware
onTriggered
:
mainWindow
.
showComponentDialog
(
resetToVehicleConfigurationConfirmComponent
,
qsTr
(
"
Reset All
"
),
mainWindow
.
showDialogDefaultWidth
,
StandardButton
.
Cancel
|
StandardButton
.
Reset
)
}
MenuSeparator
{
}
MenuItem
{
QGC
MenuSeparator
{
}
QGC
MenuItem
{
text
:
qsTr
(
"
Load from file...
"
)
onTriggered
:
{
fileDialog
.
title
=
qsTr
(
"
Load Parameters
"
)
...
...
@@ -126,7 +126,7 @@ Item {
fileDialog
.
openForLoad
()
}
}
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Save to file...
"
)
onTriggered
:
{
fileDialog
.
title
=
qsTr
(
"
Save Parameters
"
)
...
...
@@ -134,14 +134,14 @@ Item {
fileDialog
.
openForSave
()
}
}
MenuSeparator
{
visible
:
_showRCToParam
}
MenuItem
{
QGC
MenuSeparator
{
visible
:
_showRCToParam
}
QGC
MenuItem
{
text
:
qsTr
(
"
Clear RC to Param
"
)
onTriggered
:
controller
.
clearRCToParam
()
visible
:
_showRCToParam
}
MenuSeparator
{
}
MenuItem
{
QGC
MenuSeparator
{
}
QGC
MenuItem
{
text
:
qsTr
(
"
Reboot Vehicle
"
)
onTriggered
:
mainWindow
.
showComponentDialog
(
rebootVehicleConfirmComponent
,
qsTr
(
"
Reboot Vehicle
"
),
mainWindow
.
showDialogDefaultWidth
,
StandardButton
.
Cancel
|
StandardButton
.
Ok
)
}
...
...
src/QmlControls/QGCComboBox.qml
View file @
a2fc9962
...
...
@@ -104,7 +104,7 @@ Button {
ExclusiveGroup
{
id
:
eg
}
Menu
{
QGC
Menu
{
id
:
popup
__minimumWidth
:
combo
.
width
__visualItem
:
combo
...
...
@@ -233,7 +233,7 @@ Button {
onObjectRemoved
:
popup
.
removeItem
(
object
)
MenuItem
{
QGC
MenuItem
{
text
:
popup
.
textRole
===
''
?
modelData
:
((
popup
.
_modelIsArray
?
modelData
[
popup
.
textRole
]
:
model
[
popup
.
textRole
])
||
''
)
checked
:
index
==
currentIndex
checkable
:
true
...
...
src/QmlControls/QGCFileDialog.qml
View file @
a2fc9962
...
...
@@ -126,14 +126,14 @@ Item {
hamburgerMenu
.
popup
()
}
Menu
{
QGC
Menu
{
id
:
hamburgerMenu
property
string
fileToDelete
onAboutToHide
:
fileButton
.
highlight
=
false
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Delete
"
)
onTriggered
:
{
controller
.
deleteFile
(
hamburgerMenu
.
fileToDelete
)
...
...
@@ -239,14 +239,14 @@ Item {
hamburgerMenu
.
popup
()
}
Menu
{
QGC
Menu
{
id
:
hamburgerMenu
property
string
fileToDelete
onAboutToHide
:
fileButton
.
highlight
=
false
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Delete
"
)
onTriggered
:
{
controller
.
deleteFile
(
hamburgerMenu
.
fileToDelete
)
...
...
src/QmlControls/QGCMenu.qml
0 → 100644
View file @
a2fc9962
// QtQuick.Control 1.x Menu
import
QtQuick
2.6
import
QtQuick
.
Controls
1.4
Menu
{
}
src/QmlControls/QGCMenuItem.qml
0 → 100644
View file @
a2fc9962
// QtQuick.Control 1.x Menu
import
QtQuick
2.6
import
QtQuick
.
Controls
1.4
MenuItem
{
}
src/QmlControls/QGCMenuSeparator.qml
0 → 100644
View file @
a2fc9962
// QtQuick.Control 1.x Menu
import
QtQuick
2.6
import
QtQuick
.
Controls
1.4
MenuSeparator
{
}
src/QmlControls/QGroundControl/Controls/qmldir
View file @
a2fc9962
...
...
@@ -50,6 +50,9 @@ QGCMapCircleVisuals 1.0 QGCMapCircleVisuals.qml
QGCMapLabel 1.0 QGCMapLabel.qml
QGCMapPolygonVisuals 1.0 QGCMapPolygonVisuals.qml
QGCMapPolylineVisuals 1.0 QGCMapPolylineVisuals.qml
QGCMenu 1.0 QGCMenu.qml
QGCMenuItem 1.0 QGCMenuItem.qml
QGCMenuSeparator 1.0 QGCMenuSeparator.qml
QGCMouseArea 1.0 QGCMouseArea.qml
QGCMovableItem 1.0 QGCMovableItem.qml
QGCPipable 1.0 QGCPipable.qml
...
...
src/QmlControls/QmlTest.qml
View file @
a2fc9962
...
...
@@ -491,13 +491,13 @@ Rectangle {
}
Menu
{
id
:
buttonMenu
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Item 1
"
)
}
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Item 2
"
)
}
MenuItem
{
QGC
MenuItem
{
text
:
qsTr
(
"
Item 3
"
)
}
}
...
...
src/ui/toolbar/LinkIndicator.qml
View file @
a2fc9962
...
...
@@ -34,12 +34,12 @@ Item {
font.pointSize
:
ScreenTools
.
mediumFontPointSize
color
:
qgcPal
.
buttonText
anchors.verticalCenter
:
parent
.
verticalCenter
Menu
{
QGC
Menu
{
id
:
linkSelectionMenu
}
Component
{
id
:
linkSelectionMenuItemComponent
MenuItem
{
QGC
MenuItem
{
onTriggered
:
activeVehicle
.
priorityLinkName
=
text
}
}
...
...
src/ui/toolbar/ModeIndicator.qml
View file @
a2fc9962
...
...
@@ -34,12 +34,12 @@ Item {
font.pointSize
:
ScreenTools
.
mediumFontPointSize
color
:
qgcPal
.
buttonText
anchors.verticalCenter
:
parent
.
verticalCenter
Menu
{
QGC
Menu
{
id
:
flightModesMenu
}
Component
{
id
:
flightModeMenuItemComponent
MenuItem
{
QGC
MenuItem
{
onTriggered
:
activeVehicle
.
flightMode
=
text
}
}
...
...
src/ui/toolbar/MultiVehicleSelector.qml
View file @
a2fc9962
...
...
@@ -38,12 +38,12 @@ Item {
font.pointSize
:
ScreenTools
.
mediumFontPointSize
color
:
qgcPal
.
buttonText
anchors.verticalCenter
:
parent
.
verticalCenter
Menu
{
QGC
Menu
{
id
:
multiVehiclesMenu
}
Component
{
id
:
multiVehicleMenuItemComponent
MenuItem
{
QGC
MenuItem
{
onTriggered
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
=
vehicle
property
int
vehicleId
:
Number
(
text
.
split
(
"
"
)[
1
])
property
var
vehicle
:
QGroundControl
.
multiVehicleManager
.
getVehicleById
(
vehicleId
)
...
...
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