Inform on channel / radio not available (#6574)

Inform on channel / radio not available
This commit is contained in:
Andre Bernet
2019-07-22 15:00:17 +02:00
committed by Bertrand Songis
parent 50d00c2997
commit 90f933aab1
2 changed files with 49 additions and 0 deletions
+47
View File
@@ -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."));
+2
View File
@@ -34,6 +34,8 @@ echo "Build firmware stamps"
docker run -dit --name companion -v /home/opentx/${docker}:/opentx ${docker}
docker exec companion sh -c "mkdir -p build && cd build && cmake /opentx/code && cp radio/src/stamp.h /opentx/binaries/stamp-opentx.txt"
cp -f ${workdir}/binaries/stamp-opentx.txt ${output}/firmware
# These radios are currently not enabled
echo "#define BLOCK \"x9d,x9d+,x9e,x10,x12s\"" >> ${output}/firmware/stamp-opentx.txt
docker exec companion rm -rf build
echo "Check if Linux companion is needed"