Commit 891f893a authored by Gus Grubba's avatar Gus Grubba Committed by GitHub

Merge pull request #4718 from dogmaphobic/toolbarIndicator

Making toolbar indicator list private.
parents b7f2d3b1 e6e826bd
...@@ -107,16 +107,16 @@ bool ArduSubFirmwarePlugin::supportsMotorInterference(void) ...@@ -107,16 +107,16 @@ bool ArduSubFirmwarePlugin::supportsMotorInterference(void)
return false; return false;
} }
QVariantList& ArduSubFirmwarePlugin::toolBarIndicators(const Vehicle* vehicle) const QVariantList& ArduSubFirmwarePlugin::toolBarIndicators(const Vehicle* vehicle)
{ {
Q_UNUSED(vehicle); Q_UNUSED(vehicle);
//-- Sub specific list of indicators (Enter your modified list here) //-- Sub specific list of indicators (Enter your modified list here)
if(_toolBarIndicatorList.size() == 0) { if(_toolBarIndicators.size() == 0) {
_toolBarIndicatorList.append(QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/MessageIndicator.qml"))); _toolBarIndicators.append(QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/MessageIndicator.qml")));
_toolBarIndicatorList.append(QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/TelemetryRSSIIndicator.qml"))); _toolBarIndicators.append(QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/TelemetryRSSIIndicator.qml")));
_toolBarIndicatorList.append(QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/RCRSSIIndicator.qml"))); _toolBarIndicators.append(QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/RCRSSIIndicator.qml")));
_toolBarIndicatorList.append(QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/BatteryIndicator.qml"))); _toolBarIndicators.append(QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/BatteryIndicator.qml")));
_toolBarIndicatorList.append(QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/ModeIndicator.qml"))); _toolBarIndicators.append(QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/ModeIndicator.qml")));
} }
return _toolBarIndicatorList; return _toolBarIndicators;
} }
...@@ -86,9 +86,10 @@ public: ...@@ -86,9 +86,10 @@ public:
QString brandImage(const Vehicle* vehicle) const { Q_UNUSED(vehicle); return QStringLiteral("/qmlimages/APM/BrandImageSub"); } QString brandImage(const Vehicle* vehicle) const { Q_UNUSED(vehicle); return QStringLiteral("/qmlimages/APM/BrandImageSub"); }
const FirmwarePlugin::remapParamNameMajorVersionMap_t& paramNameRemapMajorVersionMap(void) const final { return _remapParamName; } const FirmwarePlugin::remapParamNameMajorVersionMap_t& paramNameRemapMajorVersionMap(void) const final { return _remapParamName; }
int remapParamNameHigestMinorVersionNumber(int majorVersionNumber) const final; int remapParamNameHigestMinorVersionNumber(int majorVersionNumber) const final;
QVariantList& toolBarIndicators(const Vehicle* vehicle) final; const QVariantList& toolBarIndicators(const Vehicle* vehicle) final;
private: private:
QVariantList _toolBarIndicators;
static bool _remapParamNameIntialized; static bool _remapParamNameIntialized;
static FirmwarePlugin::remapParamNameMajorVersionMap_t _remapParamName; static FirmwarePlugin::remapParamNameMajorVersionMap_t _remapParamName;
}; };
......
...@@ -341,7 +341,7 @@ QString FirmwarePlugin::vehicleImageCompass(const Vehicle* vehicle) const ...@@ -341,7 +341,7 @@ QString FirmwarePlugin::vehicleImageCompass(const Vehicle* vehicle) const
return QStringLiteral("/qmlimages/compassInstrumentArrow.svg"); return QStringLiteral("/qmlimages/compassInstrumentArrow.svg");
} }
QVariantList& FirmwarePlugin::toolBarIndicators(const Vehicle* vehicle) const QVariantList &FirmwarePlugin::toolBarIndicators(const Vehicle* vehicle)
{ {
Q_UNUSED(vehicle); Q_UNUSED(vehicle);
//-- Default list of indicators for all vehicles. //-- Default list of indicators for all vehicles.
......
...@@ -259,7 +259,7 @@ public: ...@@ -259,7 +259,7 @@ public:
/// Allows the core plugin to override the toolbar indicators /// Allows the core plugin to override the toolbar indicators
/// @return A list of QUrl with the indicators (see MainToolBarIndicators.qml) /// @return A list of QUrl with the indicators (see MainToolBarIndicators.qml)
virtual QVariantList& toolBarIndicators(const Vehicle* vehicle); virtual const QVariantList& toolBarIndicators(const Vehicle* vehicle);
/// Returns a list of CameraMetaData objects for available cameras on the vehicle. /// Returns a list of CameraMetaData objects for available cameras on the vehicle.
virtual const QVariantList& cameraList(const Vehicle* vehicle); virtual const QVariantList& cameraList(const Vehicle* vehicle);
...@@ -267,10 +267,8 @@ public: ...@@ -267,10 +267,8 @@ public:
// FIXME: Hack workaround for non pluginize FollowMe support // FIXME: Hack workaround for non pluginize FollowMe support
static const char* px4FollowMeFlightMode; static const char* px4FollowMeFlightMode;
protected:
QVariantList _toolBarIndicatorList;
private: private:
QVariantList _toolBarIndicatorList;
static QVariantList _cameraList; ///< Standard QGC camera list static QVariantList _cameraList; ///< Standard QGC camera list
}; };
......
...@@ -2375,7 +2375,7 @@ QString Vehicle::vehicleImageCompass() const ...@@ -2375,7 +2375,7 @@ QString Vehicle::vehicleImageCompass() const
return QString(); return QString();
} }
QVariantList& Vehicle::toolBarIndicators() const QVariantList& Vehicle::toolBarIndicators()
{ {
if(_firmwarePlugin) { if(_firmwarePlugin) {
return _firmwarePlugin->toolBarIndicators(this); return _firmwarePlugin->toolBarIndicators(this);
......
...@@ -653,8 +653,8 @@ public: ...@@ -653,8 +653,8 @@ public:
QString vehicleImageOutline () const; QString vehicleImageOutline () const;
QString vehicleImageCompass () const; QString vehicleImageCompass () const;
QVariantList& toolBarIndicators(); const QVariantList& toolBarIndicators ();
const QVariantList& cameraList(void) const; const QVariantList& cameraList (void) const;
public slots: public slots:
......
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