summaryrefslogtreecommitdiffstats
path: root/src/kvirc/ui/kvi_statusbarapplet.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_statusbarapplet.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_statusbarapplet.cpp')
-rw-r--r--src/kvirc/ui/kvi_statusbarapplet.cpp100
1 files changed, 50 insertions, 50 deletions
diff --git a/src/kvirc/ui/kvi_statusbarapplet.cpp b/src/kvirc/ui/kvi_statusbarapplet.cpp
index 8e4ec89..bc8fa02 100644
--- a/src/kvirc/ui/kvi_statusbarapplet.cpp
+++ b/src/kvirc/ui/kvi_statusbarapplet.cpp
@@ -40,15 +40,15 @@
#include "kvi_options.h"
#include "kvi_kvs_script.h"
-#include <qpainter.h>
-#include <qstyle.h>
-#include <qlayout.h>
-#include <qtimer.h>
-#include <qcursor.h>
+#include <tqpainter.h>
+#include <tqstyle.h>
+#include <tqlayout.h>
+#include <tqtimer.h>
+#include <tqcursor.h>
#include "kvi_tal_popupmenu.h"
-#include <qpixmap.h>
+#include <tqpixmap.h>
#ifdef COMPILE_USE_QT4
- #include <qevent.h>
+ #include <tqevent.h>
#endif
// This class COULD be derived also from KStatusBar but in fact
@@ -61,7 +61,7 @@
#include "kvi_time.h"
#include "kvi_qstring.h"
-#include <qfont.h>
+#include <tqfont.h>
/*
IDEAS:
@@ -69,7 +69,7 @@
- Countdown timer
*/
-KviStatusBarAppletDescriptor::KviStatusBarAppletDescriptor(const QString &szVisibleName,const QString &szInternalName,CreateAppletCallback pProc,const QString &szPreloadModule,const QPixmap &pixIcon)
+KviStatusBarAppletDescriptor::KviStatusBarAppletDescriptor(const TQString &szVisibleName,const TQString &szInternalName,CreateAppletCallback pProc,const TQString &szPreloadModule,const TQPixmap &pixIcon)
: KviHeapObject()
{
static int s_iAppletDescriptorUniqueId = 0;
@@ -81,7 +81,7 @@ KviStatusBarAppletDescriptor::KviStatusBarAppletDescriptor(const QString &szVisi
m_pProc = pProc;
m_pAppletList = new KviPointerList<KviStatusBarApplet>;
m_pAppletList->setAutoDelete(false);
- if(!pixIcon.isNull())m_pIcon = new QPixmap(pixIcon);
+ if(!pixIcon.isNull())m_pIcon = new TQPixmap(pixIcon);
else m_pIcon = 0;
}
@@ -113,7 +113,7 @@ void KviStatusBarAppletDescriptor::unregisterApplet(KviStatusBarApplet * a)
KviStatusBarApplet::KviStatusBarApplet(KviStatusBar * pParent,KviStatusBarAppletDescriptor *pDescriptor)
-: QLabel(pParent), m_pStatusBar(pParent), m_pDescriptor(pDescriptor)
+: TQLabel(pParent), m_pStatusBar(pParent), m_pDescriptor(pDescriptor)
{
m_pDescriptor->registerApplet(this);
m_pStatusBar->registerApplet(this);
@@ -126,26 +126,26 @@ KviStatusBarApplet::~KviStatusBarApplet()
m_pStatusBar->unregisterApplet(this);
}
-QString KviStatusBarApplet::tipText(const QPoint &)
+TQString KviStatusBarApplet::tipText(const TQPoint &)
{
- return QString::null;
+ return TQString();
}
-void KviStatusBarApplet::paintEvent(QPaintEvent * e)
+void KviStatusBarApplet::paintEvent(TQPaintEvent * e)
{
- QLabel::paintEvent(e);
+ TQLabel::paintEvent(e);
setFont(KVI_OPTION_FONT(KviOption_fontIrcToolBarApplet));
if(m_bSelected)
{
- QPainter p(this);
+ TQPainter p(this);
#ifdef COMPILE_USE_QT4
- p.setCompositionMode(QPainter::CompositionMode_SourceOut);
- p.fillRect(rect(),Qt::black);
- p.setCompositionMode(QPainter::CompositionMode_SourceOver);
+ p.setCompositionMode(TQPainter::CompositionMode_SourceOut);
+ p.fillRect(rect(),TQt::black);
+ p.setCompositionMode(TQPainter::CompositionMode_SourceOver);
#else
- p.setRasterOp(Qt::NotROP);
- p.fillRect(rect(),Qt::black);
- p.setRasterOp(Qt::CopyROP);
+ p.setRasterOp(TQt::NotROP);
+ p.fillRect(rect(),TQt::black);
+ p.setRasterOp(TQt::CopyROP);
#endif
}
}
@@ -164,9 +164,9 @@ KviStatusBarAwayIndicator::KviStatusBarAwayIndicator(KviStatusBar * pParent,KviS
: KviStatusBarApplet(pParent,pDescriptor)
{
m_bAwayOnAllContexts = false;
- connect(pParent->frame(),SIGNAL(activeContextChanged()),this,SLOT(updateDisplay()));
- connect(pParent->frame(),SIGNAL(activeContextStateChanged()),this,SLOT(updateDisplay()));
- connect(pParent->frame(),SIGNAL(activeConnectionAwayStateChanged()),this,SLOT(updateDisplay()));
+ connect(pParent->frame(),TQT_SIGNAL(activeContextChanged()),this,TQT_SLOT(updateDisplay()));
+ connect(pParent->frame(),TQT_SIGNAL(activeContextStateChanged()),this,TQT_SLOT(updateDisplay()));
+ connect(pParent->frame(),TQT_SIGNAL(activeConnectionAwayStateChanged()),this,TQT_SLOT(updateDisplay()));
updateDisplay();
@@ -200,7 +200,7 @@ void KviStatusBarAwayIndicator::toggleContext()
void KviStatusBarAwayIndicator::fillContextPopup(KviTalPopupMenu *p)
{
- int id = p->insertItem(__tr2qs("Apply to all IRC Contexts"),this,SLOT(toggleContext()));
+ int id = p->insertItem(__tr2qs("Apply to all IRC Contexts"),this,TQT_SLOT(toggleContext()));
p->setItemChecked(id,m_bAwayOnAllContexts);
}
@@ -229,13 +229,13 @@ void KviStatusBarAwayIndicator::selfRegister(KviStatusBar * pBar)
}
// FIXME: Away on all context should know where user is not away/back before toggling status
-void KviStatusBarAwayIndicator::mouseDoubleClickEvent(QMouseEvent * e)
+void KviStatusBarAwayIndicator::mouseDoubleClickEvent(TQMouseEvent * e)
{
if(!(e->button() & Qt::LeftButton))return;
KviIrcConnection * c = statusBar()->frame()->activeConnection();
if(!c)return;
if(c->state() != KviIrcConnection::Connected)return;
- QString command;
+ TQString command;
if(m_bAwayOnAllContexts)
command = "if($away)back -a; else away -a";
else
@@ -243,15 +243,15 @@ void KviStatusBarAwayIndicator::mouseDoubleClickEvent(QMouseEvent * e)
KviKvsScript::run(command,c->console());
}
-QString KviStatusBarAwayIndicator::tipText(const QPoint &)
+TQString KviStatusBarAwayIndicator::tipText(const TQPoint &)
{
KviIrcConnection * c = statusBar()->frame()->activeConnection();
- QString ret = "<center><b>";
+ TQString ret = "<center><b>";
if(!c)goto not_connected;
if(c->state() != KviIrcConnection::Connected)goto not_connected;
if(c->userInfo()->isAway())
{
- QString tmp = KviTimeUtils::formatTimeInterval(kvi_unixTime() - c->userInfo()->awayTime(),KviTimeUtils::NoLeadingEmptyIntervals);
+ TQString tmp = KviTimeUtils::formatTimeInterval(kvi_unixTime() - c->userInfo()->awayTime(),KviTimeUtils::NoLeadingEmptyIntervals);
ret += __tr2qs("Away since");
ret += ' ';
ret += tmp;
@@ -275,13 +275,13 @@ not_connected:
KviStatusBarLagIndicator::KviStatusBarLagIndicator(KviStatusBar * pParent,KviStatusBarAppletDescriptor *pDescriptor)
: KviStatusBarApplet(pParent,pDescriptor)
{
- connect(pParent->frame(),SIGNAL(activeContextChanged()),this,SLOT(updateDisplay()));
- connect(pParent->frame(),SIGNAL(activeContextStateChanged()),this,SLOT(updateDisplay()));
- connect(pParent->frame(),SIGNAL(activeConnectionLagChanged()),this,SLOT(updateDisplay()));
+ connect(pParent->frame(),TQT_SIGNAL(activeContextChanged()),this,TQT_SLOT(updateDisplay()));
+ connect(pParent->frame(),TQT_SIGNAL(activeContextStateChanged()),this,TQT_SLOT(updateDisplay()));
+ connect(pParent->frame(),TQT_SIGNAL(activeConnectionLagChanged()),this,TQT_SLOT(updateDisplay()));
updateDisplay();
- QFont f = font();
+ TQFont f = font();
f.setFixedPitch(true);
f.setFamily("fixed");
setFont(f);
@@ -293,7 +293,7 @@ KviStatusBarLagIndicator::~KviStatusBarLagIndicator()
{
}
-void KviStatusBarLagIndicator::mouseDoubleClickEvent(QMouseEvent *e)
+void KviStatusBarLagIndicator::mouseDoubleClickEvent(TQMouseEvent *e)
{
if(!(e->button() & Qt::LeftButton))return;
@@ -308,10 +308,10 @@ void KviStatusBarLagIndicator::mouseDoubleClickEvent(QMouseEvent *e)
}
-QString KviStatusBarLagIndicator::tipText(const QPoint &)
+TQString KviStatusBarLagIndicator::tipText(const TQPoint &)
{
KviIrcConnection * c = statusBar()->frame()->activeConnection();
- QString ret = "<center><b>";
+ TQString ret = "<center><b>";
if(!c)goto not_connected;
if(c->state() != KviIrcConnection::Connected)goto not_connected;
if(c->lagMeter())
@@ -322,12 +322,12 @@ QString KviStatusBarLagIndicator::tipText(const QPoint &)
int llls = lll / 1000;
int llld = (lll % 1000) / 100;
int lllc = (lll % 100) / 10;
- KviQString::appendFormatted(ret,__tr2qs("Lag: %d.%d%d"),llls,llld,lllc);
+ KviTQString::appendFormatted(ret,__tr2qs("Lag: %d.%d%d"),llls,llld,lllc);
ret += "</b><br>";
int vss = c->lagMeter()->secondsSinceLastCompleted();
int vmm = vss / 60;
vss = vss % 60;
- KviQString::appendFormatted(ret,__tr2qs("Last checked %d mins %d secs ago"),vmm,vss);
+ KviTQString::appendFormatted(ret,__tr2qs("Last checked %d mins %d secs ago"),vmm,vss);
} else {
ret += __tr2qs("Lag measure not available yet");
ret += "</b>";
@@ -361,8 +361,8 @@ void KviStatusBarLagIndicator::updateDisplay()
int llls = lll / 1000;
int llld = (lll % 1000) / 100;
int lllc = (lll % 100) / 10;
- QString tmp;
- KviQString::sprintf(tmp,__tr2qs("Lag: %d.%d%d"),llls,llld,lllc);
+ TQString tmp;
+ KviTQString::sprintf(tmp,__tr2qs("Lag: %d.%d%d"),llls,llld,lllc);
if(lll > 60000)
{
// one minute lag!
@@ -401,7 +401,7 @@ KviStatusBarClock::KviStatusBarClock(KviStatusBar * pParent,KviStatusBarAppletDe
startTimer(1000);
- QFont f = font();
+ TQFont f = font();
f.setFixedPitch(true);
f.setFamily("fixed");
setFont(f);
@@ -411,12 +411,12 @@ KviStatusBarClock::~KviStatusBarClock()
{
}
-void KviStatusBarClock::timerEvent(QTimerEvent *)
+void KviStatusBarClock::timerEvent(TQTimerEvent *)
{
kvi_time_t tt = kvi_unixTime();
struct tm * t = m_bUtc ? gmtime(&tt) : localtime(&tt);
- QString tmp;
- KviQString::sprintf(tmp,"%d%d:%d%d:%d%d",
+ TQString tmp;
+ KviTQString::sprintf(tmp,"%d%d:%d%d:%d%d",
t->tm_hour / 10,
t->tm_hour % 10,
t->tm_min / 10,
@@ -428,7 +428,7 @@ void KviStatusBarClock::timerEvent(QTimerEvent *)
void KviStatusBarClock::fillContextPopup(KviTalPopupMenu * p)
{
- int id = p->insertItem("UTC",this,SLOT(toggleUtc()));
+ int id = p->insertItem("UTC",this,TQT_SLOT(toggleUtc()));
p->setItemChecked(id,m_bUtc);
}
@@ -474,7 +474,7 @@ KviStatusBarConnectionTimer::~KviStatusBarConnectionTimer()
{
}
//g_pApp->topmostConnectedConsole()
-void KviStatusBarConnectionTimer::timerEvent(QTimerEvent * e)
+void KviStatusBarConnectionTimer::timerEvent(TQTimerEvent * e)
{
if(m_bTotal)
{
@@ -509,7 +509,7 @@ void KviStatusBarConnectionTimer::toggleTotal()
void KviStatusBarConnectionTimer::fillContextPopup(KviTalPopupMenu *p)
{
- int id = p->insertItem(__tr2qs("Show total connection time"),this,SLOT(toggleTotal()));
+ int id = p->insertItem(__tr2qs("Show total connection time"),this,TQT_SLOT(toggleTotal()));
p->setItemChecked(id,m_bTotal);
}
@@ -542,7 +542,7 @@ void KviStatusBarConnectionTimer::selfRegister(KviStatusBar * pBar)
KviStatusBarSeparator::KviStatusBarSeparator(KviStatusBar * pParent,KviStatusBarAppletDescriptor *pDescriptor)
: KviStatusBarApplet(pParent,pDescriptor)
{
- setFrameStyle(QFrame::VLine | QFrame::Sunken);
+ setFrameStyle(TQFrame::VLine | TQFrame::Sunken);
}
KviStatusBarSeparator::~KviStatusBarSeparator()