Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qgroundcontrol
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Valentin Platzgummer
qgroundcontrol
Commits
7a89279c
Commit
7a89279c
authored
8 years ago
by
Don Gagne
Browse files
Options
Downloads
Patches
Plain Diff
Fix indoorPalette overriding
parent
da928b1b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Settings/AppSettings.cc
+3
-11
3 additions, 11 deletions
src/Settings/AppSettings.cc
src/api/QGCCorePlugin.cc
+12
-1
12 additions, 1 deletion
src/api/QGCCorePlugin.cc
with
15 additions
and
12 deletions
src/Settings/AppSettings.cc
+
3
−
11
View file @
7a89279c
...
@@ -46,16 +46,8 @@ AppSettings::AppSettings(QObject* parent)
...
@@ -46,16 +46,8 @@ AppSettings::AppSettings(QObject* parent)
,
_indoorPaletteFact
(
NULL
)
,
_indoorPaletteFact
(
NULL
)
{
{
QQmlEngine
::
setObjectOwnership
(
this
,
QQmlEngine
::
CppOwnership
);
QQmlEngine
::
setObjectOwnership
(
this
,
QQmlEngine
::
CppOwnership
);
qmlRegisterUncreatableType
<
AppSettings
>
(
"QGroundControl.SettingsManager"
,
1
,
0
,
"AppSettings"
,
"Reference only"
);
qmlRegisterUncreatableType
<
AppSettings
>
(
"QGroundControl.SettingsManager"
,
1
,
0
,
"AppSettings"
,
"Reference only"
);
QGCPalette
::
setGlobalTheme
(
indoorPalette
()
->
rawValue
().
toBool
()
?
QGCPalette
::
Dark
:
QGCPalette
::
Light
);
// Set up correct default for palette setting
QVariant
outdoorPalette
;
#if defined (__mobile__)
outdoorPalette
=
0
;
#else
outdoorPalette
=
1
;
#endif
_nameToMetaDataMap
[
indoorPaletteName
]
->
setRawDefaultValue
(
outdoorPalette
);
}
}
Fact
*
AppSettings
::
offlineEditingFirmwareType
(
void
)
Fact
*
AppSettings
::
offlineEditingFirmwareType
(
void
)
...
@@ -177,5 +169,5 @@ Fact* AppSettings::indoorPalette(void)
...
@@ -177,5 +169,5 @@ Fact* AppSettings::indoorPalette(void)
void
AppSettings
::
_indoorPaletteChanged
(
void
)
void
AppSettings
::
_indoorPaletteChanged
(
void
)
{
{
qgcApp
()
->
_loadCurrentStyleSheet
();
qgcApp
()
->
_loadCurrentStyleSheet
();
QGCPalette
::
setGlobalTheme
(
_
indoorPalette
Fact
->
rawValue
().
toBool
()
?
QGCPalette
::
Dark
:
QGCPalette
::
Light
);
QGCPalette
::
setGlobalTheme
(
indoorPalette
()
->
rawValue
().
toBool
()
?
QGCPalette
::
Dark
:
QGCPalette
::
Light
);
}
}
This diff is collapsed.
Click to expand it.
src/api/QGCCorePlugin.cc
+
12
−
1
View file @
7a89279c
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
#include
"QGCOptions.h"
#include
"QGCOptions.h"
#include
"QGCSettings.h"
#include
"QGCSettings.h"
#include
"FactMetaData.h"
#include
"FactMetaData.h"
#include
"SettingsManager.h"
#include
<QtQml>
#include
<QtQml>
#include
<QQmlEngine>
#include
<QQmlEngine>
...
@@ -164,6 +165,16 @@ bool QGCCorePlugin::overrideSettingsGroupVisibility(QString name)
...
@@ -164,6 +165,16 @@ bool QGCCorePlugin::overrideSettingsGroupVisibility(QString name)
bool
QGCCorePlugin
::
adjustSettingMetaData
(
FactMetaData
&
metaData
)
bool
QGCCorePlugin
::
adjustSettingMetaData
(
FactMetaData
&
metaData
)
{
{
Q_UNUSED
(
metaData
);
// No mods to standard meta data
if
(
metaData
.
name
()
==
AppSettings
::
indoorPaletteName
)
{
// Set up correct default for palette setting
QVariant
outdoorPalette
;
#if defined (__mobile__)
outdoorPalette
=
0
;
#else
outdoorPalette
=
1
;
#endif
metaData
.
setRawDefaultValue
(
outdoorPalette
);
}
return
true
;
// Show setting in ui
return
true
;
// Show setting in ui
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment