diff --git a/src/ui/QGCBaseParamWidget.cc b/src/ui/QGCBaseParamWidget.cc index b7c38915808899fa4e0fadb490ee2e0ad7c77bda..f7ba8c9142bfd8b80c773ea52f0ed02e4e1124a8 100644 --- a/src/ui/QGCBaseParamWidget.cc +++ b/src/ui/QGCBaseParamWidget.cc @@ -45,6 +45,7 @@ void QGCBaseParamWidget::setUAS(UASInterface* uas) void QGCBaseParamWidget::connectToParamManager() { + paramMgr = mav->getParamManager(); //TODO route via paramManager instead? // Listen to updated param signals from the data model connect(paramMgr->dataModel(), SIGNAL(parameterUpdated(int, QString , QVariant )), @@ -77,6 +78,8 @@ void QGCBaseParamWidget::disconnectFromParamManager() // Listen to communications status messages so we can display them disconnect(paramMgr, SIGNAL(parameterStatusMsgUpdated(QString,int)), this, SLOT(handleParamStatusMsgUpdate(QString , int ))); + + paramMgr = NULL; } diff --git a/src/ui/QGCPX4VehicleConfig.cc b/src/ui/QGCPX4VehicleConfig.cc index bddc235b3262a57f8125a5947978b165988efe80..c0de45aa0af59673611e4f02bbcb881e73282d2e 100644 --- a/src/ui/QGCPX4VehicleConfig.cc +++ b/src/ui/QGCPX4VehicleConfig.cc @@ -84,7 +84,8 @@ QGCPX4VehicleConfig::QGCPX4VehicleConfig(QWidget *parent) : //connect(ui->setTrimButton, SIGNAL(clicked()), this, SLOT(setTrimPositions())); //TODO connect buttons here to save/clear actions? - ui->pendingCommitsWidget->initWithUAS(this->mav); + mav = UASManager::instance()->getActiveUAS(); + ui->pendingCommitsWidget->initWithUAS(mav); ui->pendingCommitsWidget->update(); //TODO the following methods are not yet implemented diff --git a/src/ui/QGCParamWidget.cc b/src/ui/QGCParamWidget.cc index 5c095b3bdb28436736c7074b4e272852e3056688..97b0b94adcdd25e7383f6c003c3546346b0aa63f 100644 --- a/src/ui/QGCParamWidget.cc +++ b/src/ui/QGCParamWidget.cc @@ -51,9 +51,12 @@ This file is part of the QGROUNDCONTROL project */ QGCParamWidget::QGCParamWidget(QWidget *parent) : QGCBaseParamWidget(parent), - componentItems(new QMap()) + componentItems(new QMap()), + statusLabel(new QLabel(this)), + tree(new QTreeWidget(this)) { + } @@ -75,9 +78,7 @@ void QGCParamWidget::connectViewSignalsAndSlots() void QGCParamWidget::layoutWidget() { - // Create tree widget - tree = new QTreeWidget(this); - statusLabel = new QLabel(); + statusLabel->setAutoFillBackground(true); // Set tree widget as widget onto this component diff --git a/src/ui/QGCParamWidget.h b/src/ui/QGCParamWidget.h index e009d5082899b3017095b9770cd8435263b14720..3fc34214c0c2eac4a092414885d93987a2ba381a 100644 --- a/src/ui/QGCParamWidget.h +++ b/src/ui/QGCParamWidget.h @@ -88,10 +88,10 @@ public slots: protected: - QTreeWidget* tree; ///< The parameter tree - QLabel* statusLabel; ///< User-facing parameter status label QMap* componentItems; ///< The tree of component items, stored by component ID QMap* > paramGroups; ///< Parameter groups to organize component items + QLabel* statusLabel; ///< User-facing parameter status label + QTreeWidget* tree; ///< The parameter tree }; diff --git a/src/ui/QGCPendingParamWidget.cc b/src/ui/QGCPendingParamWidget.cc index 3230583e022aad846e5f95c4e87993f9298b8dcd..a37e20c7b44c774d9a291e8897985b0f517f5fc5 100644 --- a/src/ui/QGCPendingParamWidget.cc +++ b/src/ui/QGCPendingParamWidget.cc @@ -12,6 +12,7 @@ QGCPendingParamWidget::QGCPendingParamWidget(QObject *parent) : void QGCPendingParamWidget::connectToParamManager() { + paramMgr = mav->getParamManager(); //TODO route via paramManager instead? // Listen to updated param signals from the data model connect(paramMgr->dataModel(), SIGNAL(pendingParamUpdate(int , const QString&, QVariant , bool )), @@ -33,6 +34,8 @@ void QGCPendingParamWidget::disconnectFromParamManager() // Listen to communications status messages so we can display them disconnect(paramMgr, SIGNAL(parameterStatusMsgUpdated(QString,int)), this, SLOT(handleParamStatusMsgUpdate(QString , int ))); + + paramMgr = NULL; }