Commit 23561c4a authored by dheideman's avatar dheideman

Move User Brand Image to new factgroup

parent cbbdf425
...@@ -554,6 +554,7 @@ HEADERS += \ ...@@ -554,6 +554,7 @@ HEADERS += \
src/QtLocationPlugin/QMLControl/QGCMapEngineManager.h \ src/QtLocationPlugin/QMLControl/QGCMapEngineManager.h \
src/Settings/AppSettings.h \ src/Settings/AppSettings.h \
src/Settings/AutoConnectSettings.h \ src/Settings/AutoConnectSettings.h \
src/Settings/BrandImageSettings.h \
src/Settings/FlightMapSettings.h \ src/Settings/FlightMapSettings.h \
src/Settings/GuidedSettings.h \ src/Settings/GuidedSettings.h \
src/Settings/RTKSettings.h \ src/Settings/RTKSettings.h \
...@@ -736,6 +737,7 @@ SOURCES += \ ...@@ -736,6 +737,7 @@ SOURCES += \
src/QtLocationPlugin/QMLControl/QGCMapEngineManager.cc \ src/QtLocationPlugin/QMLControl/QGCMapEngineManager.cc \
src/Settings/AppSettings.cc \ src/Settings/AppSettings.cc \
src/Settings/AutoConnectSettings.cc \ src/Settings/AutoConnectSettings.cc \
src/Settings/BrandImageSettings.cc \
src/Settings/FlightMapSettings.cc \ src/Settings/FlightMapSettings.cc \
src/Settings/GuidedSettings.cc \ src/Settings/GuidedSettings.cc \
src/Settings/RTKSettings.cc \ src/Settings/RTKSettings.cc \
......
...@@ -222,6 +222,7 @@ ...@@ -222,6 +222,7 @@
<file alias="Vehicle/VibrationFact.json">src/Vehicle/VibrationFact.json</file> <file alias="Vehicle/VibrationFact.json">src/Vehicle/VibrationFact.json</file>
<file alias="Vehicle/TemperatureFact.json">src/Vehicle/TemperatureFact.json</file> <file alias="Vehicle/TemperatureFact.json">src/Vehicle/TemperatureFact.json</file>
<file alias="Vehicle/SubmarineFact.json">src/Vehicle/SubmarineFact.json</file> <file alias="Vehicle/SubmarineFact.json">src/Vehicle/SubmarineFact.json</file>
<file alias="BrandImage.SettingsGroup.json">src/Settings/BrandImage.SettingsGroup.json</file>
</qresource> </qresource>
<qresource prefix="/MockLink"> <qresource prefix="/MockLink">
<file alias="APMArduCopterMockLink.params">src/comm/APMArduCopterMockLink.params</file> <file alias="APMArduCopterMockLink.params">src/comm/APMArduCopterMockLink.params</file>
......
...@@ -32,8 +32,6 @@ const char* AppSettings::appFontPointSizeName = "BaseDev ...@@ -32,8 +32,6 @@ const char* AppSettings::appFontPointSizeName = "BaseDev
const char* AppSettings::indoorPaletteName = "StyleIsDark"; const char* AppSettings::indoorPaletteName = "StyleIsDark";
const char* AppSettings::showLargeCompassName = "ShowLargeCompass"; const char* AppSettings::showLargeCompassName = "ShowLargeCompass";
const char* AppSettings::savePathName = "SavePath"; const char* AppSettings::savePathName = "SavePath";
const char* AppSettings::userBrandImageIndoorName = "UserBrandImageIndoor";
const char* AppSettings::userBrandImageOutdoorName = "UserBrandImageOutdoor";
const char* AppSettings::autoLoadMissionsName = "AutoLoadMissions"; const char* AppSettings::autoLoadMissionsName = "AutoLoadMissions";
const char* AppSettings::mapboxTokenName = "MapboxToken"; const char* AppSettings::mapboxTokenName = "MapboxToken";
const char* AppSettings::esriTokenName = "EsriToken"; const char* AppSettings::esriTokenName = "EsriToken";
...@@ -73,8 +71,6 @@ AppSettings::AppSettings(QObject* parent) ...@@ -73,8 +71,6 @@ AppSettings::AppSettings(QObject* parent)
, _indoorPaletteFact(NULL) , _indoorPaletteFact(NULL)
, _showLargeCompassFact(NULL) , _showLargeCompassFact(NULL)
, _savePathFact(NULL) , _savePathFact(NULL)
, _userBrandImageIndoorFact(NULL)
, _userBrandImageOutdoorFact(NULL)
, _autoLoadMissionsFact(NULL) , _autoLoadMissionsFact(NULL)
, _mapboxTokenFact(NULL) , _mapboxTokenFact(NULL)
, _esriTokenFact(NULL) , _esriTokenFact(NULL)
...@@ -335,24 +331,6 @@ QString AppSettings::videoSavePath(void) ...@@ -335,24 +331,6 @@ QString AppSettings::videoSavePath(void)
return fullPath; return fullPath;
} }
Fact* AppSettings::userBrandImageIndoor(void)
{
if (!_userBrandImageIndoorFact) {
_userBrandImageIndoorFact = _createSettingsFact(userBrandImageIndoorName);
}
return _userBrandImageIndoorFact;
}
Fact* AppSettings::userBrandImageOutdoor(void)
{
if (!_userBrandImageOutdoorFact) {
_userBrandImageOutdoorFact = _createSettingsFact(userBrandImageOutdoorName);
}
return _userBrandImageOutdoorFact;
}
Fact* AppSettings::autoLoadMissions(void) Fact* AppSettings::autoLoadMissions(void)
{ {
if (!_autoLoadMissionsFact) { if (!_autoLoadMissionsFact) {
......
...@@ -36,8 +36,6 @@ public: ...@@ -36,8 +36,6 @@ public:
Q_PROPERTY(Fact* indoorPalette READ indoorPalette CONSTANT) Q_PROPERTY(Fact* indoorPalette READ indoorPalette CONSTANT)
Q_PROPERTY(Fact* showLargeCompass READ showLargeCompass CONSTANT) Q_PROPERTY(Fact* showLargeCompass READ showLargeCompass CONSTANT)
Q_PROPERTY(Fact* savePath READ savePath CONSTANT) Q_PROPERTY(Fact* savePath READ savePath CONSTANT)
Q_PROPERTY(Fact* userBrandImageIndoor READ userBrandImageIndoor CONSTANT)
Q_PROPERTY(Fact* userBrandImageOutdoor READ userBrandImageOutdoor CONSTANT)
Q_PROPERTY(Fact* autoLoadMissions READ autoLoadMissions CONSTANT) Q_PROPERTY(Fact* autoLoadMissions READ autoLoadMissions CONSTANT)
Q_PROPERTY(Fact* mapboxToken READ mapboxToken CONSTANT) Q_PROPERTY(Fact* mapboxToken READ mapboxToken CONSTANT)
Q_PROPERTY(Fact* esriToken READ esriToken CONSTANT) Q_PROPERTY(Fact* esriToken READ esriToken CONSTANT)
...@@ -73,8 +71,6 @@ public: ...@@ -73,8 +71,6 @@ public:
Fact* indoorPalette (void); Fact* indoorPalette (void);
Fact* showLargeCompass (void); Fact* showLargeCompass (void);
Fact* savePath (void); Fact* savePath (void);
Fact* userBrandImageIndoor (void);
Fact* userBrandImageOutdoor (void);
Fact* autoLoadMissions (void); Fact* autoLoadMissions (void);
Fact* mapboxToken (void); Fact* mapboxToken (void);
Fact* esriToken (void); Fact* esriToken (void);
...@@ -107,8 +103,6 @@ public: ...@@ -107,8 +103,6 @@ public:
static const char* indoorPaletteName; static const char* indoorPaletteName;
static const char* showLargeCompassName; static const char* showLargeCompassName;
static const char* savePathName; static const char* savePathName;
static const char* userBrandImageIndoorName;
static const char* userBrandImageOutdoorName;
static const char* autoLoadMissionsName; static const char* autoLoadMissionsName;
static const char* mapboxTokenName; static const char* mapboxTokenName;
static const char* esriTokenName; static const char* esriTokenName;
...@@ -156,8 +150,6 @@ private: ...@@ -156,8 +150,6 @@ private:
SettingsFact* _indoorPaletteFact; SettingsFact* _indoorPaletteFact;
SettingsFact* _showLargeCompassFact; SettingsFact* _showLargeCompassFact;
SettingsFact* _savePathFact; SettingsFact* _savePathFact;
SettingsFact* _userBrandImageIndoorFact;
SettingsFact* _userBrandImageOutdoorFact;
SettingsFact* _autoLoadMissionsFact; SettingsFact* _autoLoadMissionsFact;
SettingsFact* _mapboxTokenFact; SettingsFact* _mapboxTokenFact;
SettingsFact* _esriTokenFact; SettingsFact* _esriTokenFact;
......
[
{
"name": "UserBrandImageIndoor",
"shortDescription": "User-selected brand image",
"longDescription": "Location in file system of user-selected brand image (indoor)",
"type": "string",
"defaultValue": ""
},
{
"name": "UserBrandImageOutdoor",
"shortDescription": "User-selected brand image",
"longDescription": "Location in file system of user-selected brand image (outdoor)",
"type": "string",
"defaultValue": ""
}
]
/****************************************************************************
*
* (c) 2009-2017 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#include "BrandImageSettings.h"
#include <QQmlEngine>
#include <QtQml>
const char* BrandImageSettings::brandImageSettingsGroupName = "BrandImage";
const char* BrandImageSettings::userBrandImageIndoorName = "UserBrandImageIndoor";
const char* BrandImageSettings::userBrandImageOutdoorName = "UserBrandImageOutdoor";
BrandImageSettings::BrandImageSettings(QObject* parent)
: SettingsGroup(brandImageSettingsGroupName, QString() /* root settings group */, parent)
, _userBrandImageIndoorFact(NULL)
, _userBrandImageOutdoorFact(NULL)
{
QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership);
qmlRegisterUncreatableType<BrandImageSettings>("QGroundControl.SettingsManager", 1, 0, "BrandImageSettings", "Reference only");
}
Fact* BrandImageSettings::userBrandImageIndoor(void)
{
if (!_userBrandImageIndoorFact) {
_userBrandImageIndoorFact = _createSettingsFact(userBrandImageIndoorName);
}
return _userBrandImageIndoorFact;
}
Fact* BrandImageSettings::userBrandImageOutdoor(void)
{
if (!_userBrandImageOutdoorFact) {
_userBrandImageOutdoorFact = _createSettingsFact(userBrandImageOutdoorName);
}
return _userBrandImageOutdoorFact;
}
/****************************************************************************
*
* (c) 2009-2017 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#ifndef BrandImageSettings_H
#define BrandImageSettings_H
#include "SettingsGroup.h"
class BrandImageSettings : public SettingsGroup
{
Q_OBJECT
public:
BrandImageSettings(QObject* parent = NULL);
Q_PROPERTY(Fact* userBrandImageIndoor READ userBrandImageIndoor CONSTANT)
Q_PROPERTY(Fact* userBrandImageOutdoor READ userBrandImageOutdoor CONSTANT)
Fact* userBrandImageIndoor (void);
Fact* userBrandImageOutdoor (void);
static const char* brandImageSettingsGroupName;
static const char* userBrandImageIndoorName;
static const char* userBrandImageOutdoorName;
private:
SettingsFact* _userBrandImageIndoorFact;
SettingsFact* _userBrandImageOutdoorFact;
};
#endif
...@@ -21,6 +21,7 @@ SettingsManager::SettingsManager(QGCApplication* app, QGCToolbox* toolbox) ...@@ -21,6 +21,7 @@ SettingsManager::SettingsManager(QGCApplication* app, QGCToolbox* toolbox)
, _flightMapSettings (NULL) , _flightMapSettings (NULL)
, _rtkSettings (NULL) , _rtkSettings (NULL)
, _guidedSettings (NULL) , _guidedSettings (NULL)
, _brandImageSettings (NULL)
{ {
} }
...@@ -38,4 +39,5 @@ void SettingsManager::setToolbox(QGCToolbox *toolbox) ...@@ -38,4 +39,5 @@ void SettingsManager::setToolbox(QGCToolbox *toolbox)
_flightMapSettings = new FlightMapSettings(this); _flightMapSettings = new FlightMapSettings(this);
_rtkSettings = new RTKSettings(this); _rtkSettings = new RTKSettings(this);
_guidedSettings = new GuidedSettings(this); _guidedSettings = new GuidedSettings(this);
_brandImageSettings = new BrandImageSettings(this);
} }
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "FlightMapSettings.h" #include "FlightMapSettings.h"
#include "RTKSettings.h" #include "RTKSettings.h"
#include "GuidedSettings.h" #include "GuidedSettings.h"
#include "BrandImageSettings.h"
#include <QVariantList> #include <QVariantList>
...@@ -39,6 +40,7 @@ public: ...@@ -39,6 +40,7 @@ public:
Q_PROPERTY(QObject* flightMapSettings READ flightMapSettings CONSTANT) Q_PROPERTY(QObject* flightMapSettings READ flightMapSettings CONSTANT)
Q_PROPERTY(QObject* rtkSettings READ rtkSettings CONSTANT) Q_PROPERTY(QObject* rtkSettings READ rtkSettings CONSTANT)
Q_PROPERTY(QObject* guidedSettings READ guidedSettings CONSTANT) Q_PROPERTY(QObject* guidedSettings READ guidedSettings CONSTANT)
Q_PROPERTY(QObject* brandImageSettings READ brandImageSettings CONSTANT)
// Override from QGCTool // Override from QGCTool
virtual void setToolbox(QGCToolbox *toolbox); virtual void setToolbox(QGCToolbox *toolbox);
...@@ -50,6 +52,7 @@ public: ...@@ -50,6 +52,7 @@ public:
FlightMapSettings* flightMapSettings (void) { return _flightMapSettings; } FlightMapSettings* flightMapSettings (void) { return _flightMapSettings; }
RTKSettings* rtkSettings (void) { return _rtkSettings; } RTKSettings* rtkSettings (void) { return _rtkSettings; }
GuidedSettings* guidedSettings (void) { return _guidedSettings; } GuidedSettings* guidedSettings (void) { return _guidedSettings; }
BrandImageSettings* brandImageSettings (void) { return _brandImageSettings; }
private: private:
AppSettings* _appSettings; AppSettings* _appSettings;
...@@ -59,6 +62,7 @@ private: ...@@ -59,6 +62,7 @@ private:
FlightMapSettings* _flightMapSettings; FlightMapSettings* _flightMapSettings;
RTKSettings* _rtkSettings; RTKSettings* _rtkSettings;
GuidedSettings* _guidedSettings; GuidedSettings* _guidedSettings;
BrandImageSettings* _brandImageSettings;
}; };
#endif #endif
...@@ -34,9 +34,9 @@ QGCView { ...@@ -34,9 +34,9 @@ QGCView {
property Fact _percentRemainingAnnounce: QGroundControl.settingsManager.appSettings.batteryPercentRemainingAnnounce property Fact _percentRemainingAnnounce: QGroundControl.settingsManager.appSettings.batteryPercentRemainingAnnounce
property Fact _savePath: QGroundControl.settingsManager.appSettings.savePath property Fact _savePath: QGroundControl.settingsManager.appSettings.savePath
property Fact _userBrandImageIndoor: QGroundControl.settingsManager.appSettings.userBrandImageIndoor
property Fact _userBrandImageOutdoor: QGroundControl.settingsManager.appSettings.userBrandImageOutdoor
property Fact _appFontPointSize: QGroundControl.settingsManager.appSettings.appFontPointSize property Fact _appFontPointSize: QGroundControl.settingsManager.appSettings.appFontPointSize
property Fact _userBrandImageIndoor: QGroundControl.settingsManager.brandImageSettings.userBrandImageIndoor
property Fact _userBrandImageOutdoor: QGroundControl.settingsManager.brandImageSettings.userBrandImageOutdoor
property real _labelWidth: ScreenTools.defaultFontPixelWidth * 15 property real _labelWidth: ScreenTools.defaultFontPixelWidth * 15
property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 30 property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 30
property Fact _mapProvider: QGroundControl.settingsManager.flightMapSettings.mapProvider property Fact _mapProvider: QGroundControl.settingsManager.flightMapSettings.mapProvider
...@@ -697,7 +697,7 @@ QGCView { ...@@ -697,7 +697,7 @@ QGCView {
anchors.baseline: userBrandImageIndoorBrowse.baseline anchors.baseline: userBrandImageIndoorBrowse.baseline
readOnly: true readOnly: true
width: _editFieldWidth width: _editFieldWidth
text: QGroundControl.settingsManager.appSettings.userBrandImageIndoor.valueString.replace("file:///","") text: _userBrandImageIndoor.valueString.replace("file:///","")
} }
QGCButton { QGCButton {
id: userBrandImageIndoorBrowse id: userBrandImageIndoorBrowse
...@@ -729,7 +729,7 @@ QGCView { ...@@ -729,7 +729,7 @@ QGCView {
anchors.baseline: userBrandImageOutdoorBrowse.baseline anchors.baseline: userBrandImageOutdoorBrowse.baseline
readOnly: true readOnly: true
width: _editFieldWidth width: _editFieldWidth
text: QGroundControl.settingsManager.appSettings.userBrandImageOutdoor.valueString.replace("file:///","") text: _userBrandImageOutdoor.valueString.replace("file:///","")
} }
QGCButton { QGCButton {
id: userBrandImageOutdoorBrowse id: userBrandImageOutdoorBrowse
......
...@@ -96,8 +96,8 @@ Item { ...@@ -96,8 +96,8 @@ Item {
property bool _outdoorPalette: qgcPal.globalTheme === QGCPalette.Light property bool _outdoorPalette: qgcPal.globalTheme === QGCPalette.Light
property bool _corePluginBranding: QGroundControl.corePlugin.brandImageIndoor.length != 0 property bool _corePluginBranding: QGroundControl.corePlugin.brandImageIndoor.length != 0
property string _userBrandImageIndoor: QGroundControl.settingsManager.appSettings.userBrandImageIndoor.value property string _userBrandImageIndoor: QGroundControl.settingsManager.brandImageSettings.userBrandImageIndoor.value
property string _userBrandImageOutdoor: QGroundControl.settingsManager.appSettings.userBrandImageOutdoor.value property string _userBrandImageOutdoor: QGroundControl.settingsManager.brandImageSettings.userBrandImageOutdoor.value
property bool _userBrandingIndoor: _userBrandImageIndoor.length != 0 property bool _userBrandingIndoor: _userBrandImageIndoor.length != 0
property bool _userBrandingOutdoor: _userBrandImageOutdoor.length != 0 property bool _userBrandingOutdoor: _userBrandImageOutdoor.length != 0
property string _brandImageIndoor: _userBrandingIndoor ? _userBrandImageIndoor : (_userBrandingOutdoor ? _userBrandImageOutdoor : (_corePluginBranding ? QGroundControl.corePlugin.brandImageIndoor : (_activeVehicle ? _activeVehicle.brandImageIndoor : "") ) ) property string _brandImageIndoor: _userBrandingIndoor ? _userBrandImageIndoor : (_userBrandingOutdoor ? _userBrandImageOutdoor : (_corePluginBranding ? QGroundControl.corePlugin.brandImageIndoor : (_activeVehicle ? _activeVehicle.brandImageIndoor : "") ) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment