Browse Source

Merge pull request #4540 from DonLakeFlyer/ParameterEditorDialogMobile

Parameter editor dialog mobile
QGC4.4
Don Gagne 8 years ago committed by GitHub
parent
commit
2dbd131bdd
  1. 162
      ios/iOS-Info.plist
  2. 2
      src/FactSystem/FactControls/FactTextField.qml
  3. 110
      src/QmlControls/ParameterEditorDialog.qml
  4. 1
      src/QmlControls/QGCFlickable.qml
  5. 7
      src/QmlControls/QGCTextField.qml

162
ios/iOS-Info.plist

@ -2,85 +2,87 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CFBundleDisplayName</key> <key>NSCameraUsageDescription</key>
<string>QGroundControl</string> <string>QGC uses UVC devices for video streaming.</string>
<key>CFBundleExecutable</key> <key>CFBundleDisplayName</key>
<string>$(EXECUTABLE_NAME)</string> <string>QGroundControl</string>
<key>NSHumanReadableCopyright</key> <key>CFBundleExecutable</key>
<string>Open Source Flight Systems GmbH - Internal Build</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIconFile</key> <key>NSHumanReadableCopyright</key>
<string></string> <string>Open Source Flight Systems GmbH - Internal Build</string>
<key>CFBundleIdentifier</key> <key>CFBundleIconFile</key>
<string>org.QGroundControl.qgc</string> <string></string>
<key>CFBundleName</key> <key>CFBundleIdentifier</key>
<string>$(PRODUCT_NAME)</string> <string>org.QGroundControl.qgc</string>
<key>CFBundlePackageType</key> <key>CFBundleName</key>
<string>APPL</string> <string>$(PRODUCT_NAME)</string>
<key>CFBundleShortVersionString</key> <key>CFBundlePackageType</key>
<string>0.0.0</string> <string>APPL</string>
<key>CFBundleSignature</key> <key>CFBundleShortVersionString</key>
<string>????</string> <string>0.0.0</string>
<key>CFBundleVersion</key> <key>CFBundleSignature</key>
<string>1</string> <string>????</string>
<key>LSRequiresIPhoneOS</key> <key>CFBundleVersion</key>
<true/> <string>1</string>
<key>UILaunchStoryboardName</key> <key>LSRequiresIPhoneOS</key>
<string>QGCLaunchScreen</string> <true/>
<key>UIRequiresFullScreen</key> <key>UILaunchStoryboardName</key>
<true/> <string>QGCLaunchScreen</string>
<key>CFBundleInfoDictionaryVersion</key> <key>UIRequiresFullScreen</key>
<string>6.0</string> <true/>
<key>ForAppStore</key> <key>CFBundleInfoDictionaryVersion</key>
<string>No</string> <string>6.0</string>
<key>NSLocationUsageDescription</key> <key>ForAppStore</key>
<string>Ground Station Location</string> <string>No</string>
<key>NSLocationWhenInUseUsageDescription</key> <key>NSLocationUsageDescription</key>
<string>Ground Station Location</string> <string>Ground Station Location</string>
<key>UISupportedInterfaceOrientations</key> <key>NSLocationWhenInUseUsageDescription</key>
<array> <string>Ground Station Location</string>
<string>UIInterfaceOrientationLandscapeLeft</string> <key>UISupportedInterfaceOrientations</key>
<string>UIInterfaceOrientationLandscapeRight</string> <array>
</array> <string>UIInterfaceOrientationLandscapeLeft</string>
<key>CFBundleIcons</key> <string>UIInterfaceOrientationLandscapeRight</string>
<dict> </array>
<key>CFBundlePrimaryIcon</key> <key>CFBundleIcons</key>
<dict> <dict>
<key>CFBundleIconFiles</key> <key>CFBundlePrimaryIcon</key>
<array> <dict>
<string>AppIcon29x29.png</string> <key>CFBundleIconFiles</key>
<string>AppIcon29x29@2x.png</string> <array>
<string>AppIcon40x40@2x.png</string> <string>AppIcon29x29.png</string>
<string>AppIcon57x57.png</string> <string>AppIcon29x29@2x.png</string>
<string>AppIcon57x57@2x.png</string> <string>AppIcon40x40@2x.png</string>
<string>AppIcon60x60@2x.png</string> <string>AppIcon57x57.png</string>
</array> <string>AppIcon57x57@2x.png</string>
</dict> <string>AppIcon60x60@2x.png</string>
</dict> </array>
<key>CFBundleIcons~ipad</key> </dict>
<dict> </dict>
<key>CFBundlePrimaryIcon</key> <key>CFBundleIcons~ipad</key>
<dict> <dict>
<key>CFBundleIconFiles</key> <key>CFBundlePrimaryIcon</key>
<array> <dict>
<string>AppIcon29x29.png</string> <key>CFBundleIconFiles</key>
<string>AppIcon29x29@2x.png</string> <array>
<string>AppIcon40x40@2x.png</string> <string>AppIcon29x29.png</string>
<string>AppIcon57x57.png</string> <string>AppIcon29x29@2x.png</string>
<string>AppIcon57x57@2x.png</string> <string>AppIcon40x40@2x.png</string>
<string>AppIcon60x60@2x.png</string> <string>AppIcon57x57.png</string>
<string>AppIcon29x29~ipad.png</string> <string>AppIcon57x57@2x.png</string>
<string>AppIcon29x29@2x~ipad.png</string> <string>AppIcon60x60@2x.png</string>
<string>AppIcon40x40~ipad.png</string> <string>AppIcon29x29~ipad.png</string>
<string>AppIcon40x40@2x~ipad.png</string> <string>AppIcon29x29@2x~ipad.png</string>
<string>AppIcon50x50~ipad.png</string> <string>AppIcon40x40~ipad.png</string>
<string>AppIcon50x50@2x~ipad.png</string> <string>AppIcon40x40@2x~ipad.png</string>
<string>AppIcon72x72~ipad.png</string> <string>AppIcon50x50~ipad.png</string>
<string>AppIcon72x72@2x~ipad.png</string> <string>AppIcon50x50@2x~ipad.png</string>
<string>AppIcon76x76~ipad.png</string> <string>AppIcon72x72~ipad.png</string>
<string>AppIcon76x76@2x~ipad.png</string> <string>AppIcon72x72@2x~ipad.png</string>
<string>AppIcon83.5x83.5@2x~ipad.png</string> <string>AppIcon76x76~ipad.png</string>
</array> <string>AppIcon76x76@2x~ipad.png</string>
</dict> <string>AppIcon83.5x83.5@2x~ipad.png</string>
</dict> </array>
</dict>
</dict>
</dict> </dict>
</plist> </plist>

2
src/FactSystem/FactControls/FactTextField.qml

@ -40,7 +40,7 @@ QGCTextField {
} }
} }
onHelpClicked: qgcView.showDialog(helpDialogComponent, qsTr("Value Details"), qgcView.showDialogDefaultWidth, StandardButton.Save) onHelpClicked: qgcView.showDialog(helpDialogComponent, qsTr("Value Details"), qgcView.showDialogDefaultWidth, StandardButton.Save | StandardButton.Cancel)
Component { Component {

110
src/QmlControls/ParameterEditorDialog.qml

@ -7,12 +7,9 @@
* *
****************************************************************************/ ****************************************************************************/
/// @file
/// @author Don Gagne <don@thegagnes.com>
import QtQuick 2.5 import QtQuick 2.5
import QtQuick.Controls 1.3 import QtQuick.Controls 1.3
import QtQuick.Layouts 1.2
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0 import QGroundControl.Palette 1.0
@ -29,7 +26,8 @@ QGCViewDialog {
property bool validate: false property bool validate: false
property string validateValue property string validateValue
property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 20 property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 20
property bool _longDescriptionAvailable: fact.longDescription != ""
ParameterEditorController { id: controller; factPanel: parent } ParameterEditorController { id: controller; factPanel: parent }
@ -68,7 +66,6 @@ QGCViewDialog {
validationError.text = fact.validate(validateValue, false /* convertOnly */) validationError.text = fact.validate(validateValue, false /* convertOnly */)
forceSave.visible = true forceSave.visible = true
} }
//valueField.forceActiveFocus()
} }
QGCFlickable { QGCFlickable {
@ -83,28 +80,24 @@ QGCViewDialog {
anchors.right: parent.right anchors.right: parent.right
QGCLabel { QGCLabel {
id: validationError
width: parent.width width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
visible: fact.shortDescription color: qgcPal.warningText
text: fact.shortDescription
}
QGCLabel {
width: parent.width
wrapMode: Text.WordWrap
visible: fact.longDescription
text: fact.longDescription
} }
Row { RowLayout {
spacing: defaultTextWidth spacing: defaultTextWidth
anchors.left: parent.left
anchors.right: parent.right
QGCTextField { QGCTextField {
id: valueField id: valueField
text: validate ? validateValue : fact.valueString text: validate ? validateValue : fact.valueString
visible: fact.enumStrings.length == 0 || validate visible: fact.enumStrings.length == 0 || validate
//focus: true unitsLabel: fact.units
showUnits: fact.units != ""
Layout.fillWidth: true
inputMethodHints: ScreenTools.isiOS ? inputMethodHints: ScreenTools.isiOS ?
Qt.ImhNone : // iOS numeric keyboard has not done button, we can't use it Qt.ImhNone : // iOS numeric keyboard has not done button, we can't use it
Qt.ImhFormattedNumbersOnly // Forces use of virtual numeric keyboard Qt.ImhFormattedNumbersOnly // Forces use of virtual numeric keyboard
@ -113,7 +106,6 @@ QGCViewDialog {
QGCButton { QGCButton {
anchors.baseline: valueField.baseline anchors.baseline: valueField.baseline
visible: fact.defaultValueAvailable visible: fact.defaultValueAvailable
width: _editFieldWidth
text: qsTr("Reset to default") text: qsTr("Reset to default")
onClicked: { onClicked: {
@ -159,63 +151,55 @@ QGCViewDialog {
} }
QGCLabel { QGCLabel {
text: fact.name width: parent.width
visible: fact.componentId > 0 // > 0 means it's a parameter fact wrapMode: Text.WordWrap
visible: !longDescriptionLabel.visible
text: fact.shortDescription
} }
Column { QGCLabel {
spacing: defaultTextHeight / 2 id: longDescriptionLabel
anchors.left: parent.left width: parent.width
anchors.right: parent.right wrapMode: Text.WordWrap
visible: fact.longDescription != ""
Row { text: fact.longDescription
spacing: defaultTextWidth }
QGCLabel { text: qsTr("Units:") }
QGCLabel { text: fact.units ? fact.units : qsTr("none") }
}
Row {
spacing: defaultTextWidth
visible: !fact.minIsDefaultForType
QGCLabel { text: qsTr("Minimum value:") }
QGCLabel { text: fact.minString }
}
Row { Row {
spacing: defaultTextWidth spacing: defaultTextWidth
visible: !fact.maxIsDefaultForType
QGCLabel { text: qsTr("Maximum value:") } QGCLabel {
QGCLabel { text: fact.maxString } id: minValueDisplay
text: qsTr("Min: ") + fact.minString
visible: !fact.minIsDefaultForType
} }
Row { QGCLabel {
spacing: defaultTextWidth text: qsTr("Max: ") + fact.maxString
visible: !fact.maxIsDefaultForType
QGCLabel { text: qsTr("Default value:") }
QGCLabel { text: fact.defaultValueAvailable ? fact.defaultValueString : qsTr("none") }
} }
QGCLabel { QGCLabel {
visible: fact.rebootRequired text: qsTr("Default: ") + fact.defaultValueString
text: "Reboot required after change" visible: fact.defaultValueAvailable
} }
} // Column }
QGCLabel { QGCLabel {
width: parent.width text: qsTr("Parameter name: ") + fact.name
wrapMode: Text.WordWrap visible: fact.componentId > 0 // > 0 means it's a parameter fact
text: qsTr("Warning: Modifying values while vehicle is in flight can lead to vehicle instability and possible vehicle loss. ") + }
qsTr("Make sure you know what you are doing and double-check your values before Save!")
QGCLabel {
visible: fact.rebootRequired
text: "Reboot required after change"
} }
QGCLabel { QGCLabel {
id: validationError
width: parent.width width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
color: qsTr("yellow") text: qsTr("Warning: Modifying values while vehicle is in flight can lead to vehicle instability and possible vehicle loss. ") +
qsTr("Make sure you know what you are doing and double-check your values before Save!")
} }
QGCCheckBox { QGCCheckBox {

1
src/QmlControls/QGCFlickable.qml

@ -6,6 +6,7 @@ import QGroundControl.Palette 1.0
Flickable { Flickable {
id: root id: root
boundsBehavior: Flickable.StopAtBounds boundsBehavior: Flickable.StopAtBounds
clip: true
property color indicatorColor: qgcPal.text property color indicatorColor: qgcPal.text

7
src/QmlControls/QGCTextField.qml

@ -97,9 +97,10 @@ TextField {
} }
MouseArea { MouseArea {
anchors.fill: unitsHelpLayout anchors.margins: ScreenTools.isMobile ? -(ScreenTools.defaultFontPixelWidth * 0.66) : 0 // Larger touch area for mobile
enabled: control.activeFocus anchors.fill: unitsHelpLayout
onClicked: root.helpClicked() enabled: control.activeFocus
onClicked: root.helpClicked()
} }
} }

Loading…
Cancel
Save