diff --git a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp index 346b339ac..50cf64115 100644 --- a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp @@ -36,13 +36,14 @@ #include #include #include +#include #include #include #include "altitudeholdsettings.h" ConfigStabilizationWidget::ConfigStabilizationWidget(QWidget *parent) : ConfigTaskWidget(parent), - boardModel(0) + boardModel(0), m_currentPIDBank(0) { ui = new Ui_StabilizationWidget(); ui->setupUi(this); @@ -227,13 +228,17 @@ void ConfigStabilizationWidget::onBoardConnected() void ConfigStabilizationWidget::pidBankChanged(int index) { + foreach(QTabBar * tabBar, m_pidTabBars) { + disconnect(tabBar, SIGNAL(currentChanged(int)), this, SLOT(pidBankChanged(int))); tabBar->setCurrentIndex(index); + connect(tabBar, SIGNAL(currentChanged(int)), this, SLOT(pidBankChanged(int))); } for(int i = 0; i < m_pidTabBars.at(0)->count(); i++) { setWidgetBindingObjectEnabled(m_pidTabBars.at(0)->tabData(i).toString(), index == i); } + m_currentPIDBank = index; } bool ConfigStabilizationWidget::shouldObjectBeSaved(UAVObject *object) diff --git a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.h b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.h index 895654521..f5331137b 100644 --- a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.h @@ -57,6 +57,7 @@ private: static const int PID_BANKS = 3; int boardModel; + int m_currentPIDBank; protected: QString mapObjectName(const QString objectName);