mirror of
https://github.com/opentx/opentx.git
synced 2025-07-25 01:05:10 +03:00
Dialog for choosing radio type, separate eeprom file for each type
This commit is contained in:
parent
78f36a02b4
commit
db7034b150
1 changed files with 18 additions and 2 deletions
|
@ -101,17 +101,33 @@ int main(int argc, char *argv[])
|
|||
|
||||
RegisterFirmwares();
|
||||
SimulatorDialog *dialog;
|
||||
char * eepromFileName;
|
||||
|
||||
if (argc > 1 && !strcmp(argv[1], "taranis")) {
|
||||
QMessageBox msgBox;
|
||||
msgBox.setWindowTitle("Radio type");
|
||||
msgBox.setText("Which radio type do you want to simulate?");
|
||||
msgBox.setIcon(QMessageBox::Question);
|
||||
QAbstractButton *taranisButton = msgBox.addButton("Taranis", QMessageBox::ActionRole);
|
||||
QAbstractButton *stdButton = msgBox.addButton("9X", QMessageBox::ActionRole);
|
||||
QPushButton *exitButton = msgBox.addButton(QMessageBox::Close);
|
||||
|
||||
msgBox.exec();
|
||||
|
||||
if (msgBox.clickedButton() == exitButton)
|
||||
return 0;
|
||||
|
||||
if (msgBox.clickedButton() == taranisButton) {
|
||||
current_firmware_variant = GetFirmwareVariant("opentx-taranis-en");
|
||||
eepromFileName = "eeprom-taranis.bin";
|
||||
dialog = new SimulatorDialogTaranis();
|
||||
}
|
||||
else {
|
||||
eepromFileName = "eeprom-9x.bin";
|
||||
dialog = new SimulatorDialog9X();
|
||||
}
|
||||
|
||||
dialog->show();
|
||||
dialog->start("eeprom.bin");
|
||||
dialog->start(eepromFileName);
|
||||
|
||||
int result = app.exec();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue