Skip to content

Commit

Permalink
Remember device and release selections
Browse files Browse the repository at this point in the history
  • Loading branch information
Risca committed Jun 15, 2015
1 parent 084d628 commit ed5e590
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions installer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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());
}
Expand All @@ -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 */
Expand Down Expand Up @@ -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();

}
Expand Down

0 comments on commit ed5e590

Please sign in to comment.