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
6921214a
Commit
6921214a
authored
Dec 29, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rework gear icon to hamburger with menu options
Hamburger: Delete, Delete All, Show all Values
parent
3a1f28cc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
111 additions
and
84 deletions
+111
-84
MissionEditor.qml
src/MissionEditor/MissionEditor.qml
+43
-17
MissionEditorHelp.qml
src/MissionEditor/MissionEditorHelp.qml
+1
-50
MissionController.cc
src/MissionManager/MissionController.cc
+11
-11
MissionController.h
src/MissionManager/MissionController.h
+1
-1
MissionItemEditor.qml
src/QmlControls/MissionItemEditor.qml
+55
-5
No files found.
src/MissionEditor/MissionEditor.qml
View file @
6921214a
...
...
@@ -133,6 +133,43 @@ QGCView {
}
}
property
int
_moveDialogMissionItemIndex
Component
{
id
:
moveDialog
QGCViewDialog
{
function
accept
()
{
var
toIndex
=
toCombo
.
currentIndex
if
(
toIndex
==
0
)
{
toIndex
=
1
}
controller
.
moveMissionItem
(
_moveDialogMissionItemIndex
,
toIndex
)
hideDialog
()
}
Column
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
spacing
:
ScreenTools
.
defaultFontPixelHeight
QGCLabel
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
wrapMode
:
Text
.
WordWrap
text
:
"
Move the selected mission item to the be after following mission item:
"
}
QGCComboBox
{
id
:
toCombo
model
:
_missionItems
.
count
currentIndex
:
_moveDialogMissionItemIndex
}
}
}
}
QGCViewPanel
{
id
:
panel
anchors.fill
:
parent
...
...
@@ -340,12 +377,13 @@ QGCView {
onClicked
:
setCurrentItem
(
object
.
sequenceNumber
)
onRemove
:
{
var
newCurrentItem
=
object
.
sequenceNumber
-
1
itemDragger
.
clearItem
()
controller
.
removeMissionItem
(
object
.
sequenceNumber
)
if
(
_missionItems
.
count
>
1
)
{
newCurrentItem
=
Math
.
min
(
_missionItems
.
count
-
1
,
newCurrentItem
)
setCurrentItem
(
newCurrentItem
)
}
}
onRemoveAll
:
{
itemDragger
.
clearItem
()
controller
.
removeAllMissionItems
()
}
}
}
// ListView
...
...
@@ -408,18 +446,6 @@ QGCView {
}
}
RoundButton
{
id
:
deleteMissionItemButton
buttonImage
:
"
/qmlimages/TrashDelete.svg
"
z
:
QGroundControl
.
zOrderWidgets
onClicked
:
{
addMissionItemsButton
.
checked
=
false
itemDragger
.
clearItem
()
controller
.
deleteCurrentMissionItem
()
checked
=
false
}
}
DropButton
{
id
:
syncButton
dropDirection
:
dropRight
...
...
src/MissionEditor/MissionEditorHelp.qml
View file @
6921214a
...
...
@@ -97,59 +97,10 @@ Rectangle {
"
When enabled, add mission items by clicking on the map.
"
}
Image
{
id
:
deleteHelpIcon
anchors.topMargin
:
ScreenTools
.
defaultFontPixelHeight
anchors.top
:
addMissionItemsHelpText
.
bottom
width
:
ScreenTools
.
defaultFontPixelHeight
*
3
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
smooth
:
true
source
:
(
qgcPal
.
globalTheme
===
QGCPalette
.
Light
)
?
"
/qmlimages/TrashDeleteBlack.svg
"
:
"
/qmlimages/TrashDelete.svg
"
}
QGCLabel
{
id
:
deleteHelpText
anchors.leftMargin
:
ScreenTools
.
defaultFontPixelHeight
anchors.left
:
mapTypeHelpIcon
.
right
anchors.right
:
parent
.
right
anchors.top
:
deleteHelpIcon
.
top
wrapMode
:
Text
.
WordWrap
text
:
"
<b>Delete Mission Item</b><br>
"
+
"
Delete the currently selected mission item.
"
}
/*
Home Position Manager disabled
Image {
id: homePositionManagerHelpIcon
anchors.topMargin: ScreenTools.defaultFontPixelHeight
anchors.top: deleteHelpText.bottom
width: ScreenTools.defaultFontPixelHeight * 3
fillMode: Image.PreserveAspectFit
mipmap: true
smooth: true
source: (qgcPal.globalTheme === QGCPalette.Light) ? "/qmlimages/MapHomeBlack.svg" : "/qmlimages/MapHome.svg"
}
QGCLabel {
id: homePositionManagerHelpText
anchors.leftMargin: ScreenTools.defaultFontPixelHeight
anchors.left: mapTypeHelpIcon.right
anchors.right: parent.right
anchors.top: homePositionManagerHelpIcon.top
wrapMode: Text.WordWrap
text: "<b>Flying Field Manager</b><br>" +
"When enabled, allows you to select/add/update flying field locations. " +
"You can save multiple flying field locations for use while creating missions while you are not connected to your vehicle."
}
*/
Image
{
id
:
mapCenterHelpIcon
anchors.topMargin
:
ScreenTools
.
defaultFontPixelHeight
anchors.top
:
delete
HelpText
.
bottom
anchors.top
:
addMissionItems
HelpText
.
bottom
width
:
ScreenTools
.
defaultFontPixelHeight
*
3
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
...
...
src/MissionManager/MissionController.cc
View file @
6921214a
...
...
@@ -205,6 +205,17 @@ void MissionController::removeMissionItem(int index)
}
}
void
MissionController
::
removeAllMissionItems
(
void
)
{
if
(
_missionItems
)
{
_deinitAllMissionItems
();
_missionItems
->
deleteLater
();
}
_missionItems
=
new
QmlObjectListModel
(
this
);
_initAllMissionItems
();
}
void
MissionController
::
loadMissionFromFile
(
void
)
{
#ifndef __mobile__
...
...
@@ -606,17 +617,6 @@ void MissionController::_activeVehicleHomePositionChanged(const QGeoCoordinate&
_recalcWaypointLines
();
}
void
MissionController
::
deleteCurrentMissionItem
(
void
)
{
for
(
int
i
=
0
;
i
<
_missionItems
->
count
();
i
++
)
{
MissionItem
*
item
=
qobject_cast
<
MissionItem
*>
(
_missionItems
->
get
(
i
));
if
(
item
->
isCurrentItem
()
&&
i
!=
0
)
{
removeMissionItem
(
i
);
return
;
}
}
}
void
MissionController
::
setAutoSync
(
bool
autoSync
)
{
// FIXME: AutoSync temporarily turned off
...
...
src/MissionManager/MissionController.h
View file @
6921214a
...
...
@@ -53,7 +53,7 @@ public:
Q_INVOKABLE
void
loadMissionFromFile
(
void
);
Q_INVOKABLE
void
saveMissionToFile
(
void
);
Q_INVOKABLE
void
removeMissionItem
(
int
index
);
Q_INVOKABLE
void
deleteCurrentMissionItem
(
void
);
Q_INVOKABLE
void
removeAllMissionItems
(
void
);
// Property accessors
...
...
src/QmlControls/MissionItemEditor.qml
View file @
6921214a
...
...
@@ -20,6 +20,7 @@ Rectangle {
signal
clicked
signal
remove
signal
removeAll
height
:
innerItem
.
height
+
(
_margin
*
3
)
color
:
missionItem
.
isCurrentItem
?
qgcPal
.
buttonHighlight
:
qgcPal
.
windowShade
...
...
@@ -34,6 +35,19 @@ Rectangle {
colorGroupEnabled
:
enabled
}
Component
{
id
:
deleteAllPromptDialog
QGCViewMessage
{
message
:
"
Are you sure you want to delete all mission items?
"
function
accept
()
{
removeAll
()
hideDialog
()
}
}
}
Item
{
id
:
innerItem
anchors.margins
:
_margin
...
...
@@ -57,18 +71,54 @@ Rectangle {
}
Image
{
id
:
rawEdit
id
:
hamburger
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelWidth
anchors.right
:
parent
.
right
anchors.verticalCenter
:
commandPicker
.
verticalCenter
width
:
commandPicker
.
height
height
:
commandPicker
.
height
visible
:
missionItem
.
friendlyEditAllowed
&&
missionItem
.
sequenceNumber
!=
0
&&
missionItem
.
isCurrentItem
source
:
"
qrc:/qmlimages/CogWheel.svg
"
source
:
"
qrc:/qmlimages/Hamburger.svg
"
visible
:
missionItem
.
isCurrentItem
&&
missionItem
.
sequenceNumber
!=
0
MouseArea
{
anchors.fill
:
parent
onClicked
:
missionItem
.
rawEdit
=
!
missionItem
.
rawEdit
onClicked
:
hamburgerMenu
.
popup
()
Menu
{
id
:
hamburgerMenu
MenuItem
{
text
:
"
Delete
"
onTriggered
:
remove
()
}
MenuItem
{
text
:
"
Delete all
"
onTriggered
:
qgcView
.
showDialog
(
deleteAllPromptDialog
,
"
Delete all
"
,
40
,
StandardButton
.
Yes
|
StandardButton
.
No
)
}
MenuSeparator
{
}
MenuItem
{
text
:
"
Show all values
"
checkable
:
true
checked
:
missionItem
.
rawEdit
onTriggered
:
{
if
(
missionItem
.
rawEdit
)
{
if
(
missionItem
.
friendlyEditAllowed
)
{
missionItem
.
rawEdit
=
false
}
else
{
qgcView
.
showMessage
(
"
Mission Edit
"
,
"
You have made changes to the mission item which cannot be shown in Simple Mode
"
,
StandardButton
.
Ok
)
}
}
else
{
missionItem
.
rawEdit
=
true
}
checked
=
missionItem
.
rawEdit
}
}
}
}
}
...
...
@@ -77,7 +127,7 @@ Rectangle {
anchors.leftMargin
:
ScreenTools
.
defaultFontPixelWidth
*
2
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelWidth
anchors.left
:
label
.
right
anchors.right
:
rawEdit
.
left
anchors.right
:
hamburger
.
left
visible
:
missionItem
.
sequenceNumber
!=
0
&&
missionItem
.
isCurrentItem
&&
!
missionItem
.
rawEdit
text
:
missionItem
.
commandName
...
...
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