summaryrefslogtreecommitdiffstats
path: root/src/modules/dockwidget/libkvidockwidget_qt4.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/dockwidget/libkvidockwidget_qt4.cpp')
-rw-r--r--src/modules/dockwidget/libkvidockwidget_qt4.cpp116
1 files changed, 58 insertions, 58 deletions
diff --git a/src/modules/dockwidget/libkvidockwidget_qt4.cpp b/src/modules/dockwidget/libkvidockwidget_qt4.cpp
index 73a21998..c8ad4092 100644
--- a/src/modules/dockwidget/libkvidockwidget_qt4.cpp
+++ b/src/modules/dockwidget/libkvidockwidget_qt4.cpp
@@ -49,16 +49,16 @@
#include "libkvidockwidget.h"
#include "kvi_doublebuffer.h"
-#include <qlabel.h>
+#include <tqlabel.h>
#include "kvi_tal_popupmenu.h"
-#include <qpixmap.h>
-#include <qpainter.h>
-#include <qtimer.h>
-#include <qevent.h>
-#include <qregexp.h>
+#include <tqpixmap.h>
+#include <tqpainter.h>
+#include <tqtimer.h>
+#include <tqevent.h>
+#include <tqregexp.h>
#include <stdlib.h>
#include <time.h>
@@ -67,12 +67,12 @@
extern KVIRC_API KviPointerHashTable<const char *,KviWindow> * g_pGlobalWindowDict;
static KviPointerList<KviDockWidget> * g_pDockWidgetList = 0;
-static QPixmap * g_pDock1 = 0;
-static QPixmap * g_pDock2 = 0;
-static QPixmap * g_pDock3 = 0;
+static TQPixmap * g_pDock1 = 0;
+static TQPixmap * g_pDock2 = 0;
+static TQPixmap * g_pDock3 = 0;
KviDockWidget::KviDockWidget(KviFrame * frm)
-: QSystemTrayIcon(frm), m_CurrentPixmap(ICON_SIZE,ICON_SIZE)
+: TQSystemTrayIcon(frm), m_CurrentPixmap(ICON_SIZE,ICON_SIZE)
{
m_pContextPopup = new KviTalPopupMenu(0);
setContextMenu(m_pContextPopup);
@@ -82,8 +82,8 @@ KviDockWidget::KviDockWidget(KviFrame * frm)
m_iQueries = 0;
m_iOther = 0;
- m_pFlashingTimer = new QTimer(this,"flashing_timer");
- connect( m_pFlashingTimer, SIGNAL(timeout()), this, SLOT(flashingTimerShot()) );
+ m_pFlashingTimer = new TQTimer(this,"flashing_timer");
+ connect( m_pFlashingTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(flashingTimerShot()) );
m_bFlashed=0;
g_pDockWidgetList->append(this);
m_pFrm = frm;
@@ -92,30 +92,30 @@ KviDockWidget::KviDockWidget(KviFrame * frm)
m_pTip = new KviDynamicToolTip(frm,"dock_tooltip");
m_pAwayPopup = new KviTalPopupMenu(0);
- QLabel * l = new QLabel(__tr2qs("KVIrc"),m_pContextPopup);
- l->setFrameStyle(QFrame::Raised | QFrame::StyledPanel);
+ TQLabel * l = new TQLabel(__tr2qs("KVIrc"),m_pContextPopup);
+ l->setFrameStyle(TQFrame::Raised | TQFrame::StyledPanel);
m_pContextPopup->insertItem(l);
m_pContextPopup->setCaption(__tr2qs("Context"));
m_iAwayMenuId = m_pContextPopup->insertItem ( __tr2qs("Away"), m_pAwayPopup);
m_pContextPopup->changeItem(m_iAwayMenuId,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_AWAY)),__tr2qs("Away"));
- int id = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_OPTIONS)),__tr2qs("&Configure KVIrc..."),m_pFrm,SLOT(executeInternalCommand(int)));
+ int id = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_OPTIONS)),__tr2qs("&Configure KVIrc..."),m_pFrm,TQT_SLOT(executeInternalCommand(int)));
m_pContextPopup->setItemParameter(id,KVI_INTERNALCOMMAND_OPTIONS_DIALOG);
- id = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_KVIRC)),__tr2qs("&About KVIrc"),m_pFrm,SLOT(executeInternalCommand(int)));
+ id = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_KVIRC)),__tr2qs("&About KVIrc"),m_pFrm,TQT_SLOT(executeInternalCommand(int)));
m_pContextPopup->setItemParameter(id,KVI_INTERNALCOMMAND_ABOUT_ABOUTKVIRC);
m_pContextPopup->insertSeparator();
- m_iToggleFrame = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_RAW)),QString(""),this,SLOT(toggleParentFrame()));
+ m_iToggleFrame = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_RAW)),TQString(""),this,TQT_SLOT(toggleParentFrame()));
m_pContextPopup->insertSeparator();
- id = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_DOCKWIDGET)),__tr2qs("Un&dock"),m_pFrm,SLOT(executeInternalCommand(int)));
+ id = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_DOCKWIDGET)),__tr2qs("Un&dock"),m_pFrm,TQT_SLOT(executeInternalCommand(int)));
m_pContextPopup->setItemParameter(id,KVI_INTERNALCOMMAND_DOCKWIDGET_HIDE);
- id = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_QUITAPP)),__tr2qs("&Quit"),g_pApp,SLOT(quit()));
+ id = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TQUITAPP)),__tr2qs("&Quit"),g_pApp,TQT_SLOT(quit()));
m_pContextPopup->setAccel(__tr2qs("Ctrl+Q"),id);
- connect(m_pContextPopup,SIGNAL(aboutToShow()),this,SLOT(fillContextPopup()));
+ connect(m_pContextPopup,TQT_SIGNAL(aboutToShow()),this,TQT_SLOT(fillContextPopup()));
- QIcon icon(*g_pDock1);
+ TQIcon icon(*g_pDock1);
setIcon(icon);
- connect(this,SIGNAL(activated ( QSystemTrayIcon::ActivationReason )),this,SLOT(activatedSlot ( QSystemTrayIcon::ActivationReason )));
+ connect(this,TQT_SIGNAL(activated ( TQSystemTrayIcon::ActivationReason )),this,TQT_SLOT(activatedSlot ( TQSystemTrayIcon::ActivationReason )));
}
@@ -160,13 +160,13 @@ static const char * idlemsgs[NIDLEMSGS]=
__tr("idle idle idle idle!")
};
-void KviDockWidget::tipRequest(KviDynamicToolTip *tip,const QPoint &pnt)
+void KviDockWidget::tipRequest(KviDynamicToolTip *tip,const TQPoint &pnt)
{
- QString tmp;
+ TQString tmp;
KviTaskBarBase * t = m_pFrm->taskBar();
- QString line;
+ TQString line;
for(KviTaskBarItem * b = t->firstItem();b;b = t->nextItem())
{
@@ -178,9 +178,9 @@ void KviDockWidget::tipRequest(KviDynamicToolTip *tip,const QPoint &pnt)
line = b->kviWindow()->lastMessageText();
if(!line.isEmpty())
{
- line.replace(QChar('&'),"&amp;");
- line.replace(QChar('<'),"&lt;");
- line.replace(QChar('>'),"&gt;");
+ line.tqreplace(TQChar('&'),"&amp;");
+ line.tqreplace(TQChar('<'),"&lt;");
+ line.tqreplace(TQChar('>'),"&gt;");
tmp += "<b>";
tmp += b->kviWindow()->plainTextCaption();
tmp += "</b><br>";
@@ -208,8 +208,8 @@ void KviDockWidget::tipRequest(KviDynamicToolTip *tip,const QPoint &pnt)
// return 0;
//}
-//FIXME: Qt4 port
-/*void KviDockWidget::mousePressEvent(QMouseEvent *e)
+//FIXME: TQt4 port
+/*void KviDockWidget::mousePressEvent(TQMouseEvent *e)
{
if(e->button() & Qt::LeftButton)toggleParentFrame();
else if(e->button() & Qt::RightButton)
@@ -257,10 +257,10 @@ void KviDockWidget::fillContextPopup()
m_pContextPopup->setItemVisible(m_iAwayMenuId,true);
m_pAwayPopup->clear();
- int iAllAway=m_pAwayPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CONSOLE)),__tr2qs("Away on all"),this,SLOT(doAway(int)));
+ int iAllAway=m_pAwayPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CONSOLE)),__tr2qs("Away on all"),this,TQT_SLOT(doAway(int)));
m_pAwayPopup->setItemParameter(iAllAway,-1);
- int iAllUnaway=m_pAwayPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CONSOLE)),__tr2qs("Back on all"),this,SLOT(doAway(int)));
+ int iAllUnaway=m_pAwayPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CONSOLE)),__tr2qs("Back on all"),this,TQT_SLOT(doAway(int)));
m_pAwayPopup->setItemParameter(iAllUnaway,-2);
int iSeparator=m_pAwayPopup->insertSeparator();
@@ -279,10 +279,10 @@ void KviDockWidget::fillContextPopup()
int id;
if(pConsole->connection()->userInfo()->isAway())
{
- id=m_pAwayPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CONSOLE)),__tr2qs("Back on %1").arg(pConsole->currentNetworkName()),this,SLOT(doAway(int)));
+ id=m_pAwayPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CONSOLE)),__tr2qs("Back on %1").tqarg(pConsole->currentNetworkName()),this,TQT_SLOT(doAway(int)));
bAllUnaway=0;
} else {
- id=m_pAwayPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CONSOLE)),__tr2qs("Away on %1").arg(pConsole->currentNetworkName()),this,SLOT(doAway(int)));
+ id=m_pAwayPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CONSOLE)),__tr2qs("Away on %1").tqarg(pConsole->currentNetworkName()),this,TQT_SLOT(doAway(int)));
bAllAway=0;
}
m_pAwayPopup->setItemParameter(id,pConsole->ircContextId());
@@ -307,7 +307,7 @@ void KviDockWidget::fillContextPopup()
void KviDockWidget::toggleParentFrame()
{
- QWidget *top_widget = m_pFrm->topLevelWidget();
+ TQWidget *top_widget = m_pFrm->tqtopLevelWidget();
if(m_pFrm->isVisible()) {
m_pFrm->hide();
@@ -336,31 +336,31 @@ void KviDockWidget::refresh()
m_bFlashed=false;
}
- m_CurrentPixmap.fill(Qt::transparent);
- QPainter thisRestrictionOfQt4IsNotNice(&m_CurrentPixmap);
- //thisRestrictionOfQt4IsNotNice.drawPixmap(0,0,22,22,*g_pDock1,0,0,22,22);
+ m_CurrentPixmap.fill(TQt::transparent);
+ TQPainter thisRestrictionOfTQt4IsNotNice(&m_CurrentPixmap);
+ //thisRestrictionOfTQt4IsNotNice.drawPixmap(0,0,22,22,*g_pDock1,0,0,22,22);
if(m_bFlashed)
{
- thisRestrictionOfQt4IsNotNice.drawPixmap((ICON_SIZE-16)/2,(ICON_SIZE-16)/2,16,16,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MESSAGE)),0,0,16,16);
+ thisRestrictionOfTQt4IsNotNice.drawPixmap((ICON_SIZE-16)/2,(ICON_SIZE-16)/2,16,16,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MESSAGE)),0,0,16,16);
} else {
- thisRestrictionOfQt4IsNotNice.drawPixmap(0,0,ICON_SIZE/2,ICON_SIZE/2,
+ thisRestrictionOfTQt4IsNotNice.drawPixmap(0,0,ICON_SIZE/2,ICON_SIZE/2,
m_iOther ?
((m_iOther == 2) ? *g_pDock3 : *g_pDock2)
: *g_pDock1,0,0,ICON_SIZE/2,ICON_SIZE/2);
- thisRestrictionOfQt4IsNotNice.drawPixmap(0,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2,
+ thisRestrictionOfTQt4IsNotNice.drawPixmap(0,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2,
m_iConsoles ?
((m_iConsoles == 2) ? *g_pDock3 : *g_pDock2)
: *g_pDock1,0,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2);
- thisRestrictionOfQt4IsNotNice.drawPixmap(ICON_SIZE/2,0,ICON_SIZE/2,ICON_SIZE/2,
+ thisRestrictionOfTQt4IsNotNice.drawPixmap(ICON_SIZE/2,0,ICON_SIZE/2,ICON_SIZE/2,
m_iQueries ?
((m_iQueries == 2)
? *g_pDock3 : *g_pDock2)
: *g_pDock1,ICON_SIZE/2,0,ICON_SIZE/2,ICON_SIZE/2);
- thisRestrictionOfQt4IsNotNice.drawPixmap(ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2,
+ thisRestrictionOfTQt4IsNotNice.drawPixmap(ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2,
m_iChannels ?
((m_iChannels == 2) ? *g_pDock3 : *g_pDock2)
: *g_pDock1
@@ -370,9 +370,9 @@ void KviDockWidget::refresh()
updateIcon();
}
-void KviDockWidget::activatedSlot( QSystemTrayIcon::ActivationReason reason )
+void KviDockWidget::activatedSlot( TQSystemTrayIcon::ActivationReason reason )
{
- if(reason==QSystemTrayIcon::Trigger)
+ if(reason==TQSystemTrayIcon::Trigger)
{
toggleParentFrame();
}
@@ -412,7 +412,7 @@ void KviDockWidget::grabActivityInfo()
case KVI_WINDOW_TYPE_CHANNEL:
if(m_iChannels < iLevel) m_iChannels = iLevel;
break;
- case KVI_WINDOW_TYPE_QUERY:
+ case KVI_WINDOW_TYPE_TQUERY:
if(m_iQueries < iLevel) m_iQueries = iLevel;
break;
default:
@@ -439,7 +439,7 @@ void KviDockWidget::grabActivityInfo()
case KVI_WINDOW_TYPE_CHANNEL:
if(m_iChannels < iLevel) m_iChannels = iLevel;
break;
- case KVI_WINDOW_TYPE_QUERY:
+ case KVI_WINDOW_TYPE_TQUERY:
if(m_iQueries < iLevel) m_iQueries = iLevel;
break;
default:
@@ -472,11 +472,11 @@ void KviDockWidget::grabActivityInfo()
void KviDockWidget::updateIcon()
{
- setIcon(QIcon(m_CurrentPixmap));
+ setIcon(TQIcon(m_CurrentPixmap));
}
-static KviDockWidget * dockwidget_find(KviFrame *f)
+static KviDockWidget * dockwidget_tqfind(KviFrame *f)
{
if(!g_pDockWidgetList)return 0;
for(KviDockWidget * w = g_pDockWidgetList->first();w;w = g_pDockWidgetList->next())
@@ -522,7 +522,7 @@ static KviDockWidget * dockwidget_find(KviFrame *f)
static bool dockwidget_kvs_cmd_show(KviKvsModuleCommandCall * c)
{
- if(!(dockwidget_find(c->window()->frame())))
+ if(!(dockwidget_tqfind(c->window()->frame())))
{
KviDockWidget * w = new KviDockWidget(c->window()->frame());
w->show();
@@ -548,9 +548,9 @@ static bool dockwidget_kvs_cmd_show(KviKvsModuleCommandCall * c)
static bool dockwidget_kvs_cmd_hide(KviKvsModuleCommandCall * c)
{
- KviDockWidget * w= dockwidget_find(c->window()->frame());
+ KviDockWidget * w= dockwidget_tqfind(c->window()->frame());
if(w)delete w;
- // show the parent frame.. otherwise there will be no way to get it back
+ // show the tqparent frame.. otherwise there will be no way to get it back
if(!c->window()->frame()->isVisible())
{
c->window()->frame()->show();
@@ -576,7 +576,7 @@ static bool dockwidget_kvs_cmd_hide(KviKvsModuleCommandCall * c)
static bool dockwidget_kvs_cmd_hidewindow(KviKvsModuleCommandCall * c)
{
- KviDockWidget * w= dockwidget_find(c->window()->frame());
+ KviDockWidget * w= dockwidget_tqfind(c->window()->frame());
if(w)
{
c->window()->frame()->hide();
@@ -602,7 +602,7 @@ static bool dockwidget_kvs_cmd_hidewindow(KviKvsModuleCommandCall * c)
static bool dockwidget_kvs_fnc_isvisible(KviKvsModuleFunctionCall * c)
{
- c->returnValue()->setBoolean(dockwidget_find(c->window()->frame()));
+ c->returnValue()->setBoolean(dockwidget_tqfind(c->window()->frame()));
return true;
}
@@ -613,20 +613,20 @@ static bool dockwidget_kvs_fnc_isvisible(KviKvsModuleFunctionCall * c)
// =======================================
static bool dockwidget_module_init(KviModule * m)
{
- QString buffer;
+ TQString buffer;
#ifdef COMPILE_ON_WINDOWS
g_pApp->findImage(buffer,"kvi_dock_win32-0.png");
#else
g_pApp->findImage(buffer,"kvi_dock_part-0.png");
#endif
- g_pDock1 = new QPixmap(buffer);
+ g_pDock1 = new TQPixmap(buffer);
#ifdef COMPILE_ON_WINDOWS
g_pApp->findImage(buffer,"kvi_dock_win32-1.png");
#else
g_pApp->findImage(buffer,"kvi_dock_part-1.png");
#endif
- g_pDock2 = new QPixmap(buffer);
+ g_pDock2 = new TQPixmap(buffer);
#ifdef COMPILE_ON_WINDOWS
g_pApp->findImage(buffer,"kvi_dock_win32-2.png");
@@ -634,7 +634,7 @@ static bool dockwidget_module_init(KviModule * m)
g_pApp->findImage(buffer,"kvi_dock_part-2.png");
#endif
- g_pDock3 = new QPixmap(buffer);
+ g_pDock3 = new TQPixmap(buffer);
g_pDockWidgetList = new KviPointerList<KviDockWidget>;