QString label("At ");
label += QString::number((int)(100 * book_->
getProgress(bookmark.part, bookmark.pos))) + "%";
+ if (!bookmark.note.isEmpty()) {
+ label += ": " + bookmark.note;
+ }
+ label += "\n";
int chapterIndex = book_->chapterFromPart(bookmark.part);
if (chapterIndex != -1) {
QString chapterId = book_->chapters[chapterIndex];
- label += "\nIn \"" + book_->content[chapterId].name + "\"";
+ label += "In \"" + book_->content[chapterId].name + "\"";
}
data.append(label);
}
void BookmarksDialog::onAdd()
{
- emit addBookmark();
- close();
+ bool ok;
+ QString text = QInputDialog::getText(this, tr("Add bookmark"),
+ tr("Note:"), QLineEdit::Normal,
+ QString(), &ok);
+ if (ok) {
+ emit addBookmark(text);
+ close();
+ }
}
void BookmarksDialog::onDelete(bool really)