diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-28 18:31:12 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-28 18:31:12 +0000 |
commit | 0a80cfd57d271dd44221467efb426675fa470356 (patch) | |
tree | 6f503a31aa078eaf8fa015cf1749808529d49fc9 /src/modules/dockwidget | |
parent | 3329e5a804e28ef3f5eb51d1e7affdd5a508e8f2 (diff) | |
download | kvirc-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/modules/dockwidget')
-rw-r--r-- | src/modules/dockwidget/libkvidockwidget_qt3.cpp | 150 | ||||
-rw-r--r-- | src/modules/dockwidget/libkvidockwidget_qt3.h | 17 | ||||
-rw-r--r-- | src/modules/dockwidget/libkvidockwidget_qt4.cpp | 116 | ||||
-rw-r--r-- | src/modules/dockwidget/libkvidockwidget_qt4.h | 17 |
4 files changed, 150 insertions, 150 deletions
diff --git a/src/modules/dockwidget/libkvidockwidget_qt3.cpp b/src/modules/dockwidget/libkvidockwidget_qt3.cpp index 60003853..afee8824 100644 --- a/src/modules/dockwidget/libkvidockwidget_qt3.cpp +++ b/src/modules/dockwidget/libkvidockwidget_qt3.cpp @@ -46,17 +46,17 @@ #include <kwin.h> #include <kpopupmenu.h> #else - #include <qlabel.h> + #include <tqlabel.h> #endif #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> @@ -64,8 +64,8 @@ #ifdef COMPILE_ON_WINDOWS #include <windows.h> - #include <qbitmap.h> - #include <qcursor.h> + #include <tqbitmap.h> + #include <tqcursor.h> #define ID_DOCKWIDGET_TASKBAR_ICON 0xdeadbeef #define WM_KVIRC_NOTIFY_ICON_MESSAGE (WM_USER + 0xbeef) @@ -92,26 +92,26 @@ 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; #ifdef COMPILE_ON_WINDOWS static HICON g_pCurrentIcon = 0; - static QPixmap * g_pCurrentPixmap = 0; + static TQPixmap * g_pCurrentPixmap = 0; #endif KviDockWidget::KviDockWidget(KviFrame * frm,const char * name) -: QWidget(0,name) +: TQWidget(0,name) { m_iConsoles = 0; m_iChannels = 0; 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; @@ -132,11 +132,11 @@ KviDockWidget::KviDockWidget(KviFrame * frm,const char * name) #endif //!COMPILE_ON_WINDOWS #ifdef COMPILE_USE_QT4 - m_pSysTrayIcon = new QSystemTrayIcon(m_pFrm); + m_pSysTrayIcon = new TQSystemTrayIcon(m_pFrm); #endif m_pTip = new KviDynamicToolTip(this,"dock_tooltip"); - connect(m_pTip,SIGNAL(tipRequest(KviDynamicToolTip *,const QPoint &)),this,SLOT(tipRequest(KviDynamicToolTip *,const QPoint &))); + connect(m_pTip,TQT_SIGNAL(tipRequest(KviDynamicToolTip *,const TQPoint &)),this,TQT_SLOT(tipRequest(KviDynamicToolTip *,const TQPoint &))); m_pAwayPopup = new KviTalPopupMenu(this); @@ -146,8 +146,8 @@ KviDockWidget::KviDockWidget(KviFrame * frm,const char * name) #else m_pContextPopup = new KviTalPopupMenu(this); #ifndef COMPILE_USE_QT4 - 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); #endif #endif @@ -155,18 +155,18 @@ KviDockWidget::KviDockWidget(KviFrame * frm,const char * name) 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())); } @@ -197,10 +197,10 @@ void KviDockWidget::flashingTimerShot() void KviDockWidget::createTaskbarIcon() { ICONINFO inf; - g_pCurrentPixmap=new QPixmap(*g_pDock1); + g_pCurrentPixmap=new TQPixmap(*g_pDock1); inf.hbmColor = g_pCurrentPixmap->hbm(); - if(!g_pCurrentPixmap->mask())g_pCurrentPixmap->setMask(g_pCurrentPixmap->createHeuristicMask()); - inf.hbmMask = g_pCurrentPixmap->mask()->hbm(); + if(!g_pCurrentPixmap->tqmask())g_pCurrentPixmap->setMask(g_pCurrentPixmap->createHeuristicMask()); + inf.hbmMask = g_pCurrentPixmap->tqmask()->hbm(); g_pCurrentIcon=CreateIconIndirect(&inf); NOTIFYICONDATA nid; @@ -227,10 +227,10 @@ void KviDockWidget::destroyTaskbarIcon() void KviDockWidget::updateTaskbarIcon() { ICONINFO inf; - QPixmap* pix = m_bFlashed ? g_pIconManager->getSmallIcon(KVI_SMALLICON_MESSAGE) : g_pCurrentPixmap; + TQPixmap* pix = m_bFlashed ? g_pIconManager->getSmallIcon(KVI_SMALLICON_MESSAGE) : g_pCurrentPixmap; inf.hbmColor = pix->hbm(); - if(!pix->mask())pix->setMask(pix->createHeuristicMask()); - inf.hbmMask = pix->mask()->hbm(); + if(!pix->tqmask())pix->setMask(pix->createHeuristicMask()); + inf.hbmMask = pix->tqmask()->hbm(); HICON hIcon=CreateIconIndirect(&inf); NOTIFYICONDATA nid; @@ -253,13 +253,13 @@ bool KviDockWidget::winEvent(MSG * m) switch(m->lParam) { case WM_MOUSEMOVE: - tipRequest(m_pTip,QCursor::pos()); + tipRequest(m_pTip,TQCursor::pos()); break; case WM_LBUTTONDOWN: toggleParentFrame(); break; case WM_RBUTTONDOWN: - m_pContextPopup->popup(QCursor::pos()); + m_pContextPopup->popup(TQCursor::pos()); break; } return true; @@ -305,10 +305,10 @@ static const char * idlemsgs[NIDLEMSGS]= extern Time qt_x_time; #endif -void KviDockWidget::enterEvent( QEvent* ) +void KviDockWidget::enterEvent( TQEvent* ) { #ifdef COMPILE_KDE_SUPPORT - if(!g_pApp->focusWidget()) + if(!g_pApp->tqfocusWidget()) { XEvent ev; kvi_memset(&ev, 0, sizeof(ev)); @@ -325,13 +325,13 @@ void KviDockWidget::enterEvent( QEvent* ) #endif } -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()) { @@ -343,9 +343,9 @@ void KviDockWidget::tipRequest(KviDynamicToolTip *tip,const QPoint &pnt) line = b->kviWindow()->lastMessageText(); if(!line.isEmpty()) { - line.replace(QChar('&'),"&"); - line.replace(QChar('<'),"<"); - line.replace(QChar('>'),">"); + line.tqreplace(TQChar('&'),"&"); + line.tqreplace(TQChar('<'),"<"); + line.tqreplace(TQChar('>'),">"); tmp += "<b>"; tmp += b->kviWindow()->plainTextCaption(); tmp += "</b><br>"; @@ -377,7 +377,7 @@ void KviDockWidget::tipRequest(KviDynamicToolTip *tip,const QPoint &pnt) // return 0; //} -void KviDockWidget::mousePressEvent(QMouseEvent *e) +void KviDockWidget::mousePressEvent(TQMouseEvent *e) { if(e->button() & Qt::LeftButton)toggleParentFrame(); else if(e->button() & Qt::RightButton) @@ -425,10 +425,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(); @@ -447,10 +447,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()); @@ -475,7 +475,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(); @@ -498,11 +498,11 @@ void KviDockWidget::refresh() #ifdef COMPILE_ON_WINDOWS // how to copy transparency???? delete g_pCurrentPixmap; - g_pCurrentPixmap=new QPixmap(16,16); - bitBlt(g_pCurrentPixmap,0,0,m_iOther ? ((m_iOther == 2) ? g_pDock3 : g_pDock2) : g_pDock1,0,0,8,8,Qt::ClearROP); - bitBlt(g_pCurrentPixmap,0,8,m_iConsoles ? ((m_iConsoles == 2) ? g_pDock3 : g_pDock2) : g_pDock1,0,8,8,8,Qt::ClearROP); - bitBlt(g_pCurrentPixmap,8,0,m_iQueries ? ((m_iQueries == 2) ? g_pDock3 : g_pDock2) : g_pDock1,8,0,8,8,Qt::ClearROP); - bitBlt(g_pCurrentPixmap,8,8,m_iChannels ? ((m_iChannels == 2) ? g_pDock3 : g_pDock2) : g_pDock1,8,8,8,8,Qt::ClearROP); + g_pCurrentPixmap=new TQPixmap(16,16); + bitBlt(g_pCurrentPixmap,0,0,m_iOther ? ((m_iOther == 2) ? g_pDock3 : g_pDock2) : g_pDock1,0,0,8,8,TQt::ClearROP); + bitBlt(g_pCurrentPixmap,0,8,m_iConsoles ? ((m_iConsoles == 2) ? g_pDock3 : g_pDock2) : g_pDock1,0,8,8,8,TQt::ClearROP); + bitBlt(g_pCurrentPixmap,8,0,m_iQueries ? ((m_iQueries == 2) ? g_pDock3 : g_pDock2) : g_pDock1,8,0,8,8,TQt::ClearROP); + bitBlt(g_pCurrentPixmap,8,8,m_iChannels ? ((m_iChannels == 2) ? g_pDock3 : g_pDock2) : g_pDock1,8,8,8,8,TQt::ClearROP); #endif if( (m_iChannels == 2) || (m_iQueries == 2) ) @@ -554,7 +554,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: @@ -581,7 +581,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: @@ -612,19 +612,19 @@ void KviDockWidget::grabActivityInfo() } } -void KviDockWidget::paintEvent(QPaintEvent * event) +void KviDockWidget::paintEvent(TQPaintEvent * event) { #ifdef COMPILE_USE_QT4 - QPainter thisRestrictionOfQt4IsNotNice(this); + TQPainter thisRestrictionOfTQt4IsNotNice(this); if(m_bFlashed) { erase(); - thisRestrictionOfQt4IsNotNice.drawPixmap(4,4,16,16,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MESSAGE)),0,0,16,16); + thisRestrictionOfTQt4IsNotNice.drawPixmap(4,4,16,16,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MESSAGE)),0,0,16,16); } else { - thisRestrictionOfQt4IsNotNice.drawPixmap(0,0,12,12,m_iOther ? ((m_iOther == 2) ? *g_pDock3 : *g_pDock2) : *g_pDock1,0,0,12,12); - thisRestrictionOfQt4IsNotNice.drawPixmap(0,12,12,12,m_iConsoles ? ((m_iConsoles == 2) ? *g_pDock3 : *g_pDock2) : *g_pDock1,0,12,12,12); - thisRestrictionOfQt4IsNotNice.drawPixmap(12,0,12,12,m_iQueries ? ((m_iQueries == 2) ? *g_pDock3 : *g_pDock2) : *g_pDock1,12,0,12,12); - thisRestrictionOfQt4IsNotNice.drawPixmap(12,12,12,12,m_iChannels ? ((m_iChannels == 2) ? *g_pDock3 : *g_pDock2) : *g_pDock1,12,12,12,12); + thisRestrictionOfTQt4IsNotNice.drawPixmap(0,0,12,12,m_iOther ? ((m_iOther == 2) ? *g_pDock3 : *g_pDock2) : *g_pDock1,0,0,12,12); + thisRestrictionOfTQt4IsNotNice.drawPixmap(0,12,12,12,m_iConsoles ? ((m_iConsoles == 2) ? *g_pDock3 : *g_pDock2) : *g_pDock1,0,12,12,12); + thisRestrictionOfTQt4IsNotNice.drawPixmap(12,0,12,12,m_iQueries ? ((m_iQueries == 2) ? *g_pDock3 : *g_pDock2) : *g_pDock1,12,0,12,12); + thisRestrictionOfTQt4IsNotNice.drawPixmap(12,12,12,12,m_iChannels ? ((m_iChannels == 2) ? *g_pDock3 : *g_pDock2) : *g_pDock1,12,12,12,12); } #else if(m_bFlashed) @@ -632,16 +632,16 @@ void KviDockWidget::paintEvent(QPaintEvent * event) erase(); bitBlt(this,4,4,g_pIconManager->getSmallIcon(KVI_SMALLICON_MESSAGE),0,0,16,16); } else { - bitBlt(this,0,0,m_iOther ? ((m_iOther == 2) ? g_pDock3 : g_pDock2) : g_pDock1,0,0,12,12,Qt::CopyROP,false); - bitBlt(this,0,12,m_iConsoles ? ((m_iConsoles == 2) ? g_pDock3 : g_pDock2) : g_pDock1,0,12,12,12,Qt::CopyROP,false); - bitBlt(this,12,0,m_iQueries ? ((m_iQueries == 2) ? g_pDock3 : g_pDock2) : g_pDock1,12,0,12,12,Qt::CopyROP,false); - bitBlt(this,12,12,m_iChannels ? ((m_iChannels == 2) ? g_pDock3 : g_pDock2) : g_pDock1,12,12,12,12,Qt::CopyROP,false); + bitBlt(TQT_TQPAINTDEVICE(this),0,0,TQT_TQPAINTDEVICE(m_iOther ? ((m_iOther == 2) ? g_pDock3 : g_pDock2) : g_pDock1),0,0,12,12,TQt::CopyROP,false); + bitBlt(TQT_TQPAINTDEVICE(this),0,12,TQT_TQPAINTDEVICE(m_iConsoles ? ((m_iConsoles == 2) ? g_pDock3 : g_pDock2) : g_pDock1),0,12,12,12,TQt::CopyROP,false); + bitBlt(TQT_TQPAINTDEVICE(this),12,0,TQT_TQPAINTDEVICE(m_iQueries ? ((m_iQueries == 2) ? g_pDock3 : g_pDock2) : g_pDock1),12,0,12,12,TQt::CopyROP,false); + bitBlt(TQT_TQPAINTDEVICE(this),12,12,TQT_TQPAINTDEVICE(m_iChannels ? ((m_iChannels == 2) ? g_pDock3 : g_pDock2) : g_pDock1),12,12,12,12,TQt::CopyROP,false); } #endif } -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()) @@ -687,7 +687,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(),"dock_widget"); #ifndef COMPILE_ON_WINDOWS @@ -717,9 +717,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(); @@ -745,12 +745,10 @@ 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) { -#if QT_VERSION > 0x030201 w->setPrevWindowState(c->window()->frame()->windowState()); -#endif c->window()->frame()->hide(); } return true; @@ -774,7 +772,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; } @@ -793,9 +791,9 @@ static bool dockwidget_module_init(KviModule * m) g_pApp->findImage(buffer,"kvi_dock.png"); KviImageLibrary l1(buffer.ptr(),22,22); #endif - g_pDock1 = new QPixmap(l1.getImage(0)); - g_pDock2 = new QPixmap(l1.getImage(1)); - g_pDock3 = new QPixmap(l1.getImage(2)); + g_pDock1 = new TQPixmap(l1.getImage(0)); + g_pDock2 = new TQPixmap(l1.getImage(1)); + g_pDock3 = new TQPixmap(l1.getImage(2)); #ifdef COMPILE_ON_WINDOWS diff --git a/src/modules/dockwidget/libkvidockwidget_qt3.h b/src/modules/dockwidget/libkvidockwidget_qt3.h index 1721c28b..74f83486 100644 --- a/src/modules/dockwidget/libkvidockwidget_qt3.h +++ b/src/modules/dockwidget/libkvidockwidget_qt3.h @@ -32,15 +32,16 @@ -class QPixmap; -class QTimer; +class TQPixmap; +class TQTimer; //class KviFrame; class KviDynamicToolTip; -class KviDockWidget : public QWidget , public KviDockExtension +class KviDockWidget : public TQWidget , public KviDockExtension { Q_OBJECT + TQ_OBJECT public: KviDockWidget(KviFrame * win,const char * name); ~KviDockWidget(); @@ -58,7 +59,7 @@ protected: bool m_bFlashed; - QTimer* m_pFlashingTimer; + TQTimer* m_pFlashingTimer; int m_iConsoles; int m_iChannels; int m_iQueries; @@ -67,12 +68,12 @@ public: KviFrame * frame(){ return m_pFrm; }; public: // virtual int message(int msgtype,void * data); - virtual void enterEvent(QEvent *); + virtual void enterEvent(TQEvent *); virtual void refresh(); virtual void die(); protected: - virtual void paintEvent(QPaintEvent *e); - virtual void mousePressEvent(QMouseEvent *e); + virtual void paintEvent(TQPaintEvent *e); + virtual void mousePressEvent(TQMouseEvent *e); void grabActivityInfo(); #ifdef COMPILE_ON_WINDOWS @@ -87,7 +88,7 @@ protected: protected slots: void fillContextPopup(); void toggleParentFrame(); - void tipRequest(KviDynamicToolTip *tip,const QPoint &pnt); + void tipRequest(KviDynamicToolTip *tip,const TQPoint &pnt); void doAway(int); void flashingTimerShot(); }; 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('&'),"&"); - line.replace(QChar('<'),"<"); - line.replace(QChar('>'),">"); + line.tqreplace(TQChar('&'),"&"); + line.tqreplace(TQChar('<'),"<"); + line.tqreplace(TQChar('>'),">"); 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>; diff --git a/src/modules/dockwidget/libkvidockwidget_qt4.h b/src/modules/dockwidget/libkvidockwidget_qt4.h index 9d9e87bc..bf67148e 100644 --- a/src/modules/dockwidget/libkvidockwidget_qt4.h +++ b/src/modules/dockwidget/libkvidockwidget_qt4.h @@ -26,17 +26,18 @@ #include "kvi_frame.h" class KviTalPopupMenu; -#include <QSystemTrayIcon> +#include <TQSystemTrayIcon> -class QPixmap; -class QTimer; +class TQPixmap; +class TQTimer; //class KviFrame; class KviDynamicToolTip; -class KviDockWidget : public QSystemTrayIcon, public KviDockExtension +class KviDockWidget : public TQSystemTrayIcon, public KviDockExtension { Q_OBJECT + TQ_OBJECT public: KviDockWidget(KviFrame * win); ~KviDockWidget(); @@ -51,8 +52,8 @@ protected: bool m_bFlashed; - QPixmap m_CurrentPixmap; - QTimer* m_pFlashingTimer; + TQPixmap m_CurrentPixmap; + TQTimer* m_pFlashingTimer; int m_iConsoles; int m_iChannels; int m_iQueries; @@ -69,11 +70,11 @@ protected: protected slots: void fillContextPopup(); void toggleParentFrame(); - void tipRequest(KviDynamicToolTip *tip,const QPoint &pnt); + void tipRequest(KviDynamicToolTip *tip,const TQPoint &pnt); void doAway(int); void flashingTimerShot(); - void activatedSlot( QSystemTrayIcon::ActivationReason reason ); + void activatedSlot( TQSystemTrayIcon::ActivationReason reason ); }; //#endif |