Commit 5be806e3 authored by DonLakeFlyer's avatar DonLakeFlyer

Reorganize to retain state

parent a640bcec
...@@ -91,6 +91,7 @@ ...@@ -91,6 +91,7 @@
<file alias="QGroundControl/Controls/PreFlightCheckButton.qml">src/QmlControls/PreFlightCheckButton.qml</file> <file alias="QGroundControl/Controls/PreFlightCheckButton.qml">src/QmlControls/PreFlightCheckButton.qml</file>
<file alias="QGroundControl/Controls/PreFlightCheckGroup.qml">src/QmlControls/PreFlightCheckGroup.qml</file> <file alias="QGroundControl/Controls/PreFlightCheckGroup.qml">src/QmlControls/PreFlightCheckGroup.qml</file>
<file alias="QGroundControl/Controls/PreFlightCheckList.qml">src/QmlControls/PreFlightCheckList.qml</file> <file alias="QGroundControl/Controls/PreFlightCheckList.qml">src/QmlControls/PreFlightCheckList.qml</file>
<file alias="QGroundControl/Controls/PreFlightCheckModel.qml">src/QmlControls/PreFlightCheckModel.qml</file>
<file alias="QGroundControl/Controls/QGCButton.qml">src/QmlControls/QGCButton.qml</file> <file alias="QGroundControl/Controls/QGCButton.qml">src/QmlControls/QGCButton.qml</file>
<file alias="QGroundControl/Controls/QGCCheckBox.qml">src/QmlControls/QGCCheckBox.qml</file> <file alias="QGroundControl/Controls/QGCCheckBox.qml">src/QmlControls/QGCCheckBox.qml</file>
<file alias="QGroundControl/Controls/QGCColoredImage.qml">src/QmlControls/QGCColoredImage.qml</file> <file alias="QGroundControl/Controls/QGCColoredImage.qml">src/QmlControls/QGCColoredImage.qml</file>
...@@ -155,7 +156,7 @@ ...@@ -155,7 +156,7 @@
<file alias="QGroundControl/FlightDisplay/GuidedAltitudeSlider.qml">src/FlightDisplay/GuidedAltitudeSlider.qml</file> <file alias="QGroundControl/FlightDisplay/GuidedAltitudeSlider.qml">src/FlightDisplay/GuidedAltitudeSlider.qml</file>
<file alias="QGroundControl/FlightDisplay/MultiVehicleList.qml">src/FlightDisplay/MultiVehicleList.qml</file> <file alias="QGroundControl/FlightDisplay/MultiVehicleList.qml">src/FlightDisplay/MultiVehicleList.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightBatteryCheck.qml">src/FlightDisplay/PreFlightBatteryCheck.qml</file> <file alias="QGroundControl/FlightDisplay/PreFlightBatteryCheck.qml">src/FlightDisplay/PreFlightBatteryCheck.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightCheckModel.qml">src/FlightDisplay/PreFlightCheckModel.qml</file> <file alias="QGroundControl/FlightDisplay/BuiltInPreFlightCheckModel.qml">src/FlightDisplay/BuiltInPreFlightCheckModel.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightGPSCheck.qml">src/FlightDisplay/PreFlightGPSCheck.qml</file> <file alias="QGroundControl/FlightDisplay/PreFlightGPSCheck.qml">src/FlightDisplay/PreFlightGPSCheck.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightRCCheck.qml">src/FlightDisplay/PreFlightRCCheck.qml</file> <file alias="QGroundControl/FlightDisplay/PreFlightRCCheck.qml">src/FlightDisplay/PreFlightRCCheck.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightSensorsHealthCheck.qml">src/FlightDisplay/PreFlightSensorsHealthCheck.qml</file> <file alias="QGroundControl/FlightDisplay/PreFlightSensorsHealthCheck.qml">src/FlightDisplay/PreFlightSensorsHealthCheck.qml</file>
......
...@@ -17,7 +17,7 @@ import QGroundControl.Controls 1.0 ...@@ -17,7 +17,7 @@ import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0 import QGroundControl.Palette 1.0
import QGroundControl.Vehicle 1.0 import QGroundControl.Vehicle 1.0
ObjectModel { PreFlightCheckModel {
PreFlightCheckGroup { PreFlightCheckGroup {
name: qsTr("Initial checks") name: qsTr("Initial checks")
......
...@@ -112,7 +112,7 @@ QGCView { ...@@ -112,7 +112,7 @@ QGCView {
Component.onCompleted: start(true /* flyView */) Component.onCompleted: start(true /* flyView */)
} }
PreFlightCheckModel { BuiltInPreFlightCheckModel {
id: preFlightCheckModel id: preFlightCheckModel
} }
......
...@@ -10,7 +10,7 @@ GuidedActionList 1.0 GuidedActionList.qml ...@@ -10,7 +10,7 @@ GuidedActionList 1.0 GuidedActionList.qml
GuidedAltitudeSlider 1.0 GuidedAltitudeSlider.qml GuidedAltitudeSlider 1.0 GuidedAltitudeSlider.qml
MultiVehicleList 1.0 MultiVehicleList.qml MultiVehicleList 1.0 MultiVehicleList.qml
PreFlightBatteryCheck 1.0 PreFlightBatteryCheck.qml PreFlightBatteryCheck 1.0 PreFlightBatteryCheck.qml
PreFlightCheckModel 1.0 PreFlightCheckModel.qml BuiltInPreFlightCheckModel 1.0 BuiltInPreFlightCheckModel.qml
PreFlightGPSCheck 1.0 PreFlightGPSCheck.qml PreFlightGPSCheck 1.0 PreFlightGPSCheck.qml
PreFlightRCCheck 1.0 PreFlightRCCheck.qml PreFlightRCCheck 1.0 PreFlightRCCheck.qml
PreFlightSensorsHealthCheck 1.0 PreFlightSensorsHealthCheck.qml PreFlightSensorsHealthCheck 1.0 PreFlightSensorsHealthCheck.qml
......
...@@ -25,17 +25,6 @@ Rectangle { ...@@ -25,17 +25,6 @@ Rectangle {
property bool _passed: false property bool _passed: false
function reset() {
for (var i=0; i<model.count; i++) {
var group = model.get(i)
group.reset()
group.enabled = i === 0
group._checked = i === 0
}
}
Component.onCompleted: reset()
// We delay the updates when a group passes so the user can see all items green for a moment prior to hiding // We delay the updates when a group passes so the user can see all items green for a moment prior to hiding
Timer { Timer {
id: delayedGroupPassed id: delayedGroupPassed
...@@ -94,7 +83,7 @@ Rectangle { ...@@ -94,7 +83,7 @@ Rectangle {
opacity : 0.2+0.8*(QGroundControl.multiVehicleManager.vehicles.count > 0) opacity : 0.2+0.8*(QGroundControl.multiVehicleManager.vehicles.count > 0)
tooltip: qsTr("Reset the checklist (e.g. after a vehicle reboot)") tooltip: qsTr("Reset the checklist (e.g. after a vehicle reboot)")
onClicked: reset() onClicked: model.reset()
Image { source:"/qmlimages/MapSyncBlack.svg" ; anchors.fill: parent } Image { source:"/qmlimages/MapSyncBlack.svg" ; anchors.fill: parent }
} }
......
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QtQuick 2.3
import QtQml.Models 2.1
ObjectModel {
id: _root
function reset() {
for (var i=0; i<_root.count; i++) {
var group = _root.get(i)
group.reset()
group.enabled = i === 0
group._checked = i === 0
}
}
Component.onCompleted: reset()
}
...@@ -37,6 +37,7 @@ PlanToolBar 1.0 PlanToolBar.qml ...@@ -37,6 +37,7 @@ PlanToolBar 1.0 PlanToolBar.qml
PreFlightCheckButton 1.0 PreFlightCheckButton.qml PreFlightCheckButton 1.0 PreFlightCheckButton.qml
PreFlightCheckGroup 1.0 PreFlightCheckGroup.qml PreFlightCheckGroup 1.0 PreFlightCheckGroup.qml
PreFlightCheckList 1.0 PreFlightCheckList.qml PreFlightCheckList 1.0 PreFlightCheckList.qml
PreFlightCheckModel 1.0 PreFlightCheckModel.qml
QGCButton 1.0 QGCButton.qml QGCButton 1.0 QGCButton.qml
QGCCheckBox 1.0 QGCCheckBox.qml QGCCheckBox 1.0 QGCCheckBox.qml
QGCColoredImage 1.0 QGCColoredImage.qml QGCColoredImage 1.0 QGCColoredImage.qml
......
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