diff --git a/files/styles/style-dark.css b/files/styles/style-dark.css index 0818591..26b6825 100644 --- a/files/styles/style-dark.css +++ b/files/styles/style-dark.css @@ -408,6 +408,15 @@ QPushButton#viewModeGeneric, QPushButton#viewModePX4, QPushButton#viewModeAPM, Q border: 3px solid #465158; } +QPushButton#magButton, QPushButton#gyroButton, QPushButton#accelButton { + background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #73D95D, stop: 1 #18A154); + border-radius: 8px; + min-height: 30px; + max-height: 50px; + min-width: 60px; + border: 3px solid #465158; +} + QWidget#containerWidget { background-color: qlineargradient(spread:pad, x1:0.527222, y1:0.961, x2:0.536946, y2:0.198864, stop:0.103448 rgba(65, 65, 65, 255), stop:1 rgba(119, 119, 119, 255)); border-radius: 16px; diff --git a/src/ui/px4_configuration/QGCPX4AirframeConfig.cc b/src/ui/px4_configuration/QGCPX4AirframeConfig.cc index 4f3ecd2..e4de511 100644 --- a/src/ui/px4_configuration/QGCPX4AirframeConfig.cc +++ b/src/ui/px4_configuration/QGCPX4AirframeConfig.cc @@ -46,20 +46,31 @@ QGCPX4AirframeConfig::QGCPX4AirframeConfig(QWidget *parent) : connect(ui->quadPlusPushButton, SIGNAL(clicked()), this, SLOT(quadPlusSelected())); connect(ui->quadPlusComboBox, SIGNAL(activated(int)), this, SLOT(quadPlusSelected(int))); + ui->quadPlusPushButton->setEnabled(ui->quadPlusComboBox->count() > 0); + connect(ui->hexaXPushButton, SIGNAL(clicked()), this, SLOT(hexaXSelected())); connect(ui->hexaXComboBox, SIGNAL(activated(int)), this, SLOT(hexaXSelected(int))); + ui->hexaXPushButton->setEnabled(ui->hexaXComboBox->count() > 0); + connect(ui->hexaPlusPushButton, SIGNAL(clicked()), this, SLOT(hexaPlusSelected())); connect(ui->hexaPlusComboBox, SIGNAL(activated(int)), this, SLOT(hexaPlusSelected(int))); + ui->hexaPlusPushButton->setEnabled(ui->hexaPlusComboBox->count() > 0); + connect(ui->octoXPushButton, SIGNAL(clicked()), this, SLOT(octoXSelected())); connect(ui->octoXComboBox, SIGNAL(activated(int)), this, SLOT(octoXSelected(int))); + ui->octoXPushButton->setEnabled(ui->octoXComboBox->count() > 0); + connect(ui->octoPlusPushButton, SIGNAL(clicked()), this, SLOT(octoPlusSelected())); connect(ui->octoPlusComboBox, SIGNAL(activated(int)), this, SLOT(octoPlusSelected(int))); - - connect(ui->hComboBox, SIGNAL(activated(int)), this, SLOT(hSelected(int))); + ui->octoPlusPushButton->setEnabled(ui->octoPlusComboBox->count() > 0); ui->hComboBox->addItem(tr("TBS Discovery"), 15); ui->hComboBox->addItem(tr("H Custom"), 16); + connect(ui->hPushButton, SIGNAL(clicked()), this, SLOT(hSelected())); + connect(ui->hComboBox, SIGNAL(activated(int)), this, SLOT(hSelected(int))); + ui->hPushButton->setEnabled(ui->hComboBox->count() > 0); + connect(ui->applyButton, SIGNAL(clicked()), this, SLOT(applyAndReboot())); connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setActiveUAS(UASInterface*))); @@ -123,9 +134,6 @@ void QGCPX4AirframeConfig::setAirframeID(int id) qDebug() << "setAirframeID" << id; ui->statusLabel->setText(tr("Start script ID: #%1").arg(id)); - if (selectedId == id) - return; - selectedId = id; // XXX too much boilerplate code here - this widget is really just @@ -223,6 +231,7 @@ void QGCPX4AirframeConfig::applyAndReboot() configState = CONFIG_STATE_SEND; QTimer::singleShot(200, this, SLOT(checkConfigState())); + setEnabled(false); } void QGCPX4AirframeConfig::checkConfigState() @@ -269,6 +278,7 @@ void QGCPX4AirframeConfig::checkConfigState() if (progress->wasCanceled()) { configState = CONFIG_STATE_ABORT; + setEnabled(true); pendingParams = 0; return; } @@ -300,6 +310,13 @@ void QGCPX4AirframeConfig::checkConfigState() progress = new QProgressDialog("Waiting for autopilot reboot", "Abort", 0, pendingMax, this); progress->setWindowModality(Qt::WindowModal); qDebug() << "Waiting for reboot, pending" << pendingParams; + } else { + if (progress->wasCanceled()) { + configState = CONFIG_STATE_ABORT; + setEnabled(true); + pendingParams = 0; + return; + } } if (pendingParams == 3) { @@ -334,6 +351,7 @@ void QGCPX4AirframeConfig::checkConfigState() progress->setValue(pendingMax); configState = CONFIG_STATE_ABORT; pendingParams = 0; + setEnabled(true); return; } qDebug() << "PENDING PARAMS REBOOT AFTER:" << pendingParams; diff --git a/src/ui/px4_configuration/QGCPX4AirframeConfig.ui b/src/ui/px4_configuration/QGCPX4AirframeConfig.ui index 045df39..245c374 100644 --- a/src/ui/px4_configuration/QGCPX4AirframeConfig.ui +++ b/src/ui/px4_configuration/QGCPX4AirframeConfig.ui @@ -33,7 +33,7 @@ 0 - -291 + 0 762 647 diff --git a/src/ui/px4_configuration/QGCPX4SensorCalibration.cc b/src/ui/px4_configuration/QGCPX4SensorCalibration.cc index e202df0..1fbea1f 100644 --- a/src/ui/px4_configuration/QGCPX4SensorCalibration.cc +++ b/src/ui/px4_configuration/QGCPX4SensorCalibration.cc @@ -21,6 +21,7 @@ QGCPX4SensorCalibration::QGCPX4SensorCalibration(QWidget *parent) : accelAxes << "z+"; accelAxes << "z-"; + ui->setupUi(this); connect(clearAction, SIGNAL(triggered()), ui->textView, SLOT(clear()));