Observe volume keys on Symbian. Add minimal documentation to headers.
[dorian] / mainwindow.cpp
index c0d614c..37b66eb 100755 (executable)
@@ -1,7 +1,6 @@
 #include <QtGui>
 
 #ifdef Q_WS_MAEMO_5
-#   include <QtMaemo5/QMaemo5InformationBox>
 #   include <QtDBus>
 #   include <QtGui/QX11Info>
 #   include <X11/Xlib.h>
@@ -224,8 +223,8 @@ void MainWindow::showRegular()
     view->restoreLastBookmark();
 #endif
     progress->flash();
-    nextButton->flash(1500);
-    previousButton->flash(1500);
+    nextButton->flash();
+    previousButton->flash();
 }
 
 void MainWindow::showBig()
@@ -259,8 +258,8 @@ void MainWindow::showBig()
     fullScreenWindow->activateWindow();
 #endif
     progress->flash();
-    nextButton->flash(1500);
-    previousButton->flash(1500);
+    nextButton->flash();
+    previousButton->flash();
 }
 
 void MainWindow::setCurrentBook(const QModelIndex &current)
@@ -341,6 +340,13 @@ void MainWindow::onSettingsChanged(const QString &key)
         grabZoomKeys(value);
         fullScreenWindow->grabZoomKeys(value);
     }
+#elif defined Q_OS_SYMBIAN
+    if (key == "usevolumekeys") {
+        bool value = Settings::instance()->value(key).toBool();
+        qDebug() << "MainWindow::onSettingsChanged: usevolumekeys" << value;
+        grabZoomKeys(value);
+        fullScreenWindow->grabZoomKeys(value);
+    }
 #else
     Q_UNUSED(key);
 #endif // Q_WS_MAEMO_5
@@ -377,13 +383,7 @@ void MainWindow::onAddBookmark(const QString &note)
 {
     TRACE;
     view->addBookmark(note);
-#ifdef Q_WS_MAEMO_5
-    QMaemo5InformationBox::information(this,
-        tr("Bookmarked current position"), QMaemo5InformationBox::DefaultTimeout);
-#else
-    (void)QMessageBox::information(this, tr("Dorian"),
-        tr("Bookmarked current position"), QMessageBox::Ok);
-#endif // Q_WS_MAEMO_5}
+    Platform::information(tr("Bookmarked current position"), this);
 }
 
 void MainWindow::onGoToBookmark(int index)
@@ -454,8 +454,8 @@ void MainWindow::resizeEvent(QResizeEvent *e)
         toolBar->height(), TranslucentButton::pixels, TranslucentButton::pixels);
 #endif // Q_WS_MAEMO_5
     qDebug() << "previousButton geometry" << previousButton->geometry();
-    previousButton->flash(1500);
-    nextButton->flash(1500);
+    previousButton->flash();
+    nextButton->flash();
     QMainWindow::resizeEvent(e);
 }
 
@@ -480,15 +480,15 @@ void MainWindow::about()
 
 void MainWindow::goToNextPage()
 {
-    nextButton->flash(1500);
-    previousButton->flash(1500);
+    nextButton->flash();
+    previousButton->flash();
     view->goNextPage();
 }
 
 void MainWindow::goToPreviousPage()
 {
-    nextButton->flash(1500);
-    previousButton->flash(1500);
+    nextButton->flash();
+    previousButton->flash();
     view->goPreviousPage();
 }