Fix tricky access to Horus settings (#4094)

This commit is contained in:
3djc
2016-12-04 12:18:57 +01:00
committed by Bertrand Songis
parent 3cd139b906
commit 119f3ef88c
2 changed files with 12 additions and 6 deletions
+9 -3
View File
@@ -49,6 +49,9 @@ ModelEdit::ModelEdit(QWidget * parent, RadioData & radioData, int modelId, Firmw
setWindowIcon(CompanionIcon("edit.png")); setWindowIcon(CompanionIcon("edit.png"));
restoreGeometry(g.modelEditGeo()); restoreGeometry(g.modelEditGeo());
ui->pushButton->setIcon(CompanionIcon("simulate.png")); ui->pushButton->setIcon(CompanionIcon("simulate.png"));
if(GetCurrentFirmware()->getBoard() == BOARD_HORUS && !HORUS_READY_FOR_RELEASE()) {
ui->pushButton->setEnabled(false);
}
SetupPanel * setupPanel = new SetupPanel(this, model, generalSettings, firmware); SetupPanel * setupPanel = new SetupPanel(this, model, generalSettings, firmware);
addTab(setupPanel, tr("Setup")); addTab(setupPanel, tr("Setup"));
if (firmware->getCapability(Heli)) if (firmware->getCapability(Heli))
@@ -107,7 +110,12 @@ void ModelEdit::on_tabWidget_currentChanged(int index)
void ModelEdit::on_pushButton_clicked() void ModelEdit::on_pushButton_clicked()
{ {
launchSimulation(); if (GetCurrentFirmware()->getBoard() == BOARD_HORUS && !HORUS_READY_FOR_RELEASE()) {
QMessageBox::warning(this, "Unavailable", "Horus simulation not currently supported within Companion");
}
else {
launchSimulation();
}
} }
void ModelEdit::launchSimulation() void ModelEdit::launchSimulation()
@@ -118,5 +126,3 @@ void ModelEdit::launchSimulation()
startSimulation(this, *simuData, 0); startSimulation(this, *simuData, 0);
delete simuData; delete simuData;
} }
+1 -1
View File
@@ -200,7 +200,7 @@ int main(int argc, char *argv[])
showMessage(QObject::tr("ERROR: Simulator %1 not found").arg(firmwareId), QMessageBox::Critical); showMessage(QObject::tr("ERROR: Simulator %1 not found").arg(firmwareId), QMessageBox::Critical);
return 2; return 2;
} }
if (factory->type() == BOARD_HORUS && HORUS_READY_FOR_RELEASE()) if (factory->type() == BOARD_HORUS)
dialog = new SimulatorDialogHorus(NULL, factory->create()); dialog = new SimulatorDialogHorus(NULL, factory->create());
else if (factory->type() == BOARD_FLAMENCO) else if (factory->type() == BOARD_FLAMENCO)
dialog = new SimulatorDialogFlamenco(NULL, factory->create()); dialog = new SimulatorDialogFlamenco(NULL, factory->create());