+ TRACE;
+
+ Book *book = Library::instance()->book(mCurrent);
+ if (book) {
+ QString fragment;
+ int partIndex = book->partFromChapter(index, fragment);
+ if (partIndex != -1) {
+ view->goToPart(partIndex, fragment);
+ }
+ }
+}
+
+void MainWindow::timerEvent(QTimerEvent *event)
+{
+ if (event->timerId() == preventBlankingTimer) {
+#ifdef Q_WS_MAEMO_5
+ QDBusInterface mce(MCE_SERVICE, MCE_REQUEST_PATH,
+ MCE_REQUEST_IF, QDBusConnection::systemBus());
+ mce.call(MCE_PREVENT_BLANK_REQ);
+#endif // Q_WS_MAEMO_5
+ qDebug() << "MainWindow::timerEvent: Prevent display blanking";
+ }
+ AdopterWindow::timerEvent(event);
+}
+
+void MainWindow::about()
+{
+ Dyalog *aboutDialog = new Dyalog(this, false);
+ aboutDialog->setWindowTitle(tr("About Dorian"));
+ QString version = Platform::instance()->version();
+ QLabel *label = new QLabel(aboutDialog);
+ label->setTextFormat(Qt::RichText);
+ label->setOpenExternalLinks(true);
+ label->setWordWrap(true);
+ label->setText(tr("<b>Dorian %1</b><br><br>Copyright © 2010 "
+ "Akos Polster <akos@pipacs.com><br>"
+ "Licensed under GNU General Public License, Version 3<br>"
+ "Source code:<br><a href='http://dorian.garage.maemo.org/'>"
+ "dorian.garage.maemo.org</a>").arg(version));
+ aboutDialog->addWidget(label);
+ aboutDialog->addStretch();
+ aboutDialog->show();
+}
+
+void MainWindow::goToNextPage()
+{
+ next->flash();
+ prev->flash();
+ view->goNextPage();
+}
+
+void MainWindow::goToPreviousPage()
+{
+ next->flash();
+ prev->flash();
+ view->goPreviousPage();
+}
+
+void MainWindow::onBeginUpgrade(int total)
+{
+ libraryProgress->setVisible(total > 0);
+ libraryProgress->setWindowTitle(tr("Upgrading library"));
+ libraryProgress->setMaximum(total);
+}
+
+void MainWindow::onUpgrading(const QString &path)
+{
+ libraryProgress->setLabelText(tr("Upgrading %1").
+ arg(QFileInfo(path).fileName()));
+ libraryProgress->setValue(libraryProgress->value() + 1);
+}
+
+void MainWindow::onEndUpgrade()
+{
+ libraryProgress->hide();
+ libraryProgress->reset();
+}
+
+void MainWindow::onBeginLoad(int total)
+{
+ libraryProgress->setVisible(total > 0);
+ libraryProgress->setWindowTitle(tr("Loading library"));
+ libraryProgress->setMaximum(total);
+}
+
+void MainWindow::onLoading(const QString &path)
+{
+ libraryProgress->setLabelText(tr("Loading %1").
+ arg(QFileInfo(path).fileName()));
+ libraryProgress->setValue(libraryProgress->value() + 1);
+}
+
+void MainWindow::onEndLoad()
+{
+ libraryProgress->hide();
+ libraryProgress->reset();