#include <QtGui>
+#include <QEvent>
#ifdef Q_WS_MAEMO_5
-# include <QtMaemo5/QMaemo5InformationBox>
# include <QtDBus>
# include <QtGui/QX11Info>
# include <X11/Xlib.h>
layout->addWidget(view);
// Progress
- progress = new Progress(central);
+ progress = new Progress(this);
// Settings dialog
settings = new QDialog(this);
connect(library, SIGNAL(upgrading(const QString &)),
this, SLOT(onUpgrading(const QString &)));
connect(library, SIGNAL(endUpgrade()), this, SLOT(onEndUpgrade()));
+#ifndef Q_OS_SYMBIAN
connect(library, SIGNAL(beginLoad(int)), this, SLOT(onBeginLoad(int)));
connect(library, SIGNAL(loading(const QString &)),
this, SLOT(onLoading(const QString &)));
connect(library, SIGNAL(endLoad()), this, SLOT(onEndLoad()));
+#endif
library->upgrade();
library->load();
this, SLOT(onSettingsChanged(const QString &)));
settings->setValue("orientation", settings->value("orientation"));
settings->setValue("lightson", settings->value("lightson"));
- settings->setValue("usevolumekeys", settings->value("usevolumekeys"));
// Handle book view buttons
connect(nextButton, SIGNAL(triggered()), this, SLOT(goToNextPage()));
connect(previousButton, SIGNAL(triggered()), this, SLOT(goToPreviousPage()));
+ // Adopt view, show window
+ showRegular();
+
#ifdef DORIAN_TEST_MODEL
(void)new ModelTest(Library::instance(), this);
#endif
}
-MainWindow::~MainWindow()
-{
-}
-
void MainWindow::onCurrentBookChanged()
{
setCurrentBook(Library::instance()->nowReading());
void MainWindow::onSettingsChanged(const QString &key)
{
+ TRACE;
+ qDebug() << key;
#if defined(Q_WS_MAEMO_5)
if (key == "orientation") {
QString value = Settings::instance()->value(key).toString();
- qDebug() << "MainWindow::onSettingsChanged: orientation" << value;
if (value == "portrait") {
setAttribute(Qt::WA_Maemo5LandscapeOrientation, false);
setAttribute(Qt::WA_Maemo5PortraitOrientation, true);
}
} else if (key == "lightson") {
bool enable = Settings::instance()->value(key, false).toBool();
- qDebug() << "MainWindow::onSettingsChanged: lightson:" << enable;
killTimer(preventBlankingTimer);
if (enable) {
preventBlankingTimer = startTimer(29 * 1000);
}
- } else 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
}
void MainWindow::onPartLoadStart()
{
TRACE;
-#ifdef Q_WS_MAEMO_5
- setAttribute(Qt::WA_Maemo5ShowProgressIndicator, true);
-#endif
+ Platform::showBusy(this, true);
}
void MainWindow::onPartLoadEnd(int index)
enableNext = true;
}
}
-#ifdef Q_WS_MAEMO_5
- setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false);
-#endif // Q_WS_MAEMO_5
+ Platform::showBusy(this, false);
}
void MainWindow::onAddBookmark(const QString ¬e)
{
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)
aboutDialog->show();
}
-
void MainWindow::goToNextPage()
{
nextButton->flash();
libraryProgress->reset();
}
-
void MainWindow::onBeginLoad(int total)
{
libraryProgress->setVisible(total > 0);
libraryProgress->hide();
libraryProgress->reset();
}
-