feat: Allow OTA update to beta releases
This commit is contained in:
@@ -141,6 +141,9 @@ void OtaUpdateActivity::render(RenderLock&&) {
|
||||
case OtaUpdater::OOM_ERROR:
|
||||
reason = "Out of memory";
|
||||
break;
|
||||
case OtaUpdater::METADATA_TOO_LARGE_ERROR:
|
||||
reason = tr(STR_RELEASE_METADATA_TOO_LARGE);
|
||||
break;
|
||||
case OtaUpdater::INTERNAL_UPDATE_ERROR:
|
||||
reason = "Internal update error";
|
||||
break;
|
||||
|
||||
@@ -64,6 +64,8 @@ void SettingsActivity::onEnter() {
|
||||
|
||||
bool sawReaderFontSection = false;
|
||||
bool insertedFontDownload = false;
|
||||
bool sawIncludeBetaUpdates = false;
|
||||
SettingInfo includeBetaUpdatesSetting{};
|
||||
|
||||
auto insertFontDownloadBelowFontSection = [&]() {
|
||||
auto fontDownload = SettingInfo::Action(StrId::STR_FONT_DOWNLOAD, SettingAction::DownloadFonts);
|
||||
@@ -88,6 +90,11 @@ void SettingsActivity::onEnter() {
|
||||
enriched.enumLabels.reserve(n);
|
||||
for (uint8_t i = 0; i < n; i++) enriched.enumLabels.push_back(fontFamilyOptionLabel(i));
|
||||
}
|
||||
if (enriched.nameId == StrId::STR_INCLUDE_BETA_UPDATES) {
|
||||
includeBetaUpdatesSetting = enriched;
|
||||
sawIncludeBetaUpdates = true;
|
||||
continue;
|
||||
}
|
||||
const bool isReaderFontEntry =
|
||||
enriched.category == StrId::STR_CAT_READER && (enriched.subcategory == StrId::STR_MENU_READER_FONT ||
|
||||
enriched.submenu == StrId::STR_MENU_READER_FONT_SETTINGS);
|
||||
@@ -150,6 +157,10 @@ void SettingsActivity::onEnter() {
|
||||
addToMoved(systemSettings, lastSystemSub,
|
||||
std::move(SettingInfo::Action(StrId::STR_CHECK_UPDATES, SettingAction::CheckForUpdates)
|
||||
.withSubcategory(StrId::STR_MENU_SYS_SYSTEM)));
|
||||
if (sawIncludeBetaUpdates) {
|
||||
addToMoved(systemSettings, lastSystemSub,
|
||||
std::move(includeBetaUpdatesSetting.withSubcategory(StrId::STR_MENU_SYS_SYSTEM)));
|
||||
}
|
||||
addToMoved(systemSettings, lastSystemSub,
|
||||
std::move(SettingInfo::Action(StrId::STR_SD_FIRMWARE_UPDATE, SettingAction::SdFirmwareUpdate)
|
||||
.withSubcategory(StrId::STR_MENU_SYS_SYSTEM)));
|
||||
|
||||
Reference in New Issue
Block a user