X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;ds=sidebyside;f=chaptersdialog.cpp;h=20f7824c062fbdc039df8955a0ec9c74ed9b5786;hb=549e8d8b51f631005863aa7f4f3cb2683a901669;hp=2f279e040dff08ee8e836e225f46e12a98a5073d;hpb=198b9339f119bc261ee0d25a1a66b3b7c73e1226;p=dorian diff --git a/chaptersdialog.cpp b/chaptersdialog.cpp index 2f279e0..20f7824 100644 --- a/chaptersdialog.cpp +++ b/chaptersdialog.cpp @@ -1,13 +1,12 @@ -#include +#include #include "chaptersdialog.h" #include "book.h" -#include "listview.h" -ChaptersDialog::ChaptersDialog(Book *book, QWidget *parent): ListWindow(parent) +ChaptersDialog::ChaptersDialog(Book *book, QWidget *parent): + ListWindow(tr("(No chapters)"), parent) { setWindowTitle(tr("Chapters")); - if (book) { foreach (QString id, book->chapters) { QString contentTitle = book->content[id].name; @@ -15,17 +14,9 @@ ChaptersDialog::ChaptersDialog(Book *book, QWidget *parent): ListWindow(parent) } } QStringListModel *model = new QStringListModel(data, this); - list = new ListView; - list->setSelectionMode(QAbstractItemView::SingleSelection); - list->setModel(model); - list->setUniformItemSizes(true); - addList(list); - connect(list, SIGNAL(activated(const QModelIndex &)), + setModel(model); + connect(this, SIGNAL(activated(const QModelIndex &)), this, SLOT(onItemActivated(const QModelIndex &))); - -#ifndef Q_WS_MAEMO_5 - addAction(tr("Close"), this, SLOT(close()), QDialogButtonBox::RejectRole); -#endif // Q_WS_MAEMO_5 } void ChaptersDialog::onItemActivated(const QModelIndex &index)