Commit ffd803ac authored by Gus Grubba's avatar Gus Grubba

Moved the preflight checklist to a proper, modal dialog.

parent d2ab2510
...@@ -627,7 +627,6 @@ Item { ...@@ -627,7 +627,6 @@ Item {
{ {
name: "Checklist", name: "Checklist",
iconSource: "/qmlimages/check.svg", iconSource: "/qmlimages/check.svg",
dropPanelComponent: checklistDropPanel
}, },
{ {
name: _guidedController.takeoffTitle, name: _guidedController.takeoffTitle,
...@@ -660,6 +659,8 @@ Item { ...@@ -660,6 +659,8 @@ Item {
guidedActionsController.closeAll() guidedActionsController.closeAll()
if(index === 0) { if(index === 0) {
mainWindow.showPlanView() mainWindow.showPlanView()
} else if(index === 1) {
checklistDropPanel.open()
} else { } else {
var action = model[index].action var action = model[index].action
if (action === -1) { if (action === -1) {
...@@ -795,10 +796,24 @@ Item { ...@@ -795,10 +796,24 @@ Item {
} }
//-- Checklist GUI //-- Checklist GUI
Component { Popup {
id: checklistDropPanel id: checklistDropPanel
x: Math.round((mainWindow.width - width) * 0.5)
y: Math.round((mainWindow.height - height) * 0.5)
height: checkList.height
width: checkList.width
modal: true
focus: true
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
background: Rectangle {
anchors.fill: parent
color: Qt.rgba(0,0,0,0)
clip: true
}
PreFlightCheckList { PreFlightCheckList {
model: preFlightCheckModel id: checkList
model: preFlightCheckModel
} }
} }
} }
...@@ -43,9 +43,9 @@ QGCButton { ...@@ -43,9 +43,9 @@ QGCButton {
readonly property int _stateFailed: 1 ///< Telemetry check is failing, user cannot click to make it pass readonly property int _stateFailed: 1 ///< Telemetry check is failing, user cannot click to make it pass
readonly property int _statePassed: 2 ///< Check has passed readonly property int _statePassed: 2 ///< Check has passed
readonly property color _passedColor: Qt.rgba(0.27,0.67,0.42,1) readonly property color _passedColor: "#86cc6a"
readonly property color _pendingColor: Qt.rgba(0.9,0.47,0.2,1) readonly property color _pendingColor: "#f7a81f"
readonly property color _failedColor: Qt.rgba(0.92,0.22,0.22,1) readonly property color _failedColor: "#c31818"
property string _text: "<b>" + name +"</b>: " + property string _text: "<b>" + name +"</b>: " +
((_telemetryState !== _statePassed) ? ((_telemetryState !== _statePassed) ?
...@@ -136,5 +136,4 @@ QGCButton { ...@@ -136,5 +136,4 @@ QGCButton {
} }
} }
QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
} }
...@@ -16,10 +16,10 @@ import QGroundControl.ScreenTools 1.0 ...@@ -16,10 +16,10 @@ import QGroundControl.ScreenTools 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
Rectangle { Rectangle {
width: mainColumn.width + 3*ScreenTools.defaultFontPixelWidth width: mainColumn.width + ScreenTools.defaultFontPixelWidth * 3
height: mainColumn.height + ScreenTools.defaultFontPixelHeight height: mainColumn.height + ScreenTools.defaultFontPixelHeight
color: qgcPal.windowShade color: qgcPal.windowShade
radius: 3 radius: 3
property alias model: checkListRepeater.model property alias model: checkListRepeater.model
...@@ -52,12 +52,12 @@ Rectangle { ...@@ -52,12 +52,12 @@ Rectangle {
Column { Column {
id: mainColumn id: mainColumn
width: 40*ScreenTools.defaultFontPixelWidth width: 40 * ScreenTools.defaultFontPixelWidth
spacing: 0.8*ScreenTools.defaultFontPixelWidth spacing: 0.8 * ScreenTools.defaultFontPixelWidth
anchors.left: parent.left anchors.left: parent.left
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 0.6*ScreenTools.defaultFontPixelWidth anchors.topMargin: 0.6 * ScreenTools.defaultFontPixelWidth
anchors.leftMargin: 1.5*ScreenTools.defaultFontPixelWidth anchors.leftMargin: 1.5 * ScreenTools.defaultFontPixelWidth
function groupPassedChanged(index, passed) { function groupPassedChanged(index, passed) {
if (passed) { if (passed) {
...@@ -70,8 +70,8 @@ Rectangle { ...@@ -70,8 +70,8 @@ Rectangle {
// Header/title of checklist // Header/title of checklist
Item { Item {
width: parent.width width: parent.width
height: 1.75*ScreenTools.defaultFontPixelHeight height: 1.75 * ScreenTools.defaultFontPixelHeight
QGCLabel { QGCLabel {
text: qsTr("Pre-Flight Checklist %1").arg(_passed ? qsTr("(passed)") : "") text: qsTr("Pre-Flight Checklist %1").arg(_passed ? qsTr("(passed)") : "")
...@@ -80,16 +80,19 @@ Rectangle { ...@@ -80,16 +80,19 @@ Rectangle {
font.pointSize: ScreenTools.mediumFontPointSize font.pointSize: ScreenTools.mediumFontPointSize
} }
QGCButton { QGCButton {
width: 1.2*ScreenTools.defaultFontPixelHeight width: 1.2 * ScreenTools.defaultFontPixelHeight
height: 1.2*ScreenTools.defaultFontPixelHeight height: 1.2 * ScreenTools.defaultFontPixelHeight
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
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: model.reset() onClicked: model.reset()
Image { source:"/qmlimages/MapSyncBlack.svg" ; anchors.fill: parent } QGCColoredImage {
source: "/qmlimages/MapSyncBlack.svg"
color: qgcPal.buttonText
anchors.fill: parent
}
} }
} }
...@@ -97,5 +100,5 @@ Rectangle { ...@@ -97,5 +100,5 @@ Rectangle {
Repeater { Repeater {
id: checkListRepeater id: checkListRepeater
} }
} // Column }
} //Rectangle }
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