From 226d25a975d3a65f33bea87098800a81bc09b4ed Mon Sep 17 00:00:00 2001 From: Szymon Tomasz Stefanek Date: Sun, 3 Jan 2016 01:55:35 +0100 Subject: Startup times are negligible nowadays. Remove splash screen. Close #1808. --- data/man/kvirc.de.1 | 3 - data/man/kvirc.en.1 | 3 - data/man/kvirc.it.1 | 3 - data/man/kvirc.pt.1 | 3 - data/man/kvirc.uk.1 | 3 - data/pics/kvi_splash_overlay.png | Bin 2459 -> 0 bytes src/kvirc/CMakeLists.txt | 1 - src/kvirc/kernel/KviApplication.cpp | 102 ----------- src/kvirc/kernel/KviApplication.h | 3 - src/kvirc/kernel/KviMain.cpp | 10 -- src/kvirc/kernel/KviOptions.cpp | 15 +- src/kvirc/ui/KviSplashScreen.cpp | 193 --------------------- src/kvirc/ui/KviSplashScreen.h | 113 ------------ .../options/OptionsWidget_interfaceFeatures.cpp | 36 +--- .../options/OptionsWidget_interfaceFeatures.h | 4 - src/modules/options/libkvioptions.cpp | 11 -- 16 files changed, 7 insertions(+), 496 deletions(-) delete mode 100644 data/pics/kvi_splash_overlay.png delete mode 100644 src/kvirc/ui/KviSplashScreen.cpp delete mode 100644 src/kvirc/ui/KviSplashScreen.h diff --git a/data/man/kvirc.de.1 b/data/man/kvirc.de.1 index cb1eb4847..e046daf5d 100644 --- a/data/man/kvirc.de.1 +++ b/data/man/kvirc.de.1 @@ -54,9 +54,6 @@ Popup-Dialog an, anstatt die Meldung auf einer Konsole auszugeben. Dies ist besonders dann hilfreich, wenn KVIrc mittels eines grafischen Buttons in der Taskleise gestartet wird. .TP 8 -.B \-\-nosplash -Den Begrüßungsbildschirm (splash screen) nicht anzeigen. -.TP 8 .B [Server] Nach dem Start zu diesem Server verbinden. .TP 8 diff --git a/data/man/kvirc.en.1 b/data/man/kvirc.en.1 index 74801b499..009abfeac 100644 --- a/data/man/kvirc.en.1 +++ b/data/man/kvirc.en.1 @@ -53,9 +53,6 @@ If a KVIrc session is already running, show an informational popup dialog instead of writing to the console. This is useful when starting KVIrc from a graphical taskbar button. .TP 8 -.B \-\-nosplash -Do not show the splash screen at startup -.TP 8 .B [server] Connect to this server after startup. .TP 8 diff --git a/data/man/kvirc.it.1 b/data/man/kvirc.it.1 index 154b18fd6..936b55c2d 100644 --- a/data/man/kvirc.it.1 +++ b/data/man/kvirc.it.1 @@ -52,9 +52,6 @@ Se una sessione di KVIrc e' gia' avviata, mostra un pannello informativo invece di scrivere sulla console. Questo e' utile quando si avvia KVIrc da un bottone grafico. .TP 8 -.B \-\-nosplash -Non mostra lo splash screen all'avvio -.TP 8 .B [server] Connette a questo server dopo l'avvio. .TP 8 diff --git a/data/man/kvirc.pt.1 b/data/man/kvirc.pt.1 index b96f78161..fb07e86a6 100644 --- a/data/man/kvirc.pt.1 +++ b/data/man/kvirc.pt.1 @@ -53,9 +53,6 @@ Se uma sessão do KVIrc já extiver a correr, mostra uma caixa de diálogo informacional em vez de escrever para a consola. Isto é útil quando inicia o KVIrc de um botão da barra de tarefas. .TP 8 -.B \-\-nosplash -Não mostra o ecrã de arranque KVIrc ao iniciar -.TP 8 .B [servidor] Conecta a este servidor após iniciar. .TP 8 diff --git a/data/man/kvirc.uk.1 b/data/man/kvirc.uk.1 index 8494866cc..fa2f8281e 100644 --- a/data/man/kvirc.uk.1 +++ b/data/man/kvirc.uk.1 @@ -53,9 +53,6 @@ KVIrc є Візуальним клієнтом Internet Relay Chat і основ замість запису в консоль. Це корисно якщо стартувати KVIrc кнопкою з графічної панелі. .TP 8 -.B \-\-nosplash -Не показувати заставку при запуску -.TP 8 .B [сервер] Приєднатись до цього сервера при старті. .TP 8 diff --git a/data/pics/kvi_splash_overlay.png b/data/pics/kvi_splash_overlay.png deleted file mode 100644 index dfd62b056..000000000 Binary files a/data/pics/kvi_splash_overlay.png and /dev/null differ diff --git a/src/kvirc/CMakeLists.txt b/src/kvirc/CMakeLists.txt index b328b91c7..8a116769a 100644 --- a/src/kvirc/CMakeLists.txt +++ b/src/kvirc/CMakeLists.txt @@ -56,7 +56,6 @@ set(kvirc_SRCS ui/KviScriptButton.cpp ui/KviScriptEditor.cpp ui/KviSelectors.cpp - ui/KviSplashScreen.cpp ui/KviStatusBar.cpp ui/KviStatusBarApplet.cpp ui/KviTextIconWindow.cpp diff --git a/src/kvirc/kernel/KviApplication.cpp b/src/kvirc/kernel/KviApplication.cpp index c00a3c1be..08bf0bd6e 100644 --- a/src/kvirc/kernel/KviApplication.cpp +++ b/src/kvirc/kernel/KviApplication.cpp @@ -50,7 +50,6 @@ #include "kvi_defaults.h" #include "KviLocale.h" #include "kvi_out.h" -#include "KviSplashScreen.h" #include "KviNickServRuleSet.h" #include "KviIdentityProfileSet.h" #include "KviDefaultScript.h" @@ -177,9 +176,6 @@ KVIRC_API KviHistoryWindowWidget * g_pHistoryWindow // this is eventually set by libkviident KVIRC_API int g_iIdentDaemonRunningUsers = 0; -KVIRC_API KviSplashScreen * g_pSplashScreen = 0; - - // Loaded and destroyed by KviIconManager QPixmap * g_pUserChanStatePixmap = 0; QPixmap * g_pActivityMeterPixmap = 0; @@ -217,7 +213,6 @@ KviApplication::KviApplication(int &argc,char ** argv) g_pApp = this; m_szConfigFile = QString(); m_bCreateConfig = false; - m_bShowSplashScreen = true; m_bUpdateGuiPending = false; m_pPendingAvatarChanges = NULL; m_pRecentChannelDict = NULL; @@ -304,18 +299,6 @@ void KviApplication::setup() //qDebug("%1",loader.isLoaded()); #endif - QString szSplashDisableFile; - getLocalKvircDirectory(szSplashDisableFile,Pics,"disable-splash"); - - if(KviFileUtils::fileExists(szSplashDisableFile)) - m_bShowSplashScreen = false; - - // Now we can create the splash screen (we can locate the splash image) - if(m_bShowSplashScreen) - createSplashScreen(); - - KVI_SPLASH_SET_PROGRESS(0) - // Make sure that the C strings are translated to utf8 // This is a fallback solution anyway: we should use the appropriate // encoding every time. @@ -331,53 +314,33 @@ void KviApplication::setup() QString szTmp; - KVI_SPLASH_SET_PROGRESS(1) - // Initialize the scripting engine KviKvs::init(); - KVI_SPLASH_SET_PROGRESS(2) - // Initialize the action manager KviActionManager::init(); - KVI_SPLASH_SET_PROGRESS(3) - // Create the module manager early: so the other managers can load modules g_pModuleExtensionManager = new KviModuleExtensionManager(); - KVI_SPLASH_SET_PROGRESS(4); - g_pModuleManager = new KviModuleManager(); - KVI_SPLASH_SET_PROGRESS(5) - if(getReadOnlyConfigPath(szTmp,KVI_CONFIGFILE_USERACTIONS)) KviActionManager::instance()->load(szTmp); - KVI_SPLASH_SET_PROGRESS(8); - // Initialize and load the identities KviUserIdentityManager::init(); - KVI_SPLASH_SET_PROGRESS(9); - if(getReadOnlyConfigPath(szTmp,KVI_CONFIGFILE_IDENTITIES)) KviUserIdentityManager::instance()->load(szTmp); - KVI_SPLASH_SET_PROGRESS(12); - KviAnimatedPixmapCache::init(); - KVI_SPLASH_SET_PROGRESS(13); - // Load the remaining configuration // Note that loadOptions() assumes that the current progress is 12 and // will bump it up to 45 in small steps loadOptions(); - KVI_SPLASH_SET_PROGRESS(47) - // set the global font if needed updateApplicationFont(); @@ -388,76 +351,52 @@ void KviApplication::setup() // enforce our "icon in popups" option - this is done also in each updateGui() call setAttribute(Qt::AA_DontShowIconsInMenus, !KVI_OPTION_BOOL(KviOption_boolShowIconsInPopupMenus)); - KVI_SPLASH_SET_PROGRESS(48) - // Load the win properties config getLocalKvircDirectory(szTmp,Config,KVI_CONFIGFILE_WINPROPERTIES); g_pWinPropertiesConfig = new KviConfigurationFile(szTmp,KviConfigurationFile::ReadWrite); - KVI_SPLASH_SET_PROGRESS(50) - // Load the server database g_pServerDataBase = new KviIrcServerDataBase(); if(getReadOnlyConfigPath(szTmp,KVI_CONFIGFILE_SERVERDB)) g_pServerDataBase->load(szTmp); - KVI_SPLASH_SET_PROGRESS(53) - // Load the proxy database g_pProxyDataBase = new KviProxyDataBase(); if(getReadOnlyConfigPath(szTmp,KVI_CONFIGFILE_PROXYDB)) g_pProxyDataBase->load(szTmp); - KVI_SPLASH_SET_PROGRESS(54) - // Event manager if(getReadOnlyConfigPath(szTmp,KVI_CONFIGFILE_EVENTS)) KviKvs::loadAppEvents(szTmp); - KVI_SPLASH_SET_PROGRESS(59) - if(getReadOnlyConfigPath(szTmp,KVI_CONFIGFILE_RAWEVENTS)) KviKvs::loadRawEvents(szTmp); - KVI_SPLASH_SET_PROGRESS(62) - // Popup manager if(getReadOnlyConfigPath(szTmp,KVI_CONFIGFILE_POPUPS)) KviKvs::loadPopups(szTmp); - KVI_SPLASH_SET_PROGRESS(67) - KviCustomToolBarManager::init(); if(getReadOnlyConfigPath(szTmp,KVI_CONFIGFILE_CUSTOMTOOLBARS)) KviCustomToolBarManager::instance()->load(szTmp); - KVI_SPLASH_SET_PROGRESS(70) - // Alias manager if(getReadOnlyConfigPath(szTmp,KVI_CONFIGFILE_ALIASES)) KviKvs::loadAliases(szTmp); - KVI_SPLASH_SET_PROGRESS(75) - // Script addons manager (this in fact has delayed loading, so we don't even care // about showing up an entry in the splash screen) if(getReadOnlyConfigPath(szTmp,KVI_CONFIGFILE_SCRIPTADDONS)) KviKvs::loadScriptAddons(szTmp); - KVI_SPLASH_SET_PROGRESS(77) - g_pTextIconManager = new KviTextIconManager(); g_pTextIconManager->load(); - KVI_SPLASH_SET_PROGRESS(80) - // load the recent data lists g_pRecentTopicList = new QStringList(); //g_pBookmarkList = new QStringList(); loadRecentEntries(); - KVI_SPLASH_SET_PROGRESS(81) - // media manager g_pMediaManager = new KviMediaManager(); g_pMediaManager->lock(); @@ -465,63 +404,45 @@ void KviApplication::setup() g_pMediaManager->load(szTmp); g_pMediaManager->unlock(); - KVI_SPLASH_SET_PROGRESS(82) - // registered user data base g_pRegisteredUserDataBase = new KviRegisteredUserDataBase(); if(getReadOnlyConfigPath(szTmp,KVI_CONFIGFILE_REGUSERDB)) g_pRegisteredUserDataBase->load(szTmp); - KVI_SPLASH_SET_PROGRESS(83) - // registered channel data base g_pRegisteredChannelDataBase = new KviRegisteredChannelDataBase(); if(getReadOnlyConfigPath(szTmp,KVI_CONFIGFILE_REGCHANDB)) g_pRegisteredChannelDataBase->load(szTmp); - KVI_SPLASH_SET_PROGRESS(84) - // file trader g_pSharedFilesManager = new KviSharedFilesManager(); if(getReadOnlyConfigPath(szTmp,KVI_CONFIGFILE_SHAREDFILES)) g_pSharedFilesManager->load(szTmp); - KVI_SPLASH_SET_PROGRESS(85) - // nick serv data base g_pNickServRuleSet = new KviNickServRuleSet(); if(getReadOnlyConfigPath(szTmp,KVI_CONFIGFILE_NICKSERVDATABASE)) g_pNickServRuleSet->load(szTmp); - KVI_SPLASH_SET_PROGRESS(86) - // Identity profiles database KviIdentityProfileSet::init(); if(getReadOnlyConfigPath(szTmp,KVI_CONFIGFILE_PROFILESDATABASE)) KviIdentityProfileSet::instance()->load(szTmp); - KVI_SPLASH_SET_PROGRESS(87) - KviAvatarCache::init(); if(getReadOnlyConfigPath(szTmp,KVI_CONFIGFILE_AVATARCACHE)) KviAvatarCache::instance()->load(szTmp); - KVI_SPLASH_SET_PROGRESS(88) - KviInputHistory::init(); if(getReadOnlyConfigPath(szTmp,KVI_CONFIGFILE_INPUTHISTORY)) KviInputHistory::instance()->load(szTmp); - KVI_SPLASH_SET_PROGRESS(89) - KviDefaultScriptManager::init(); if(getReadOnlyConfigPath(szTmp,KVI_CONFIGFILE_DEFAULTSCRIPT)) KviDefaultScriptManager::instance()->load(szTmp); else KviDefaultScriptManager::instance()->loadEmptyConfig(); - KVI_SPLASH_SET_PROGRESS(90) - // Eventually initialize the crypt engine manager #ifdef COMPILE_CRYPT_SUPPORT g_pCryptEngineManager = new KviCryptEngineManager(); @@ -535,16 +456,12 @@ void KviApplication::setup() // create the server parser g_pServerParser = new KviIrcServerParser(); - KVI_SPLASH_SET_PROGRESS(91) - // Global window dictionary g_pGlobalWindowDict = new KviPointerHashTable(41); g_pGlobalWindowDict->setAutoDelete(false); // Script object controller //g_pScriptObjectController = new KviScriptObjectController(); gone - KVI_SPLASH_SET_PROGRESS(92) - QString szStylesheetFile; getGlobalKvircDirectory(szStylesheetFile,Config,"style.css"); if(KviFileUtils::fileExists(szStylesheetFile)) @@ -576,14 +493,9 @@ void KviApplication::setup() // We're REALLY up and running! // kill the splash screen - KVI_SPLASH_SET_PROGRESS(100) - //KVI_SPLASH_SET_TEXT(__tr2qs("Have fun! :)")) - if(KVI_OPTION_BOOL(KviOption_boolShowServersConnectDialogOnStart)) g_pMainWindow->executeInternalCommand(KVI_INTERNALCOMMAND_SERVERSJOIN_OPEN); - destroySplashScreen(); - // check if we're in trouble... checkSuggestRestoreDefaultScript(); @@ -621,8 +533,6 @@ KviApplication::~KviApplication() delete g_pMainWindow; g_pActiveWindow = 0; // .. but it should be already 0 anyway - if(g_pSplashScreen) - delete g_pSplashScreen; if(g_pCtcpPageDialog) delete g_pCtcpPageDialog; @@ -1203,18 +1113,6 @@ void KviApplication::ipcMessage(char * pcMessage) } #endif // COMPILE_NO_IPC -void KviApplication::createSplashScreen() -{ - g_pSplashScreen = new KviSplashScreen(); - g_pSplashScreen->show(); -} - -void KviApplication::destroySplashScreen() -{ - if(g_pSplashScreen) - g_pSplashScreen->die(); -} - void KviApplication::setAvatarFromOptions() { KviPointerHashTableIterator it(*g_pGlobalWindowDict); diff --git a/src/kvirc/kernel/KviApplication.h b/src/kvirc/kernel/KviApplication.h index 1d25ec68b..31bcf0b3f 100644 --- a/src/kvirc/kernel/KviApplication.h +++ b/src/kvirc/kernel/KviApplication.h @@ -128,7 +128,6 @@ public: QString m_szConfigFile; // setup bool m_bCreateConfig; // setup QString m_szExecAfterStartup; - bool m_bShowSplashScreen; protected: #ifdef COMPILE_KDE_SUPPORT KAboutData * m_pAboutData; @@ -323,8 +322,6 @@ protected: void heartbeat(kvi_time_t tNow); virtual void timerEvent(QTimerEvent *e); private: - void createSplashScreen(); - void destroySplashScreen(); // KviApplication_setup.cpp : Setup stuff void loadDirectories(); diff --git a/src/kvirc/kernel/KviMain.cpp b/src/kvirc/kernel/KviMain.cpp index 72de3e281..fca893dd8 100644 --- a/src/kvirc/kernel/KviMain.cpp +++ b/src/kvirc/kernel/KviMain.cpp @@ -65,7 +65,6 @@ typedef struct _ParseArgs bool createFile; bool bForceNewSession; bool bShowPopup; - bool bShowSplashScreen; bool bExecuteCommandAndClose; QString szExecCommand; QString szExecRemoteCommand; @@ -138,7 +137,6 @@ int parseArgs(ParseArgs * a) KviQString::appendFormatted(szMessage," You can eventually use this switch more than once\n"); KviQString::appendFormatted(szMessage," -m : If a KVIrc session is already running, show an informational\n"); KviQString::appendFormatted(szMessage," popup dialog instead of writing to the console\n"); - KviQString::appendFormatted(szMessage," --nosplash : Do not show the splash screen at startup\n"); KviQString::appendFormatted(szMessage," [server] : Connect to this server after startup\n"); KviQString::appendFormatted(szMessage," [port] : Use this port for connection\n"); KviQString::appendFormatted(szMessage," [ircurl] : URL in the following form:\n"); @@ -233,12 +231,6 @@ int parseArgs(ParseArgs * a) continue; } - if(kvi_strEqualCI("-nosplash",p)) - { - a->bShowSplashScreen = false; - continue; - } - if(kvi_strEqualCI("-f",p)) { a->bForceNewSession = true; @@ -351,7 +343,6 @@ int main(int argc, char ** argv) a.createFile = false; a.bForceNewSession = false; a.bShowPopup = false, - a.bShowSplashScreen = true; a.bExecuteCommandAndClose = false; int iRetCode = parseArgs(&a); @@ -477,7 +468,6 @@ int main(int argc, char ** argv) pTheApp->m_bCreateConfig = a.createFile; pTheApp->m_szConfigFile = a.configFile; pTheApp->m_szExecAfterStartup = a.szExecCommand; - pTheApp->m_bShowSplashScreen = a.bShowSplashScreen; pTheApp->setup(); // YEAH! diff --git a/src/kvirc/kernel/KviOptions.cpp b/src/kvirc/kernel/KviOptions.cpp index 30ca6ca8c..42da6d16b 100644 --- a/src/kvirc/kernel/KviOptions.cpp +++ b/src/kvirc/kernel/KviOptions.cpp @@ -37,7 +37,6 @@ #include "kvi_out.h" #include "KviStringConversion.h" #include "kvi_settings.h" -#include "KviSplashScreen.h" #include "KviMainWindow.h" #include "KviInternalCommand.h" #include "KviTheme.h" @@ -925,7 +924,6 @@ void KviApplication::loadOptions() { KviConfigurationFile cfg(buffer,KviConfigurationFile::Read); - int prg = 12; int i; #define READ_OPTIONS(_num,_table,_readFnc) \ @@ -933,9 +931,7 @@ void KviApplication::loadOptions() { \ config_set_section(_table[i].flags,&cfg); \ _table[i].option = cfg._readFnc(_table[i].name,_table[i].option); \ - } \ - prg += 3; \ - KVI_SPLASH_SET_PROGRESS(prg) + } READ_OPTIONS(KVI_NUM_RECT_OPTIONS,g_rectOptionsTable,readRectEntry) READ_OPTIONS(KVI_NUM_BOOL_OPTIONS,g_boolOptionsTable,readBoolEntry) @@ -1186,11 +1182,6 @@ namespace KviTheme // reset the current theme subdir KVI_OPTION_STRING(KviOption_stringIconThemeSubdir) = ""; - // reset the splash screen pointer - QString szPointerFile; - g_pApp->getLocalKvircDirectory(szPointerFile,KviApplication::Themes,"current-splash"); - KviFileUtils::removeFile(szPointerFile); - KviConfigurationFile cfg(szThemeDirPath+KVI_THEMEDATA_FILE_NAME,KviConfigurationFile::Read); QString t=szThemeDirPath+KVI_THEMEDATA_FILE_NAME; cfg.setGroup(KVI_THEMEDATA_CONFIG_GROUP); @@ -1276,10 +1267,6 @@ namespace KviTheme } } - // create the splash screen pointer if this theme has some pixmaps in it - if(!KVI_OPTION_STRING(KviOption_stringIconThemeSubdir).isEmpty()) - KviFileUtils::writeFile(szPointerFile,KVI_OPTION_STRING(KviOption_stringIconThemeSubdir)); - // force reloading of images anyway g_pApp->optionResetUpdate(iResetFlags | KviOption_resetReloadImages); KVI_OPTION_STRING(KviOption_stringIconThemeSubdir) = szThemeDir; diff --git a/src/kvirc/ui/KviSplashScreen.cpp b/src/kvirc/ui/KviSplashScreen.cpp deleted file mode 100644 index 1ce19dabf..000000000 --- a/src/kvirc/ui/KviSplashScreen.cpp +++ /dev/null @@ -1,193 +0,0 @@ -//============================================================================= -// -// File : KviSplashScreen.cpp -// Creation date : Wed Aug 8 2001 17:46:10 CEST by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2001-2010 Szymon Stefanek (pragma at kvirc dot net) -// -// This program is FREE software. You can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the HOPE that it will be USEFUL, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, write to the Free Software Foundation, -// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -//============================================================================= - - -#include "KviCString.h" -#include "KviApplication.h" -#include "kvi_defaults.h" -#include "KviSplashScreen.h" -#include "KviLocale.h" -#include "KviFileUtils.h" - -#include -#include -#include -#include -#include - -#include - - -KviSplashScreen::KviSplashScreen() -: QSplashScreen(QPixmap(1,1),Qt::FramelessWindowHint | Qt::Window | Qt::WindowStaysOnTopHint | Qt::SplashScreen) -{ - QString szPix; - QPixmap * pix = 0; - - // check for the current theme splash screen pointer - QString szPointerFile; - g_pApp->getLocalKvircDirectory(szPointerFile,KviApplication::Themes,"current-splash"); - if(KviFileUtils::fileExists(szPointerFile)) - { - QString szBuf; - KviFileUtils::readFile(szPointerFile,szBuf); - if(!szBuf.isEmpty()) - { - g_pApp->getLocalKvircDirectory(szPix,KviApplication::Themes,szBuf); - KviQString::ensureLastCharIs(szPix,KVI_PATH_SEPARATOR_CHAR); - szPix.append("kvi_splash.png"); - pix = new QPixmap(szPix); - if(pix->isNull()) - { - // no way.. - delete pix; - pix = 0; - } else { - // else we might have a themed splash screen -// g_pApp->getLocalKvircDirectory(szPix,KviApplication::Themes,szBuf); - KviQString::ensureLastCharIs(szPix,KVI_PATH_SEPARATOR_CHAR); - szPix.append("kvi_splash_overlay.png"); - m_pOverlay = new QPixmap(szPix); - if(m_pOverlay->isNull()) - { - // no way.. - delete pix; - pix = 0; - delete m_pOverlay; - m_pOverlay = 0; - } - } - } - } - - if(!pix) - { - if(g_pApp->findImage(szPix,"kvi_splash.png")) - { - pix = new QPixmap(szPix); - } else { - // dummy image - pix = new QPixmap(300,200); - } - - if(g_pApp->findImage(szPix,"kvi_splash_overlay.png")) - { - m_pOverlay = new QPixmap(szPix); - } else { - m_pOverlay = new QPixmap(300,20); - } - } - - setPixmap(*pix); - m_pTimer = new QTimer(this); - connect(m_pTimer,SIGNAL(timeout()),this,SLOT(suicide())); - delete pix; - - setWindowOpacity(0); - m_bIncreasing=true; - m_rTransparency=0; - m_pFadeTimer= new QTimer(this); - connect(m_pFadeTimer,SIGNAL(timeout()),this,SLOT(fadeTimerShot())); - m_pFadeTimer->start(6); -} - -// We don't need messages on the splash: they just add work to the translators and nobody can read them anyway :D -//void KviSplashScreen::message(QString szMessage) -//{ - //QSplashScreen::message(szMessage, Qt::AlignRight | Qt::AlignBottom, Qt::white); -//} - -KviSplashScreen::~KviSplashScreen() -{ - g_pSplashScreen = 0; // make sure it's true - delete m_pTimer; - delete m_pOverlay; -} - -void KviSplashScreen::showEvent(QShowEvent *) -{ - QRect rect = g_pApp->desktop()->screenGeometry(g_pApp->desktop()->primaryScreen()); - move((rect.width() - width())/2,(rect.height() - height())/2); - - m_creationTime = QTime::currentTime(); -} - -void KviSplashScreen::hideEvent(QHideEvent *) -{ - suicide(); -} - -void KviSplashScreen::setProgress(int iProgress) -{ - QPixmap slowQt4Copy = pixmap(); - QPainter painter(&slowQt4Copy); - QSize size = slowQt4Copy.size(); - int iWidth = (m_pOverlay->width() * iProgress) / 100; - painter.drawPixmap(0,size.height() - m_pOverlay->height(),iWidth,m_pOverlay->height(),*m_pOverlay,0,0,iWidth,m_pOverlay->height()); - painter.end(); - setPixmap(slowQt4Copy); - - //raise(); - repaint(); - g_pApp->processEvents(); //damn... -} - -void KviSplashScreen::die() -{ - m_bIncreasing = false; - m_pFadeTimer->start(6); -} - -void KviSplashScreen::suicide() -{ - if(!g_pSplashScreen) - return; // already in suicide ? - //g_pApp->collectGarbage(this); - g_pSplashScreen = 0; - deleteLater(); - //delete this; -} - -void KviSplashScreen::fadeTimerShot() -{ - if(m_bIncreasing) - { - m_rTransparency += 0.05; - setWindowOpacity(m_rTransparency); - if(m_rTransparency>=1) - { - m_pFadeTimer->stop(); - m_bIncreasing = false; - } - } else { - m_rTransparency -= 0.02; - setWindowOpacity(m_rTransparency); - if(m_rTransparency<=0) - { - m_pFadeTimer->stop(); - m_bIncreasing = true; - suicide(); - } - } -} diff --git a/src/kvirc/ui/KviSplashScreen.h b/src/kvirc/ui/KviSplashScreen.h deleted file mode 100644 index acf118795..000000000 --- a/src/kvirc/ui/KviSplashScreen.h +++ /dev/null @@ -1,113 +0,0 @@ -#ifndef _KVI_SPLASH_H_ -#define _KVI_SPLASH_H_ -//============================================================================= -// -// File : KviSplashScreen.h -// Creation date : Wed Aug 8 2001 17:45:12 CEST by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2001-2010 Szymon Stefanek (pragma at kvirc dot net) -// -// This program is FREE software. You can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the HOPE that it will be USEFUL, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, write to the Free Software Foundation, -// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -//============================================================================= - -/** -* \file KviSplashScreen.h -* \author Szymon Stefanek -* \brief Splash screen -* -* \def KVI_SPLASH_SCREEN_MINIMUM_TIMEOUT_IN_MSECS The minimum timeout in msec -* \def KVI_SPLASH_SET_PROGRESS Updates the splash screen progress bar -*/ - -#include "kvi_settings.h" - -#include -#include -#include -#include -#include -#include -#include - -#define KVI_SPLASH_SCREEN_MINIMUM_TIMEOUT_IN_MSECS 2000 - -#define KVI_SPLASH_SET_PROGRESS(__val) \ - if(g_pSplashScreen) \ - g_pSplashScreen->setProgress(__val); - -//#define KVI_SPLASH_SET_TEXT(__txt) if(g_pSplashScreen){ g_pSplashScreen->message(__txt); qDebug(__txt.latin1()); } - -/** -* \class KviSplashScreen -* \brief Splash screen class -*/ -class KVIRC_API KviSplashScreen : public QSplashScreen -{ - Q_OBJECT -public: - /** - * \brief Constructs the splash screen object - * \return KviSplashScreen - */ - KviSplashScreen(); - - /** - * \brief Destroys the splash screen object - */ - virtual ~KviSplashScreen(); -private: - QTimer * m_pTimer; - QTime m_creationTime; - QPixmap * m_pOverlay; - bool m_bIncreasing; - qreal m_rTransparency; - QTimer * m_pFadeTimer; -public: - /** - * \brief Sets the progress in steps - * \param iProgress The progress step - * \return void - */ - void setProgress(int iProgress); - - /** - * \brief Kills the splash screen - * \return void - */ - void die(); - - //void message(QString); -protected slots: - /** - * \brief Called when we want to kill the splash screen - * \return void - */ - void suicide(); - - /** - * \brief Sets the fading effect - * \return void - */ - void fadeTimerShot(); -protected: - virtual void showEvent(QShowEvent * e); - virtual void hideEvent(QHideEvent * e); -}; - -extern KVIRC_API KviSplashScreen * g_pSplashScreen; - -#endif //_KVI_SPLASH_H_ diff --git a/src/modules/options/OptionsWidget_interfaceFeatures.cpp b/src/modules/options/OptionsWidget_interfaceFeatures.cpp index cba08387e..6c1cb2e67 100644 --- a/src/modules/options/OptionsWidget_interfaceFeatures.cpp +++ b/src/modules/options/OptionsWidget_interfaceFeatures.cpp @@ -45,48 +45,24 @@ OptionsWidget_interfaceFeatures::OptionsWidget_interfaceFeatures(QWidget * paren addBoolSelector(0,1,0,1,__tr2qs_ctx("Confirm quit with active connections","options"),KviOption_boolConfirmCloseWhenThereAreConnections); addBoolSelector(0,2,0,2,__tr2qs_ctx("Remember window properties","options"),KviOption_boolWindowsRememberProperties); - QString szSplashDisableFile; - g_pApp->getLocalKvircDirectory(szSplashDisableFile,KviApplication::Pics,"disable-splash"); - bool bDisableSplash = KviFileUtils::fileExists(szSplashDisableFile); - m_pDisableSplash = new QCheckBox(__tr2qs_ctx("Disable splash screen","options"),this); - addWidgetToLayout(m_pDisableSplash,0,3,0,3); - m_pDisableSplash->setChecked(bDisableSplash); - - addBoolSelector(0,4,0,4,__tr2qs_ctx("Enable visual effects","options"),KviOption_boolEnableVisualEffects); - addBoolSelector(0,5,0,5,__tr2qs_ctx("Hide channel window tool buttons by default","options"),KviOption_boolHideWindowToolButtons); + addBoolSelector(0,3,0,3,__tr2qs_ctx("Enable visual effects","options"),KviOption_boolEnableVisualEffects); + addBoolSelector(0,4,0,4,__tr2qs_ctx("Hide channel window tool buttons by default","options"),KviOption_boolHideWindowToolButtons); #ifdef COMPILE_ON_MAC - addBoolSelector(0,6,0,6,__tr2qs_ctx("Require ⌘ to be held down to copy text","options"),KviOption_boolRequireControlToCopy); + addBoolSelector(0,5,0,5,__tr2qs_ctx("Require ⌘ to be held down to copy text","options"),KviOption_boolRequireControlToCopy); #else - addBoolSelector(0,6,0,6,__tr2qs_ctx("Require Ctrl to be held down to copy text","options"),KviOption_boolRequireControlToCopy); + addBoolSelector(0,5,0,5,__tr2qs_ctx("Require Ctrl to be held down to copy text","options"),KviOption_boolRequireControlToCopy); #endif - KviTalGroupBox * g = addGroupBox(0,7,0,7,Qt::Horizontal,__tr2qs_ctx("Open Dialog Window for","options")); + KviTalGroupBox * g = addGroupBox(0,6,0,6,Qt::Horizontal,__tr2qs_ctx("Open Dialog Window for","options")); addBoolSelector(g,__tr2qs_ctx("Preferences","options"),KviOption_boolShowGeneralOptionsDialogAsToplevel); addBoolSelector(g,__tr2qs_ctx("Registered users","options"),KviOption_boolShowRegisteredUsersDialogAsToplevel); addBoolSelector(g,__tr2qs_ctx("Identity","options"),KviOption_boolShowIdentityDialogAsToplevel); addBoolSelector(g,__tr2qs_ctx("Servers","options"),KviOption_boolShowServersConnectDialogAsToplevel); addBoolSelector(g,__tr2qs_ctx("Join channels","options"),KviOption_boolShowChannelsJoinDialogAsToplevel); - addRowSpacer(0,8,0,8); + addRowSpacer(0,7,0,7); } OptionsWidget_interfaceFeatures::~OptionsWidget_interfaceFeatures() { } -void OptionsWidget_interfaceFeatures::commit() -{ - KviOptionsWidget::commit(); - - QString szSplashDisableFile; - g_pApp->getLocalKvircDirectory(szSplashDisableFile,KviApplication::Pics,"disable-splash"); - - if(m_pDisableSplash->isChecked()) - { - if(!KviFileUtils::fileExists(szSplashDisableFile)) - KviFileUtils::writeFile(szSplashDisableFile,QString()); - } else { - if(KviFileUtils::fileExists(szSplashDisableFile)) - KviFileUtils::removeFile(szSplashDisableFile); - } - -} diff --git a/src/modules/options/OptionsWidget_interfaceFeatures.h b/src/modules/options/OptionsWidget_interfaceFeatures.h index ec54a80e3..2ae21508b 100644 --- a/src/modules/options/OptionsWidget_interfaceFeatures.h +++ b/src/modules/options/OptionsWidget_interfaceFeatures.h @@ -39,10 +39,6 @@ class OptionsWidget_interfaceFeatures : public KviOptionsWidget public: OptionsWidget_interfaceFeatures(QWidget * parent); ~OptionsWidget_interfaceFeatures(); -protected: - QCheckBox * m_pDisableSplash; -public: - virtual void commit(); }; #endif //!_OPTW_INTERFACEFEATURES_H_ diff --git a/src/modules/options/libkvioptions.cpp b/src/modules/options/libkvioptions.cpp index f5bcba8a3..9cb3ad246 100644 --- a/src/modules/options/libkvioptions.cpp +++ b/src/modules/options/libkvioptions.cpp @@ -34,7 +34,6 @@ #include "KviLocale.h" #include "KviControlCodes.h" #include "kvi_out.h" -#include "KviSplashScreen.h" #include "KviPointerHashTable.h" #include @@ -229,16 +228,6 @@ static bool options_kvs_cmd_edit(KviKvsModuleCommandCall * c) //wc->setModal(true); - // a trick for the dialog covering the splash screen before the time (this is prolly a WM or Qt bug) - if(g_pSplashScreen) - { - if(g_pSplashScreen->isVisible()) // another bug: this ALWAYS RETURNS true, even if the splash was hidden by a mouse click... - { - QObject::connect(g_pSplashScreen,SIGNAL(destroyed()),wc,SLOT(show())); - return true; - } - } - wc->show(); wc->raise(); return true; -- cgit v1.3.1-10-gc9f91