Inform on channel / radio not available (#6574)
Inform on channel / radio not available
This commit is contained in:
committed by
Bertrand Songis
parent
50d00c2997
commit
90f933aab1
@@ -340,6 +340,15 @@ void MainWindow::checkForCompanionUpdateFinished(QNetworkReply * reply)
|
||||
closeUpdatesWaitDialog();
|
||||
|
||||
QString version = seekCodeString(qba, "VERSION");
|
||||
const QString errorString = seekCodeString(qba, "ERROR");
|
||||
|
||||
if (errorString == "NO_RC")
|
||||
return onUpdatesError(tr("No Companion release candidates are currently being served for this version, please switch release channel"));
|
||||
else if (errorString == "NO_NIGHTLY")
|
||||
return onUpdatesError(tr("No nightly Companion builds are currently being served for this version, please switch release channel"));
|
||||
else if (errorString == "NO_RELEASE")
|
||||
return onUpdatesError(tr("No Companion release builds are currently being served for this version, please switch release channel"));
|
||||
|
||||
if (version.isNull())
|
||||
return onUpdatesError(tr("Companion update check failed, new version information not found."));
|
||||
|
||||
@@ -456,7 +465,45 @@ void MainWindow::checkForFirmwareUpdateFinished(QNetworkReply * reply)
|
||||
|
||||
const QString versionString = seekCodeString(qba, "VERSION");
|
||||
const QString dateString = seekCodeString(qba, "DATE");
|
||||
const QString errorString = seekCodeString(qba, "ERROR");
|
||||
const QString blockedRadios = seekCodeString(qba, "BLOCK");
|
||||
long version;
|
||||
|
||||
if (errorString == "NO_RC")
|
||||
return onUpdatesError(tr("No firmware release candidates are currently being served for this version, please switch release channel"));
|
||||
else if (errorString == "NO_NIGHTLY")
|
||||
return onUpdatesError(tr("No firmware nightly builds are currently being served for this version, please switch release channel"));
|
||||
else if (errorString == "NO_RELEASE")
|
||||
return onUpdatesError(tr("No firmware release builds are currently being served for this version, please switch release channel"));
|
||||
else if (errorString == "MOVE_TO_RC") {
|
||||
QMessageBox msgbox;
|
||||
msgbox.setIcon(QMessageBox::Question);
|
||||
msgbox.setText(tr("Release candidate builds are now available for this version, would you like to switch to using them?"));
|
||||
msgbox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
||||
msgbox.setDefaultButton(QMessageBox::Yes);
|
||||
|
||||
if(msgbox.exec() == QMessageBox::Yes) {
|
||||
g.OpenTxBranch(AppData::DownloadBranchType(AppData::BRANCH_RC_TESTING));
|
||||
return onUpdatesError(tr("Channel changed to RC, please restart the download process"));
|
||||
}
|
||||
}
|
||||
else if (errorString == "MOVE_TO_RELEASE") {
|
||||
QMessageBox msgbox;
|
||||
msgbox.setIcon(QMessageBox::Question);
|
||||
msgbox.setText(tr("Official release builds are now available for this version, would you like to switch to using them?"));
|
||||
msgbox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
||||
msgbox.setDefaultButton(QMessageBox::Yes);
|
||||
|
||||
if(msgbox.exec() == QMessageBox::Yes) {
|
||||
g.OpenTxBranch(AppData::DownloadBranchType(AppData::BRANCH_RELEASE_STABLE));
|
||||
return onUpdatesError(tr("Channel changed to Release, please restart the download process"));
|
||||
}
|
||||
}
|
||||
|
||||
QString variant = Firmware::getCurrentVariant()->getId();
|
||||
QStringList splitId = variant.split("-");
|
||||
if (blockedRadios.contains(splitId.value(1)))
|
||||
return onUpdatesError(tr("This radio (%1) is not currently available in this firmware release channel").arg(getCurrentFirmware()->getName()));
|
||||
|
||||
if (versionString.isNull() || dateString.isNull() || (version = version2index(versionString)) <= 0)
|
||||
return onUpdatesError(tr("Firmware update check failed, new version information not found or invalid."));
|
||||
|
||||
Reference in New Issue
Block a user