mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 04:54:18 +00:00
Make sure the splash screen is displayed for 3 seconds
This commit is contained in:
parent
080a36de5f
commit
0374f9d0a8
20
src/main.cpp
20
src/main.cpp
@ -38,6 +38,7 @@
|
|||||||
#include <QStyle>
|
#include <QStyle>
|
||||||
#include <QSplashScreen>
|
#include <QSplashScreen>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
#include <QTimer>
|
||||||
#include "sessionapplication.h"
|
#include "sessionapplication.h"
|
||||||
#include "GUI.h"
|
#include "GUI.h"
|
||||||
#include "ico.h"
|
#include "ico.h"
|
||||||
@ -248,6 +249,13 @@ int main(int argc, char *argv[]){
|
|||||||
if(settings.value(QString::fromUtf8("Preferences/General/NoSplashScreen"), false).toBool()) {
|
if(settings.value(QString::fromUtf8("Preferences/General/NoSplashScreen"), false).toBool()) {
|
||||||
no_splash = true;
|
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
|
#endif
|
||||||
// Set environment variable
|
// Set environment variable
|
||||||
if(putenv((char*)"QBITTORRENT="VERSION)) {
|
if(putenv((char*)"QBITTORRENT="VERSION)) {
|
||||||
@ -257,17 +265,9 @@ int main(int argc, char *argv[]){
|
|||||||
#ifndef DISABLE_GUI
|
#ifndef DISABLE_GUI
|
||||||
useStyle(settings.value("Preferences/General/Style", "").toString());
|
useStyle(settings.value("Preferences/General/Style", "").toString());
|
||||||
app.setStyleSheet("QStatusBar::item { border-width: 0; }");
|
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
|
#endif
|
||||||
|
|
||||||
if(!LegalNotice::userAgreesWithNotice()) {
|
if(!LegalNotice::userAgreesWithNotice()) {
|
||||||
#ifndef DISABLE_GUI
|
|
||||||
delete splash;
|
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#ifndef DISABLE_GUI
|
#ifndef DISABLE_GUI
|
||||||
@ -285,10 +285,6 @@ int main(int argc, char *argv[]){
|
|||||||
torrentCmdLine.removeFirst();
|
torrentCmdLine.removeFirst();
|
||||||
#ifndef DISABLE_GUI
|
#ifndef DISABLE_GUI
|
||||||
GUI window(0, torrentCmdLine);
|
GUI window(0, torrentCmdLine);
|
||||||
if(!no_splash) {
|
|
||||||
splash->finish(&window);
|
|
||||||
delete splash;
|
|
||||||
}
|
|
||||||
QObject::connect(&app, SIGNAL(messageReceived(const QString&)),
|
QObject::connect(&app, SIGNAL(messageReceived(const QString&)),
|
||||||
&window, SLOT(processParams(const QString&)));
|
&window, SLOT(processParams(const QString&)));
|
||||||
app.setActivationWindow(&window);
|
app.setActivationWindow(&window);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user