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
63b29b1c
Commit
63b29b1c
authored
Mar 02, 2017
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix remove item/current item bug
Plus remove unused code
parent
99fda356
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
81 deletions
+7
-81
MissionEditor.qml
src/MissionEditor/MissionEditor.qml
+7
-71
MissionController.cc
src/MissionManager/MissionController.cc
+0
-10
No files found.
src/MissionEditor/MissionEditor.qml
View file @
63b29b1c
...
...
@@ -248,13 +248,9 @@ QGCView {
id
:
_mapTypeButtonsExclusiveGroup
}
ExclusiveGroup
{
id
:
_dropButtonsExclusiveGroup
}
function
setCurrentItem
(
sequenceNumber
)
{
if
(
sequenceNumber
!==
_currentMissionIndex
)
{
//editorMap.polygonDraw.cancelPolygonEdit(
)
console
.
log
(
"
setCurrentItem
"
,
sequenceNumber
)
_currentMissionItem
=
undefined
_currentMissionIndex
=
-
1
for
(
var
i
=
0
;
i
<
_visualItems
.
count
;
i
++
)
{
...
...
@@ -457,59 +453,6 @@ QGCView {
}
}
Component
{
id
:
missionItemComponent
MissionItemIndicator
{
id
:
itemIndicator
coordinate
:
object
.
coordinate
visible
:
object
.
isSimpleItem
&&
object
.
specifiesCoordinate
z
:
QGroundControl
.
zOrderMapItems
missionItem
:
object
sequenceNumber
:
object
.
sequenceNumber
//-- If you don't want to allow selecting items beneath the
// toolbar, the code below has to check and see if mouse.y
// is greater than (map.height - ScreenTools.availableHeight)
onClicked
:
setCurrentItem
(
object
.
sequenceNumber
)
function
updateItemIndicator
()
{
if
(
object
.
isCurrentItem
&&
itemIndicator
.
visible
&&
object
.
specifiesCoordinate
&&
object
.
isSimpleItem
)
{
// Setup our drag item
itemDragger
.
visible
=
true
itemDragger
.
coordinateItem
=
Qt
.
binding
(
function
()
{
return
object
})
itemDragger
.
mapCoordinateIndicator
=
Qt
.
binding
(
function
()
{
return
itemIndicator
})
}
}
Connections
{
target
:
object
onIsCurrentItemChanged
:
updateItemIndicator
()
onSpecifiesCoordinateChanged
:
updateItemIndicator
()
}
// These are the non-coordinate child mission items attached to this item
Row
{
anchors.top
:
parent
.
top
anchors.left
:
parent
.
right
Repeater
{
model
:
object
.
isSimpleItem
?
object
.
childItems
:
0
delegate
:
MissionItemIndexLabel
{
label
:
object
.
abbreviation
checked
:
object
.
isCurrentItem
z
:
2
specifiesCoordinate
:
false
onClicked
:
setCurrentItem
(
object
.
sequenceNumber
)
}
}
}
}
}
// Add lines between waypoints
MissionLineView
{
model
:
_editingLayer
==
_layerMission
?
missionController
.
waypointLines
:
undefined
...
...
@@ -635,9 +578,13 @@ QGCView {
onClicked
:
setCurrentItem
(
object
.
sequenceNumber
)
onRemove
:
{
var
removeIndex
=
index
itemDragger
.
clearItem
()
missionController
.
removeMissionItem
(
index
)
editorMap
.
polygonDraw
.
cancelPolygonEdit
()
missionController
.
removeMissionItem
(
removeIndex
)
if
(
removeIndex
>=
missionController
.
visualItems
.
count
)
{
removeIndex
--
}
setCurrentItem
(
removeIndex
)
}
onInsert
:
{
...
...
@@ -750,17 +697,6 @@ QGCView {
}
}
//-- Dismiss Drop Down (if any)
MouseArea
{
anchors.fill
:
parent
enabled
:
_dropButtonsExclusiveGroup
.
current
!=
null
onClicked
:
{
if
(
_dropButtonsExclusiveGroup
.
current
)
_dropButtonsExclusiveGroup
.
current
.
checked
=
false
_dropButtonsExclusiveGroup
.
current
=
null
}
}
ToolStrip
{
id
:
toolStrip
anchors.leftMargin
:
ScreenTools
.
defaultFontPixelWidth
...
...
src/MissionManager/MissionController.cc
View file @
63b29b1c
...
...
@@ -258,16 +258,6 @@ void MissionController::removeMissionItem(int index)
item
->
deleteLater
();
_recalcAll
();
// Set the new current item
if
(
index
>=
_visualItems
->
count
())
{
index
--
;
}
for
(
int
i
=
0
;
i
<
_visualItems
->
count
();
i
++
)
{
VisualMissionItem
*
item
=
qobject_cast
<
VisualMissionItem
*>
(
_visualItems
->
get
(
i
));
item
->
setIsCurrentItem
(
i
==
index
);
}
_visualItems
->
setDirty
(
true
);
}
...
...
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