diff --git a/src/FactSystem/Fact.cc b/src/FactSystem/Fact.cc index 36be213df5a08e7003d098be406b14c3b7259359..391f79b1ca5025c2b6df1fff0658596b70172557 100644 --- a/src/FactSystem/Fact.cc +++ b/src/FactSystem/Fact.cc @@ -27,6 +27,7 @@ Fact::Fact(QObject* parent) , _sendValueChangedSignals (true) , _deferredValueChangeSignal(false) , _valueSliderModel (nullptr) + , _ignoreQGCRebootRequired (false) { FactMetaData* metaData = new FactMetaData(_type, this); setMetaData(metaData); @@ -44,6 +45,7 @@ Fact::Fact(int componentId, QString name, FactMetaData::ValueType_t type, QObjec , _sendValueChangedSignals (true) , _deferredValueChangeSignal(false) , _valueSliderModel (nullptr) + , _ignoreQGCRebootRequired (false) { FactMetaData* metaData = new FactMetaData(_type, this); setMetaData(metaData); @@ -61,6 +63,7 @@ Fact::Fact(const QString& settingsGroup, FactMetaData* metaData, QObject* parent , _sendValueChangedSignals (true) , _deferredValueChangeSignal(false) , _valueSliderModel (nullptr) + , _ignoreQGCRebootRequired (false) { qgcApp()->toolbox()->corePlugin()->adjustSettingMetaData(settingsGroup, *metaData); setMetaData(metaData, true /* setDefaultFromMetaData */); @@ -90,7 +93,8 @@ const Fact& Fact::operator=(const Fact& other) _type = other._type; _sendValueChangedSignals = other._sendValueChangedSignals; _deferredValueChangeSignal = other._deferredValueChangeSignal; - _valueSliderModel = nullptr; + _valueSliderModel = nullptr; + _ignoreQGCRebootRequired = other._ignoreQGCRebootRequired; if (_metaData && other._metaData) { *_metaData = *other._metaData; } else { @@ -615,7 +619,9 @@ bool Fact::vehicleRebootRequired(void) const bool Fact::qgcRebootRequired(void) const { - if (_metaData) { + if (_ignoreQGCRebootRequired) { + return false; + } else if (_metaData) { return _metaData->qgcRebootRequired(); } else { qWarning() << kMissingMetadata << name(); @@ -743,3 +749,8 @@ void Fact::_checkForRebootMessaging(void) } } } + +void Fact::_setIgnoreQGCRebootRequired(bool ignore) +{ + _ignoreQGCRebootRequired = ignore; +} diff --git a/src/FactSystem/Fact.h b/src/FactSystem/Fact.h index 1490595d061e87c232396c7babf49d264814881c..f8ffcc1589e046c27c43b384c6b5db38b4bb0438 100644 --- a/src/FactSystem/Fact.h +++ b/src/FactSystem/Fact.h @@ -129,6 +129,10 @@ public: bool writeOnly (void) const; bool volatileValue (void) const; + // Internal hack to allow changes to fact which do not signal reboot. Currently used by font point size + // code in ScreenTools.qml to set initial sizing at first boot. + Q_INVOKABLE void _setIgnoreQGCRebootRequired(bool ignore); + Q_INVOKABLE FactValueSliderListModel* valueSliderModel(void); /// Returns the values as a string with full 18 digit precision if float/double. @@ -208,6 +212,7 @@ protected: bool _sendValueChangedSignals; bool _deferredValueChangeSignal; FactValueSliderListModel* _valueSliderModel; + bool _ignoreQGCRebootRequired; }; #endif diff --git a/src/QmlControls/ScreenTools.qml b/src/QmlControls/ScreenTools.qml index a1c786cf65a7b1ea3478eb9e69929864265171c2..3e6d456f76faa0e7949a785d86b051689a38ef57 100644 --- a/src/QmlControls/ScreenTools.qml +++ b/src/QmlControls/ScreenTools.qml @@ -181,7 +181,9 @@ Item { } else { baseSize = _defaultFont.font.pointSize; } + _appFontPointSizeFact._setIgnoreQGCRebootRequired(true) _appFontPointSizeFact.value = baseSize + _appFontPointSizeFact._setIgnoreQGCRebootRequired(false) //-- Release build doesn't get signal if(!ScreenToolsController.isDebug) _screenTools._setBasePointSize(baseSize); diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc index f9e721e31455b213c5793696c836713bed65ff97..7a98324b0c0ba2952d8ecf82c0c2b1a2314a67a4 100644 --- a/src/ui/MainWindow.cc +++ b/src/ui/MainWindow.cc @@ -504,7 +504,7 @@ void MainWindow::_storeVisibleWidgetsSettings(void) QObject* MainWindow::rootQmlObject(void) { - return _mainQmlWidgetHolder->getRootObject(); + return _mainQmlWidgetHolder ? _mainQmlWidgetHolder->getRootObject() : nullptr; } void MainWindow::_showAdvancedUIChanged(bool advanced)