-#include <QtGui>
-#include <QDebug>
-#include <QFileInfo>
#include <QDir>
-#include <QModelIndex>
+#include <QtGui>
#ifdef Q_WS_MAEMO_5
#include <QtMaemo5/QMaemo5InformationBox>
#include "searchdialog.h"
#include "platform.h"
#include "searchresultsdialog.h"
+#include "progressdialog.h"
LibraryDialog::LibraryDialog(QWidget *parent): ListWindow(parent)
{
setSelected(current);
addList(list);
- progress = new QProgressDialog(tr("Adding books"), "", 0, 0, this);
- progress->reset();
- progress->setMinimumDuration(0);
- progress->setWindowModality(Qt::WindowModal);
- progress->setCancelButton(0);
-#ifdef Q_WS_S60
- progress->setFixedWidth(
- QApplication::desktop()->availableGeometry().width());
-#endif
+ progress = new ProgressDialog(tr("Adding books"), this);
connect(Library::instance(), SIGNAL(nowReadingChanged()),
this, SLOT(onCurrentBookChanged()));
void LibraryDialog::onRead()
{
- qDebug() << "LibraryDialog::onRead";
QModelIndex current = sortedLibrary->mapToSource(list->currentIndex());
if (current.isValid()) {
Library::instance()->setNowReading(current);
void LibraryDialog::onItemActivated(const QModelIndex &index)
{
- qDebug() << "LibraryDialog::onItemActivated";
+ TRACE;
QModelIndex libraryIndex = sortedLibrary->mapToSource(index);
Book *book = Library::instance()->book(libraryIndex);
(new InfoDialog(book, this))->exec();
void LibraryDialog::onAddFolder()
{
- Trace t("LibraryDialog::onAddFolder");
+ TRACE;
// Get folder name
Settings *settings = Settings::instance();
#ifdef Q_WS_MAEMO_5
QMaemo5InformationBox::information(this, msg);
#else
- // FIXME
+ QMessageBox::information(this, tr("Done adding books"), msg);
#endif
}
if (ret != QDialog::Accepted) {
return;
}
+ progress->setLabelText(tr("Searching Project Gutenberg"));
+ progress->showWait();
Search::instance()->start(searchDialog->query());
}
void LibraryDialog::showSearchResults()
{
+ progress->reset();
QList<Search::Result> results = Search::instance()->results();
if (results.count() == 0) {
- QMessageBox::information(this, tr("Search results"), tr("No books found"));
+ QMessageBox::information(this, tr("Search results"),
+ tr("No books found"));
return;
}
SearchResultsDialog *dialog = new SearchResultsDialog(results, this);
- // FIXME
connect(dialog, SIGNAL(add(const Search::Result &)),
this, SLOT(onAddSearchResult(const Search::Result &)));
dialog->show();