Commit 1d5cf925 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #4578 from DonLakeFlyer/FactBool

Add bool support to FactSystem
parents a83e15d0 9b384a95
......@@ -55,7 +55,6 @@ public:
Q_PROPERTY(QString name READ name CONSTANT)
Q_PROPERTY(bool rebootRequired READ rebootRequired CONSTANT)
Q_PROPERTY(QString shortDescription READ shortDescription CONSTANT)
Q_PROPERTY(FactMetaData::ValueType_t type READ type CONSTANT)
Q_PROPERTY(QString units READ cookedUnits CONSTANT)
Q_PROPERTY(QVariant value READ cookedValue WRITE setCookedValue NOTIFY valueChanged)
Q_PROPERTY(QVariant rawValue READ rawValue WRITE setRawValue NOTIFY rawValueChanged)
......@@ -63,6 +62,8 @@ public:
Q_PROPERTY(QString valueString READ cookedValueString NOTIFY valueChanged)
Q_PROPERTY(QString enumOrValueString READ enumOrValueString NOTIFY valueChanged)
Q_PROPERTY(double increment READ increment CONSTANT)
Q_PROPERTY(bool typeIsString READ typeIsString CONSTANT)
Q_PROPERTY(bool typeIsBool READ typeIsBool CONSTANT)
/// Convert and validate value
/// @param convertOnly true: validate type conversion only, false: validate against meta data as well
......@@ -103,6 +104,8 @@ public:
bool rebootRequired (void) const;
QString enumOrValueString (void); // This is not const, since an unknown value can modify the enum lists
double increment (void) const;
bool typeIsString (void) const { return type() == FactMetaData::valueTypeString; }
bool typeIsBool (void) const { return type() == FactMetaData::valueTypeBool; }
/// Returns the values as a string with full 18 digit precision if float/double.
QString rawValueStringFullPrecision(void) const;
......
......@@ -11,7 +11,11 @@ QGCCheckBox {
property variant checkedValue: 1
property variant uncheckedValue: 0
checkedState: fact ? (fact.value === checkedValue ? Qt.Checked : Qt.Unchecked) : Qt.Unchecked
checkedState: fact ?
(fact.typeIsBool ?
(fact.value === true ? Qt.Checked : Qt.Unchecked) :
(fact.value === checkedValue ? Qt.Checked : Qt.Unchecked)) :
Qt.Unchecked
text: qsTr("Label")
......
......@@ -19,10 +19,9 @@ QGCTextField {
property Fact fact: null
property string _validateString
property bool _factIsString: fact ? fact.type === FactMetaData.valueTypeString : false
// At this point all Facts are numeric
inputMethodHints: (_factIsString || ScreenTools.isiOS) ?
inputMethodHints: (fact.typeIsString || ScreenTools.isiOS) ?
Qt.ImhNone : // iOS numeric keyboard has no done button, we can't use it
Qt.ImhFormattedNumbersOnly // Forces use of virtual numeric keyboard
......
......@@ -204,6 +204,8 @@ QVariant FactMetaData::_minForType(void) const
return QVariant(-std::numeric_limits<double>::max());
case valueTypeString:
return QVariant();
case valueTypeBool:
return QVariant(0);
}
// Make windows compiler happy, even switch is full cased
......@@ -231,6 +233,8 @@ QVariant FactMetaData::_maxForType(void) const
return QVariant(std::numeric_limits<double>::max());
case valueTypeString:
return QVariant();
case valueTypeBool:
return QVariant(1);
}
// Make windows compiler happy, even switch is full cased
......@@ -287,6 +291,10 @@ bool FactMetaData::convertAndValidateRaw(const QVariant& rawValue, bool convertO
convertOk = true;
typedValue = QVariant(rawValue.toString());
break;
case FactMetaData::valueTypeBool:
convertOk = true;
typedValue = QVariant(rawValue.toBool());
break;
}
if (!convertOk) {
......@@ -346,6 +354,10 @@ bool FactMetaData::convertAndValidateCooked(const QVariant& cookedValue, bool co
convertOk = true;
typedValue = QVariant(cookedValue.toString());
break;
case FactMetaData::valueTypeBool:
convertOk = true;
typedValue = QVariant(cookedValue.toBool());
break;
}
if (!convertOk) {
......@@ -563,7 +575,8 @@ FactMetaData::ValueType_t FactMetaData::stringToType(const QString& typeString,
<< QStringLiteral("Int32")
<< QStringLiteral("Float")
<< QStringLiteral("Double")
<< QStringLiteral("String");
<< QStringLiteral("String")
<< QStringLiteral("Bool");
knownTypes << valueTypeUint8
<< valueTypeInt8
......@@ -573,7 +586,8 @@ FactMetaData::ValueType_t FactMetaData::stringToType(const QString& typeString,
<< valueTypeInt32
<< valueTypeFloat
<< valueTypeDouble
<< valueTypeString;
<< valueTypeString
<< valueTypeBool;
for (int i=0; i<knownTypeStrings.count(); i++) {
if (knownTypeStrings[i].compare(typeString, Qt::CaseInsensitive) == 0) {
......@@ -819,13 +833,19 @@ FactMetaData* FactMetaData::createFromJsonObject(const QJsonObject& json, QObjec
metaData->setRawUnits(json[_unitsJsonKey].toString());
}
if (json.contains(_defaultValueJsonKey)) {
metaData->setRawDefaultValue(json[_defaultValueJsonKey]);
metaData->setRawDefaultValue(json[_defaultValueJsonKey].toVariant());
}
if (json.contains(_minJsonKey)) {
metaData->setRawMin(json[_minJsonKey].toDouble());
QVariant typedValue;
QString errorString;
metaData->convertAndValidateRaw(json[_minJsonKey].toVariant(), true /* convertOnly */, typedValue, errorString);
metaData->setRawMin(typedValue);
}
if (json.contains(_maxJsonKey)) {
metaData->setRawMax(json[_maxJsonKey].toDouble());
QVariant typedValue;
QString errorString;
metaData->convertAndValidateRaw(json[_maxJsonKey].toVariant(), true /* convertOnly */, typedValue, errorString);
metaData->setRawMax(typedValue);
}
return metaData;
......
......@@ -38,11 +38,10 @@ public:
valueTypeInt32,
valueTypeFloat,
valueTypeDouble,
valueTypeString
valueTypeString,
valueTypeBool
} ValueType_t;
Q_ENUM(ValueType_t)
typedef QVariant (*Translator)(const QVariant& from);
FactMetaData(QObject* parent = NULL);
......
......@@ -33,7 +33,11 @@ SettingsFact::SettingsFact(QString settingGroup, FactMetaData* metaData, QObject
// Allow core plugin a chance to override the default value
metaData->setRawDefaultValue(qgcApp()->toolbox()->corePlugin()->overrideSettingsDefault(metaData->name(), metaData->rawDefaultValue()));
setMetaData(metaData);
_rawValue = settings.value(_name, metaData->rawDefaultValue());
QVariant typedValue;
QString errorString;
metaData->convertAndValidateRaw(settings.value(_name, metaData->rawDefaultValue()), true /* conertOnly */, typedValue, errorString);
_rawValue = typedValue;
connect(this, &Fact::rawValueChanged, this, &SettingsFact::_rawValueChanged);
}
......
......@@ -59,6 +59,10 @@ QVariant APMParameterMetaData::_stringToTypedVariant(const QString& string,
qWarning() << "Internal Error: No support for string parameters";
convertTo = QVariant::String;
break;
case FactMetaData::valueTypeBool:
qWarning() << "Internal Error: No support for string parameters";
convertTo = QVariant::Bool;
break;
}
*convertOk = var.convert(convertTo);
......
......@@ -59,6 +59,10 @@ QVariant PX4ParameterMetaData::_stringToTypedVariant(const QString& string, Fact
qWarning() << "Internal Error: No support for string parameters";
convertTo = QVariant::String;
break;
case FactMetaData::valueTypeBool:
qWarning() << "Internal Error: No support for string parameters";
convertTo = QVariant::Bool;
break;
}
*convertOk = var.convert(convertTo);
......
......@@ -18,31 +18,25 @@
*/
#include <QApplication>
#include <QSettings>
#include <QDebug>
#include "GAudioOutput.h"
#include "QGCApplication.h"
#include "QGC.h"
#include "SettingsManager.h"
#if defined __android__
#include <QtAndroidExtras/QtAndroidExtras>
#include <QtAndroidExtras/QAndroidJniObject>
#endif
const char* GAudioOutput::_mutedKey = "AudioMuted";
GAudioOutput::GAudioOutput(QGCApplication* app)
: QGCTool(app)
, muted(false)
#ifndef __android__
, thread(new QThread())
, worker(new QGCAudioWorker())
#endif
{
QSettings settings;
muted = settings.value(_mutedKey, false).toBool();
muted |= app->runningUnitTests();
#ifndef __android__
worker->moveToThread(thread);
connect(this, &GAudioOutput::textToSpeak, worker, &QGCAudioWorker::say);
......@@ -60,23 +54,10 @@ GAudioOutput::~GAudioOutput()
}
void GAudioOutput::mute(bool mute)
{
QSettings settings;
muted = mute;
settings.setValue(_mutedKey, mute);
#ifndef __android__
emit mutedChanged(mute);
#endif
}
bool GAudioOutput::isMuted()
{
return muted;
}
bool GAudioOutput::say(const QString& inText)
{
bool muted = qgcApp()->toolbox()->settingsManager()->audioMuted()->rawValue().toBool();
muted |= qgcApp()->runningUnitTests();
if (!muted && !qgcApp()->runningUnitTests()) {
#if defined __android__
#if defined QGC_SPEECH_ENABLED
......
......@@ -62,30 +62,19 @@ public:
AUDIO_SEVERITY_DEBUG = 7
};
/** @brief Get the mute state */
bool isMuted();
public slots:
/** @brief Say this text */
bool say(const QString& text);
/** @brief Mute/unmute sound */
void mute(bool mute);
signals:
void mutedChanged(bool);
bool textToSpeak(QString text);
void beepOnce();
protected:
bool muted;
#if !defined __android__
QThread* thread;
QGCAudioWorker* worker;
#endif
private:
static const char* _mutedKey;
};
#endif // AUDIOOUTPUT_H
......
......@@ -115,8 +115,6 @@ const char* QGCApplication::telemetryFileExtension = "tlog";
const char* QGCApplication::_deleteAllSettingsKey = "DeleteAllSettingsNextBoot";
const char* QGCApplication::_settingsVersionKey = "SettingsVersion";
const char* QGCApplication::_promptFlightDataSave = "PromptFLightDataSave";
const char* QGCApplication::_promptFlightDataSaveNotArmed = "PromptFLightDataSaveNotArmed";
const char* QGCApplication::_styleKey = "StyleIsDark";
const char* QGCApplication::_lastKnownHomePositionLatKey = "LastKnownHomePositionLat";
const char* QGCApplication::_lastKnownHomePositionLonKey = "LastKnownHomePositionLon";
......@@ -466,32 +464,6 @@ void QGCApplication::clearDeleteAllSettingsNextBoot(void)
settings.remove(_deleteAllSettingsKey);
}
bool QGCApplication::promptFlightDataSave(void)
{
QSettings settings;
return settings.value(_promptFlightDataSave, true).toBool();
}
bool QGCApplication::promptFlightDataSaveNotArmed(void)
{
QSettings settings;
return settings.value(_promptFlightDataSaveNotArmed, false).toBool();
}
void QGCApplication::setPromptFlightDataSave(bool promptForSave)
{
QSettings settings;
settings.setValue(_promptFlightDataSave, promptForSave);
}
void QGCApplication::setPromptFlightDataSaveNotArmed(bool promptForSave)
{
QSettings settings;
settings.setValue(_promptFlightDataSaveNotArmed, promptForSave);
}
/// @brief Returns the QGCApplication object singleton.
QGCApplication* qgcApp(void)
{
......
......@@ -75,15 +75,6 @@ public:
/// @brief Clears the persistent flag to delete all settings the next time QGroundControl is started.
void clearDeleteAllSettingsNextBoot(void);
/// @return true: Prompt to save log file when vehicle goes away
bool promptFlightDataSave(void);
/// @return true: Prompt to save log file even if vehicle was not armed
bool promptFlightDataSaveNotArmed(void);
void setPromptFlightDataSave(bool promptForSave);
void setPromptFlightDataSaveNotArmed(bool promptForSave);
/// @brief Returns truee if unit test are being run
bool runningUnitTests(void) { return _runningUnitTests; }
......@@ -195,8 +186,6 @@ private:
static const char* _settingsVersionKey; ///< Settings key which hold settings version
static const char* _deleteAllSettingsKey; ///< If this settings key is set on boot, all settings will be deleted
static const char* _promptFlightDataSave; ///< Settings key for promptFlightDataSave
static const char* _promptFlightDataSaveNotArmed; ///< Settings key for promptFlightDataSaveNotArmed
static const char* _styleKey; ///< Settings key for UI style
static const char* _lastKnownHomePositionLatKey;
static const char* _lastKnownHomePositionLonKey;
......
......@@ -163,24 +163,6 @@ void QGroundControlQmlGlobal::setIsDarkStyle(bool dark)
emit isDarkStyleChanged(dark);
}
void QGroundControlQmlGlobal::setIsAudioMuted(bool muted)
{
qgcApp()->toolbox()->audioOutput()->mute(muted);
emit isAudioMutedChanged(muted);
}
void QGroundControlQmlGlobal::setIsSaveLogPrompt(bool prompt)
{
qgcApp()->setPromptFlightDataSave(prompt);
emit isSaveLogPromptChanged(prompt);
}
void QGroundControlQmlGlobal::setIsSaveLogPromptNotArmed(bool prompt)
{
qgcApp()->setPromptFlightDataSaveNotArmed(prompt);
emit isSaveLogPromptNotArmedChanged(prompt);
}
void QGroundControlQmlGlobal::setIsVersionCheckEnabled(bool enable)
{
qgcApp()->toolbox()->mavlinkProtocol()->enableVersionCheck(enable);
......
......@@ -56,9 +56,6 @@ public:
// Various QGC settings exposed to Qml
Q_PROPERTY(bool isDarkStyle READ isDarkStyle WRITE setIsDarkStyle NOTIFY isDarkStyleChanged) // TODO: Should be in ScreenTools?
Q_PROPERTY(bool isAudioMuted READ isAudioMuted WRITE setIsAudioMuted NOTIFY isAudioMutedChanged)
Q_PROPERTY(bool isSaveLogPrompt READ isSaveLogPrompt WRITE setIsSaveLogPrompt NOTIFY isSaveLogPromptChanged)
Q_PROPERTY(bool isSaveLogPromptNotArmed READ isSaveLogPromptNotArmed WRITE setIsSaveLogPromptNotArmed NOTIFY isSaveLogPromptNotArmedChanged)
Q_PROPERTY(bool virtualTabletJoystick READ virtualTabletJoystick WRITE setVirtualTabletJoystick NOTIFY virtualTabletJoystickChanged)
Q_PROPERTY(qreal baseFontPointSize READ baseFontPointSize WRITE setBaseFontPointSize NOTIFY baseFontPointSizeChanged)
......@@ -146,9 +143,6 @@ public:
qreal zOrderMapItems () { return 50; }
bool isDarkStyle () { return _app->styleIsDark(); }
bool isAudioMuted () { return _toolbox->audioOutput()->isMuted(); }
bool isSaveLogPrompt () { return _app->promptFlightDataSave(); }
bool isSaveLogPromptNotArmed () { return _app->promptFlightDataSaveNotArmed(); }
bool virtualTabletJoystick () { return _virtualTabletJoystick; }
qreal baseFontPointSize () { return _baseFontPointSize; }
......@@ -160,9 +154,6 @@ public:
int supportedFirmwareCount ();
void setIsDarkStyle (bool dark);
void setIsAudioMuted (bool muted);
void setIsSaveLogPrompt (bool prompt);
void setIsSaveLogPromptNotArmed (bool prompt);
void setVirtualTabletJoystick (bool enabled);
void setBaseFontPointSize (qreal size);
......@@ -180,9 +171,6 @@ public:
signals:
void isDarkStyleChanged (bool dark);
void isAudioMutedChanged (bool muted);
void isSaveLogPromptChanged (bool prompt);
void isSaveLogPromptNotArmedChanged (bool prompt);
void virtualTabletJoystickChanged (bool enabled);
void baseFontPointSizeChanged (qreal size);
void isMultiplexingEnabledChanged (bool enabled);
......
......@@ -22,6 +22,9 @@ const char* SettingsManager::speedUnitsSettingsName = "Spe
const char* SettingsManager::batteryPercentRemainingAnnounceSettingsName = "batteryPercentRemainingAnnounce";
const char* SettingsManager::defaultMissionItemAltitudeSettingsName = "DefaultMissionItemAltitude";
const char* SettingsManager::missionAutoLoadDirSettingsName = "MissionAutoLoadDir";
const char* SettingsManager::promptFlightTelemetrySaveName = "PromptFLightDataSave";
const char* SettingsManager::promptFlightTelemetrySaveNotArmedName = "PromptFLightDataSaveNotArmed";
const char* SettingsManager::audioMutedName = "AudioMuted";
SettingsManager::SettingsManager(QGCApplication* app)
: QGCTool(app)
......@@ -35,6 +38,9 @@ SettingsManager::SettingsManager(QGCApplication* app)
, _batteryPercentRemainingAnnounceFact(NULL)
, _defaultMissionItemAltitudeFact(NULL)
, _missionAutoLoadDirFact(NULL)
, _promptFlightTelemetrySave(NULL)
, _promptFlightTelemetrySaveNotArmed(NULL)
, _audioMuted(NULL)
{
}
......@@ -114,6 +120,33 @@ Fact* SettingsManager::missionAutoLoadDir(void)
return _missionAutoLoadDirFact;
}
Fact* SettingsManager::promptFlightTelemetrySave(void)
{
if (!_promptFlightTelemetrySave) {
_promptFlightTelemetrySave = _createSettingsFact(promptFlightTelemetrySaveName);
}
return _promptFlightTelemetrySave;
}
Fact* SettingsManager::promptFlightTelemetrySaveNotArmed(void)
{
if (!_promptFlightTelemetrySaveNotArmed) {
_promptFlightTelemetrySaveNotArmed = _createSettingsFact(promptFlightTelemetrySaveNotArmedName);
}
return _promptFlightTelemetrySaveNotArmed;
}
Fact* SettingsManager::audioMuted(void)
{
if (!_audioMuted) {
_audioMuted = _createSettingsFact(audioMutedName);
}
return _audioMuted;
}
Fact* SettingsManager::distanceUnits(void)
{
if (!_distanceUnitsFact) {
......
......@@ -64,6 +64,9 @@ public:
Q_PROPERTY(Fact* batteryPercentRemainingAnnounce READ batteryPercentRemainingAnnounce CONSTANT)
Q_PROPERTY(Fact* defaultMissionItemAltitude READ defaultMissionItemAltitude CONSTANT)
Q_PROPERTY(Fact* missionAutoLoadDir READ missionAutoLoadDir CONSTANT)
Q_PROPERTY(Fact* promptFlightTelemetrySave READ promptFlightTelemetrySave CONSTANT)
Q_PROPERTY(Fact* promptFlightTelemetrySaveNotArmed READ promptFlightTelemetrySaveNotArmed CONSTANT)
Q_PROPERTY(Fact* audioMuted READ audioMuted CONSTANT)
Fact* offlineEditingFirmwareType (void);
Fact* offlineEditingVehicleType (void);
......@@ -75,6 +78,9 @@ public:
Fact* batteryPercentRemainingAnnounce (void);
Fact* defaultMissionItemAltitude (void);
Fact* missionAutoLoadDir (void);
Fact* promptFlightTelemetrySave (void);
Fact* promptFlightTelemetrySaveNotArmed (void);
Fact* audioMuted (void);
// Override from QGCTool
virtual void setToolbox(QGCToolbox *toolbox);
......@@ -89,6 +95,9 @@ public:
static const char* batteryPercentRemainingAnnounceSettingsName;
static const char* defaultMissionItemAltitudeSettingsName;
static const char* missionAutoLoadDirSettingsName;
static const char* promptFlightTelemetrySaveName;
static const char* promptFlightTelemetrySaveNotArmedName;
static const char* audioMutedName;
private:
SettingsFact* _createSettingsFact(const QString& name);
......@@ -105,6 +114,9 @@ private:
SettingsFact* _batteryPercentRemainingAnnounceFact;
SettingsFact* _defaultMissionItemAltitudeFact;
SettingsFact* _missionAutoLoadDirFact;
SettingsFact* _promptFlightTelemetrySave;
SettingsFact* _promptFlightTelemetrySaveNotArmed;
SettingsFact* _audioMuted;
};
#endif
......@@ -58,8 +58,29 @@
{
"name": "MissionAutoLoadDir",
"shortDescription": "Mission auto load directory",
"longDescription": "The directory from which missions will be automaticallu loaded onto a vehicle when it connects.",
"longDescription": "The directory from which missions will be automatically loaded onto a vehicle when it connects. The mission file must be named AutoLoad#.mission where the # is replaced with the vehicle id.",
"type": "string",
"defaultValue": ""
},
{
"name": "PromptFLightDataSave",
"shortDescription": "Prompt to save Flight Data Log after each flight",
"longDescription": "If this option is enabled you will be prompted to save Flight Data Log after each flight completes.",
"type": "bool",
"defaultValue": true
},
{
"name": "PromptFLightDataSaveNotArmed",
"shortDescription": "Prompt to save Flight Data Log even if vehicle was not armed",
"longDescription": "If this option is enabled you will be prompted to save Flight Data Log even if vehicle was never armed.",
"type": "bool",
"defaultValue": false
},
{
"name": "AudioMuted",
"shortDescription": "Mute audio output",
"longDescription": "If this option is enabled all audio output will be muted.",
"type": "bool",
"defaultValue": false
}
]
......@@ -35,6 +35,7 @@
#include "QGCApplication.h"
#include "QGCLoggingCategory.h"
#include "MultiVehicleManager.h"
#include "SettingsManager.h"
Q_DECLARE_METATYPE(mavlink_message_t)
......@@ -422,7 +423,8 @@ void MAVLinkProtocol::_stopLogging(void)
{
if (_closeLogFile()) {
// If the signals are not connected it means we are running a unit test. In that case just delete log files
if ((_vehicleWasArmed || _app->promptFlightDataSaveNotArmed()) && _app->promptFlightDataSave()) {
SettingsManager* settingsManager = _app->toolbox()->settingsManager();
if ((_vehicleWasArmed || settingsManager->promptFlightTelemetrySaveNotArmed()->rawValue().toBool()) && settingsManager->promptFlightTelemetrySave()->rawValue().toBool()) {
emit saveTempFlightDataLog(_tempLogFile.fileName());
} else {
QFile::remove(_tempLogFile.fileName());
......
......@@ -463,11 +463,6 @@ void MainWindow::configureWindowName()
**/
void MainWindow::connectCommonActions()
{
// Audio output
_ui.actionMuteAudioOutput->setChecked(qgcApp()->toolbox()->audioOutput()->isMuted());
connect(qgcApp()->toolbox()->audioOutput(), &GAudioOutput::mutedChanged, _ui.actionMuteAudioOutput, &QAction::setChecked);
connect(_ui.actionMuteAudioOutput, &QAction::triggered, qgcApp()->toolbox()->audioOutput(), &GAudioOutput::mute);
// Connect internal actions
connect(qgcApp()->toolbox()->multiVehicleManager(), &MultiVehicleManager::vehicleAdded, this, &MainWindow::_vehicleAdded);
}
......
......@@ -59,7 +59,6 @@
<string>File</string>
</property>
<addaction name="separator"/>
<addaction name="actionMuteAudioOutput"/>
<addaction name="actionStatusBar"/>
<addaction name="separator"/>
<addaction name="actionExit"/>
......@@ -86,14 +85,6 @@
<string>Manage Communication Links</string>
</property>
</action>
<action name="actionMuteAudioOutput">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Mute Audio Output</string>
</property>
</action>
<action name="actionAdvanced_Mode">
<property name="checkable">
<bool>true</bool>
......
......@@ -231,34 +231,26 @@ QGCView {
}
//-----------------------------------------------------------------
//-- Audio preferences
QGCCheckBox {
text: qsTr("Mute all audio output")
checked: QGroundControl.isAudioMuted
onClicked: {
QGroundControl.isAudioMuted = checked
}
FactCheckBox {
text: qsTr("Mute all audio output")
fact: QGroundControl.settingsManager.audioMuted
}
//-----------------------------------------------------------------
//-- Prompt Save Log
QGCCheckBox {
id: promptSaveLog
text: qsTr("Prompt to save Flight Data Log after each flight")
checked: QGroundControl.isSaveLogPrompt
checked: QGroundControl.settingsManager.promptFlightTelemetrySave
//fact: QGroundControl.settingsManager.promptFlightTelemetrySave
visible: !ScreenTools.isMobile
onClicked: {
QGroundControl.isSaveLogPrompt = checked
}
}
//-----------------------------------------------------------------
//-- Prompt Save even if not armed
QGCCheckBox {
FactCheckBox {
text: qsTr("Prompt to save Flight Data Log even if vehicle was not armed")
checked: QGroundControl.isSaveLogPromptNotArmed
fact: QGroundControl.settingsManager.promptFlightTelemetrySaveNotArmed
visible: !ScreenTools.isMobile
enabled: promptSaveLog.checked
onClicked: {
QGroundControl.isSaveLogPromptNotArmed = checked
}
}
//-----------------------------------------------------------------
//-- Clear settings
......
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