Parcourir la source

Added a splashscreen.

Klaas Freitag il y a 14 ans
Parent
commit
c9597c8fb9

+ 1 - 0
mirall.qrc

@@ -19,5 +19,6 @@
         <file>resources/folder-sync.png</file>
         <file>resources/folder-important.png</file>
         <file>resources/folder-grey.png</file>
+        <file>resources/owncloud_splash.png</file>
     </qresource>
 </RCC>

BIN
resources/beta_sign.xcf


BIN
resources/owncloud_splash.png


BIN
resources/owncloud_splash.xcf


+ 14 - 0
src/mirall/application.cpp

@@ -18,6 +18,7 @@
 #include <QHashIterator>
 #include <QUrl>
 #include <QDesktopServices>
+#include <QSplashScreen>
 
 #include "mirall/constants.h"
 #include "mirall/application.h"
@@ -55,6 +56,12 @@ Application::Application(int argc, char **argv) :
     _theme = new mirallTheme();
 #endif
     setApplicationName( _theme->appName() );
+
+    _splash = new QSplashScreen( _theme->splashScreen() );
+    _splash->show();
+
+    processEvents();
+
     INotify::initialize();
 
     _folderMan = new FolderMan();
@@ -102,6 +109,8 @@ Application::Application(int argc, char **argv) :
         _tray->setIcon(QIcon::fromTheme(MIRALL_ICON, QIcon( QString( ":/mirall/resources/%1").arg(MIRALL_ICON))));
     }
 
+    QTimer::singleShot( 5000, this, SLOT(slotHideSplash()) );
+
     qDebug() << "Network Location: " << NetworkLocation::currentLocation().encoded();
 }
 
@@ -115,6 +124,11 @@ Application::~Application()
     delete _tray;
 }
 
+void Application::slotHideSplash()
+{
+    delete _splash;
+}
+
 void Application::setupActions()
 {
     _actionAddFolder = new QAction(tr("Add folder..."), this);

+ 3 - 0
src/mirall/application.h

@@ -28,6 +28,7 @@ class QMenu;
 class QSystemTrayIcon;
 class QNetworkConfigurationManager;
 class QSignalMapper;
+class QSplashScreen;
 
 namespace Mirall {
 class Theme;
@@ -69,6 +70,7 @@ protected:
 protected slots:
     void slotTrayClicked( QSystemTrayIcon::ActivationReason );
     void slotFolderOpenAction(const QString & );
+    void slotHideSplash();
 
 private:
     // configuration file -> folder
@@ -89,6 +91,7 @@ private:
     FolderMan *_folderMan;
     Theme *_theme;
     QSignalMapper *_folderOpenActionMapper;
+    QSplashScreen *_splash;
 };
 
 } // namespace Mirall

+ 1 - 1
src/mirall/folderwatcher.cpp

@@ -161,7 +161,7 @@ void FolderWatcher::slotINotifyEvent(int mask, int cookie, const QString &path)
     _lastMask = mask;
     _lastPath = path;
 
-    qDebug() << "***************** Inotify Event " << mask << " on " << path;
+    // qDebug() << "** Inotify Event " << mask << " on " << path;
     // cancel close write events that come after create
     if (lastMask == IN_CREATE && mask == IN_CLOSE_WRITE
         && lastPath == path ) {

+ 6 - 0
src/mirall/miralltheme.cpp

@@ -14,6 +14,7 @@
 
 #include <QString>
 #include <QDebug>
+#include <QPixmap>
 
 #include "miralltheme.h"
 
@@ -34,5 +35,10 @@ QString mirallTheme::configFileName() const
     return QString::fromLocal8Bit("mirall.cfg");
 }
 
+QPixmap mirallTheme::splashScreen() const
+{
+    return QPixmap(":/mirall/resources/owncloud_splash.png"); // FIXME: mirall splash!
+}
+
 }
 

+ 1 - 0
src/mirall/miralltheme.h

@@ -26,6 +26,7 @@ public:
 
     virtual QString appName() const;
     virtual QString configFileName() const;
+    virtual QPixmap splashScreen() const;
 
 private:
 

+ 7 - 0
src/mirall/owncloudtheme.cpp

@@ -14,6 +14,7 @@
 
 #include <QString>
 #include <QDebug>
+#include <QPixmap>
 
 #include "owncloudtheme.h"
 
@@ -33,5 +34,11 @@ QString ownCloudTheme::configFileName() const
 {
     return QString::fromLocal8Bit("owncloud.cfg");
 }
+
+QPixmap ownCloudTheme::splashScreen() const
+{
+    return QPixmap(":/mirall/resources/owncloud_splash.png");
+}
+
 }
 

+ 1 - 1
src/mirall/owncloudtheme.h

@@ -26,7 +26,7 @@ public:
 
     virtual QString appName() const;
     QString configFileName() const;
-
+    virtual QPixmap splashScreen() const;
 private:
 
 

+ 3 - 0
src/mirall/theme.h

@@ -17,9 +17,11 @@
 
 #include "mirall/syncresult.h"
 
+
 class QIcon;
 class QString;
 class QObject;
+class QPixmap;
 
 namespace Mirall {
 
@@ -40,6 +42,7 @@ public:
     virtual QIcon folderIcon( const QString&, int ) const;
     virtual QIcon syncStateIcon( SyncResult::Status, int ) const;
     virtual QString statusHeaderText( SyncResult::Status ) const;
+    virtual QPixmap splashScreen() const = 0;
 
     virtual QString version() const;
 private: