1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Fix tab order. Switch to using unum for tabs.

This commit is contained in:
zedamota 2011-07-21 15:35:59 +01:00
parent 3bf7dbd7e5
commit 05f6904e09
3 changed files with 20 additions and 20 deletions

View File

@ -69,6 +69,7 @@ ConfigCCHWWidget::ConfigCCHWWidget(QWidget *parent) : ConfigTaskWidget(parent)
ConfigCCHWWidget::~ConfigCCHWWidget()
{
// Do nothing
delete smartsave;
}

View File

@ -64,25 +64,23 @@ ConfigGadgetWidget::ConfigGadgetWidget(QWidget *parent) : QWidget(parent)
QWidget *qwd;
qwd = new DefaultHwSettingsWidget(this);
ftw->insertTab(0, qwd, QIcon(":/configgadget/images/hw_config.svg"), QString("HW Settings"));
ftw->insertTab(ConfigGadgetWidget::hardware, qwd, QIcon(":/configgadget/images/hw_config.svg"), QString("HW Settings"));
qwd = new ConfigAirframeWidget(this);
ftw->insertTab(1, qwd, QIcon(":/configgadget/images/Airframe.png"), QString("Aircraft"));
ftw->insertTab(ConfigGadgetWidget::aircraft, qwd, QIcon(":/configgadget/images/Airframe.png"), QString("Aircraft"));
qwd = new ConfigInputWidget(this);
ftw->insertTab(2, qwd, QIcon(":/configgadget/images/Transmitter.png"), QString("Input"));
ftw->insertTab(ConfigGadgetWidget::input, qwd, QIcon(":/configgadget/images/Transmitter.png"), QString("Input"));
qwd = new ConfigOutputWidget(this);
ftw->insertTab(3, qwd, QIcon(":/configgadget/images/Servo.png"), QString("Output"));
ftw->insertTab(ConfigGadgetWidget::output, qwd, QIcon(":/configgadget/images/Servo.png"), QString("Output"));
qwd = new DefaultAttitudeWidget(this);
ftw->insertTab(4, qwd, QIcon(":/configgadget/images/AHRS-v1.3.png"), QString("INS"));
ftw->insertTab(ConfigGadgetWidget::ins, qwd, QIcon(":/configgadget/images/AHRS-v1.3.png"), QString("INS"));
qwd = new ConfigStabilizationWidget(this);
ftw->insertTab(5, qwd, QIcon(":/configgadget/images/gyroscope.svg"), QString("Stabilization"));
ftw->insertTab(ConfigGadgetWidget::stabilization, qwd, QIcon(":/configgadget/images/gyroscope.svg"), QString("Stabilization"));
qwd = new ConfigProHWWidget(this);
ftw->insertTab(6, qwd, QIcon(":/configgadget/images/XBee.svg"), QString("Telemetry"));
// qwd = new ConfigPipXtremeWidget(this);
@ -132,24 +130,24 @@ void ConfigGadgetWidget::onAutopilotConnect() {
if ((board & 0xff00) == 1024) {
// CopterControl family
// Delete the INS panel, replace with CC Panel:
ftw->setCurrentIndex(0);
ftw->removeTab(3);
ftw->setCurrentIndex(ConfigGadgetWidget::hardware);
ftw->removeTab(ConfigGadgetWidget::ins);
QWidget *qwd = new ConfigCCAttitudeWidget(this);
ftw->insertTab(3, qwd, QIcon(":/configgadget/images/AHRS-v1.3.png"), QString("Attitude"));
ftw->removeTab(0);
ftw->insertTab(ConfigGadgetWidget::ins, qwd, QIcon(":/configgadget/images/AHRS-v1.3.png"), QString("Attitude"));
ftw->removeTab(ConfigGadgetWidget::hardware);
qwd = new ConfigCCHWWidget(this);
ftw->insertTab(0, qwd, QIcon(":/configgadget/images/hw_config.svg"), QString("HW Settings"));
ftw->setCurrentIndex(0);
ftw->insertTab(ConfigGadgetWidget::hardware, qwd, QIcon(":/configgadget/images/hw_config.svg"), QString("HW Settings"));
ftw->setCurrentIndex(ConfigGadgetWidget::hardware);
} else if ((board & 0xff00) == 256 ) {
// Mainboard family
ftw->setCurrentIndex(0);
ftw->removeTab(3);
ftw->setCurrentIndex(ConfigGadgetWidget::hardware);
ftw->removeTab(ConfigGadgetWidget::ins);
QWidget *qwd = new ConfigAHRSWidget(this);
ftw->insertTab(3, qwd, QIcon(":/configgadget/images/AHRS-v1.3.png"), QString("INS"));
ftw->removeTab(0);
ftw->insertTab(ConfigGadgetWidget::ins, qwd, QIcon(":/configgadget/images/AHRS-v1.3.png"), QString("INS"));
ftw->removeTab(ConfigGadgetWidget::hardware);
qwd = new ConfigProHWWidget(this);
ftw->insertTab(0, qwd, QIcon(":/configgadget/images/hw_config.svg"), QString("HW Settings"));
ftw->setCurrentIndex(0);
ftw->insertTab(ConfigGadgetWidget::hardware, qwd, QIcon(":/configgadget/images/hw_config.svg"), QString("HW Settings"));
ftw->setCurrentIndex(ConfigGadgetWidget::hardware);
}
}
emit autopilotConnected();

View File

@ -49,6 +49,7 @@ class ConfigGadgetWidget: public QWidget
public:
ConfigGadgetWidget(QWidget *parent = 0);
~ConfigGadgetWidget();
enum widgetTabs {hardware=0, aircraft, input, output, ins, stabilization};
public slots:
void onAutopilotConnect();