Make sure the splash screen is displayed for 3 seconds (Thanks Leigh)

This commit is contained in:
Christophe Dumez
2010-10-30 14:38:41 +00:00
parent c8a1f625f0
commit 98fcb91dae
2 changed files with 9 additions and 12 deletions

View File

@@ -5,6 +5,7 @@
- BUGFIX: Correctly update total number of torrents when a torrent is automatically removed (closes #668726)
- BUGFIX: Correctly display the hash of torrents with no metadata
- BUGFIX: Elide status bar text if it is too wide
- BUGFIX: Make sure the splash screen is displayed for 3 seconds
* Sun Oct 24 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.8
- BUGFIX: Fix possible crash on manual peer ban

View File

@@ -38,6 +38,7 @@
#include <QStyle>
#include <QSplashScreen>
#include <QPushButton>
#include <QTimer>
#include "sessionapplication.h"
#include "GUI.h"
#include "ico.h"
@@ -248,6 +249,13 @@ int main(int argc, char *argv[]){
if(settings.value(QString::fromUtf8("Preferences/General/NoSplashScreen"), false).toBool()) {
no_splash = true;
}
QSplashScreen *splash = 0;
if(!no_splash) {
splash = new QSplashScreen(QPixmap(QString::fromUtf8(":/Icons/skin/splash.png")), Qt::WindowStaysOnTopHint);
splash->show();
app.processEvents();
QTimer::singleShot(3000, splash, SLOT(deleteLater()));
}
#endif
// Set environment variable
if(putenv((char*)"QBITTORRENT="VERSION)) {
@@ -257,17 +265,9 @@ int main(int argc, char *argv[]){
#ifndef DISABLE_GUI
useStyle(settings.value("Preferences/General/Style", "").toString());
app.setStyleSheet("QStatusBar::item { border-width: 0; }");
QSplashScreen *splash = 0;
if(!no_splash) {
splash = new QSplashScreen(QPixmap(QString::fromUtf8(":/Icons/skin/splash.png")));
splash->show();
}
#endif
if(!LegalNotice::userAgreesWithNotice()) {
#ifndef DISABLE_GUI
delete splash;
#endif
return 0;
}
#ifndef DISABLE_GUI
@@ -285,10 +285,6 @@ int main(int argc, char *argv[]){
torrentCmdLine.removeFirst();
#ifndef DISABLE_GUI
GUI window(0, torrentCmdLine);
if(!no_splash) {
splash->finish(&window);
delete splash;
}
QObject::connect(&app, SIGNAL(messageReceived(const QString&)),
&window, SLOT(processParams(const QString&)));
app.setActivationWindow(&window);