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.9 KiB
2.9 KiB
Clock Persistence, Size Setting, and Timezone Support
Task Description
Implemented the plan from clock_settings_and_timezone_fd0bf03f.plan.md covering three features:
- Fix homeScreenClock setting not persisting across reboots
- Add clock size setting (Small/Medium/Large)
- Add timezone selection with North American presets and custom UTC offset
Changes Made
1. Fix Persistence Bug
src/CrossPointSettings.cpp: Removed stale legacysleepScreenGradientDirread (lines 270-271) fromloadFromFile()that was causing a one-byte deserialization offset, corruptingpreferredPortrait,preferredLandscape, andhomeScreenClock.
2. Clock Size Setting
src/CrossPointSettings.h: AddedCLOCK_SIZEenum (SMALL/MEDIUM/LARGE) anduint8_t clockSizefield.src/CrossPointSettings.cpp: AddedclockSizetowriteSettings()andloadFromFile()serialization.src/SettingsList.h: Added clock size enum setting in Display category.lib/I18n/I18nKeys.h: AddedSTR_CLOCK_SIZE,STR_CLOCK_SIZE_SMALL,STR_CLOCK_SIZE_MEDIUM,STR_CLOCK_SIZE_LARGE.- All 8 YAML translation files: Added clock size strings.
src/components/themes/BaseTheme.cppandsrc/components/themes/lyra/LyraTheme.cpp: UpdateddrawHeader()to select font (SMALL_FONT_ID / UI_10_FONT_ID / UI_12_FONT_ID) based onclockSizesetting.
3. Timezone Support
src/CrossPointSettings.h: AddedTIMEZONEenum (UTC, Eastern, Central, Mountain, Pacific, Alaska, Hawaii, Custom),uint8_t timezoneandint8_t timezoneOffsetHoursfields, andgetTimezonePosixStr()declaration.src/CrossPointSettings.cpp: Added timezone/offset serialization, validation (-12 to +14), andgetTimezonePosixStr()implementation returning POSIX TZ strings (including DST rules for NA timezones).lib/I18n/I18nKeys.h+ all YAML files: Added timezone strings and "Set UTC Offset" label.src/SettingsList.h: Added timezone enum setting in Display category.src/activities/settings/SetTimezoneOffsetActivity.h/.cpp(new files): UTC offset picker activity (-12 to +14), using same UI pattern asSetTimeActivity.src/activities/settings/SettingsActivity.h: AddedSetTimezoneOffsettoSettingActionenum.src/activities/settings/SettingsActivity.cpp: Added include, action entry, handler for SetTimezoneOffset, andsetenv/tzsetcall after every settings save.src/main.cpp: Apply saved timezone viasetenv/tzseton boot afterSETTINGS.loadFromFile().src/util/TimeSync.cpp: Apply timezone before starting NTP sync so time displays correctly.
Build Status
Firmware builds successfully (99.5% flash usage).
Follow-up Items
- Test on device: verify clock persistence, size changes, timezone selection, and custom UTC offset picker.
- Timezone strings use English fallbacks for non-English languages.