scrollerMonitor = 0;
scroller = property("kineticScroller").value<QAbstractKineticScroller *>();
#elif defined(Q_OS_SYMBIAN)
- FlickCharm *charm = new FlickCharm(this);
+ scrollerMonitor = 0;
+ charm = new FlickCharm(this);
charm->activateOn(this);
#endif
}
}
loaded = true;
onSettingsChanged("scheme");
+ onSettingsChanged("zoom");
+ onSettingsChanged("font");
emit partLoadEnd(contentIndex);
showProgress();
}
void BookView::mousePressEvent(QMouseEvent *e)
{
QWebView::mousePressEvent(e);
-#ifdef Q_WS_MAEMO_5
+#if defined(Q_WS_MAEMO_5) || defined(Q_OS_SYMBIAN)
// Start monitoring kinetic scroll
if (scrollerMonitor) {
killTimer(scrollerMonitor);
bool BookView::eventFilter(QObject *o, QEvent *e)
{
+#if 0
if (e->type() != QEvent::Paint && e->type() != QEvent::MouseMove) {
if (e->type() == QEvent::Resize) {
qDebug() << "BookView::eventFilter QEvent::Resize to"
qDebug() << "BookView::eventFilter" << Trace::event(e->type());
}
}
+#endif
// Work around Qt bug that sometimes selects web view contents during swipe
switch (e->type()) {
void BookView::timerEvent(QTimerEvent *e)
{
-#ifdef Q_WS_MAEMO_5
+#if defined(Q_WS_MAEMO_5)
if (e->timerId() == scrollerMonitor) {
if (scroller &&
((scroller->state() == QAbstractKineticScroller::AutoScrolling) ||
showProgress();
} else {
killTimer(scrollerMonitor);
+ scrollerMonitor = -1;
}
}
+#elif defined(Q_OS_SYMBIAN)
+ if (e->timerId() == scrollerMonitor) {
+ if (charm && charm->)
+ }
#endif
QWebView::timerEvent(e);
}
class Progress;
class QAbstractKineticScroller;
class ProgressDialog;
+class FlickCharm;
/** Visual representation of a book. */
class BookView: public QWebView
bool mousePressed;
int contentsHeight; /**< Last know height of the frame. */
-#if defined(Q_WS_MAEMO_5)
+#if defined(Q_WS_MAEMO_5) || defined(Q_OS_SYMBIAN)
int scrollerMonitor;
+#endif
+#if defined(Q_WS_MAEMO_5)
QAbstractKineticScroller *scroller;
+#elif defined(Q_OS_SYMBIAN)
+ FlickCharm *charm;
#endif
};
#include "infodialog.h"
#include "book.h"
#include "library.h"
+#include "trace.h"
InfoDialog::InfoDialog(Book *b, QWidget *parent, bool showButtons):
Dyalog(parent, showButtons), book(b)
{
+ TRACE;
+
setWindowTitle(tr("Book Details"));
if (book) {
/** Add space. */
void addToolBarSpace();
- /** Add action that is visible on the menu. */
- QAction *addAction(QObject *receiver, const char *slot,
- const QString &text);
-
/** Show window. */
void show();
#include <QtGui>
#include "dyalog.h"
+#include "trace.h"
#ifdef Q_OS_SYMBIAN
#include "flickcharm.h"
closeAction->setSoftKeyRole(QAction::NegativeSoftKey);
connect(closeAction, SIGNAL(triggered()), this, SLOT(reject()));
addAction(closeAction);
+ leftSoftKey = 0;
menuBar = 0;
#endif // Q_OS_SYMBIAN
}
void Dyalog::addButton(const QString &label, QObject *receiver,
const char *slot, QDialogButtonBox::ButtonRole role)
{
+ TRACE;
if (!showButtons) {
+ qDebug() << "Ignored: showButtons is false";
return;
}
#ifdef Q_OS_SYMBIAN
Q_UNUSED(role);
- if (!menuBar) {
- menuBar = new QMenuBar(this);
+#if 0
+ if (!leftSoftKey) {
+ qDebug() << "Adding left soft key";
+ leftSoftKey = new QAction(label, this);
+ leftSoftKey->setSoftKeyRole(QAction::PositiveSoftKey);
+ connect(leftSoftKey, SIGNAL(triggered()), receiver, slot);
+ addAction(leftSoftKey);
+ } else {
+#endif
+ if (!menuBar) {
+ qDebug() << "Creating menu bar";
+ menuBar = new QMenuBar(this);
+ menuBar->addAction(leftSoftKey);
+ }
+ qDebug() << "Adding to menu bar";
+ QAction *action = new QAction(label, this);
+ connect(action, SIGNAL(triggered()), receiver, slot);
+ menuBar->addAction(action);
+#if 0
}
- QAction *action = new QAction(label, this);
- connect(action, SIGNAL(triggered()), receiver, slot);
- menuBar->addAction(action);
+#endif
#else
QPushButton *button = new QPushButton(label, this);
connect(button, SIGNAL(clicked()), receiver, slot);
class QScrollArea;
class QVBoxLayout;
class QMenuBar;
+class QAction;
/** Maemo- and Mac-friendly dialog box. */
-class Dyalog: public QDialog
+class Dyalog:
+ public QDialog
{
Q_OBJECT
QDialogButtonBox *buttonBox;
bool showButtons;
#ifdef Q_OS_SYMBIAN
+ QAction *leftSoftKey;
QMenuBar *menuBar;
#endif
};