Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
27289773
Unverified
Commit
27289773
authored
Jan 17, 2019
by
Don Gagne
Committed by
GitHub
Jan 17, 2019
Browse files
Merge pull request #7149 from mavlink/FontReboot
Fix startup crash on initial font change signalling qgc reboot required
parents
6c8477f8
00ea831b
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/FactSystem/Fact.cc
View file @
27289773
...
...
@@ -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
;
}
src/FactSystem/Fact.h
View file @
27289773
...
...
@@ -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
src/QmlControls/ScreenTools.qml
View file @
27289773
...
...
@@ -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
);
...
...
src/ui/MainWindow.cc
View file @
27289773
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment