return;
}
- addAction(tr("Add bookmark"), this, SLOT(onAdd()), ":/icons/add.png");
+ addAction(tr("Add bookmark"), this, SLOT(onAdd()), "add");
#ifndef Q_WS_MAEMO_5
addItemAction(tr("Go to"), this, SLOT(onGo()));
addItemAction(tr("Delete"), this, SLOT(onDelete()));
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 (optional):"), QLineEdit::Normal, QString(), &ok);
+ if (ok) {
+ emit addBookmark(text);
+ close();
+ }
}
void BookmarksDialog::onDelete(bool really)
if (!really) {
if (QMessageBox::Yes !=
QMessageBox::question(this, tr("Delete bookmark"),
- tr("Delete bookmark?"),
- QMessageBox::Yes | QMessageBox::No)) {
+ tr("Delete bookmark?"), QMessageBox::Yes | QMessageBox::No)) {
return;
}
}