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];
14 QString contentId = book->parts[bookmark.part];
15 QString contentTitle = book->content[contentId].name;
16 QLabel *info = new QLabel(contentTitle + "\nAt " +
17 QString::number((int)(bookmark.pos*100)) + "%", this);
21 QPushButton *read = new QPushButton(tr("Go to"), this);
22 QPushButton *remove = new QPushButton(tr("Delete"), this);
23 connect(read, SIGNAL(clicked()), this, SLOT(onRead()));
24 connect(remove, SIGNAL(clicked()), this, SLOT(onRemove()));
25 addButton(read, QDialogButtonBox::ActionRole);
26 addButton(remove, QDialogButtonBox::DestructiveRole);
29 void BookmarkInfoDialog::onRead()
34 void BookmarkInfoDialog::onRemove()
36 if (QMessageBox::Yes ==
37 QMessageBox::question(this, tr("Delete bookmark"),
38 tr("Delete bookmark?"),
39 QMessageBox::Yes | QMessageBox::No)) {