Commit 3027250d authored by Lorenz Meier's avatar Lorenz Meier

Disable the active WP setting in the edit list, as its super error prone -...

Disable the active WP setting in the edit list, as its super error prone - only allow it in the view list and switch between views based on activity on the system / UI
parent 01961dc3
......@@ -92,6 +92,11 @@ WaypointEditableView::WaypointEditableView(Waypoint* wp, QWidget* parent) :
m_ui->comboBox_frame->addItem("Local(NED)",MAV_FRAME_LOCAL_NED);
m_ui->comboBox_frame->addItem("Mission",MAV_FRAME_MISSION);
// We do not want users to mess with the current waypoint in missions -
// they have to use the one downloaded from the MAV to change the current WP.
m_ui->selectedBox->setVisible(false);
connect(m_ui->selectedBox, SIGNAL(stateChanged(int)), this, SLOT(changedCurrent(int)));
// Initialize view correctly
int actionID = wp->getAction();
initializeActionView(actionID);
......@@ -109,7 +114,6 @@ WaypointEditableView::WaypointEditableView(Waypoint* wp, QWidget* parent) :
connect(m_ui->removeButton, SIGNAL(clicked()), this, SLOT(remove()));
connect(m_ui->autoContinue, SIGNAL(stateChanged(int)), this, SLOT(changedAutoContinue(int)));
connect(m_ui->selectedBox, SIGNAL(stateChanged(int)), this, SLOT(changedCurrent(int)));
connect(m_ui->comboBox_action, SIGNAL(activated(int)), this, SLOT(changedAction(int)));
connect(m_ui->comboBox_frame, SIGNAL(activated(int)), this, SLOT(changedFrame(int)));
......
......@@ -29,10 +29,16 @@
<string notr="true"/>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<property name="leftMargin">
<number>6</number>
</property>
<property name="margin">
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item>
......@@ -62,6 +68,9 @@
</item>
<item>
<widget class="QCheckBox" name="selectedBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
......
......@@ -405,6 +405,9 @@ void WaypointList::currentWaypointEditableChanged(quint16 seq)
// Update waypointViews to correctly indicate the new current waypoint
void WaypointList::currentWaypointViewOnlyChanged(quint16 seq)
{
// First update the edit list
currentWaypointEditableChanged(seq);
const QList<Waypoint *> &waypoints = WPM->getWaypointViewOnlyList();
if (seq < waypoints.count())
......@@ -423,6 +426,7 @@ void WaypointList::currentWaypointViewOnlyChanged(quint16 seq)
}
}
}
m_ui->tabWidget->setCurrentIndex(1); // XXX magic number
}
void WaypointList::updateWaypointEditable(int uas, Waypoint* wp)
......@@ -430,6 +434,7 @@ void WaypointList::updateWaypointEditable(int uas, Waypoint* wp)
Q_UNUSED(uas);
WaypointEditableView *wpv = wpEditableViews.value(wp);
wpv->updateValues();
m_ui->tabWidget->setCurrentIndex(0); // XXX magic number
}
void WaypointList::updateWaypointViewOnly(int uas, Waypoint* wp)
......@@ -437,6 +442,7 @@ void WaypointList::updateWaypointViewOnly(int uas, Waypoint* wp)
Q_UNUSED(uas);
WaypointViewOnlyView *wpv = wpViewOnlyViews.value(wp);
wpv->updateValues();
m_ui->tabWidget->setCurrentIndex(1); // XXX magic number
}
void WaypointList::waypointViewOnlyListChanged()
......@@ -488,6 +494,8 @@ void WaypointList::waypointViewOnlyListChanged()
this->setUpdatesEnabled(true);
loadFileGlobalWP = false;
m_ui->tabWidget->setCurrentIndex(1);
}
......@@ -544,7 +552,6 @@ void WaypointList::waypointEditableListChanged()
this->setUpdatesEnabled(true);
loadFileGlobalWP = false;
}
void WaypointList::moveUp(Waypoint* wp)
......
......@@ -154,8 +154,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>836</width>
<height>316</height>
<width>834</width>
<height>325</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
......@@ -294,8 +294,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>836</width>
<height>316</height>
<width>834</width>
<height>323</height>
</rect>
</property>
<property name="autoFillBackground">
......
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