Complete download integration
This commit is contained in:
@@ -24,6 +24,7 @@ STR_EMPTY_FILE: "Empty file"
|
||||
STR_OUT_OF_BOUNDS: "Out of bounds"
|
||||
STR_LOADING: "Loading..."
|
||||
STR_LOADING_POPUP: "Loading"
|
||||
STR_LOADING_FONT_LIST: "Loading font list..."
|
||||
STR_WIFI_NETWORKS: "WiFi Networks"
|
||||
STR_NO_NETWORKS: "No networks found"
|
||||
STR_NETWORKS_FOUND: "%zu networks found"
|
||||
@@ -99,6 +100,9 @@ STR_CREATE_FALLBACK_FOR_INVALID_TOC: "Create fallback for invalid TOC"
|
||||
STR_ORIENTATION: "Reading Orientation"
|
||||
STR_LONG_PRESS_SKIP: "Long-press Chapter Skip"
|
||||
STR_FONT_FAMILY: "Reader Font Family"
|
||||
STR_FONT_DOWNLOAD: "Font Download"
|
||||
STR_FONT_INSTALLED: "Font installed!"
|
||||
STR_FONT_INSTALL_FAILED: "Font installation failed"
|
||||
STR_FONT_SIZE: "Reader Font Size"
|
||||
STR_LINE_SPACING: "Reader Line Spacing"
|
||||
STR_SCREEN_MARGIN: "Reader Screen Margin"
|
||||
@@ -181,6 +185,9 @@ STR_REGISTER_SUCCESS: "Account created successfully!"
|
||||
STR_REGISTER_FAILED: "Registration failed"
|
||||
STR_USERNAME_TAKEN: "Username already taken"
|
||||
STR_DONE: "Done"
|
||||
STR_INSTALLED: "Installed"
|
||||
STR_DOWNLOAD_ALL: "Download / Update All"
|
||||
STR_UPDATE_AVAILABLE: "Update"
|
||||
STR_CLEAR_CACHE_WARNING_1: "This will clear all cached book data."
|
||||
STR_CLEAR_CACHE_WARNING_2: "All reading progress will be lost!"
|
||||
STR_CLEAR_CACHE_WARNING_3: "Books will need to be re-indexed"
|
||||
@@ -242,6 +249,7 @@ STR_POWER_ON_HINT: "Press and hold power button to turn back on"
|
||||
STR_NO_ENTRIES: "No entries found"
|
||||
STR_DOWNLOADING: "Downloading..."
|
||||
STR_DOWNLOAD_FAILED: "Download failed"
|
||||
STR_NO_FONTS_AVAILABLE: "No fonts available"
|
||||
STR_ERROR_MSG: "Error:"
|
||||
STR_UNNAMED: "Unnamed"
|
||||
STR_NO_SERVER_URL: "No server URL configured"
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "ClearCacheActivity.h"
|
||||
#include "ClockSettingsActivity.h"
|
||||
#include "DetectTimezoneActivity.h"
|
||||
#include "FontDownloadActivity.h"
|
||||
#include "KOReaderSettingsActivity.h"
|
||||
#include "LanguageSelectActivity.h"
|
||||
#include "OpdsServerListActivity.h"
|
||||
@@ -21,6 +22,8 @@ std::unique_ptr<Activity> createActivityForAction(SettingAction action, GfxRende
|
||||
return std::make_unique<ButtonRemapActivity>(renderer, mappedInput);
|
||||
case SettingAction::CustomiseStatusBar:
|
||||
return std::make_unique<StatusBarSettingsActivity>(renderer, mappedInput);
|
||||
case SettingAction::DownloadFonts:
|
||||
return std::make_unique<FontDownloadActivity>(renderer, mappedInput);
|
||||
case SettingAction::ClockSettings:
|
||||
return std::make_unique<ClockSettingsActivity>(renderer, mappedInput);
|
||||
case SettingAction::KOReaderSync:
|
||||
|
||||
@@ -15,6 +15,7 @@ enum class SettingAction {
|
||||
None,
|
||||
RemapFrontButtons,
|
||||
CustomiseStatusBar,
|
||||
DownloadFonts,
|
||||
ClockSettings,
|
||||
KOReaderSync,
|
||||
OPDSBrowser,
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <cstring>
|
||||
|
||||
#include "CrossPointSettings.h"
|
||||
#include "FontSelectionActivity.h"
|
||||
#include "MappedInputManager.h"
|
||||
#include "SettingActionDispatch.h"
|
||||
#include "SettingsList.h"
|
||||
@@ -96,6 +97,9 @@ void SettingsActivity::onEnter() {
|
||||
|
||||
addToMoved(readerSettings, lastReaderSub,
|
||||
SettingInfo::Action(StrId::STR_CUSTOMISE_STATUS_BAR, SettingAction::CustomiseStatusBar));
|
||||
addToMoved(readerSettings, lastReaderSub,
|
||||
std::move(SettingInfo::Action(StrId::STR_FONT_DOWNLOAD, SettingAction::DownloadFonts)
|
||||
.withSubcategory(StrId::STR_MENU_READER_FONT)));
|
||||
|
||||
addToMoved(systemSettings, lastSystemSub, SettingInfo::Action(StrId::STR_LANGUAGE, SettingAction::Language));
|
||||
addToMoved(systemSettings, lastSystemSub,
|
||||
@@ -107,6 +111,9 @@ void SettingsActivity::onEnter() {
|
||||
addToMoved(systemSettings, lastSystemSub,
|
||||
std::move(SettingInfo::Action(StrId::STR_OPDS_BROWSER, SettingAction::OPDSBrowser)
|
||||
.withSubcategory(StrId::STR_MENU_SYS_NETWORK)));
|
||||
addToMoved(systemSettings, lastSystemSub,
|
||||
std::move(SettingInfo::Action(StrId::STR_FONT_DOWNLOAD, SettingAction::DownloadFonts)
|
||||
.withSubcategory(StrId::STR_MENU_SYS_NETWORK)));
|
||||
addToMoved(systemSettings, lastSystemSub,
|
||||
std::move(SettingInfo::Action(StrId::STR_CLOCK_SETTINGS, SettingAction::ClockSettings)
|
||||
.withSubcategory(StrId::STR_MENU_SYS_TOOLS)));
|
||||
@@ -227,6 +234,15 @@ void SettingsActivity::toggleCurrentSetting() {
|
||||
const auto& setting = (*currentSettings)[selectedSetting];
|
||||
if (setting.isSeparator) return;
|
||||
|
||||
if (setting.type == SettingType::ENUM && setting.nameId == StrId::STR_FONT_FAMILY) {
|
||||
startActivityForResult(std::make_unique<FontSelectionActivity>(renderer, mappedInput),
|
||||
[this](const ActivityResult&) {
|
||||
SETTINGS.saveToFile();
|
||||
needsHalfRefresh = true;
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (setting.type == SettingType::ACTION) {
|
||||
auto resultHandler = [this](const ActivityResult& result) {
|
||||
SETTINGS.saveToFile();
|
||||
|
||||
Reference in New Issue
Block a user