Commit c9f56212 authored by Don Gagne's avatar Don Gagne

Use ViewWithDialog, support custom config

parent 52d149b7
......@@ -40,7 +40,8 @@ bool AirframeComponentController::_typesRegistered = false;
AirframeComponentController::AirframeComponentController(void) :
_uas(NULL),
_currentVehicleIndex(0),
_autostartId(0)
_autostartId(0),
_showCustomConfigPanel(false)
{
_uas = UASManager::instance()->getActiveUAS();
Q_ASSERT(_uas);
......@@ -82,10 +83,9 @@ AirframeComponentController::AirframeComponentController(void) :
_airframeTypes.append(QVariant::fromValue(airframeType));
}
if (_autostartId != 0) {
// FIXME: Should be a user error
Q_UNUSED(autostartFound);
Q_ASSERT(autostartFound);
if (_autostartId != 0 && !autostartFound) {
_showCustomConfigPanel = true;
emit showCustomConfigPanelChanged(true);
}
}
......
......@@ -44,6 +44,8 @@ public:
AirframeComponentController(void);
~AirframeComponentController();
Q_PROPERTY(bool showCustomConfigPanel MEMBER _showCustomConfigPanel NOTIFY showCustomConfigPanelChanged)
Q_PROPERTY(QVariantList airframeTypes MEMBER _airframeTypes CONSTANT)
Q_PROPERTY(QString currentAirframeType MEMBER _currentAirframeType CONSTANT)
......@@ -59,6 +61,7 @@ public:
signals:
void autostartIdChanged(int newAutostartId);
void showCustomConfigPanelChanged(bool show);
private:
static bool _typesRegistered;
......@@ -69,6 +72,7 @@ private:
QString _currentVehicleName;
int _currentVehicleIndex;
int _autostartId;
bool _showCustomConfigPanel;
};
class Airframe : public QObject
......
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