summaryrefslogtreecommitdiffstats
path: root/src/kvirc/ui/kvi_splash.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 18:31:12 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 18:31:12 +0000
commit0a80cfd57d271dd44221467efb426675fa470356 (patch)
tree6f503a31aa078eaf8fa015cf1749808529d49fc9 /src/kvirc/ui/kvi_splash.cpp
parent3329e5a804e28ef3f5eb51d1e7affdd5a508e8f2 (diff)
downloadkvirc-0a80cfd57d271dd44221467efb426675fa470356.tar.gz
kvirc-0a80cfd57d271dd44221467efb426675fa470356.zip
TQt4 port kvirc
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1238719 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/kvirc/ui/kvi_splash.cpp')
-rw-r--r--src/kvirc/ui/kvi_splash.cpp70
1 files changed, 35 insertions, 35 deletions
diff --git a/src/kvirc/ui/kvi_splash.cpp b/src/kvirc/ui/kvi_splash.cpp
index 7b6b7177..d91be01e 100644
--- a/src/kvirc/ui/kvi_splash.cpp
+++ b/src/kvirc/ui/kvi_splash.cpp
@@ -29,38 +29,38 @@
#include "kvi_splash.h"
#include "kvi_locale.h"
#include "kvi_fileutils.h"
-#include <qsplashscreen.h>
+#include <tqsplashscreen.h>
#ifdef COMPILE_USE_QT4
- #include <qdesktopwidget.h>
+ #include <tqdesktopwidget.h>
#endif
-#include <qpixmap.h>
-#include <qpainter.h>
-#include <qlayout.h>
+#include <tqpixmap.h>
+#include <tqpainter.h>
+#include <tqlayout.h>
#include <stdio.h>
KviSplashScreen::KviSplashScreen()
-: QSplashScreen(QPixmap(1,1),Qt::WStyle_NoBorder | Qt::WType_TopLevel | Qt::WStyle_Customize | Qt::WStyle_StaysOnTop | Qt::WStyle_Splash)
+: TQSplashScreen(TQPixmap(1,1),TQt::WStyle_NoBorder | TQt::WType_TopLevel | TQt::WStyle_Customize | TQt::WStyle_StaysOnTop | TQt::WStyle_Splash)
{
- QString szPix;
- QPixmap * pix = 0;
+ TQString szPix;
+ TQPixmap * pix = 0;
// check for the current theme splash screen pointer
- QString szPointerFile;
+ TQString szPointerFile;
g_pApp->getLocalKvircDirectory(szPointerFile,KviApp::Themes,"current-splash");
if(KviFileUtils::fileExists(szPointerFile))
{
- QString szBuf;
+ TQString szBuf;
KviFileUtils::readFile(szPointerFile,szBuf);
if(!szBuf.isEmpty())
{
g_pApp->getLocalKvircDirectory(szPix,KviApp::Themes,szBuf);
- KviQString::ensureLastCharIs(szPix,KVI_PATH_SEPARATOR_CHAR);
+ KviTQString::ensureLastCharIs(szPix,KVI_PATH_SEPARATOR_CHAR);
szPix.append("kvi_splash.png");
- pix = new QPixmap(szPix);
+ pix = new TQPixmap(szPix);
if(pix->isNull())
{
// no way..
@@ -69,9 +69,9 @@ KviSplashScreen::KviSplashScreen()
} else {
// else we might have a themed splash screen
// g_pApp->getLocalKvircDirectory(szPix,KviApp::Themes,szBuf);
- KviQString::ensureLastCharIs(szPix,KVI_PATH_SEPARATOR_CHAR);
+ KviTQString::ensureLastCharIs(szPix,KVI_PATH_SEPARATOR_CHAR);
szPix.append("kvi_splash_overlay.png");
- m_pOverlay = new QPixmap(szPix);
+ m_pOverlay = new TQPixmap(szPix);
if(m_pOverlay->isNull())
{
// no way..
@@ -88,39 +88,39 @@ KviSplashScreen::KviSplashScreen()
{
if(g_pApp->findImage(szPix,"kvi_splash.png"))
{
- pix = new QPixmap(szPix);
+ pix = new TQPixmap(szPix);
} else {
// dummy image
- pix = new QPixmap(300,200);
+ pix = new TQPixmap(300,200);
}
if(g_pApp->findImage(szPix,"kvi_splash_overlay.png"))
{
- m_pOverlay = new QPixmap(szPix);
+ m_pOverlay = new TQPixmap(szPix);
} else {
- m_pOverlay = new QPixmap(300,20);
+ m_pOverlay = new TQPixmap(300,20);
}
}
setPixmap(*pix);
- m_pTimer = new QTimer(this);
- connect(m_pTimer,SIGNAL(timeout()),this,SLOT(suicide()));
+ m_pTimer = new TQTimer(this);
+ connect(m_pTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(suicide()));
delete pix;
#ifdef COMPILE_USE_QT4
setWindowOpacity(0);
m_bIncreasing=true;
m_rTransparency=0;
- m_pFadeTimer= new QTimer(this);
- connect(m_pFadeTimer,SIGNAL(timeout()),this,SLOT(fadeTimerShot()));
+ m_pFadeTimer= new TQTimer(this);
+ connect(m_pFadeTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(fadeTimerShot()));
m_pFadeTimer->start(6);
#endif
}
// 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)
+//void KviSplashScreen::message(TQString szMessage)
//{
- //QSplashScreen::message(szMessage, Qt::AlignRight | Qt::AlignBottom, Qt::white);
+ //TQSplashScreen::message(szMessage, TQt::AlignRight | TQt::AlignBottom, TQt::white);
//}
KviSplashScreen::~KviSplashScreen()
@@ -131,14 +131,14 @@ KviSplashScreen::~KviSplashScreen()
}
-void KviSplashScreen::showEvent(QShowEvent *e)
+void KviSplashScreen::showEvent(TQShowEvent *e)
{
move((g_pApp->desktop()->width() - width())/2,
(g_pApp->desktop()->height() - height())/2);
- m_creationTime = QTime::currentTime();
+ m_creationTime = TQTime::currentTime();
}
-void KviSplashScreen::hideEvent(QHideEvent *e)
+void KviSplashScreen::hideEvent(TQHideEvent *e)
{
suicide();
}
@@ -146,21 +146,21 @@ void KviSplashScreen::hideEvent(QHideEvent *e)
void KviSplashScreen::setProgress(int progress)
{
#ifdef COMPILE_USE_QT4
- QPixmap slowQt4Copy = pixmap();
- QPainter painter(&slowQt4Copy);
- QSize size = slowQt4Copy.size();
+ TQPixmap slowTQt4Copy = pixmap();
+ TQPainter painter(&slowTQt4Copy);
+ TQSize size = slowTQt4Copy.size();
int w = (m_pOverlay->width() * progress) / 100;
painter.drawPixmap(0,size.height() - m_pOverlay->height(),w,m_pOverlay->height(),*m_pOverlay,0,0,w,m_pOverlay->height());
painter.end();
- setPixmap(slowQt4Copy);
+ setPixmap(slowTQt4Copy);
#else
- QPainter painter(pixmap());
- QSize size = pixmap()->size();
+ TQPainter painter(pixmap());
+ TQSize size = pixmap()->size();
painter.drawPixmap(0,size.height() - m_pOverlay->height(),*m_pOverlay,0,0,(m_pOverlay->width() * progress) / 100,m_pOverlay->height());
painter.end();
#endif
//raise();
- repaint();
+ tqrepaint();
g_pApp->processEvents(); //damn...
}
@@ -172,7 +172,7 @@ void KviSplashScreen::die()
m_bIncreasing = false;
m_pFadeTimer->start(6);
#else
- QTime now = QTime::currentTime();
+ TQTime now = TQTime::currentTime();
int mSecs = m_creationTime.msecsTo(now);
int mRemaining = KVI_SPLASH_SCREEN_MINIMUM_TIMEOUT_IN_MSECS - mSecs;
if(mRemaining < 0)mRemaining = 0;