Fixes #2503: Standalone simulator radio selection display problem

This commit is contained in:
Damjan Adamic
2015-07-19 13:19:38 +02:00
parent 2e252aacac
commit 41d0675886
2 changed files with 13 additions and 21 deletions
+1
View File
@@ -8,6 +8,7 @@
<li>Removed constant access to floppy disk (<a href=https://github.com/opentx/opentx/issues/2160>#2160</a>)</li>
<li>Telemetry view script combo box list was empty (<a href=https://github.com/opentx/opentx/issues/2465>#2465</a>)</li>
<li>Telemetry view bars ranges not transfered to radio (<a href=https://github.com/opentx/opentx/issues/2491>#2491</a>)</li>
<li>Fixed Standalone simulator radio selection display problem (<a href=https://github.com/opentx/opentx/issues/2503>#2503</a>)</li>
</ul>
<h2>Version 2.1.0 / 2015-07-16</h2>
+12 -21
View File
@@ -123,34 +123,22 @@ int main(int argc, char *argv[])
registerSimulators();
registerOpenTxFirmwares();
QMessageBox msgBox;
msgBox.setWindowTitle("Radio type");
msgBox.setText("Which radio type do you want to simulate?");
msgBox.setIcon(QMessageBox::Question);
foreach(SimulatorFactory *factory, registered_simulators) {
QPushButton *button = msgBox.addButton(factory->name(), QMessageBox::ActionRole);
button->adjustSize();
button->setProperty("name", factory->name());
}
msgBox.adjustSize();
QPushButton *exitButton = msgBox.addButton(QMessageBox::Close);
eedir = QDir(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation));
if (!eedir.exists("OpenTX")) {
eedir.mkdir("OpenTX");
}
eedir.cd("OpenTX");
msgBox.exec();
QAbstractButton *button = msgBox.clickedButton();
if (button == exitButton) {
return 0;
QStringList firmwareIds;
foreach(SimulatorFactory *factory, registered_simulators) {
firmwareIds << factory->name();
}
else {
QString firmwareId = button->property("name").toString();
bool ok;
QString firmwareId = QInputDialog::getItem(0, QObject::tr("Radio type"),
QObject::tr("Which radio type do you want to simulate?"),
firmwareIds, 0, false, &ok);
if (ok && !firmwareId.isEmpty()) {
QString radioId;
int pos = firmwareId.indexOf("-");
if (pos > 0) {
@@ -169,6 +157,9 @@ int main(int argc, char *argv[])
else
dialog = new SimulatorDialog9X(NULL, factory->create());
}
else {
return 0;
}
dialog->show();
dialog->start(eepromFileName.toAscii().constData());