3 #include "bookmarkinfodialog.h"
6 BookmarkInfoDialog::BookmarkInfoDialog(Book *b, int i, QWidget *parent):
11 setWindowTitle(tr("Bookmark Details"));
13 Book::Bookmark bookmark = book->bookmarks()[index];
15 label += QString::number((int)(100 * book->
16 getProgress(bookmark.part, bookmark.pos))) + "%";
17 int chapterIndex = book->chapterFromPart(bookmark.part);
18 if (chapterIndex != -1) {
19 QString chapterId = book->chapters[chapterIndex];
20 label += ", in\n\"" + book->content[chapterId].name + "\"";
22 QLabel *info = new QLabel(label, this);
25 addButton(tr("Go to"), this, SLOT(onRead()), QDialogButtonBox::ActionRole);
26 addButton(tr("Delete"), this, SLOT(onRemove()),
27 QDialogButtonBox::DestructiveRole);
30 void BookmarkInfoDialog::onRead()
35 void BookmarkInfoDialog::onRemove()
37 if (QMessageBox::Yes ==
38 QMessageBox::question(this, tr("Delete bookmark"),
39 tr("Delete bookmark?"),
40 QMessageBox::Yes | QMessageBox::No)) {