Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
377508a9
Commit
377508a9
authored
May 06, 2017
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Core plugin can override Value Widgets default settings
Also added Vehicle.flightTime to default setup
parent
8616ebef
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
8 deletions
+20
-8
ValuesWidgetController.cc
src/FlightMap/Widgets/ValuesWidgetController.cc
+6
-3
QGCCorePlugin.cc
src/api/QGCCorePlugin.cc
+6
-0
QGCCorePlugin.h
src/api/QGCCorePlugin.h
+8
-5
No files found.
src/FlightMap/Widgets/ValuesWidgetController.cc
View file @
377508a9
...
...
@@ -9,6 +9,8 @@
#include "ValuesWidgetController.h"
#include "QGCApplication.h"
#include "QGCCorePlugin.h"
#include <QSettings>
...
...
@@ -19,13 +21,14 @@ const char* ValuesWidgetController::_smallValuesKey = "small";
ValuesWidgetController
::
ValuesWidgetController
(
void
)
{
QSettings
settings
;
QStringList
largeDefaults
;
settings
.
beginGroup
(
_groupKey
);
largeDefaults
<<
"Vehicle.altitudeRelative"
<<
"Vehicle.groundSpeed"
;
QStringList
largeDefaults
,
smallDefaults
;
qgcApp
()
->
toolbox
()
->
corePlugin
()
->
valuesWidgetDefaultSettings
(
largeDefaults
,
smallDefaults
);
_largeValues
=
settings
.
value
(
_largeValuesKey
,
largeDefaults
).
toStringList
();
_smallValues
=
settings
.
value
(
_smallValuesKey
,
QStringList
()
).
toStringList
();
_smallValues
=
settings
.
value
(
_smallValuesKey
,
smallDefaults
).
toStringList
();
_altitudeProperties
<<
"altitudeRelative"
<<
"altitudeAMSL"
;
...
...
src/api/QGCCorePlugin.cc
View file @
377508a9
...
...
@@ -198,3 +198,9 @@ QString QGCCorePlugin::showAdvancedUIMessage(void) const
"You should do so only if instructed by customer support. "
"Are you sure you want to enable Advanced Mode?"
);
}
void
QGCCorePlugin
::
valuesWidgetDefaultSettings
(
QStringList
&
largeValues
,
QStringList
&
smallValues
)
{
Q_UNUSED
(
smallValues
);
largeValues
<<
"Vehicle.altitudeRelative"
<<
"Vehicle.groundSpeed"
<<
"Vehicle.flightTime"
;
}
src/api/QGCCorePlugin.h
View file @
377508a9
...
...
@@ -48,25 +48,25 @@ public:
/// The list of settings under the Settings Menu
/// @return A list of QGCSettings
virtual
QVariantList
&
settingsPages
(
);
virtual
QVariantList
&
settingsPages
(
void
);
/// The default settings panel to show
/// @return The settings index
virtual
int
defaultSettings
(
);
virtual
int
defaultSettings
(
void
);
/// Global options
/// @return An instance of QGCOptions
virtual
QGCOptions
*
options
(
);
virtual
QGCOptions
*
options
(
void
);
/// Allows the core plugin to override the visibility for a settings group
/// @param name - Setting group name
/// @return true: Show settings ui, false: Hide settings ui
virtual
bool
overrideSettingsGroupVisibility
(
QString
name
);
virtual
bool
overrideSettingsGroupVisibility
(
QString
name
);
/// Allows the core plugin to override the setting meta data before the setting fact is created.
/// @param metaData - MetaData for setting fact
/// @return true: Setting should be visible in ui, false: Setting should not be shown in ui
virtual
bool
adjustSettingMetaData
(
FactMetaData
&
metaData
);
virtual
bool
adjustSettingMetaData
(
FactMetaData
&
metaData
);
/// Return the resource file which contains the brand image for for Indoor theme.
virtual
QString
brandImageIndoor
(
void
)
const
{
return
QString
();
}
...
...
@@ -83,6 +83,9 @@ public:
/// Allows a plugin to override the specified color name from the palette
virtual
void
paletteOverride
(
QString
colorName
,
QGCPalette
::
PaletteColorInfo_t
&
colorInfo
);
/// Allows the plugin the override the default settings for the Values Widget large and small values
virtual
void
valuesWidgetDefaultSettings
(
QStringList
&
largeValues
,
QStringList
&
smallValues
);
bool
showTouchAreas
(
void
)
const
{
return
_showTouchAreas
;
}
bool
showAdvancedUI
(
void
)
const
{
return
_showAdvancedUI
;
}
void
setShowTouchAreas
(
bool
show
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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