Re-design ListWindow.
[dorian] / chaptersdialog.cpp
index 2f279e0..41aaf59 100644 (file)
@@ -1,4 +1,4 @@
-#include <QtGui>
+#include <QStringListModel>
 
 #include "chaptersdialog.h"
 #include "book.h"
@@ -7,7 +7,6 @@
 ChaptersDialog::ChaptersDialog(Book *book, QWidget *parent): ListWindow(parent)
 {
     setWindowTitle(tr("Chapters"));
-
     if (book) {
         foreach (QString id, book->chapters) {
             QString contentTitle = book->content[id].name;
@@ -15,17 +14,10 @@ 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 &)),
-            this, SLOT(onItemActivated(const QModelIndex &)));
-
-#ifndef Q_WS_MAEMO_5
-    addAction(tr("Close"), this, SLOT(close()), QDialogButtonBox::RejectRole);
-#endif // Q_WS_MAEMO_5
+    setModel(model);
+    // FIXME
+    // connect(list, SIGNAL(activated(const QModelIndex &)),
+    //         this, SLOT(onItemActivated(const QModelIndex &)));
 }
 
 void ChaptersDialog::onItemActivated(const QModelIndex &index)