34 lines
2.3 KiB
Markdown
34 lines
2.3 KiB
Markdown
|
|
# 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` — Added `STR_DOWNLOAD_COMPLETE`, `STR_OPEN_BOOK`, `STR_BACK_TO_LISTING`, `STR_AFTER_DOWNLOAD`
|
||
|
|
- Regenerated `lib/I18n/I18nKeys.h`, `lib/I18n/I18nStrings.cpp` via `gen_i18n.py`
|
||
|
|
|
||
|
|
### Per-server setting
|
||
|
|
- `src/OpdsServerStore.h` — Added `afterDownloadAction` field to `OpdsServer` (0 = back to listing, 1 = open book)
|
||
|
|
- `src/OpdsServerStore.cpp` — Serialized/deserialized `after_download` in JSON
|
||
|
|
|
||
|
|
### Browser activity
|
||
|
|
- `src/activities/browser/OpdsBookBrowserActivity.h` — Added `DOWNLOAD_COMPLETE` state, `onGoToReader` callback, `downloadedFilePath`, `downloadCompleteTime`, `promptSelection` members, `executePromptAction()` method
|
||
|
|
- `src/activities/browser/OpdsBookBrowserActivity.cpp` — On download success: transition to `DOWNLOAD_COMPLETE` state instead of `BROWSING`. 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. Added `executePromptAction()` helper.
|
||
|
|
|
||
|
|
### Callback threading
|
||
|
|
- `src/main.cpp` — Passed `onGoToReader` callback to `OpdsBookBrowserActivity` constructor in both single-server and multi-server code paths
|
||
|
|
|
||
|
|
### Settings UI
|
||
|
|
- `src/activities/settings/OpdsSettingsActivity.cpp` — Incremented `BASE_ITEMS` from 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 `countdownActive` bool and `lastCountdownSecond` int 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)
|