Browse Source

Making toolbar indicator list private.

QGC4.4
Gus Grubba 8 years ago
parent
commit
e6e826bd14
  1. 16
      src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.cc
  2. 3
      src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.h
  3. 2
      src/FirmwarePlugin/FirmwarePlugin.cc
  4. 6
      src/FirmwarePlugin/FirmwarePlugin.h
  5. 2
      src/Vehicle/Vehicle.cc
  6. 4
      src/Vehicle/Vehicle.h

16
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.cc

@ -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;
} }

3
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.h

@ -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;
}; };

2
src/FirmwarePlugin/FirmwarePlugin.cc

@ -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.

6
src/FirmwarePlugin/FirmwarePlugin.h

@ -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:
// 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
}; };

2
src/Vehicle/Vehicle.cc

@ -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);

4
src/Vehicle/Vehicle.h

@ -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:

Loading…
Cancel
Save