Show splash screen on Symbian.
authorAkos Polster <akos@pipacs.com>
Sun, 7 Nov 2010 02:55:13 +0000 (03:55 +0100)
committerAkos Polster <akos@pipacs.com>
Sun, 7 Nov 2010 02:55:13 +0000 (03:55 +0100)
dorian.pro
dorian.qrc
icons/splash.jpg [new file with mode: 0755]
main.cpp
mainwindow.cpp
pkg/changelog
widgets/splash.cpp [new file with mode: 0755]
widgets/splash.h [new file with mode: 0755]

index 5eca6d9..56489aa 100644 (file)
@@ -39,7 +39,8 @@ SOURCES += \
     widgets/listview.cpp \\r
     searchresultsdialog.cpp \\r
     searchresultinfodialog.cpp \\r
-    widgets/progressdialog.cpp\r
+    widgets/progressdialog.cpp \\r
+    widgets/splash.cpp\r
 \r
 HEADERS += \\r
     mainwindow.h \\r
@@ -80,7 +81,8 @@ HEADERS += \
     widgets/flickable.h \\r
     searchresultsdialog.h \\r
     searchresultinfodialog.h \\r
-    widgets/progressdialog.h\r
+    widgets/progressdialog.h \\r
+    widgets/splash.h\r
 \r
 RESOURCES += \\r
     dorian.qrc\r
index f8ad9d3..bd63085 100644 (file)
@@ -48,5 +48,6 @@
         <file>icons/symbian/style-day.png</file>
         <file>icons/symbian/style-default.png</file>
         <file>icons/symbian/style-night.png</file>
+        <file>icons/splash.jpg</file>
     </qresource>
 </RCC>
diff --git a/icons/splash.jpg b/icons/splash.jpg
new file mode 100755 (executable)
index 0000000..c6bf552
Binary files /dev/null and b/icons/splash.jpg differ
index 1676a8e..e50a753 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -8,6 +8,7 @@
 #include "bookdb.h"
 #include "search.h"
 #include "platform.h"
+#include "splash.h"
 
 #ifdef Q_OS_SYMBIAN
 #   include "mediakeysobserver.h"
@@ -39,8 +40,17 @@ int main(int argc, char *argv[])
         value("tracelevel", (int)DORIAN_DEFAULT_TRACE_LEVEL).toInt();
     qInstallMsgHandler(Trace::messageHandler);
 
+#ifdef Q_OS_SYMBIAN
+    Splash *splash = new Splash();
+    splash->showFullScreen();
+    a.processEvents();
+#endif
+
     {
         MainWindow w;
+#ifdef Q_OS_SYMBIAN
+        splash->close();
+#endif
         ret = a.exec();
     }
 
index bfb9007..72f14ef 100755 (executable)
@@ -118,10 +118,12 @@ MainWindow::MainWindow(QWidget *parent):
     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();
 
index db4909d..60026e5 100644 (file)
@@ -3,6 +3,7 @@ dorian (0.3.4-1) unstable; urgency=low
   * On Symbian, display confirmation after downloading a book
   * Navigate with volume keys on Symbian, too
   * Speed up startup, load books on demand
+  * Show splash screen on Symbian
 
  -- Akos Polster <akos@pipacs.com>  Fri,  5 Nov 2010 02:00:00 +0100
 
diff --git a/widgets/splash.cpp b/widgets/splash.cpp
new file mode 100755 (executable)
index 0000000..998a0de
--- /dev/null
@@ -0,0 +1,14 @@
+#include <QtGui>\r
+\r
+#include "splash.h"\r
+\r
+Splash::Splash(QWidget *parent): QMainWindow(parent)\r
+{\r
+    QLabel *label = new QLabel(this);\r
+    QRect geo = QApplication::desktop()->geometry();\r
+    label->setGeometry(geo);\r
+    label->setStyleSheet("background-color: black; color: black");\r
+    label->setPixmap(QPixmap(":/icons/splash.jpg").scaled(geo.width(),\r
+        geo.height(), Qt::KeepAspectRatio, Qt::SmoothTransformation));\r
+    setCentralWidget(label);\r
+}\r
diff --git a/widgets/splash.h b/widgets/splash.h
new file mode 100755 (executable)
index 0000000..204e223
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef SPLASH_H\r
+#define SPLASH_H\r
+\r
+#include <QMainWindow>\r
+\r
+class Splash: public QMainWindow\r
+{\r
+    Q_OBJECT\r
+\r
+public:\r
+    explicit Splash(QWidget *parent = 0);\r
+};\r
+\r
+#endif // SPLASH_H\r