diff --git a/installer.cpp b/installer.cpp index 03c140e..6d2ab57 100644 --- a/installer.cpp +++ b/installer.cpp @@ -141,6 +141,7 @@ void Installer::parseAndSetSupportedDevices(const QByteArray &data) qDebug() << "Devices:" << data; SimpleJsonParser parser(data); + QString previouslySelectedDevice = ui->deviceSelectBox->currentText(); ui->deviceSelectBox->clear(); JsonArray devices = parser.getJsonArray(); @@ -151,6 +152,12 @@ void Installer::parseAndSetSupportedDevices(const QByteArray &data) ui->deviceSelectBox->insertItem(0, deviceName ,deviceId); } + int idx = ui->deviceSelectBox->findText(previouslySelectedDevice, + Qt::MatchFixedString); + if (idx >= 0) { + ui->deviceSelectBox->setCurrentIndex(idx); + } + reset(); getDeviceReleases(ui->deviceSelectBox->currentIndex()); } @@ -160,6 +167,7 @@ void Installer::parseAndSetLinks(const QByteArray &data) SimpleJsonParser parser(data); qDebug()<< "Links:" << data; + QString previouslySelectedRelease = ui->releaseLinks->currentText(); ui->releaseLinks->clear(); /* Clear all release notes */ @@ -187,6 +195,12 @@ void Installer::parseAndSetLinks(const QByteArray &data) ui->releaseNotes->insertWidget(0, releaseNotesEdit); } + int idx = ui->releaseLinks->findText(previouslySelectedRelease, + Qt::MatchFixedString); + if (idx >= 0) { + ui->releaseLinks->setCurrentIndex(idx); + } + reset(); }