{
TRACE;
- // Monitor settings
+ // Monitor settings changes
connect(Settings::instance(), SIGNAL(valueChanged(const QString &)),
this, SLOT(onSettingsChanged(const QString &)));
Q_ASSERT(previous);
Q_ASSERT(next);
- leaveBookView();
+ if (bookView) {
+ return;
+ }
bookView = view;
bookView->setParent(this);
centralWidget()->layout()->addWidget(bookView);
- bookView->show();
+ // bookView->show();
progress = prog;
previousButton = previous;
void AdopterWindow::leaveBookView()
{
TRACE;
- if (bookView) {
- bookView->hide();
- centralWidget()->layout()->removeWidget(bookView);
+
+ if (!bookView) {
+ return;
}
+
+ // bookView->hide();
+ centralWidget()->layout()->removeWidget(bookView);
bookView = 0;
progress = 0;
nextButton = 0;
#endif // Q_WS_MAEMO_5
-void AdopterWindow::showEvent(QShowEvent *e)
+void AdopterWindow::showEvent(QShowEvent *event)
{
Trace t("AdopterWindow::showEvent");
- MainBase::showEvent(e);
+ MainBase::showEvent(event);
#if defined(Q_WS_MAEMO_5)
doGrabVolumeKeys(grabbingVolumeKeys);
#endif
void AdopterWindow::resizeEvent(QResizeEvent *event)
{
Trace t("AdopterWindow::resizeEvent");
+
MainBase::resizeEvent(event);
placeDecorations();
-
#if defined(Q_WS_MAEMO_5) || defined(Q_OS_SYMBIAN)
// Restore previous reading position
if (bookView) {
- QTimer::singleShot(110, bookView, SLOT(restoreLastBookmark()));
+ bookView->scheduleRestoreLastBookmark();
}
#endif // defined(Q_WS_MAEMO_5) || defined(Q_OS_SYMBIAN)
}
if (bookView) {
bookView->setLastBookmark();
}
+ hide();
MainBase::closeEvent(event);
}
void AdopterWindow::keyPressEvent(QKeyEvent *event)
{
- TRACE;
+ Trace t("AdopterWindow::keyPressEvent");
+
switch (event->key()) {
case Qt::Key_PageDown:
#ifdef Q_WS_MAEMO_5
Trace t("AdopterWindow::placeDecorations");
if (!hasBookView()) {
+ qDebug() << "Doesn't have the book view";
return;
}
+ qDebug() << "Has the book view";
int extraHeight = 0;
QRect geo = bookView->geometry();
qDebug() << "bookView:" << geo;
-#ifdef Q_OS_SYMBIAN
- // Work around Symbian bug: If tool bar is hidden, increase bottom
- // decorator widgets' Y coordinates by the tool bar's height
- // if (isToolBarHidden()) {
- // extraHeight = toolBarHeight();
- // }
-
- // Work around another Symbian bug: When returning from full screen mode
- // in landscape, the book view widget's height is miscalculated.
- // My apologies for this kludge
- if (geo.height() == 288) {
- qDebug() << "Adjusting bottom Y";
- extraHeight -= 288 - 223;
- }
-#endif // Q_OS_SYMBIAN
-
progress->setGeometry(geo.x(),
geo.y() + geo.height() - progress->thickness() + extraHeight,
geo.width(), progress->thickness());