Commit 7b33c740 authored by DonLakeFlyer's avatar DonLakeFlyer

Move showAdvancedUI/showTouchAreas to QGCCorePlugin

parent 3a8b8099
...@@ -25,7 +25,7 @@ MouseArea { ...@@ -25,7 +25,7 @@ MouseArea {
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
border.color: "red" border.color: "red"
border.width: QGroundControl.showTouchAreas ? 1 : 0 border.width: QGroundControl.corePlugin.showTouchAreas ? 1 : 0
color: "transparent" color: "transparent"
} }
} }
...@@ -32,8 +32,6 @@ QGroundControlQmlGlobal::QGroundControlQmlGlobal(QGCApplication* app) ...@@ -32,8 +32,6 @@ QGroundControlQmlGlobal::QGroundControlQmlGlobal(QGCApplication* app)
, _corePlugin(NULL) , _corePlugin(NULL)
, _firmwarePluginManager(NULL) , _firmwarePluginManager(NULL)
, _settingsManager(NULL) , _settingsManager(NULL)
, _showTouchAreas(false)
, _showAdvancedUI(false)
{ {
// We clear the parent on this object since we run into shutdown problems caused by hybrid qml app. Instead we let it leak on shutdown. // We clear the parent on this object since we run into shutdown problems caused by hybrid qml app. Instead we let it leak on shutdown.
setParent(NULL); setParent(NULL);
......
...@@ -73,9 +73,6 @@ public: ...@@ -73,9 +73,6 @@ public:
Q_PROPERTY(QString qgcVersion READ qgcVersion CONSTANT) Q_PROPERTY(QString qgcVersion READ qgcVersion CONSTANT)
Q_PROPERTY(bool showTouchAreas MEMBER _showTouchAreas NOTIFY showTouchAreasChanged)
Q_PROPERTY(bool showAdvancedUI MEMBER _showAdvancedUI NOTIFY showAdvancedUIChanged)
Q_INVOKABLE void saveGlobalSetting (const QString& key, const QString& value); Q_INVOKABLE void saveGlobalSetting (const QString& key, const QString& value);
Q_INVOKABLE QString loadGlobalSetting (const QString& key, const QString& defaultValue); Q_INVOKABLE QString loadGlobalSetting (const QString& key, const QString& defaultValue);
Q_INVOKABLE void saveBoolGlobalSetting (const QString& key, bool value); Q_INVOKABLE void saveBoolGlobalSetting (const QString& key, bool value);
...@@ -156,9 +153,6 @@ public: ...@@ -156,9 +153,6 @@ public:
QString qgcVersion(void) const { return qgcApp()->applicationVersion(); } QString qgcVersion(void) const { return qgcApp()->applicationVersion(); }
bool showTouchAreas(void) const { return _showTouchAreas; } ///< Show visible extents of touch areas
bool showAdvancedUI(void) const { return _showAdvancedUI; } ///< Show hidden advanced UI
// Overrides from QGCTool // Overrides from QGCTool
virtual void setToolbox(QGCToolbox* toolbox); virtual void setToolbox(QGCToolbox* toolbox);
...@@ -168,8 +162,6 @@ signals: ...@@ -168,8 +162,6 @@ signals:
void mavlinkSystemIDChanged (int id); void mavlinkSystemIDChanged (int id);
void flightMapPositionChanged (QGeoCoordinate flightMapPosition); void flightMapPositionChanged (QGeoCoordinate flightMapPosition);
void flightMapZoomChanged (double flightMapZoom); void flightMapZoomChanged (double flightMapZoom);
void showTouchAreasChanged (bool showTouchAreas);
void showAdvancedUIChanged (bool showAdvancedUI);
private: private:
FlightMapSettings* _flightMapSettings; FlightMapSettings* _flightMapSettings;
...@@ -186,9 +178,6 @@ private: ...@@ -186,9 +178,6 @@ private:
QGeoCoordinate _flightMapPosition; QGeoCoordinate _flightMapPosition;
double _flightMapZoom; double _flightMapZoom;
bool _showTouchAreas;
bool _showAdvancedUI;
}; };
#endif #endif
...@@ -36,6 +36,7 @@ public: ...@@ -36,6 +36,7 @@ public:
, defaultOptions(NULL) , defaultOptions(NULL)
{ {
} }
~QGCCorePlugin_p() ~QGCCorePlugin_p()
{ {
if(pGeneral) if(pGeneral)
...@@ -57,6 +58,7 @@ public: ...@@ -57,6 +58,7 @@ public:
if(defaultOptions) if(defaultOptions)
delete defaultOptions; delete defaultOptions;
} }
QGCSettings* pGeneral; QGCSettings* pGeneral;
QGCSettings* pCommLinks; QGCSettings* pCommLinks;
QGCSettings* pOfflineMaps; QGCSettings* pOfflineMaps;
...@@ -79,6 +81,8 @@ QGCCorePlugin::~QGCCorePlugin() ...@@ -79,6 +81,8 @@ QGCCorePlugin::~QGCCorePlugin()
QGCCorePlugin::QGCCorePlugin(QGCApplication *app) QGCCorePlugin::QGCCorePlugin(QGCApplication *app)
: QGCTool(app) : QGCTool(app)
, _showTouchAreas(false)
, _showAdvancedUI(false)
{ {
_p = new QGCCorePlugin_p; _p = new QGCCorePlugin_p;
} }
...@@ -91,7 +95,7 @@ void QGCCorePlugin::setToolbox(QGCToolbox *toolbox) ...@@ -91,7 +95,7 @@ void QGCCorePlugin::setToolbox(QGCToolbox *toolbox)
qmlRegisterUncreatableType<QGCOptions>("QGroundControl.QGCOptions", 1, 0, "QGCOptions", "Reference only"); qmlRegisterUncreatableType<QGCOptions>("QGroundControl.QGCOptions", 1, 0, "QGCOptions", "Reference only");
} }
QVariantList &QGCCorePlugin::settings() QVariantList &QGCCorePlugin::settingsPages()
{ {
//-- If this hasn't been overridden, create default set of settings //-- If this hasn't been overridden, create default set of settings
if(!_p->pGeneral) { if(!_p->pGeneral) {
......
...@@ -33,13 +33,16 @@ public: ...@@ -33,13 +33,16 @@ public:
QGCCorePlugin(QGCApplication* app); QGCCorePlugin(QGCApplication* app);
~QGCCorePlugin(); ~QGCCorePlugin();
Q_PROPERTY(QVariantList settings READ settings CONSTANT) Q_PROPERTY(QVariantList settingsPages READ settingsPages NOTIFY settingsPagesChanged)
Q_PROPERTY(int defaultSettings READ defaultSettings CONSTANT) Q_PROPERTY(int defaultSettings READ defaultSettings CONSTANT)
Q_PROPERTY(QGCOptions* options READ options CONSTANT) Q_PROPERTY(QGCOptions* options READ options CONSTANT)
Q_PROPERTY(bool showTouchAreas MEMBER _showTouchAreas NOTIFY showTouchAreasChanged)
Q_PROPERTY(bool showAdvancedUI MEMBER _showAdvancedUI NOTIFY showAdvancedUIChanged)
/// The list of settings under the Settings Menu /// The list of settings under the Settings Menu
/// @return A list of QGCSettings /// @return A list of QGCSettings
virtual QVariantList& settings (); virtual QVariantList& settingsPages ();
/// The default settings panel to show /// The default settings panel to show
/// @return The settings index /// @return The settings index
...@@ -61,6 +64,16 @@ public: ...@@ -61,6 +64,16 @@ public:
// Override from QGCTool // Override from QGCTool
void setToolbox (QGCToolbox *toolbox); void setToolbox (QGCToolbox *toolbox);
signals:
void settingsPagesChanged (void);
void showTouchAreasChanged (bool showTouchAreas);
void showAdvancedUIChanged (bool showAdvancedUI);
protected:
bool _showTouchAreas;
bool _showAdvancedUI;
private: private:
QGCCorePlugin_p* _p; QGCCorePlugin_p* _p;
}; };
...@@ -74,9 +74,9 @@ Rectangle { ...@@ -74,9 +74,9 @@ Rectangle {
console.log("easter egg click", ++_clickCount) console.log("easter egg click", ++_clickCount)
eggTimer.restart() eggTimer.restart()
if (_clickCount == 5) { if (_clickCount == 5) {
QGroundControl.showAdvancedUI = true QGroundControl.corePlugin.showAdvancedUI = true
} else if (_clickCount == 7) { } else if (_clickCount == 7) {
QGroundControl.showTouchAreas = true QGroundControl.corePlugin.showTouchAreas = true
} }
} }
......
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