the screen. Make dialog contents finger-scrollable on Symbian.
#include "settings.h"
#include "trace.h"
#include "progress.h"
+#include "progressdialog.h"
BookView::BookView(QWidget *parent):
QWebView(parent), contentIndex(-1), mBook(0),
class QModelIndex;
class Progress;
class QAbstractKineticScroller;
+class ProgressDialog;
/** Visual representation of a book. */
class BookView: public QWebView
/** Go to a given (relative) position in current part. */
void goToPosition(qreal position);
- /** Show progress. */
+ /** Show reading progress. */
void showProgress();
int contentIndex; /**< Current part in book. */
Book *mBook; /**< Book to show. */
bool restorePositionAfterLoad;
- /**< If true, restoring position after load is needed. */
+ /**< If true, restore current position after load. */
qreal positionAfterLoad;
/**< Position to be restored after load. */
QImage bookmarkImage;
<file>books/2BR02B.epub</file>
<file>icons/search.png</file>
<file>icons/mac/about.png</file>
+ <file>icons/symbian/style-sand.png</file>
+ <file>icons/symbian/style-day.png</file>
+ <file>icons/symbian/style-default.png</file>
+ <file>icons/symbian/style-night.png</file>
</qresource>
</RCC>
# define DORIAN_BASE ".dorian"
#endif
-#ifdef Q_WS_MAC
+#if defined(Q_WS_MAC)
# define DORIAN_ICON_PREFIX ":/icons/mac/"
+#elif defined(Q_OS_SYMBIAN)
+# define DORIAN_ICON_PREFIX ":/icons/symbian/"
#else
# define DORIAN_ICON_PREFIX ":/icons/"
#endif
QString Platform::icon(const QString &name)
{
- return QString(DORIAN_ICON_PREFIX) + name + ".png";
+ QString iconName = QString(DORIAN_ICON_PREFIX) + name + ".png";
+ if (QFile(iconName).exists()) {
+ return iconName;
+ } else {
+ return QString(":/icons/") + name + ".png";
+ }
}
void Platform::restart(char *argv[])
#include "settingswindow.h"
#include "settings.h"
#include "toolbuttonbox.h"
+#include "platform.h"
+
+#ifdef Q_OS_SYMBIAN
+#include "flickcharm.h"
+#endif
#ifdef Q_OS_SYMBIAN
const char *DEFAULT_ORIENTATION = "portrait";
const int ZOOM_MAX = 250;
const int ZOOM_STEP = 25;
-SettingsWindow::SettingsWindow(QWidget *parent): QMainWindow(parent)
+SettingsWindow::SettingsWindow(QWidget *parent): AdopterWindow(parent)
{
#ifdef Q_WS_MAEMO_5
setAttribute(Qt::WA_Maemo5StackedWindow, true);
Settings *settings = Settings::instance();
QScrollArea *scroller = new QScrollArea(this);
-#ifdef Q_WS_MAEMO_5
+#if defined(Q_WS_MAEMO_5)
scroller->setProperty("FingerScrollable", true);
scroller->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+#elif defined(Q_OS_SYMBIAN)
+ FlickCharm *charm = new FlickCharm(this);
+ charm->activateOn(scroller);
#else
scroller->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
#endif
QVBoxLayout *layout = new QVBoxLayout(contents);
contents->setLayout(layout);
+#ifndef Q_OS_SYMBIAN
QCheckBox *backlight = new QCheckBox(tr("Keep backlight on"), contents);
layout->addWidget(backlight);
backlight->setChecked(settings->value("lightson", false).toBool());
+#endif
#ifndef Q_OS_SYMBIAN
QCheckBox *grabVolume =
layout->addWidget(colorLabel);
ToolButtonBox *box = new ToolButtonBox(this);
layout->addWidget(box);
- box->addButton(SchemeDefault, tr("Default"), ":/icons/style-default.png");
- box->addButton(SchemeNight, tr("Night"), ":/icons/style-night.png");
- box->addButton(SchemeDay, tr("Day"), ":/icons/style-day.png");
- box->addButton(SchemeSand, tr("Sand"), ":/icons/style-sand.png");
+ box->addButton(SchemeDefault, tr("Default"),
+ Platform::icon("style-default"));
+ box->addButton(SchemeNight, tr("Night"), Platform::icon("style-night"));
+ box->addButton(SchemeDay, tr("Day"), Platform::icon("style-day"));
+ box->addButton(SchemeSand, tr("Sand"), Platform::icon("style-sand"));
box->addStretch();
QString scheme = settings->value("scheme", "default").toString();
if (scheme == "night") {
box->toggle(SchemeDefault);
}
+#ifndef Q_OS_SYMBIAN
QLabel *orientationLabel = new QLabel(tr("Orientation:"), contents);
layout->addWidget(orientationLabel);
orientationBox = new ToolButtonBox(this);
} else {
orientationBox->toggle(OrientationLandscape);
}
+#endif // !Q_OS_SYMBIAN
layout->addStretch();
scroller->setWidget(contents);
setCentralWidget(scroller);
+#ifndef Q_OS_SYMBIAN
connect(backlight, SIGNAL(toggled(bool)),
this, SLOT(onLightsToggled(bool)));
-#ifndef Q_OS_SYMBIAN
connect(grabVolume, SIGNAL(toggled(bool)),
this, SLOT(onGrabVolumeToggled(bool)));
#endif
this, SLOT(onCurrentFontChanged(const QFont &)));
connect(box, SIGNAL(buttonClicked(int)),
this, SLOT(onSchemeButtonClicked(int)));
+#ifndef Q_OS_SYMBIAN
connect(orientationBox, SIGNAL(buttonClicked(int)),
this, SLOT(onOrientationButtonClicked(int)));
+#endif
#ifdef Q_OS_SYMBIAN
QAction *closeAction = new QAction(parent? tr("Back"): tr("Exit"), this);
#ifndef SETTINGSWINDOW_H
#define SETTINGSWINDOW_H
-#include <QMainWindow>
#include <QLabel>
#include <QSlider>
+#include "adopterwindow.h"
+
class QPushButton;
class QFontComboBox;
class QFont;
class ToolButtonBox;
/** Display settings. */
-class SettingsWindow: public QMainWindow
+class SettingsWindow: public AdopterWindow
{
Q_OBJECT
#include <QTime>
#include <QEvent>
-#define TRACE Trace _(Q_FUNC_INFO)
+#ifdef Q_OS_SYMBIAN
+# ifdef __PRETTY_FUNCTION__
+# define TRACE Trace _(__PRETTY_FUNCTION__)
+# else
+# define TRACE Trace _(__FUNCTION__)
+# endif
+#else
+# define TRACE Trace _(Q_FUNC_INFO)
+#endif
/** Trace helper. */
class Trace
#include "dyalog.h"
+#ifdef Q_OS_SYMBIAN
+#include "flickcharm.h"
+#endif
+
Dyalog::Dyalog(QWidget *parent, bool showButtons_):
QDialog(parent, Qt::Dialog | Qt::WindowTitleHint |
Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint),
{
scroller = new QScrollArea(this);
-#ifdef Q_WS_MAEMO_5
+#if defined(Q_WS_MAEMO_5)
scroller->setProperty("FingerScrollable", true);
scroller->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+#elif defined(Q_OS_SYMBIAN)
+ FlickCharm *charm = new FlickCharm(this);
+ charm->activateOn(scroller);
#else
scroller->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
#endif
setLayout(layout);
group = new QButtonGroup(this);
group->setExclusive(true);
- connect(group, SIGNAL(buttonClicked(int)), this, SIGNAL(buttonClicked(int)));
+ connect(group, SIGNAL(buttonClicked(int)), this,
+ SIGNAL(buttonClicked(int)));
}
void ToolButtonBox::addButton(int id, const QString &title, const QString &icon)
button->setToolButtonStyle(Qt::ToolButtonTextOnly);
} else {
button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
+#ifdef Q_OS_SYMBIAN
+ button->setIconSize(QSize(71, 81));
+ button->setFixedWidth(77);
+ qDebug() << button->palette();
+#else
button->setIconSize(QSize(81, 81));
+#endif
button->setIcon(QIcon(icon));
}
button->setText(title);