mirror of
https://github.com/YACReader/yacreader
synced 2025-06-03 17:18:23 -04:00
Implement LibraryWindow::showContinueReadingContextMenu
This commit is contained in:
parent
60c650d820
commit
ebcb3d8a91
@ -1864,7 +1864,27 @@ void LibraryWindow::showGridFoldersContextMenu(QPoint point, Folder folder)
|
||||
|
||||
void LibraryWindow::showContinueReadingContextMenu(QPoint point, ComicDB comic)
|
||||
{
|
||||
qDebug() << "openContinueReadingComicContextMenu" << comic.name;
|
||||
QMenu menu;
|
||||
|
||||
auto setAsUnReadAction = new QAction();
|
||||
setAsUnReadAction->setText(tr("Set as unread"));
|
||||
setAsUnReadAction->setIcon(QIcon(":/images/comics_view_toolbar/setUnread.png"));
|
||||
|
||||
menu.addAction(setAsUnReadAction);
|
||||
|
||||
connect(setAsUnReadAction, &QAction::triggered, this, [=]() {
|
||||
auto libraryId = libraries.getId(selectedLibrary->currentText());
|
||||
auto info = comic.info;
|
||||
info.setRead(false);
|
||||
info.currentPage = 1;
|
||||
info.hasBeenOpened = false;
|
||||
info.lastTimeOpened = QVariant();
|
||||
DBHelper::update(libraryId, info);
|
||||
|
||||
contentViewsManager->folderContentView->reloadContinueReadingModel();
|
||||
});
|
||||
|
||||
menu.exec(contentViewsManager->folderContentView->mapToGlobal(point));
|
||||
}
|
||||
|
||||
void LibraryWindow::setupAddToSubmenu(QMenu &menu)
|
||||
|
Loading…
x
Reference in New Issue
Block a user