Commit aa7b4b45 authored by Lorenz Meier's avatar Lorenz Meier

Fix up waypoint handling to not flicker on current WP change state

parent 3517b6ab
...@@ -216,7 +216,8 @@ void Waypoint::setCurrent(bool current) ...@@ -216,7 +216,8 @@ void Waypoint::setCurrent(bool current)
if (this->current != current) if (this->current != current)
{ {
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
} }
} }
......
...@@ -347,7 +347,7 @@ int UASWaypointManager::setCurrentEditable(quint16 seq) ...@@ -347,7 +347,7 @@ int UASWaypointManager::setCurrentEditable(quint16 seq)
if (seq < waypointsEditable.count()) { if (seq < waypointsEditable.count()) {
if(current_state == WP_IDLE) { if(current_state == WP_IDLE) {
//update local main storage //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) { if (waypointsEditable[i]->getId() == seq) {
waypointsEditable[i]->setCurrent(true); waypointsEditable[i]->setCurrent(true);
} else { } else {
......
...@@ -369,7 +369,10 @@ void WaypointEditableView::changedCurrent(int state) ...@@ -369,7 +369,10 @@ void WaypointEditableView::changedCurrent(int state)
else else
{ {
wp->setCurrent(true); 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() ...@@ -485,7 +488,10 @@ void WaypointEditableView::updateValues()
if (m_ui->selectedBox->isChecked() != wp->getCurrent()) 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->setChecked(wp->getCurrent());
m_ui->selectedBox->blockSignals(false);
} }
if (m_ui->autoContinue->isChecked() != wp->getAutoContinue()) if (m_ui->autoContinue->isChecked() != wp->getAutoContinue())
{ {
...@@ -578,9 +584,12 @@ void WaypointEditableView::updateValues() ...@@ -578,9 +584,12 @@ void WaypointEditableView::updateValues()
void WaypointEditableView::setCurrent(bool state) void WaypointEditableView::setCurrent(bool state)
{ {
if (m_ui->selectedBox->isChecked() != state)
{
m_ui->selectedBox->blockSignals(true); m_ui->selectedBox->blockSignals(true);
m_ui->selectedBox->setChecked(state); m_ui->selectedBox->setChecked(state);
m_ui->selectedBox->blockSignals(false); m_ui->selectedBox->blockSignals(false);
}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment