feat: replace Delete Book Cache with Manage Book in reader menu

EpubReaderMenuActivity now shows "Manage Book" instead of "Delete
Book Cache". Selecting it opens BookManageMenuActivity as a sub-activity
with Archive, Delete, Delete Cache, and Reindex options. New menu
actions (ARCHIVE_BOOK, DELETE_BOOK, REINDEX_BOOK, REINDEX_BOOK_FULL)
are forwarded to EpubReaderActivity and handled via BookManager.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cottongin
2026-02-21 03:02:30 -05:00
parent 1c19899aa3
commit f5b708424d
3 changed files with 79 additions and 2 deletions

View File

@@ -19,6 +19,7 @@
#include "RecentBooksStore.h"
#include "components/UITheme.h"
#include "fontIds.h"
#include "util/BookManager.h"
#include "util/BookmarkStore.h"
#include "util/Dictionary.h"
@@ -264,7 +265,7 @@ void EpubReaderActivity::loop() {
exitActivity();
enterNewActivity(new EpubReaderMenuActivity(
this->renderer, this->mappedInput, epub->getTitle(), currentPage, totalPages, bookProgressPercent,
SETTINGS.orientation, SETTINGS.fontSize, hasDictionary, isBookmarked, epub->getCachePath(),
SETTINGS.orientation, SETTINGS.fontSize, hasDictionary, isBookmarked, epub->getCachePath(), epub->getPath(),
[this](const uint8_t orientation, const uint8_t fontSize) { onReaderMenuBack(orientation, fontSize); },
[this](EpubReaderMenuActivity::MenuAction action) { onReaderMenuConfirm(action); }));
}
@@ -712,6 +713,36 @@ void EpubReaderActivity::onReaderMenuConfirm(EpubReaderMenuActivity::MenuAction
pendingGoHome = true;
break;
}
case EpubReaderMenuActivity::MenuAction::ARCHIVE_BOOK: {
if (epub) {
BookManager::archiveBook(epub->getPath());
}
pendingGoHome = true;
break;
}
case EpubReaderMenuActivity::MenuAction::DELETE_BOOK: {
if (epub) {
BookManager::deleteBook(epub->getPath());
}
pendingGoHome = true;
break;
}
case EpubReaderMenuActivity::MenuAction::MANAGE_BOOK:
break;
case EpubReaderMenuActivity::MenuAction::REINDEX_BOOK: {
if (epub) {
BookManager::reindexBook(epub->getPath(), false);
}
pendingGoHome = true;
break;
}
case EpubReaderMenuActivity::MenuAction::REINDEX_BOOK_FULL: {
if (epub) {
BookManager::reindexBook(epub->getPath(), true);
}
pendingGoHome = true;
break;
}
case EpubReaderMenuActivity::MenuAction::SYNC: {
if (KOREADER_STORE.hasCredentials()) {
const int currentPage = section ? section->currentPage : 0;