diff --git a/src/Waypoint.cc b/src/Waypoint.cc index 40447c1545cc730d18e8a71e72d09158ba82a296..dc9d3a6c9374cc6f795baeb3524f4a7249571a89 100644 --- a/src/Waypoint.cc +++ b/src/Waypoint.cc @@ -216,7 +216,8 @@ void Waypoint::setCurrent(bool current) if (this->current != current) { this->current = current; - emit changed(this); + // The current waypoint index is handled by the list + // and not part of the individual waypoint update state } } diff --git a/src/uas/UASWaypointManager.cc b/src/uas/UASWaypointManager.cc index 33a46f373366832fdad4b6a6efc57fc116406e32..6fc55a2e3e7e6f45c04540ff0cf092a1630f3cc8 100644 --- a/src/uas/UASWaypointManager.cc +++ b/src/uas/UASWaypointManager.cc @@ -347,7 +347,7 @@ int UASWaypointManager::setCurrentEditable(quint16 seq) if (seq < waypointsEditable.count()) { if(current_state == WP_IDLE) { //update local main storage - for(int i = 0; i < waypointsEditable.count(); i++) { + for (int i = 0; i < waypointsEditable.count(); i++) { if (waypointsEditable[i]->getId() == seq) { waypointsEditable[i]->setCurrent(true); } else { diff --git a/src/ui/WaypointEditableView.cc b/src/ui/WaypointEditableView.cc index 9c1bbf639b716baf00663dc8fd157907e9ac2297..9c9e17cf89e3cbffc4e6b1a11e39620e08b2ca2c 100644 --- a/src/ui/WaypointEditableView.cc +++ b/src/ui/WaypointEditableView.cc @@ -369,7 +369,10 @@ void WaypointEditableView::changedCurrent(int state) else { wp->setCurrent(true); - emit changeCurrentWaypoint(wp->getId()); //the slot changeCurrentWaypoint() in WaypointList sets all other current flags to false + // At this point we do not consider this signal + // to be valid / the edit check boxes should not change the view state + //emit changeCurrentWaypoint(wp->getId()); + //the slot changeCurrentWaypoint() in WaypointList sets all other current flags to false } } @@ -485,7 +488,10 @@ void WaypointEditableView::updateValues() if (m_ui->selectedBox->isChecked() != wp->getCurrent()) { + // This is never a reason to emit a changed signal + m_ui->selectedBox->blockSignals(true); m_ui->selectedBox->setChecked(wp->getCurrent()); + m_ui->selectedBox->blockSignals(false); } if (m_ui->autoContinue->isChecked() != wp->getAutoContinue()) { @@ -578,9 +584,12 @@ void WaypointEditableView::updateValues() void WaypointEditableView::setCurrent(bool state) { - m_ui->selectedBox->blockSignals(true); - m_ui->selectedBox->setChecked(state); - m_ui->selectedBox->blockSignals(false); + if (m_ui->selectedBox->isChecked() != state) + { + m_ui->selectedBox->blockSignals(true); + m_ui->selectedBox->setChecked(state); + m_ui->selectedBox->blockSignals(false); + } }