Brings ~55 mod-exclusive files to the upstream-based mod/master-resync branch: Activities (migrated to new ActivityManager pattern): - Clock/Time: SetTimeActivity, SetTimezoneOffsetActivity, NtpSyncActivity - Dictionary: DictionaryDefinitionActivity, DictionarySuggestionsActivity, DictionaryWordSelectActivity, LookedUpWordsActivity - Bookmark: EpubReaderBookmarkSelectionActivity - Book management: BookManageMenuActivity, EndOfBookMenuActivity - OPDS: OpdsServerListActivity, OpdsSettingsActivity - Utility: DirectoryPickerActivity, NumericStepperActivity Utilities (unchanged): - BookManager, BookSettings, BookmarkStore, BootNtpSync - Dictionary, LookupHistory, TimeSync, OpdsServerStore Libraries: PlaceholderCover, TableData, ChapterXPathIndexer Scripts: inject_mod_version, generate_book_icon, preview_placeholder_cover Docs: KOReader sync XPath mapping Migration changes: - ActivityWithSubactivity -> Activity base class - Callback constructors -> finish()/setResult() pattern - enterNewActivity() -> startActivityForResult() - Activity::RenderLock&& -> RenderLock&& These files won't compile yet - they reference mod settings and I18n strings that will be added in subsequent phases. Made-with: Cursor
2.3 KiB
2.3 KiB
OPDS Post-Download Prompt Screen
Task
After an OPDS download completes, instead of immediately returning to the catalog listing, show a prompt screen with two options: "Back to Listing" and "Open Book". A 5-second auto-timer executes the default action. A per-server setting controls which option is default (back to listing by default for backward compatibility).
Changes Made
New i18n strings
lib/I18n/translations/english.yaml— AddedSTR_DOWNLOAD_COMPLETE,STR_OPEN_BOOK,STR_BACK_TO_LISTING,STR_AFTER_DOWNLOAD- Regenerated
lib/I18n/I18nKeys.h,lib/I18n/I18nStrings.cppviagen_i18n.py
Per-server setting
src/OpdsServerStore.h— AddedafterDownloadActionfield toOpdsServer(0 = back to listing, 1 = open book)src/OpdsServerStore.cpp— Serialized/deserializedafter_downloadin JSON
Browser activity
src/activities/browser/OpdsBookBrowserActivity.h— AddedDOWNLOAD_COMPLETEstate,onGoToReadercallback,downloadedFilePath,downloadCompleteTime,promptSelectionmembers,executePromptAction()methodsrc/activities/browser/OpdsBookBrowserActivity.cpp— On download success: transition toDOWNLOAD_COMPLETEstate instead ofBROWSING. Added loop handling (Left/Right to toggle selection, Confirm to execute, Back to go to listing, 5s auto-timer). Added render for prompt screen with bracketed selection UI. AddedexecutePromptAction()helper.
Callback threading
src/main.cpp— PassedonGoToReadercallback toOpdsBookBrowserActivityconstructor in both single-server and multi-server code paths
Settings UI
src/activities/settings/OpdsSettingsActivity.cpp— IncrementedBASE_ITEMSfrom 6 to 7. Added "After Download" field at index 6 (toggles between "Back to Listing" and "Open Book"). Shifted Delete to index 7.
Countdown refinements (follow-up)
- Added live countdown display using
FAST_REFRESH-- shows "(5s)", "(4s)", etc., updating each second - Any button press (Left/Right to change selection, Back, Confirm) cancels the countdown entirely instead of resetting it
- Added
countdownActivebool andlastCountdownSecondint to track state without redundant redraws
Follow-up Items
- Translations for the 4 new strings in non-English languages
- On-device testing of the full flow (download → prompt → open book / back to listing)