Commit 45b5b4b1 authored by Don Gagne's avatar Don Gagne

Merge branch 'Stable_V3.2' of https://github.com/mavlink/qgroundcontrol into StableMerge

parents 0686feca 18371abe
...@@ -36,7 +36,7 @@ QGCTextField { ...@@ -36,7 +36,7 @@ QGCTextField {
fact.value = text fact.value = text
} else { } else {
_validateString = text _validateString = text
qgcView.showDialog(validationErrorDialogComponent, qsTr("Invalid Value"), qgcView.showDialogDefaultWidth, StandardButton.Save) qgcView.showDialog(validationErrorDialogComponent, qsTr("Invalid Value"), qgcView.showDialogDefaultWidth, StandardButton.Save | StandardButton.Cancel)
} }
} else { } else {
fact.value = text fact.value = text
......
...@@ -27,6 +27,7 @@ Rectangle { ...@@ -27,6 +27,7 @@ Rectangle {
border.width: 1 border.width: 1
border.color: _isSatellite ? qgcPal.mapWidgetBorderLight : qgcPal.mapWidgetBorderDark border.color: _isSatellite ? qgcPal.mapWidgetBorderLight : qgcPal.mapWidgetBorderDark
property var _qgcView: qgcView
property real _innerRadius: (width - (_topBottomMargin * 3)) / 4 property real _innerRadius: (width - (_topBottomMargin * 3)) / 4
property real _outerRadius: _innerRadius + _topBottomMargin property real _outerRadius: _innerRadius + _topBottomMargin
property real _defaultSize: ScreenTools.defaultFontPixelHeight * (9) property real _defaultSize: ScreenTools.defaultFontPixelHeight * (9)
...@@ -94,7 +95,7 @@ Rectangle { ...@@ -94,7 +95,7 @@ Rectangle {
anchors.margins: 1 anchors.margins: 1
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
qgcView: root.qgcView qgcView: root._qgcView
textColor: qgcPal.text textColor: qgcPal.text
backgroundColor: qgcPal.window backgroundColor: qgcPal.window
maxHeight: _availableValueHeight maxHeight: _availableValueHeight
......
...@@ -60,14 +60,14 @@ AppLogModel::AppLogModel() : QStringListModel() ...@@ -60,14 +60,14 @@ AppLogModel::AppLogModel() : QStringListModel()
connect(this, &AppLogModel::emitLog, this, &AppLogModel::threadsafeLog, contype); connect(this, &AppLogModel::emitLog, this, &AppLogModel::threadsafeLog, contype);
} }
void AppLogModel::writeMessages(const QUrl dest_file) void AppLogModel::writeMessages(const QString dest_file)
{ {
const QString writebuffer(stringList().join('\n').append('\n')); const QString writebuffer(stringList().join('\n').append('\n'));
QtConcurrent::run([dest_file, writebuffer] { QtConcurrent::run([dest_file, writebuffer] {
emit debug_model->writeStarted(); emit debug_model->writeStarted();
bool success = false; bool success = false;
QFile file(dest_file.toLocalFile()); QFile file(dest_file);
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) { if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
QTextStream out(&file); QTextStream out(&file);
out << writebuffer; out << writebuffer;
......
...@@ -23,7 +23,7 @@ class AppLogModel : public QStringListModel ...@@ -23,7 +23,7 @@ class AppLogModel : public QStringListModel
{ {
Q_OBJECT Q_OBJECT
public: public:
Q_INVOKABLE void writeMessages(const QUrl dest_file); Q_INVOKABLE void writeMessages(const QString dest_file);
static void log(const QString message); static void log(const QString message);
signals: signals:
......
...@@ -118,7 +118,7 @@ QGCView { ...@@ -118,7 +118,7 @@ QGCView {
selectExisting: false selectExisting: false
title: qsTr("Select log save file") title: qsTr("Select log save file")
onAcceptedForSave: { onAcceptedForSave: {
debugMessageModel.writeMessages(fileUrl); debugMessageModel.writeMessages(file);
visible = false; visible = false;
} }
} }
......
...@@ -11,6 +11,7 @@ import QtQuick 2.3 ...@@ -11,6 +11,7 @@ import QtQuick 2.3
import QtQuick.Controls 1.2 import QtQuick.Controls 1.2
import QtQuick.Layouts 1.2 import QtQuick.Layouts 1.2
import QGroundControl 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0 import QGroundControl.Palette 1.0
import QGroundControl.Controllers 1.0 import QGroundControl.Controllers 1.0
...@@ -28,6 +29,9 @@ QGCViewDialog { ...@@ -28,6 +29,9 @@ QGCViewDialog {
property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 20 property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 20
property bool _longDescriptionAvailable: fact.longDescription != "" property bool _longDescriptionAvailable: fact.longDescription != ""
property bool _editingParameter: fact.componentId != 0
property bool _allowForceSave: QGroundControl.corePlugin.showAdvancedUI || !_editingParameter
property bool _allowDefaultReset: fact.defaultValueAvailable && (QGroundControl.corePlugin.showAdvancedUI || !_editingParameter)
ParameterEditorController { id: controller; factPanel: parent } ParameterEditorController { id: controller; factPanel: parent }
...@@ -49,11 +53,18 @@ QGCViewDialog { ...@@ -49,11 +53,18 @@ QGCViewDialog {
hideDialog() hideDialog()
} else { } else {
validationError.text = errorString validationError.text = errorString
forceSave.visible = true if (_allowForceSave) {
forceSave.visible = true
}
} }
} }
} }
function reject() {
fact.valueChanged(fact.value)
hideDialog();
}
function bitmaskValue() { function bitmaskValue() {
var value = 0; var value = 0;
for (var i = 0; i < fact.bitmaskValues.length; ++i) { for (var i = 0; i < fact.bitmaskValues.length; ++i) {
...@@ -68,7 +79,9 @@ QGCViewDialog { ...@@ -68,7 +79,9 @@ QGCViewDialog {
Component.onCompleted: { Component.onCompleted: {
if (validate) { if (validate) {
validationError.text = fact.validate(validateValue, false /* convertOnly */) validationError.text = fact.validate(validateValue, false /* convertOnly */)
forceSave.visible = true if (_allowForceSave) {
forceSave.visible = true
}
} }
} }
...@@ -109,7 +122,7 @@ QGCViewDialog { ...@@ -109,7 +122,7 @@ QGCViewDialog {
QGCButton { QGCButton {
anchors.baseline: valueField.baseline anchors.baseline: valueField.baseline
visible: fact.defaultValueAvailable visible: _allowDefaultReset
text: qsTr("Reset to default") text: qsTr("Reset to default")
onClicked: { onClicked: {
...@@ -195,7 +208,7 @@ QGCViewDialog { ...@@ -195,7 +208,7 @@ QGCViewDialog {
QGCLabel { QGCLabel {
text: qsTr("Default: ") + fact.defaultValueString text: qsTr("Default: ") + fact.defaultValueString
visible: fact.defaultValueAvailable visible: _allowDefaultReset
} }
} }
......
...@@ -331,12 +331,14 @@ QGCView { ...@@ -331,12 +331,14 @@ QGCView {
id: panel id: panel
anchors.fill: parent anchors.fill: parent
Map { FlightMap {
id: _map id: _map
anchors.fill: parent anchors.fill: parent
center: QGroundControl.flightMapPosition visible: false
visible: false allowGCSLocationCenter: true
allowVehicleLocationCenter: false
gesture.flickDeceleration: 3000 gesture.flickDeceleration: 3000
mapName: "OfflineMap"
property bool isSatelliteMap: activeMapType.name.indexOf("Satellite") > -1 || activeMapType.name.indexOf("Hybrid") > -1 property bool isSatelliteMap: activeMapType.name.indexOf("Satellite") > -1 || activeMapType.name.indexOf("Hybrid") > -1
......
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