Fixes #2503: Standalone simulator radio selection display problem
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
<li>Removed constant access to floppy disk (<a href=https://github.com/opentx/opentx/issues/2160>#2160</a>)</li>
|
<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 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>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>
|
</ul>
|
||||||
|
|
||||||
<h2>Version 2.1.0 / 2015-07-16</h2>
|
<h2>Version 2.1.0 / 2015-07-16</h2>
|
||||||
|
|||||||
+12
-21
@@ -123,34 +123,22 @@ int main(int argc, char *argv[])
|
|||||||
registerSimulators();
|
registerSimulators();
|
||||||
registerOpenTxFirmwares();
|
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));
|
eedir = QDir(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation));
|
||||||
if (!eedir.exists("OpenTX")) {
|
if (!eedir.exists("OpenTX")) {
|
||||||
eedir.mkdir("OpenTX");
|
eedir.mkdir("OpenTX");
|
||||||
}
|
}
|
||||||
eedir.cd("OpenTX");
|
eedir.cd("OpenTX");
|
||||||
|
|
||||||
msgBox.exec();
|
QStringList firmwareIds;
|
||||||
|
foreach(SimulatorFactory *factory, registered_simulators) {
|
||||||
QAbstractButton *button = msgBox.clickedButton();
|
firmwareIds << factory->name();
|
||||||
if (button == exitButton) {
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
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;
|
QString radioId;
|
||||||
int pos = firmwareId.indexOf("-");
|
int pos = firmwareId.indexOf("-");
|
||||||
if (pos > 0) {
|
if (pos > 0) {
|
||||||
@@ -169,6 +157,9 @@ int main(int argc, char *argv[])
|
|||||||
else
|
else
|
||||||
dialog = new SimulatorDialog9X(NULL, factory->create());
|
dialog = new SimulatorDialog9X(NULL, factory->create());
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
dialog->show();
|
dialog->show();
|
||||||
dialog->start(eepromFileName.toAscii().constData());
|
dialog->start(eepromFileName.toAscii().constData());
|
||||||
|
|||||||
Reference in New Issue
Block a user