From f2571fe854dcae8a8cd8f9216e0f78b51dd0a1a4 Mon Sep 17 00:00:00 2001 From: Akos Polster Date: Fri, 5 Nov 2010 01:48:50 +0100 Subject: [PATCH] Add confirmation after download on Symbian. --- bookview.cpp | 6 +----- dorian.pro | 10 +++++++++- librarydialog.cpp | 19 ++----------------- mainwindow.cpp | 9 +-------- pkg/changelog | 6 ++++++ pkg/version.txt | 2 +- platform.cpp | 17 +++++++++++++++++ platform.h | 3 +++ searchresultsdialog.cpp | 11 ++--------- 9 files changed, 42 insertions(+), 41 deletions(-) diff --git a/bookview.cpp b/bookview.cpp index 05c5be9..45bdd2a 100644 --- a/bookview.cpp +++ b/bookview.cpp @@ -284,7 +284,7 @@ void BookView::paintEvent(QPaintEvent *e) void BookView::mousePressEvent(QMouseEvent *e) { QWebView::mousePressEvent(e); -#if defined(Q_WS_MAEMO_5) || defined(Q_OS_SYMBIAN) +#if defined(Q_WS_MAEMO_5) // Start monitoring kinetic scroll if (scrollerMonitor) { killTimer(scrollerMonitor); @@ -440,10 +440,6 @@ void BookView::timerEvent(QTimerEvent *e) scrollerMonitor = -1; } } -#elif defined(Q_OS_SYMBIAN) - if (e->timerId() == scrollerMonitor) { - if (charm && charm->) - } #endif QWebView::timerEvent(e); } diff --git a/dorian.pro b/dorian.pro index 85e591e..7c4f1eb 100644 --- a/dorian.pro +++ b/dorian.pro @@ -131,10 +131,18 @@ win32 { } symbian { - ICON = $$PWD/pkg/symbian/book.svg + TARGET = Dorian TARGET.UID3 = 0xEA633557 TARGET.CAPABILITY = NetworkServices ReadUserData WriteUserData TARGET.EPOCHEAPSIZE = 0x080000 0x4000000 + ICON = $$PWD/pkg/symbian/book.svg + packageheader = "$${LITERAL_HASH}{\"Dorian\"}, (0xEA633557), 0, 3, 4" + vendorinfo = \ + "%{\"Nokia Betalabs \"}" \ + ":\"Nokia Betalabs \"" + my_deployment.pkg_prerules = packageheader vendorinfo + DEPLOYMENT += my_deployment + INCLUDEPATH += $(QTDIR)/src/3rdparty/zlib HEADERS += widgets/flickcharm.h SOURCES += widgets/flickcharm.cpp diff --git a/librarydialog.cpp b/librarydialog.cpp index 3fdfe16..416e05a 100644 --- a/librarydialog.cpp +++ b/librarydialog.cpp @@ -1,10 +1,6 @@ #include #include -#ifdef Q_WS_MAEMO_5 -#include -#endif - #include "librarydialog.h" #include "library.h" #include "sortedlibrary.h" @@ -87,14 +83,7 @@ void LibraryDialog::onAdd() // Add book to library QModelIndex index = library->find(path); if (index.isValid()) { -#ifdef Q_WS_MAEMO_5 - QMaemo5InformationBox::information(this, - tr("This book is already in the library"), - QMaemo5InformationBox::DefaultTimeout); -#else - (void)QMessageBox::information(this, tr("Dorian"), - tr("This book is already in the library"), QMessageBox::Ok); -#endif // Q_WS_MAEMO_5 + Platform::information(tr("This book is already in the library"), this); setSelected(index); } else { @@ -228,11 +217,7 @@ void LibraryDialog::onAddFromFolderDone(int added) progress->reset(); qDebug() << "LibraryDialog::onRefreshDone:" << msg; -#ifdef Q_WS_MAEMO_5 - QMaemo5InformationBox::information(this, msg); -#else - QMessageBox::information(this, tr("Done adding books"), msg); -#endif + Platform::information(msg, this); } void LibraryDialog::onAddFromFolder(const QString &path) diff --git a/mainwindow.cpp b/mainwindow.cpp index 278e578..31c952c 100755 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1,7 +1,6 @@ #include #ifdef Q_WS_MAEMO_5 -# include # include # include # include @@ -377,13 +376,7 @@ 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) diff --git a/pkg/changelog b/pkg/changelog index 62d2d03..579d365 100644 --- a/pkg/changelog +++ b/pkg/changelog @@ -1,3 +1,9 @@ +dorian (0.3.4-1) unstable; urgency=low + + * On Symbian, display confirmation after downloading a book + + -- Akos Polster Fri, 5 Nov 2010 02:00:00 +0100 + dorian (0.3.3-1) unstable; urgency=low * Fix font scaling on Symbian diff --git a/pkg/version.txt b/pkg/version.txt index 02ed9ef..eb9ce88 100644 --- a/pkg/version.txt +++ b/pkg/version.txt @@ -1 +1 @@ -"0.3.3" +"0.3.4" diff --git a/platform.cpp b/platform.cpp index f96cdda..dff134c 100644 --- a/platform.cpp +++ b/platform.cpp @@ -25,6 +25,12 @@ static const char *DORIAN_VERSION = #include "pkg/version.txt" ; +#ifdef Q_WS_MAEMO_5 +# include +#else +# include +#endif + QString Platform::dbPath() { QString base(QDir::home().absoluteFilePath(DORIAN_BASE)); @@ -73,3 +79,14 @@ QString Platform::defaultFont() return QString("Times New Roman"); #endif } + +void Platform::information(const QString &label, QWidget *parent) +{ +#ifdef Q_WS_MAEMO_5 + QMaemo5InformationBox::information(parent, label, + QMaemo5InformationBox::DefaultTimeout); +#else + (void)QMessageBox::information(parent, QObject::tr("Dorian"), label, + QMessageBox::Ok); +#endif +} diff --git a/platform.h b/platform.h index 1144a5f..daec6f3 100644 --- a/platform.h +++ b/platform.h @@ -3,6 +3,8 @@ #include +class QWidget; + /** Platform abstractions. */ class Platform { @@ -13,6 +15,7 @@ public: static QString version(); static QString downloadDir(); static QString defaultFont(); + static void information(const QString &label, QWidget *parent = 0); }; #endif // PLATFORM_H diff --git a/searchresultsdialog.cpp b/searchresultsdialog.cpp index 88958f6..f52af1f 100644 --- a/searchresultsdialog.cpp +++ b/searchresultsdialog.cpp @@ -5,10 +5,6 @@ #include #include -#ifdef Q_WS_MAEMO_5 -#include -#endif - #include "listview.h" #include "searchresultsdialog.h" #include "searchresultinfodialog.h" @@ -106,10 +102,7 @@ void SearchResultsDialog::onEndDownload(int status, const Search::Result &result if (-1 != row) { list->model()->removeRow(row); } -#ifdef Q_WS_MAEMO_5 - QMaemo5InformationBox::information(this, - tr("Downloaded \"%1\"\nand added to the library").arg(result.title), - QMaemo5InformationBox::DefaultTimeout); -#endif + Platform::information(tr("Downloaded \"%1\"\nand added to the library"). + arg(result.title), this); } } -- 1.7.9.5