|
|
|
@ -382,13 +382,13 @@ void WaypointList::changeCurrentWaypoint(quint16 seq)
@@ -382,13 +382,13 @@ void WaypointList::changeCurrentWaypoint(quint16 seq)
|
|
|
|
|
void WaypointList::currentWaypointEditableChanged(quint16 seq) |
|
|
|
|
{ |
|
|
|
|
WPM->setCurrentEditable(seq); |
|
|
|
|
const QList<Waypoint *> &waypoints = WPM->getWaypointEditableList(); |
|
|
|
|
const QList<Waypoint *> waypoints = WPM->getWaypointEditableList(); |
|
|
|
|
|
|
|
|
|
if (seq < waypoints.count()) |
|
|
|
|
{ |
|
|
|
|
for(int i = 0; i < waypoints.count(); i++) |
|
|
|
|
{ |
|
|
|
|
WaypointEditableView* widget = wpEditableViews.find(waypoints[i]).value(); |
|
|
|
|
WaypointEditableView* widget = wpEditableViews.value(waypoints[i], NULL); |
|
|
|
|
|
|
|
|
|
if (widget) { |
|
|
|
|
if (waypoints[i]->getId() == seq) |
|
|
|
@ -410,13 +410,13 @@ void WaypointList::currentWaypointViewOnlyChanged(quint16 seq)
@@ -410,13 +410,13 @@ void WaypointList::currentWaypointViewOnlyChanged(quint16 seq)
|
|
|
|
|
// First update the edit list
|
|
|
|
|
currentWaypointEditableChanged(seq); |
|
|
|
|
|
|
|
|
|
const QList<Waypoint *> &waypoints = WPM->getWaypointViewOnlyList(); |
|
|
|
|
const QList<Waypoint *> waypoints = WPM->getWaypointViewOnlyList(); |
|
|
|
|
|
|
|
|
|
if (seq < waypoints.count()) |
|
|
|
|
{ |
|
|
|
|
for(int i = 0; i < waypoints.count(); i++) |
|
|
|
|
{ |
|
|
|
|
WaypointViewOnlyView* widget = wpViewOnlyViews.find(waypoints[i]).value(); |
|
|
|
|
WaypointViewOnlyView* widget = wpViewOnlyViews.value(waypoints[i], NULL); |
|
|
|
|
|
|
|
|
|
if (waypoints[i]->getId() == seq) |
|
|
|
|
{ |
|
|
|
@ -465,13 +465,15 @@ void WaypointList::waypointViewOnlyListChanged()
@@ -465,13 +465,15 @@ void WaypointList::waypointViewOnlyListChanged()
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (i == waypoints.count()) { |
|
|
|
|
WaypointViewOnlyView* widget = wpViewOnlyViews.find(cur).value(); |
|
|
|
|
WaypointViewOnlyView* widget = wpViewOnlyViews.value(cur, NULL); |
|
|
|
|
if (widget) { |
|
|
|
|
widget->hide(); |
|
|
|
|
viewOnlyListLayout->removeWidget(widget); |
|
|
|
|
wpViewOnlyViews.remove(cur); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// then add/update the views for each waypoint in the list
|
|
|
|
|
for(int i = 0; i < waypoints.count(); i++) { |
|
|
|
@ -519,13 +521,16 @@ void WaypointList::waypointEditableListChanged()
@@ -519,13 +521,16 @@ void WaypointList::waypointEditableListChanged()
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (i == waypoints.count()) { |
|
|
|
|
WaypointEditableView* widget = wpEditableViews.find(cur).value(); |
|
|
|
|
WaypointEditableView* widget = wpEditableViews.value(cur, NULL); |
|
|
|
|
|
|
|
|
|
if (widget) { |
|
|
|
|
widget->hide(); |
|
|
|
|
editableListLayout->removeWidget(widget); |
|
|
|
|
wpEditableViews.remove(cur); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// then add/update the views for each waypoint in the list
|
|
|
|
|
for(int i = 0; i < waypoints.count(); i++) { |
|
|
|
@ -613,23 +618,27 @@ void WaypointList::on_clearWPListButton_clicked()
@@ -613,23 +618,27 @@ void WaypointList::on_clearWPListButton_clicked()
|
|
|
|
|
emit clearPathclicked(); |
|
|
|
|
const QList<Waypoint *> &waypoints = WPM->getWaypointEditableList(); |
|
|
|
|
while(!waypoints.isEmpty()) { |
|
|
|
|
WaypointEditableView* widget = wpEditableViews.find(waypoints[0]).value(); |
|
|
|
|
WaypointEditableView* widget = wpEditableViews.value(waypoints[0], NULL); |
|
|
|
|
if (widget) { |
|
|
|
|
widget->remove(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void WaypointList::clearWPWidget() |
|
|
|
|
{
|
|
|
|
|
// Get list
|
|
|
|
|
const QList<Waypoint *> &waypoints = WPM->getWaypointEditableList(); |
|
|
|
|
const QList<Waypoint *> waypoints = WPM->getWaypointEditableList(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// XXX delete wps as well
|
|
|
|
|
|
|
|
|
|
// Clear UI elements
|
|
|
|
|
while(!waypoints.isEmpty()) { |
|
|
|
|
WaypointEditableView* widget = wpEditableViews.find(waypoints[0]).value(); |
|
|
|
|
WaypointEditableView* widget = wpEditableViews.value(waypoints[0], NULL); |
|
|
|
|
if (widget) { |
|
|
|
|
widget->remove(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|