Commit 916d996e authored by Don Gagne's avatar Don Gagne
Browse files

Restructure ui not parent to bottom

- Added new Advanced visualization
parent 28625888
...@@ -44,6 +44,8 @@ QGCViewDialog { ...@@ -44,6 +44,8 @@ QGCViewDialog {
ParameterEditorController { id: controller; factPanel: parent } ParameterEditorController { id: controller; factPanel: parent }
QGCPalette { id: qgcPal; colorGroupEnabled: true }
function accept() { function accept() {
if (factCombo.visible) { if (factCombo.visible) {
fact.enumIndex = factCombo.currentIndex fact.enumIndex = factCombo.currentIndex
...@@ -69,7 +71,13 @@ QGCViewDialog { ...@@ -69,7 +71,13 @@ QGCViewDialog {
//valueField.forceActiveFocus() //valueField.forceActiveFocus()
} }
QGCFlickable {
anchors.fill: parent
contentHeight: _column.y + _column.height
flickableDirection: Flickable.VerticalFlick
Column { Column {
id: _column
spacing: defaultTextHeight spacing: defaultTextHeight
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
...@@ -87,6 +95,9 @@ QGCViewDialog { ...@@ -87,6 +95,9 @@ QGCViewDialog {
text: fact.longDescription text: fact.longDescription
} }
Row {
spacing: defaultTextWidth
QGCTextField { QGCTextField {
id: valueField id: valueField
text: validate ? validateValue : fact.valueString text: validate ? validateValue : fact.valueString
...@@ -97,6 +108,19 @@ QGCViewDialog { ...@@ -97,6 +108,19 @@ QGCViewDialog {
inputMethodHints: Qt.ImhFormattedNumbersOnly inputMethodHints: Qt.ImhFormattedNumbersOnly
} }
QGCButton {
anchors.baseline: valueField.baseline
visible: fact.defaultValueAvailable
text: "Reset to default"
onClicked: {
fact.value = fact.defaultValue
fact.valueChanged(fact.value)
hideDialog()
}
}
}
QGCComboBox { QGCComboBox {
id: factCombo id: factCombo
width: valueField.width width: valueField.width
...@@ -165,30 +189,37 @@ QGCViewDialog { ...@@ -165,30 +189,37 @@ QGCViewDialog {
visible: false visible: false
text: "Force save (dangerous!)" text: "Force save (dangerous!)"
} }
} // Column - Fact information
Row {
width: parent.width
spacing: ScreenTools.defaultFontPixelWidth / 2
visible: showRCToParam
QGCButton { Rectangle {
id: bottomButton height: 1
anchors.rightMargin: defaultTextWidth width: ScreenTools.defaultFontPixelWidth * 5
anchors.right: rcButton.left color: qgcPal.text
anchors.bottom: parent.bottom anchors.verticalCenter: _advanced.verticalCenter
visible: fact.defaultValueAvailable }
text: "Reset to default"
onClicked: { QGCCheckBox {
fact.value = fact.defaultValue id: _advanced
fact.valueChanged(fact.value) text: "Advanced settings"
hideDialog() }
Rectangle {
height: 1
width: ScreenTools.defaultFontPixelWidth * 5
color: qgcPal.text
anchors.verticalCenter: _advanced.verticalCenter
} }
} }
QGCButton { QGCButton {
id: rcButton
anchors.right: parent.right
anchors.bottom: parent.bottom
text: "Set RC to Param..." text: "Set RC to Param..."
visible: !validate && showRCToParam visible: _advanced.checked && !validate && showRCToParam
onClicked: controller.setRCToParam(fact.name) onClicked: controller.setRCToParam(fact.name)
} }
} // Column
}
} // QGCViewDialog } // QGCViewDialog
...@@ -131,7 +131,7 @@ QGCView { ...@@ -131,7 +131,7 @@ QGCView {
QGCViewDialog { QGCViewDialog {
anchors.fill: parent anchors.fill: parent
property bool showFirmwareTypeSelection: advancedMode.checked property bool showFirmwareTypeSelection: _advanced.checked
property bool px4Flow: controller.boardType == "PX4 Flow" property bool px4Flow: controller.boardType == "PX4 Flow"
function accept() { function accept() {
...@@ -232,6 +232,44 @@ QGCView { ...@@ -232,6 +232,44 @@ QGCView {
onClicked: parent.firmwareVersionChanged(firmwareTypeList) onClicked: parent.firmwareVersionChanged(firmwareTypeList)
} }
QGCComboBox {
id: vehicleTypeSelectionCombo
width: 200
visible: apmFlightStack.checked
model: controller.apmAvailableVersions
}
Row {
width: parent.width
spacing: ScreenTools.defaultFontPixelWidth / 2
visible: !px4Flow
Rectangle {
height: 1
width: ScreenTools.defaultFontPixelWidth * 5
color: qgcPal.text
anchors.verticalCenter: _advanced.verticalCenter
}
QGCCheckBox {
id: _advanced
text: "Advanced settings"
checked: px4Flow ? true : false
onClicked: {
firmwareVersionCombo.currentIndex = 0
firmwareVersionWarningLabel.visible = false
}
}
Rectangle {
height: 1
width: ScreenTools.defaultFontPixelWidth * 5
color: qgcPal.text
anchors.verticalCenter: _advanced.verticalCenter
}
}
QGCLabel { QGCLabel {
width: parent.width width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
...@@ -239,8 +277,6 @@ QGCView { ...@@ -239,8 +277,6 @@ QGCView {
text: px4Flow ? "Select which version of the firmware you would like to install:" : "Select which version of the above flight stack you would like to install:" text: px4Flow ? "Select which version of the firmware you would like to install:" : "Select which version of the above flight stack you would like to install:"
} }
Row {
spacing: 10
QGCComboBox { QGCComboBox {
id: firmwareVersionCombo id: firmwareVersionCombo
width: 200 width: 200
...@@ -270,43 +306,13 @@ QGCView { ...@@ -270,43 +306,13 @@ QGCView {
} }
} }
QGCComboBox {
id: vehicleTypeSelectionCombo
width: 200
visible: apmFlightStack.checked
model: controller.apmAvailableVersions
}
}
QGCLabel { QGCLabel {
id: firmwareVersionWarningLabel id: firmwareVersionWarningLabel
width: parent.width width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
visible: false visible: false
} }
} } // Column
QGCCheckBox {
id: advancedMode
anchors.bottom: parent.bottom
text: "Advanced mode"
checked: px4Flow ? true : false
visible: !px4Flow
onClicked: {
firmwareVersionCombo.currentIndex = 0
firmwareVersionWarningLabel.visible = false
}
}
QGCButton {
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 2
anchors.left: advancedMode.right
anchors.bottom: parent.bottom
text: "Help me pick a flight stack"
onClicked: Qt.openUrlExternally("http://pixhawk.org/choice")
visible: !px4Flow
}
} // QGCViewDialog } // QGCViewDialog
} // Component - pixhawkFirmwareSelectDialog } // Component - pixhawkFirmwareSelectDialog
......
Supports Markdown
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