Commit 4fe3514b authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #4966 from DonLakeFlyer/Fixes

Fixes
parents 1cf09f40 01179ac0
......@@ -1255,7 +1255,7 @@ void MissionController::_initAllVisualItems(void)
_recalcAll();
connect(_visualItems, &QmlObjectListModel::dirtyChanged, this, &MissionController::_visualItemsDirtyChanged);
connect(_visualItems, &QmlObjectListModel::dirtyChanged, this, &MissionController::dirtyChanged);
connect(_visualItems, &QmlObjectListModel::countChanged, this, &MissionController::_updateContainsItems);
emit visualItemsChanged();
......@@ -1274,7 +1274,7 @@ void MissionController::_deinitAllVisualItems(void)
_deinitVisualItem(qobject_cast<VisualMissionItem*>(_visualItems->get(i)));
}
disconnect(_visualItems, &QmlObjectListModel::dirtyChanged, this, &MissionController::_visualItemsDirtyChanged);
disconnect(_visualItems, &QmlObjectListModel::dirtyChanged, this, &MissionController::dirtyChanged);
disconnect(_visualItems, &QmlObjectListModel::countChanged, this, &MissionController::_updateContainsItems);
}
......@@ -1586,20 +1586,6 @@ QStringList MissionController::complexMissionItemNames(void) const
return complexItems;
}
void MissionController::_visualItemsDirtyChanged(bool dirty)
{
if (dirty) {
if (_visualItems->count() > 1) {
emit dirtyChanged(true);
} else {
// This was a change to mission settings with no other mission items added
_visualItems->setDirty(false);
}
} else {
emit dirtyChanged(false);
}
}
void MissionController::resumeMission(int resumeIndex)
{
if (!_activeVehicle->firmwarePlugin()->sendHomePositionToVehicle()) {
......
......@@ -171,7 +171,6 @@ private slots:
void _recalcWaypointLines(void);
void _recalcMissionFlightStatus(void);
void _updateContainsItems(void);
void _visualItemsDirtyChanged(bool dirty);
private:
void _init(void);
......
......@@ -86,15 +86,11 @@ Rectangle {
visible: hamburger.visible
onClicked: {
currentItemScope.focus = true
if (_waypointsOnlyMode) {
waypointsOnlyMenu.popup()
} else {
normalMenu.popup()
}
hamburgerMenu.popup()
}
Menu {
id: normalMenu
id: hamburgerMenu
MenuItem {
text: qsTr("Insert waypoint")
......
......@@ -82,47 +82,43 @@ Rectangle {
GridLayout {
anchors.left: parent.left
anchors.right: parent.right
flow: GridLayout.TopToBottom
rows: missionItem.textFieldFacts.count + missionItem.nanFacts.count + (missionItem.speedSection.available ? 1 : 0)
columns: 2
Repeater {
model: missionItem.textFieldFacts
QGCLabel {
QGCLabel { text: object.name }
}
Repeater {
model: missionItem.nanFacts
QGCCheckBox {
text: object.name
Layout.column: 0
Layout.row: index
checked: !isNaN(object.rawValue)
onClicked: object.rawValue = checked ? 0 : NaN
}
}
QGCCheckBox {
id: flightSpeedCheckbox
text: qsTr("Flight Speed")
checked: missionItem.speedSection.specifyFlightSpeed
onClicked: missionItem.speedSection.specifyFlightSpeed = checked
visible: missionItem.speedSection.available
}
Repeater {
model: missionItem.textFieldFacts
FactTextField {
showUnits: true
fact: object
Layout.column: 1
Layout.row: index
Layout.fillWidth: true
}
}
}
GridLayout {
anchors.left: parent.left
anchors.right: parent.right
columns: 2
Repeater {
model: missionItem.nanFacts
QGCCheckBox {
text: object.name
Layout.column: 0
Layout.row: index
checked: !isNaN(object.rawValue)
onClicked: object.rawValue = checked ? 0 : NaN
}
}
Repeater {
model: missionItem.nanFacts
......@@ -130,31 +126,16 @@ Rectangle {
FactTextField {
showUnits: true
fact: object
Layout.column: 1
Layout.row: index
Layout.fillWidth: true
enabled: !isNaN(object.rawValue)
}
}
}
RowLayout {
anchors.left: parent.left
anchors.right: parent.right
spacing: ScreenTools.defaultFontPixelWidth
visible: missionItem.speedSection.available
QGCCheckBox {
id: flightSpeedCheckbox
text: qsTr("Flight Speed")
checked: missionItem.speedSection.specifyFlightSpeed
onClicked: missionItem.speedSection.specifyFlightSpeed = checked
}
FactTextField {
fact: missionItem.speedSection.flightSpeed
Layout.fillWidth: true
enabled: flightSpeedCheckbox.checked
visible: missionItem.speedSection.available
}
}
......
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