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
e7db8b94
Unverified
Commit
e7db8b94
authored
May 29, 2018
by
Don Gagne
Committed by
GitHub
May 29, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6523 from DonLakeFlyer/SettingsNameVersusGroup
Clean up SettingsGroup name and settingsGroup
parents
e660d0db
4a399fc0
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
65 additions
and
48 deletions
+65
-48
AppSettings.cc
src/Settings/AppSettings.cc
+4
-2
AppSettings.h
src/Settings/AppSettings.h
+1
-0
AutoConnectSettings.cc
src/Settings/AutoConnectSettings.cc
+3
-3
AutoConnectSettings.h
src/Settings/AutoConnectSettings.h
+2
-3
BrandImageSettings.cc
src/Settings/BrandImageSettings.cc
+6
-4
BrandImageSettings.h
src/Settings/BrandImageSettings.h
+2
-1
FlightMapSettings.cc
src/Settings/FlightMapSettings.cc
+6
-5
FlightMapSettings.h
src/Settings/FlightMapSettings.h
+3
-3
GuidedSettings.cc
src/Settings/GuidedSettings.cc
+4
-2
GuidedSettings.h
src/Settings/GuidedSettings.h
+2
-1
RTKSettings.cc
src/Settings/RTKSettings.cc
+4
-2
RTKSettings.h
src/Settings/RTKSettings.h
+2
-1
SettingsGroup.cc
src/Settings/SettingsGroup.cc
+6
-6
SettingsGroup.h
src/Settings/SettingsGroup.h
+3
-3
UnitsSettings.cc
src/Settings/UnitsSettings.cc
+8
-6
UnitsSettings.h
src/Settings/UnitsSettings.h
+2
-1
VideoSettings.cc
src/Settings/VideoSettings.cc
+3
-2
VideoSettings.h
src/Settings/VideoSettings.h
+2
-1
QGCCorePlugin.h
src/api/QGCCorePlugin.h
+2
-2
No files found.
src/Settings/AppSettings.cc
View file @
e7db8b94
...
...
@@ -15,7 +15,9 @@
#include <QtQml>
#include <QStandardPaths>
const
char
*
AppSettings
::
settingsGroup
=
"App"
;
const
char
*
AppSettings
::
name
=
"App"
;
const
char
*
AppSettings
::
settingsGroup
=
""
;
// settings are in root group
const
char
*
AppSettings
::
offlineEditingFirmwareTypeSettingsName
=
"OfflineEditingFirmwareType"
;
const
char
*
AppSettings
::
offlineEditingVehicleTypeSettingsName
=
"OfflineEditingVehicleType"
;
const
char
*
AppSettings
::
offlineEditingCruiseSpeedSettingsName
=
"OfflineEditingCruiseSpeed"
;
...
...
@@ -58,7 +60,7 @@ const char* AppSettings::videoDirectory = "Video";
const
char
*
AppSettings
::
crashDirectory
=
"CrashLogs"
;
AppSettings
::
AppSettings
(
QObject
*
parent
)
:
SettingsGroup
(
settingsGroup
,
QString
()
/* root settings group */
,
parent
)
:
SettingsGroup
(
name
,
settingsGroup
,
parent
)
,
_offlineEditingFirmwareTypeFact
(
NULL
)
,
_offlineEditingVehicleTypeFact
(
NULL
)
,
_offlineEditingCruiseSpeedFact
(
NULL
)
...
...
src/Settings/AppSettings.h
View file @
e7db8b94
...
...
@@ -93,6 +93,7 @@ public:
static
MAV_AUTOPILOT
offlineEditingFirmwareTypeFromFirmwareType
(
MAV_AUTOPILOT
firmwareType
);
static
MAV_TYPE
offlineEditingVehicleTypeFromVehicleType
(
MAV_TYPE
vehicleType
);
static
const
char
*
name
;
static
const
char
*
settingsGroup
;
static
const
char
*
offlineEditingFirmwareTypeSettingsName
;
...
...
src/Settings/AutoConnectSettings.cc
View file @
e7db8b94
...
...
@@ -13,7 +13,8 @@
#include <QQmlEngine>
#include <QtQml>
const
char
*
AutoConnectSettings
::
_settingsGroup
=
"LinkManager"
;
const
char
*
AutoConnectSettings
::
name
=
"AutoConnect"
;
const
char
*
AutoConnectSettings
::
settingsGroup
=
"LinkManager"
;
const
char
*
AutoConnectSettings
::
autoConnectUDPSettingsName
=
"AutoconnectUDP"
;
const
char
*
AutoConnectSettings
::
autoConnectPixhawkSettingsName
=
"AutoconnectPixhawk"
;
...
...
@@ -27,10 +28,9 @@ const char* AutoConnectSettings:: udpListenPortName = "Autocon
const
char
*
AutoConnectSettings
::
udpTargetHostIPName
=
"AutoconnectUDPTargetHostIP"
;
const
char
*
AutoConnectSettings
::
udpTargetHostPortName
=
"AutoconnectUDPTargetHostPort"
;
const
char
*
AutoConnectSettings
::
autoConnectSettingsGroupName
=
"AutoConnect"
;
AutoConnectSettings
::
AutoConnectSettings
(
QObject
*
parent
)
:
SettingsGroup
(
autoConnectSettingsGroupName
,
_
settingsGroup
,
parent
)
:
SettingsGroup
(
name
,
settingsGroup
,
parent
)
,
_autoConnectUDPFact
(
NULL
)
,
_autoConnectPixhawkFact
(
NULL
)
,
_autoConnectSiKRadioFact
(
NULL
)
...
...
src/Settings/AutoConnectSettings.h
View file @
e7db8b94
...
...
@@ -43,7 +43,8 @@ public:
Fact
*
udpTargetHostIP
(
void
);
Fact
*
udpTargetHostPort
(
void
);
static
const
char
*
autoConnectSettingsGroupName
;
static
const
char
*
name
;
static
const
char
*
settingsGroup
;
static
const
char
*
autoConnectUDPSettingsName
;
static
const
char
*
autoConnectPixhawkSettingsName
;
...
...
@@ -69,8 +70,6 @@ private:
SettingsFact
*
_udpListenPortFact
;
SettingsFact
*
_udpTargetHostIPFact
;
SettingsFact
*
_udpTargetHostPortFact
;
static
const
char
*
_settingsGroup
;
};
#endif
src/Settings/BrandImageSettings.cc
View file @
e7db8b94
...
...
@@ -12,12 +12,14 @@
#include <QQmlEngine>
#include <QtQml>
const
char
*
BrandImageSettings
::
brandImageSettingsGroupName
=
"BrandImage"
;
const
char
*
BrandImageSettings
::
userBrandImageIndoorName
=
"UserBrandImageIndoor"
;
const
char
*
BrandImageSettings
::
userBrandImageOutdoorName
=
"UserBrandImageOutdoor"
;
const
char
*
BrandImageSettings
::
name
=
"BrandImage"
;
const
char
*
BrandImageSettings
::
settingsGroup
=
""
;
// settings are in root group
const
char
*
BrandImageSettings
::
userBrandImageIndoorName
=
"UserBrandImageIndoor"
;
const
char
*
BrandImageSettings
::
userBrandImageOutdoorName
=
"UserBrandImageOutdoor"
;
BrandImageSettings
::
BrandImageSettings
(
QObject
*
parent
)
:
SettingsGroup
(
brandImageSettingsGroupName
,
QString
()
/* root settings group */
,
parent
)
:
SettingsGroup
(
name
,
settingsGroup
,
parent
)
,
_userBrandImageIndoorFact
(
NULL
)
,
_userBrandImageOutdoorFact
(
NULL
)
{
...
...
src/Settings/BrandImageSettings.h
View file @
e7db8b94
...
...
@@ -25,7 +25,8 @@ public:
Fact
*
userBrandImageIndoor
(
void
);
Fact
*
userBrandImageOutdoor
(
void
);
static
const
char
*
brandImageSettingsGroupName
;
static
const
char
*
name
;
static
const
char
*
settingsGroup
;
static
const
char
*
userBrandImageIndoorName
;
static
const
char
*
userBrandImageOutdoorName
;
...
...
src/Settings/FlightMapSettings.cc
View file @
e7db8b94
...
...
@@ -16,13 +16,14 @@
#include <QQmlEngine>
#include <QtQml>
const
char
*
FlightMapSettings
::
flightMapSettingsGroupName
=
"FlightMap"
;
const
char
*
FlightMapSettings
::
mapProviderSettingsName
=
"MapProvider"
;
const
char
*
FlightMapSettings
::
mapTypeSettingsName
=
"MapType"
;
const
char
*
FlightMapSettings
::
_settingsGroupName
=
"FlightMap"
;
const
char
*
FlightMapSettings
::
name
=
"FlightMap"
;
const
char
*
FlightMapSettings
::
settingsGroup
=
"FlightMap"
;
const
char
*
FlightMapSettings
::
mapProviderSettingsName
=
"MapProvider"
;
const
char
*
FlightMapSettings
::
mapTypeSettingsName
=
"MapType"
;
FlightMapSettings
::
FlightMapSettings
(
QObject
*
parent
)
:
SettingsGroup
(
flightMapSettingsGroupName
,
QString
(
_settingsGroupName
)
/* root settings group */
,
parent
)
:
SettingsGroup
(
name
,
settingsGroup
,
parent
)
,
_mapProviderFact
(
NULL
)
,
_mapTypeFact
(
NULL
)
{
...
...
src/Settings/FlightMapSettings.h
View file @
e7db8b94
...
...
@@ -43,7 +43,9 @@ public:
Fact
*
mapProvider
(
void
);
Fact
*
mapType
(
void
);
static
const
char
*
flightMapSettingsGroupName
;
static
const
char
*
name
;
static
const
char
*
settingsGroup
;
static
const
char
*
mapProviderSettingsName
;
static
const
char
*
mapTypeSettingsName
;
...
...
@@ -61,8 +63,6 @@ private:
SettingsFact
*
_mapTypeFact
;
QStringList
_savedMapTypeStrings
;
QVariantList
_savedMapTypeValues
;
static
const
char
*
_settingsGroupName
;
};
#endif
src/Settings/GuidedSettings.cc
View file @
e7db8b94
...
...
@@ -15,14 +15,16 @@
#include <QtQml>
#include <QStandardPaths>
const
char
*
GuidedSettings
::
guidedSettingsGroupName
=
"Guided"
;
const
char
*
GuidedSettings
::
name
=
"Guided"
;
const
char
*
GuidedSettings
::
settingsGroup
=
""
;
// settings are in root group
const
char
*
GuidedSettings
::
fixedWingMinimumAltitudeName
=
"FixedWingMinimumAltitude"
;
const
char
*
GuidedSettings
::
fixedWingMaximumAltitudeName
=
"FixedWingMaximumAltitude"
;
const
char
*
GuidedSettings
::
vehicleMinimumAltitudeName
=
"VehicleMinimumAltitude"
;
const
char
*
GuidedSettings
::
vehicleMaximumAltitudeName
=
"VehicleMaximumAltitude"
;
GuidedSettings
::
GuidedSettings
(
QObject
*
parent
)
:
SettingsGroup
(
guidedSettingsGroupName
,
QString
()
/* root settings group */
,
parent
)
:
SettingsGroup
(
name
,
settingsGroup
,
parent
)
,
_fixedWingMinimumAltitudeFact
(
NULL
)
,
_fixedWingMaximumAltitudeFact
(
NULL
)
,
_vehicleMinimumAltitudeFact
(
NULL
)
...
...
src/Settings/GuidedSettings.h
View file @
e7db8b94
...
...
@@ -31,7 +31,8 @@ public:
Fact
*
vehicleMinimumAltitude
(
void
);
Fact
*
vehicleMaximumAltitude
(
void
);
static
const
char
*
guidedSettingsGroupName
;
static
const
char
*
name
;
static
const
char
*
settingsGroup
;
static
const
char
*
fixedWingMinimumAltitudeName
;
static
const
char
*
fixedWingMaximumAltitudeName
;
...
...
src/Settings/RTKSettings.cc
View file @
e7db8b94
...
...
@@ -12,12 +12,14 @@
#include <QQmlEngine>
#include <QtQml>
const
char
*
RTKSettings
::
RTKSettingsGroupName
=
"RTK"
;
const
char
*
RTKSettings
::
name
=
"RTK"
;
const
char
*
RTKSettings
::
settingsGroup
=
"RTK"
;
const
char
*
RTKSettings
::
surveyInAccuracyLimitName
=
"SurveyInAccuracyLimit"
;
const
char
*
RTKSettings
::
surveyInMinObservationDurationName
=
"SurveyInMinObservationDuration"
;
RTKSettings
::
RTKSettings
(
QObject
*
parent
)
:
SettingsGroup
(
RTKSettingsGroupName
,
QString
(
RTKSettingsGroupName
)
,
parent
)
:
SettingsGroup
(
name
,
settingsGroup
,
parent
)
,
_surveyInAccuracyLimitFact
(
NULL
)
,
_surveyInMinObservationDurationFact
(
NULL
)
{
...
...
src/Settings/RTKSettings.h
View file @
e7db8b94
...
...
@@ -24,7 +24,8 @@ public:
Fact
*
surveyInAccuracyLimit
(
void
);
Fact
*
surveyInMinObservationDuration
(
void
);
static
const
char
*
RTKSettingsGroupName
;
static
const
char
*
name
;
static
const
char
*
settingsGroup
;
static
const
char
*
surveyInAccuracyLimitName
;
static
const
char
*
surveyInMinObservationDurationName
;
...
...
src/Settings/SettingsGroup.cc
View file @
e7db8b94
...
...
@@ -12,18 +12,18 @@
#include "QGCApplication.h"
SettingsGroup
::
SettingsGroup
(
const
QString
&
name
,
const
QString
&
settingsGroup
,
QObject
*
parent
)
:
QObject
(
parent
)
,
_name
(
name
)
:
QObject
(
parent
)
,
_name
(
name
)
,
_settingsGroup
(
settingsGroup
)
,
_visible
(
qgcApp
()
->
toolbox
()
->
corePlugin
()
->
overrideSettingsGroupVisibility
(
name
))
,
_visible
(
qgcApp
()
->
toolbox
()
->
corePlugin
()
->
overrideSettingsGroupVisibility
(
_
name
))
{
QString
jsonNameFormat
(
":/json/%1.SettingsGroup.json"
);
_nameToMetaDataMap
=
FactMetaData
::
createMapFromJsonFile
(
jsonNameFormat
.
arg
(
name
),
this
);
_nameToMetaDataMap
=
FactMetaData
::
createMapFromJsonFile
(
jsonNameFormat
.
arg
(
_
name
),
this
);
}
SettingsFact
*
SettingsGroup
::
_createSettingsFact
(
const
QString
&
n
ame
)
SettingsFact
*
SettingsGroup
::
_createSettingsFact
(
const
QString
&
factN
ame
)
{
return
new
SettingsFact
(
_settingsGroup
,
_nameToMetaDataMap
[
n
ame
],
this
);
return
new
SettingsFact
(
_settingsGroup
,
_nameToMetaDataMap
[
factN
ame
],
this
);
}
src/Settings/SettingsGroup.h
View file @
e7db8b94
...
...
@@ -31,10 +31,10 @@ public:
Q_PROPERTY
(
bool
visible
MEMBER
_visible
CONSTANT
)
protected:
SettingsFact
*
_createSettingsFact
(
const
QString
&
n
ame
);
SettingsFact
*
_createSettingsFact
(
const
QString
&
factN
ame
);
QString
_name
;
QString
_settingsGroup
;
QString
_name
;
///< Name for group. Used to generate name for loaded json meta data file.
QString
_settingsGroup
;
///< QSettings group which contains these settings. empty for settings in root
bool
_visible
;
QMap
<
QString
,
FactMetaData
*>
_nameToMetaDataMap
;
...
...
src/Settings/UnitsSettings.cc
View file @
e7db8b94
...
...
@@ -12,14 +12,16 @@
#include <QQmlEngine>
#include <QtQml>
const
char
*
UnitsSettings
::
unitsSettingsGroupName
=
"Units"
;
const
char
*
UnitsSettings
::
distanceUnitsSettingsName
=
"DistanceUnits"
;
const
char
*
UnitsSettings
::
areaUnitsSettingsName
=
"AreaUnits"
;
const
char
*
UnitsSettings
::
speedUnitsSettingsName
=
"SpeedUnits"
;
const
char
*
UnitsSettings
::
temperatureUnitsSettingsName
=
"TemperatureUnits"
;
const
char
*
UnitsSettings
::
name
=
"Units"
;
const
char
*
UnitsSettings
::
settingsGroup
=
""
;
// settings are in root group
const
char
*
UnitsSettings
::
distanceUnitsSettingsName
=
"DistanceUnits"
;
const
char
*
UnitsSettings
::
areaUnitsSettingsName
=
"AreaUnits"
;
const
char
*
UnitsSettings
::
speedUnitsSettingsName
=
"SpeedUnits"
;
const
char
*
UnitsSettings
::
temperatureUnitsSettingsName
=
"TemperatureUnits"
;
UnitsSettings
::
UnitsSettings
(
QObject
*
parent
)
:
SettingsGroup
(
unitsSettingsGroupName
,
QString
()
/* root settings group */
,
parent
)
:
SettingsGroup
(
name
,
settingsGroup
,
parent
)
,
_distanceUnitsFact
(
NULL
)
,
_areaUnitsFact
(
NULL
)
,
_speedUnitsFact
(
NULL
)
...
...
src/Settings/UnitsSettings.h
View file @
e7db8b94
...
...
@@ -61,7 +61,8 @@ public:
Fact
*
speedUnits
(
void
);
Fact
*
temperatureUnits
(
void
);
static
const
char
*
unitsSettingsGroupName
;
static
const
char
*
name
;
static
const
char
*
settingsGroup
;
static
const
char
*
distanceUnitsSettingsName
;
static
const
char
*
areaUnitsSettingsName
;
...
...
src/Settings/VideoSettings.cc
View file @
e7db8b94
...
...
@@ -17,7 +17,8 @@
#include <QCameraInfo>
#endif
const
char
*
VideoSettings
::
videoSettingsGroupName
=
"Video"
;
const
char
*
VideoSettings
::
name
=
"Video"
;
const
char
*
VideoSettings
::
settingsGroup
=
""
;
// settings are in root group
const
char
*
VideoSettings
::
videoSourceName
=
"VideoSource"
;
const
char
*
VideoSettings
::
udpPortName
=
"VideoUDPPort"
;
...
...
@@ -40,7 +41,7 @@ const char* VideoSettings::videoSourceRTSP = "RTSP Video Stream";
const
char
*
VideoSettings
::
videoSourceTCP
=
"TCP-MPEG2 Video Stream"
;
VideoSettings
::
VideoSettings
(
QObject
*
parent
)
:
SettingsGroup
(
videoSettingsGroupName
,
QString
()
/* root settings group */
,
parent
)
:
SettingsGroup
(
name
,
settingsGroup
,
parent
)
,
_videoSourceFact
(
NULL
)
,
_udpPortFact
(
NULL
)
,
_tcpUrlFact
(
NULL
)
...
...
src/Settings/VideoSettings.h
View file @
e7db8b94
...
...
@@ -49,7 +49,8 @@ public:
Fact
*
disableWhenDisarmed
(
void
);
bool
streamConfigured
(
void
);
static
const
char
*
videoSettingsGroupName
;
static
const
char
*
name
;
static
const
char
*
settingsGroup
;
static
const
char
*
videoSourceName
;
static
const
char
*
udpPortName
;
...
...
src/api/QGCCorePlugin.h
View file @
e7db8b94
...
...
@@ -67,12 +67,12 @@ public:
virtual
QGCOptions
*
options
(
void
);
/// Allows the core plugin to override the visibility for a settings group
/// @param name - Setting
g
roup name
/// @param name - Setting
sG
roup name
/// @return true: Show settings ui, false: Hide settings ui
virtual
bool
overrideSettingsGroupVisibility
(
QString
name
);
/// Allows the core plugin to override the setting meta data before the setting fact is created.
/// @param settingsGroup -
Settings group which contains this value
/// @param settingsGroup -
QSettings group which contains this item
/// @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
(
const
QString
&
settingsGroup
,
FactMetaData
&
metaData
);
...
...
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