summaryrefslogtreecommitdiffstats
path: root/src/kvirc/ui/kvi_ircview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kvirc/ui/kvi_ircview.cpp')
-rw-r--r--src/kvirc/ui/kvi_ircview.cpp706
1 files changed, 347 insertions, 359 deletions
diff --git a/src/kvirc/ui/kvi_ircview.cpp b/src/kvirc/ui/kvi_ircview.cpp
index e09edee1..330ae099 100644
--- a/src/kvirc/ui/kvi_ircview.cpp
+++ b/src/kvirc/ui/kvi_ircview.cpp
@@ -61,7 +61,7 @@
// 25 Sep 2001
// This stuff is going to be ported to Windoze
-// A conditionally compiled code will use only Qt calls...let's see :)
+// A conditionally compiled code will use only TQt calls...let's see :)
//
@@ -108,47 +108,43 @@
#include "kvi_qcstring.h"
// FIXME: #warning "There should be an option to preserve control codes in copied text (clipboard) (mIrc = CTRL+Copy->with colors)"
-#include <qbitmap.h>
-#include <qpainter.h>
-#include <qregexp.h>
-#include <qfile.h>
-#include <qtoolbutton.h>
-#include <qfontmetrics.h> // needed
-#include <qapplication.h>
+#include <tqbitmap.h>
+#include <tqpainter.h>
+#include <tqregexp.h>
+#include <tqfile.h>
+#include <tqtoolbutton.h>
+#include <tqfontmetrics.h> // needed
+#include <tqapplication.h>
#include "kvi_tal_popupmenu.h"
-#include <qmessagebox.h>
-#include <qtextcodec.h>
-#include <qdatetime.h>
-#include <qevent.h>
+#include <tqmessagebox.h>
+#include <tqtextcodec.h>
+#include <tqdatetime.h>
+#include <tqevent.h>
-//#include <qcolor.h> // needed
+//#include <tqcolor.h> // needed
// FIXME: #warning "There are problems with the selection and wrapped lines: you can select something on the first line and get the second highlighted"
// FIXME: #warning "This hack is temporary...later remove it"
-#if QT_VERSION >= 300
- #ifndef QT_CLEAN_NAMESPACE
- #define QT_CLEAN_NAMESPACE
- #include <qcursor.h>
- #undef QT_CLEAN_NAMESPACE
- #else
- #include <qcursor.h>
- #endif
+#ifndef TQT_CLEAN_NAMESPACE
+ #define TQT_CLEAN_NAMESPACE
+ #include <tqcursor.h>
+ #undef TQT_CLEAN_NAMESPACE
#else
- #include <qcursor.h>
+ #include <tqcursor.h>
#endif
-#include <qclipboard.h>
-#include <qdatetime.h>
-#include <qmessagebox.h>
-#include <qscrollbar.h>
-#include <qfontdialog.h>
+#include <tqclipboard.h>
+#include <tqdatetime.h>
+#include <tqmessagebox.h>
+#include <tqscrollbar.h>
+#include <tqfontdialog.h>
#include <time.h>
#ifdef COMPILE_USE_QT4
- #include <q3mimefactory.h>
- #define QMimeSourceFactory Q3MimeSourceFactory
+ #include <tq3mimefactory.h>
+ #define TQMimeSourceFactory Q3MimeSourceFactory
#endif
@@ -169,7 +165,7 @@
#define KVI_DEF_BACK 200
-// FIXME: #warning "The scrollbar should NOT have a fixed size : the KDE styles can configure the size (sizeHint() ?)"
+// FIXME: #warning "The scrollbar should NOT have a fixed size : the KDE styles can configure the size (tqsizeHint() ?)"
//
// FIXME: PgUp and PgDn scrolls a fixed number of lines!
@@ -189,7 +185,7 @@
#ifdef COMPILE_PSEUDO_TRANSPARENCY
- extern QPixmap * g_pShadedChildGlobalDesktopBackground;
+ extern TQPixmap * g_pShadedChildGlobalDesktopBackground;
#endif
@@ -207,7 +203,7 @@
#define KVI_IRCVIEW_HORIZONTAL_BORDER 4
#define KVI_IRCVIEW_VERTICAL_BORDER 4
// A little bit more than the scroll-bar...
-// Qt+X have strange interactions that I can not understand when I try to move the splitter
+// TQt+X have strange interactions that I can not understand when I try to move the splitter
// to the maximum on the left , Maybe the cache pixmap size becomes negative ? (I don't think so)
// Anyway , when the scroll bar position becomes negative (or the IrcView has smaller width than
// the scroll bar) X aborts with a funny
@@ -238,25 +234,25 @@
#define KVI_IRCVIEW_ESCAPE_TAG_GENERICESCAPE '['
// FIXME: Get rid of this!!!!!!!!!
-#define WSTRINGCONFIG_SAFE_TO_MEMCPY_QCHAR
+#define WSTRINGCONFIG_SAFE_TO_MEMCPY_TQCHAR
#define _WSTRING_WMEMCPY(_dst,_src,_len) kvi_fastmoveodd((void *)(_dst),(const void *)(_src),sizeof(kvi_wchar_t) * (_len))
-void kvi_appendWCharToQStringWithLength(QString * qstrptr,const kvi_wchar_t * ptr,kvi_wslen_t len)
+void kvi_appendWCharToTQStringWithLength(TQString * qstrptr,const kvi_wchar_t * ptr,kvi_wslen_t len)
{
kvi_wslen_t oldLen = qstrptr->length();
qstrptr->setLength(oldLen + len);
- #ifdef WSTRINGCONFIG_SAFE_TO_MEMCPY_QCHAR
- _WSTRING_WMEMCPY(qstrptr->unicode() + oldLen,ptr,len);
- #else // !WSTRINGCONFIG_SAFE_TO_MEMCPY_QCHAR
- QChar * c = (qstrptr->unicode() + oldLen);
+ #ifdef WSTRINGCONFIG_SAFE_TO_MEMCPY_TQCHAR
+ _WSTRING_WMEMCPY(qstrptr->tqunicode() + oldLen,ptr,len);
+ #else // !WSTRINGCONFIG_SAFE_TO_MEMCPY_TQCHAR
+ TQChar * c = (qstrptr->tqunicode() + oldLen);
while(*ptr)
{
- c->unicode() = *ptr;
+ c->tqunicode() = *ptr;
ptr++;
c++;
}
- #endif // !WSTRINGCONFIG_SAFE_TO_MEMCPY_QCHAR
+ #endif // !WSTRINGCONFIG_SAFE_TO_MEMCPY_TQCHAR
}
@@ -285,16 +281,16 @@ void kvi_appendWCharToQStringWithLength(QString * qstrptr,const kvi_wchar_t * pt
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-KviIrcView::KviIrcView(QWidget *parent,KviFrame *pFrm,KviWindow *pWnd)
-: QWidget(parent,"irc_view")
+KviIrcView::KviIrcView(TQWidget *tqparent,KviFrame *pFrm,KviWindow *pWnd)
+: TQWidget(tqparent,"irc_view")
{
// Ok...here we go
// initialize the initializable
#ifdef COMPILE_USE_QT4
- setAttribute(Qt::WA_NoSystemBackground); // This disables automatic qt double buffering
- setAttribute(Qt::WA_OpaquePaintEvent);
- //setAttribute(Qt::WA_PaintOnScreen); // disable qt backing store (that would force us to trigger repaint() instead of the 10 times faster paintEvent(0))
+ setAttribute(TQt::WA_NoSystemBackground); // This disables automatic qt double buffering
+ setAttribute(TQt::WA_OpaquePaintEvent);
+ //setAttribute(TQt::WA_PaintOnScreen); // disable qt backing store (that would force us to trigger tqrepaint() instead of the 10 times faster paintEvent(0))
#endif
m_iFlushTimer = 0;
@@ -350,7 +346,7 @@ KviIrcView::KviIrcView(QWidget *parent,KviFrame *pFrm,KviWindow *pWnd)
m_pMessagesStoppedWhileSelecting = new KviPointerList<KviIrcViewLine>;
m_pMessagesStoppedWhileSelecting->setAutoDelete(false);
- // say qt to avoid erasing on repaint
+ // say qt to avoid erasing on tqrepaint
#ifdef COMPILE_USE_QT4
setAutoFillBackground(false);
#else
@@ -363,9 +359,9 @@ KviIrcView::KviIrcView(QWidget *parent,KviFrame *pFrm,KviWindow *pWnd)
// Create the scroll bar
#ifdef COMPILE_USE_QT4
- m_pScrollBar = new QScrollBar(0,0,1,10,0,Qt::Vertical,this,"irc_view_scrollbar");
+ m_pScrollBar = new TQScrollBar(0,0,1,10,0,Qt::Vertical,this,"irc_view_scrollbar");
#else
- m_pScrollBar = new QScrollBar(0,0,1,10,0,QScrollBar::Vertical,this,"irc_view_scrollbar");
+ m_pScrollBar = new TQScrollBar(0,0,1,10,0,Qt::Vertical,this,"irc_view_scrollbar");
#endif
m_pScrollBar->setTracking(true);
m_pScrollBar->show();
@@ -375,20 +371,20 @@ KviIrcView::KviIrcView(QWidget *parent,KviFrame *pFrm,KviWindow *pWnd)
m_pToolsButton = new KviStyledToolButton(this,"btntools");
#ifdef COMPILE_USE_QT4
- QIcon is1(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_POPUPMENU)));
+ TQIcon is1(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_POPUPMENU)));
m_pToolsButton->setAutoRaise(true);
#else
- QIconSet is1(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_POPUPMENU)),QIconSet::Small);
+ TQIconSet is1(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_POPUPMENU)),TQIconSet::Small);
#endif
m_pToolsButton->setIconSet(is1);
KviTalToolTip::add(m_pToolsButton,__tr2qs("Search tools"));
m_pToolsButton->setFocusProxy(this);
- connect(m_pToolsButton,SIGNAL(clicked()),this,SLOT(showToolsPopup()));
+ connect(m_pToolsButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(showToolsPopup()));
m_pToolsButton->show();
- connect(m_pScrollBar,SIGNAL(valueChanged(int)),this,SLOT(scrollBarPositionChanged(int)));
+ connect(m_pScrollBar,TQT_SIGNAL(valueChanged(int)),this,TQT_SLOT(scrollBarPositionChanged(int)));
m_iLastScrollBarValue = 0;
// set the minimum width
@@ -454,7 +450,7 @@ KviIrcView::~KviIrcView()
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-void KviIrcView::setFont(const QFont &f)
+void KviIrcView::setFont(const TQFont &f)
{
if(m_pFm)
{
@@ -468,7 +464,7 @@ void KviIrcView::setFont(const QFont &f)
l->iMaxLineWidth = -1;
l = l->pNext;
}
- QWidget::setFont(f);
+ TQWidget::setFont(f);
update();
}
@@ -496,27 +492,27 @@ void KviIrcView::enableDnd(bool bEnable)
m_bAcceptDrops = bEnable;
}
-void KviIrcView::dragEnterEvent(QDragEnterEvent *e)
+void KviIrcView::dragEnterEvent(TQDragEnterEvent *e)
{
if(!m_bAcceptDrops)return;
e->accept(KviUriDrag::canDecode(e));
emit dndEntered();
}
-void KviIrcView::dropEvent(QDropEvent *e)
+void KviIrcView::dropEvent(TQDropEvent *e)
{
if(!m_bAcceptDrops)return;
- QStringList list;
+ TQStringList list;
if(KviUriDrag::decodeLocalFiles(e,list))
{
if(!list.isEmpty())
{
- QStringList::ConstIterator it = list.begin(); //kewl ! :)
+ TQStringList::ConstIterator it = list.begin(); //kewl ! :)
for( ; it != list.end(); ++it )
{
- QString tmp = *it; //wow :)
+ TQString tmp = *it; //wow :)
#ifndef COMPILE_ON_WINDOWS
- if(tmp[0] != '/')tmp.prepend("/"); //HACK HACK HACK for Qt bug (?!?)
+ if(tmp[0] != '/')tmp.prepend("/"); //HACK HACK HACK for TQt bug (?!?)
#endif
emit fileDropped(tmp);
}
@@ -535,8 +531,8 @@ void KviIrcView::stopLogging()
{
if(m_pLogFile)
{
- QString szLogEnd;
- szLogEnd.sprintf(__tr2qs("### Log session terminated at %s ###"),QDateTime::currentDateTime().toString().utf8().data());
+ TQString szLogEnd;
+ szLogEnd.sprintf(__tr2qs("### Log session terminated at %s ###"),TQDateTime::tqcurrentDateTime().toString().utf8().data());
add2Log(szLogEnd);
m_pLogFile->close();
@@ -545,12 +541,12 @@ void KviIrcView::stopLogging()
{
if(m_pLogFile->open(IO_ReadOnly))
{
- QByteArray bytes;
+ TQByteArray bytes;
bytes=m_pLogFile->readAll();
m_pLogFile->close();
- QFileInfo fi(*m_pLogFile);
- QString szFname=fi.dirPath(true)+QString("/")+fi.baseName(true);
- gzFile file=gzopen(QTextCodec::codecForLocale()->fromUnicode(szFname).data(),"ab9");
+ TQFileInfo fi(*m_pLogFile);
+ TQString szFname=fi.dirPath(true)+TQString("/")+fi.baseName(true);
+ gzFile file=gzopen(TQTextCodec::codecForLocale()->fromUnicode(szFname).data(),"ab9");
if(file)
{
gzwrite(file,bytes.data(),bytes.size());
@@ -572,12 +568,12 @@ void KviIrcView::getLogFileName(KviStr &buffer)
if(m_pLogFile)buffer.append(m_pLogFile->name());
}
-void KviIrcView::getLogFileName(QString &buffer)
+void KviIrcView::getLogFileName(TQString &buffer)
{
if(m_pLogFile) buffer=m_pLogFile->name();
}
-void KviIrcView::getTextBuffer(QString &buffer)
+void KviIrcView::getTextBuffer(TQString &buffer)
{
// FIXME: #warning "This does not merge the KviChannel::m_pMessageView buffer!"
buffer = "";
@@ -598,12 +594,12 @@ void KviIrcView::flushLog()
m_pLogFile->close();
if(m_pLogFile->open(IO_ReadOnly))
{
- QByteArray bytes;
+ TQByteArray bytes;
bytes=m_pLogFile->readAll();
m_pLogFile->close();
- QFileInfo fi(*m_pLogFile);
- QString szFname=fi.dirPath(true)+QString("/")+fi.baseName(true);
- gzFile file=gzopen(QTextCodec::codecForLocale()->fromUnicode(szFname).data(),"ab9");
+ TQFileInfo fi(*m_pLogFile);
+ TQString szFname=fi.dirPath(true)+TQString("/")+fi.baseName(true);
+ gzFile file=gzopen(TQTextCodec::codecForLocale()->fromUnicode(szFname).data(),"ab9");
if(file)
{
gzwrite(file,bytes.data(),bytes.size());
@@ -621,7 +617,7 @@ void KviIrcView::flushLog()
else if(m_pMasterView)m_pMasterView->flushLog();
}
-const QString & KviIrcView::lastMessageText()
+const TQString & KviIrcView::lastMessageText()
{
KviIrcViewLine * pCur=m_pLastLine;
while(pCur)
@@ -640,12 +636,12 @@ const QString & KviIrcView::lastMessageText()
}
pCur=pCur->pPrev;
}
- return KviQString::empty;
+ return KviTQString::empty;
}
-const QString & KviIrcView::lastLineOfText()
+const TQString & KviIrcView::lastLineOfText()
{
- if(!m_pLastLine)return KviQString::empty;
+ if(!m_pLastLine)return KviTQString::empty;
return m_pLastLine->szText;
}
@@ -664,9 +660,9 @@ const QString & KviIrcView::lastLineOfText()
void KviIrcView::setMasterView(KviIrcView * v)
{
- if(m_pMasterView)disconnect(this,SLOT(masterDead()));
+ if(m_pMasterView)disconnect(this,TQT_SLOT(masterDead()));
m_pMasterView = v;
- if(m_pMasterView)connect(m_pMasterView,SIGNAL(destroyed()),this,SLOT(masterDead()));
+ if(m_pMasterView)connect(m_pMasterView,TQT_SIGNAL(destroyed()),this,TQT_SLOT(masterDead()));
}
void KviIrcView::masterDead()
@@ -674,10 +670,10 @@ void KviIrcView::masterDead()
m_pMasterView = 0;
}
-bool KviIrcView::startLogging(const QString& fname,bool bPrependCurBuffer)
+bool KviIrcView::startLogging(const TQString& fname,bool bPrependCurBuffer)
{
stopLogging();
- QString szFname(fname);
+ TQString szFname(fname);
if(fname.isEmpty())
{
@@ -690,7 +686,7 @@ bool KviIrcView::startLogging(const QString& fname,bool bPrependCurBuffer)
szFname+=".tmp";
#endif
- m_pLogFile = new QFile(szFname);
+ m_pLogFile = new TQFile(szFname);
if(m_pLogFile->exists())
{
@@ -709,13 +705,13 @@ bool KviIrcView::startLogging(const QString& fname,bool bPrependCurBuffer)
}
}
- QString szLogStart;
- szLogStart.sprintf(__tr2qs("### Log session started at %s ###"),QDateTime::currentDateTime().toString().utf8().data());
+ TQString szLogStart;
+ szLogStart.sprintf(__tr2qs("### Log session started at %s ###"),TQDateTime::tqcurrentDateTime().toString().utf8().data());
add2Log(szLogStart);
if(bPrependCurBuffer)
{
add2Log(__tr2qs("### Existing data buffer:"));
- QString buffer;
+ TQString buffer;
getTextBuffer(buffer);
add2Log(buffer);
add2Log(__tr2qs("### End of existing data buffer."));
@@ -725,10 +721,10 @@ bool KviIrcView::startLogging(const QString& fname,bool bPrependCurBuffer)
return true;
}
-void KviIrcView::add2Log(const QString &szBuffer,int iMsgType)
+void KviIrcView::add2Log(const TQString &szBuffer,int iMsgType)
{
- QString szToWrite=QString("%1 %2\n").arg(iMsgType).arg(szBuffer);
- KviQCString szTmp = KviQString::toUtf8(szToWrite);
+ TQString szToWrite=TQString("%1 %2\n").tqarg(iMsgType).tqarg(szBuffer);
+ KviTQCString szTmp = KviTQString::toUtf8(szToWrite);
if(m_pLogFile->writeBlock(szTmp.data(),szTmp.length())==-1) debug("WARNING : Can not write to the log file.");
}
@@ -762,11 +758,11 @@ void KviIrcView::clearBuffer()
bool KviIrcView::saveBuffer(const char *filename)
{
- QFile f(QString::fromUtf8(filename));
+ TQFile f(TQString::fromUtf8(filename));
if(!f.open(IO_WriteOnly|IO_Truncate))return false;
- QString tmp;
+ TQString tmp;
getTextBuffer(tmp);
- KviQCString tmpx = KviQString::toUtf8(tmp);
+ KviTQCString tmpx = KviTQString::toUtf8(tmp);
f.writeBlock(tmpx.data(),tmpx.length());
f.close();
return true;
@@ -777,14 +773,14 @@ void KviIrcView::nextLine(){ m_pScrollBar->addLine(); }
void KviIrcView::prevPage(){ m_pScrollBar->subtractPage(); }
void KviIrcView::nextPage(){ m_pScrollBar->addPage(); }
-void KviIrcView::setPrivateBackgroundPixmap(const QPixmap &pixmap,bool bRepaint)
+void KviIrcView::setPrivateBackgroundPixmap(const TQPixmap &pixmap,bool bRepaint)
{
if(m_pPrivateBackgroundPixmap)
{
delete m_pPrivateBackgroundPixmap;
m_pPrivateBackgroundPixmap=0;
}
- if(!pixmap.isNull())m_pPrivateBackgroundPixmap = new QPixmap(pixmap);
+ if(!pixmap.isNull())m_pPrivateBackgroundPixmap = new TQPixmap(pixmap);
if(bRepaint)
update();
@@ -807,7 +803,7 @@ void KviIrcView::clearLineMark(bool bRepaint)
void KviIrcView::checkLogDate()
{
- QDate::currentDate();
+ TQDate::tqcurrentDate();
}
void KviIrcView::clearUnreaded()
@@ -904,31 +900,31 @@ void KviIrcView::scrollBarPositionChanged(int newValue)
}
}
if(!m_bSkipScrollBarRepaint)
- repaint();
+ tqrepaint();
//update();
// if(!m_bSkipScrollBarRepaint)postUpdateEvent();
}
-bool KviIrcView::event(QEvent *e)
+bool KviIrcView::event(TQEvent *e)
{
- if(e->type() == QEvent::User)
+ if(e->type() == TQEvent::User)
{
__range_valid(m_bPostedPaintEventPending);
if(m_iUnprocessedPaintEventRequests)
- repaint();
+ tqrepaint();
// else we just had a pointEvent that did the job
m_bPostedPaintEventPending = false;
return true;
}
- return QWidget::event(e);
+ return TQWidget::event(e);
}
-void KviIrcView::wheelEvent(QWheelEvent *e)
+void KviIrcView::wheelEvent(TQWheelEvent *e)
{
#ifdef COMPILE_USE_QT4
static bool bHere = false;
if(bHere)return;
- bHere = true; // Qt4 tends to jump into infinite recursion here
+ bHere = true; // TQt4 tends to jump into infinite recursion here
#endif
g_pApp->sendEvent(m_pScrollBar,e);
#ifdef COMPILE_USE_QT4
@@ -939,12 +935,12 @@ void KviIrcView::wheelEvent(QWheelEvent *e)
void KviIrcView::postUpdateEvent()
{
- // This will post a QEvent with a full repaint request
+ // This will post a TQEvent with a full tqrepaint request
if(!m_bPostedPaintEventPending)
{
m_bPostedPaintEventPending = true;
- QEvent *e = new QEvent(QEvent::User);
- g_pApp->postEvent(this,e); // queue a repaint
+ TQEvent *e = new TQEvent(TQEvent::User);
+ g_pApp->postEvent(this,e); // queue a tqrepaint
}
m_iUnprocessedPaintEventRequests++; // paintEvent() will set it to 0
@@ -960,7 +956,7 @@ void KviIrcView::postUpdateEvent()
fastScroll(3);
#endif
else
- repaint();
+ tqrepaint();
}
}
@@ -1097,7 +1093,7 @@ void KviIrcView::removeHeadLine(bool bRepaint)
m_pLastLine = 0;
}
if(bRepaint)
- repaint();
+ tqrepaint();
}
void KviIrcView::splitMessagesTo(KviIrcView *v)
@@ -1154,12 +1150,12 @@ void KviIrcView::splitMessagesTo(KviIrcView *v)
m_pScrollBar->setRange(0,m_iNumLines);
m_pScrollBar->setValue(m_iNumLines);
- repaint();
+ tqrepaint();
v->m_iLastScrollBarValue = v->m_iNumLines;
v->m_pScrollBar->setRange(0,v->m_iNumLines);
v->m_pScrollBar->setValue(v->m_iNumLines);
- v->repaint();
+ v->tqrepaint();
}
@@ -1187,7 +1183,7 @@ void KviIrcView::appendMessagesFrom(KviIrcView *v)
m_pScrollBar->setRange(0,m_iNumLines);
m_pScrollBar->setValue(m_iNumLines);
- repaint();
+ tqrepaint();
}
void KviIrcView::joinMessagesFrom(KviIrcView *v)
@@ -1247,7 +1243,7 @@ void KviIrcView::joinMessagesFrom(KviIrcView *v)
m_pScrollBar->setRange(0,m_iNumLines);
m_pScrollBar->setValue(m_iNumLines);
- repaint();
+ tqrepaint();
}
void KviIrcView::appendText(int iMsgType,const kvi_wchar_t *data_ptr,int iFlags)
@@ -1266,9 +1262,9 @@ void KviIrcView::appendText(int iMsgType,const kvi_wchar_t *data_ptr,int iFlags)
if(!KVI_OPTION_BOOL(KviOption_boolStripControlCodesInLogs))
{
- QString szBuffer;
- kvi_appendWCharToQStringWithLength(&szBuffer,data_ptr,kvi_wstrlen(data_ptr));
- szBuffer.prepend(QDateTime::currentDateTime().toString("[h:mm:ss] "));
+ TQString szBuffer;
+ kvi_appendWCharToTQStringWithLength(&szBuffer,data_ptr,kvi_wstrlen(data_ptr));
+ szBuffer.prepend(TQDateTime::tqcurrentDateTime().toString("[h:mm:ss] "));
if(m_pLogFile && KVI_OPTION_MSGTYPE(iMsgType).logEnabled())
{
add2Log(szBuffer,iMsgType);
@@ -1303,15 +1299,15 @@ void KviIrcView::appendText(int iMsgType,const kvi_wchar_t *data_ptr,int iFlags)
}
-void KviIrcView::getLinkEscapeCommand(QString &buffer,const QString &szPayload,const QString &escape_label)
+void KviIrcView::getLinkEscapeCommand(TQString &buffer,const TQString &szPayload,const TQString &escape_label)
{
if(szPayload.isEmpty())return;
- int idx = szPayload.find(escape_label);
+ int idx = szPayload.tqfind(escape_label);
if(idx == -1)return;
idx += escape_label.length();
- int idx2 = szPayload.find("[!",idx);
+ int idx2 = szPayload.tqfind("[!",idx);
int len = idx2 == -1 ? szPayload.length() - idx : idx2 - idx;
buffer = szPayload.mid(idx,len);
@@ -1922,12 +1918,12 @@ const kvi_wchar_t * KviIrcView::getTextLine(int iMsgType,
line_ptr->pChunks[0].iTextStart = 0;
line_ptr->pChunks[0].colors.back = KVI_OPTION_MSGTYPE(iMsgType).back();
line_ptr->pChunks[0].colors.fore = KVI_OPTION_MSGTYPE(iMsgType).fore();
- line_ptr->pChunks[0].customFore=QColor();
+ line_ptr->pChunks[0].customFore=TQColor();
if(bEnableTimeStamp && KVI_OPTION_BOOL(KviOption_boolIrcViewTimestamp))
{
- QString szTimestamp;
- szTimestamp=QDateTime::currentDateTime (
+ TQString szTimestamp;
+ szTimestamp=TQDateTime::tqcurrentDateTime (
KVI_OPTION_BOOL(KviOption_boolIrcViewTimestampUTC) ? Qt::UTC : Qt::LocalTime ).toString(
KVI_OPTION_STRING(KviOption_stringIrcViewTimestampFormat) );
szTimestamp.append(' ');
@@ -1954,7 +1950,7 @@ const kvi_wchar_t * KviIrcView::getTextLine(int iMsgType,
line_ptr->pChunks[2].iTextLen = 1;
line_ptr->pChunks[2].colors.back = KVI_OPTION_MSGTYPE(iMsgType).back();
line_ptr->pChunks[2].colors.fore = KVI_OPTION_MSGTYPE(iMsgType).fore();
- line_ptr->pChunks[2].customFore=QColor();
+ line_ptr->pChunks[2].customFore=TQColor();
iCurChunk+=2;
} else {
// only one chunk
@@ -1968,8 +1964,8 @@ const kvi_wchar_t * KviIrcView::getTextLine(int iMsgType,
iTextIdx = iTimeStampLength; // the rest of the string will begin 11 chars later
// throw away const: we WANT to set the chars :D
- register QChar * data_ptr_aux = (QChar *)line_ptr->szText.unicode();
- register QChar * stamp_ptr_aux = (QChar *)szTimestamp.unicode();
+ register TQChar * data_ptr_aux = (TQChar *)line_ptr->szText.tqunicode();
+ register TQChar * stamp_ptr_aux = (TQChar *)szTimestamp.tqunicode();
for(int i=0;i<iTimeStampLength;i++)
*data_ptr_aux++ = *stamp_ptr_aux++;
@@ -1988,12 +1984,12 @@ const kvi_wchar_t * KviIrcView::getTextLine(int iMsgType,
#define APPEND_LAST_TEXT_BLOCK(__data_ptr,__data_len) \
blockLen = (__data_len); \
line_ptr->pChunks[iCurChunk].iTextLen += blockLen; \
- kvi_appendWCharToQStringWithLength(&(line_ptr->szText),__data_ptr,__data_len); \
+ kvi_appendWCharToTQStringWithLength(&(line_ptr->szText),__data_ptr,__data_len); \
iTextIdx+=blockLen;
#define APPEND_LAST_TEXT_BLOCK_HIDDEN_FROM_NOW(__data_ptr,__data_len) \
blockLen = (__data_len); \
- kvi_appendWCharToQStringWithLength(&(line_ptr->szText),__data_ptr,__data_len); \
+ kvi_appendWCharToTQStringWithLength(&(line_ptr->szText),__data_ptr,__data_len); \
iTextIdx+=blockLen;
@@ -2007,7 +2003,7 @@ const kvi_wchar_t * KviIrcView::getTextLine(int iMsgType,
line_ptr->pChunks[iCurChunk].type = _chunk_type; \
line_ptr->pChunks[iCurChunk].iTextStart = iTextIdx; \
line_ptr->pChunks[iCurChunk].iTextLen = 0; \
- line_ptr->pChunks[iCurChunk].customFore=iCurChunk ? line_ptr->pChunks[iCurChunk-1].customFore : QColor();
+ line_ptr->pChunks[iCurChunk].customFore=iCurChunk ? line_ptr->pChunks[iCurChunk-1].customFore : TQColor();
// EOF Macros
@@ -2132,7 +2128,7 @@ highlighting_check_loop:
// yet more optimized
if(*((unsigned short *)p) < 0xff)
if(void * jmp_address = char_to_check_jump_table[*((unsigned short *)p)])goto *jmp_address;
- // goto *(char_to_check_jump_table[*((unsigned char *)p)]); <--- replace 0 with &nothing_found
+ // goto *(char_to_check_jump_table[*((unsigned char *)p)]); <--- tqreplace 0 with &nothing_found
//nothing_found:
p++;
goto highlighting_check_loop;
@@ -2281,7 +2277,7 @@ found_command_escape:
{
if(line_ptr->pChunks[iCurChunk].szPayload[1]=='c' && ((KviChannel*)m_pKviWindow)->userListView())
{
- KviUserListEntry *e = ((KviChannel*)m_pKviWindow)->userListView()->findEntry(QString((QChar*)next_cr,term_cr-next_cr));
+ KviUserListEntry *e = ((KviChannel*)m_pKviWindow)->userListView()->findEntry(TQString((TQChar*)next_cr,term_cr-next_cr));
if(e)
{
line_ptr->pChunks[iCurChunk].colors.fore = KVI_COLOR_CUSTOM; e->color(line_ptr->pChunks[iCurChunk].customFore);
@@ -2289,9 +2285,9 @@ found_command_escape:
}
}
}
- else if(m_pKviWindow->type()==KVI_WINDOW_TYPE_QUERY && m_pKviWindow && line_ptr->pChunks[iCurChunk].szPayload[1]=='c')
+ else if(m_pKviWindow->type()==KVI_WINDOW_TYPE_TQUERY && m_pKviWindow && line_ptr->pChunks[iCurChunk].szPayload[1]=='c')
{
- QString m_szNick = QString((QChar*)next_cr,term_cr-next_cr);
+ TQString m_szNick = TQString((TQChar*)next_cr,term_cr-next_cr);
if(m_szNick==m_pKviWindow->connection()->currentNickName()) {
line_ptr->pChunks[iCurChunk].colors.fore = KVI_COLOR_OWN;
bColorSetted=true;
@@ -2340,7 +2336,7 @@ found_icon_escape:
// throw away constness!
*((kvi_wchar_t *)p) = 0;
// FIXME: this has to be changed! : lookupTextIcon must use wide characters!
- QString tmpQ;
+ TQString tmpQ;
tmpQ.setUnicodeCodes(icon_name,datalen);
KviTextIcon * icon = g_pTextIconManager->lookupTextIcon(tmpQ);
// throw away constness!
@@ -2560,7 +2556,7 @@ got_url:
if(m_pKviWindow)
{
- QString tmp;
+ TQString tmp;
tmp.setUnicodeCodes(data_ptr,p-data_ptr);
KVS_TRIGGER_EVENT_1(KviEvent_OnUrl,m_pKviWindow,tmp);
}
@@ -2590,10 +2586,10 @@ check_emoticon_char:
case KVI_OUT_CHANPRIVMSG:
case KVI_OUT_ACTION:
case KVI_OUT_OWNPRIVMSG:
- case KVI_OUT_QUERYPRIVMSG:
- case KVI_OUT_QUERYPRIVMSGCRYPTED:
- case KVI_OUT_QUERYNOTICE:
- case KVI_OUT_QUERYNOTICECRYPTED:
+ case KVI_OUT_TQUERYPRIVMSG:
+ case KVI_OUT_TQUERYPRIVMSGCRYPTED:
+ case KVI_OUT_TQUERYNOTICE:
+ case KVI_OUT_TQUERYNOTICECRYPTED:
case KVI_OUT_CHANPRIVMSGCRYPTED:
case KVI_OUT_CHANNELNOTICE:
case KVI_OUT_CHANNELNOTICECRYPTED:
@@ -2602,7 +2598,7 @@ check_emoticon_char:
case KVI_OUT_DCCCHATMSG:
{
// Pragma: 31.05.2002 : I had to kill the 8 prefix
- // It happens really too often to have an 8 followed by a parenthesis
+ // It happens really too often to have an 8 followed by a tqparenthesis
// that is not an emoticon
// *begin can be one of ':' , ';' , '='
@@ -2641,7 +2637,7 @@ check_emoticon_char:
// We lookup simplified versions of the emoticons...
// FIXME: this sould become UNICODE!!!
- QString lookupstring;
+ TQString lookupstring;
kvi_wchar_t ng[3];
ng[0] = *begin;
ng[1] = *item;
@@ -2717,13 +2713,13 @@ void KviIrcView::fastScroll(int lines)
if(!m_pFm)
{
// We must get the metrics from a real paint event :/
- // must do a full repaint to get them...
- repaint();
+ // must do a full tqrepaint to get them...
+ tqrepaint();
return;
}
// Ok...the current line is the last one here
- // It is the only one that needs to be repainted
+ // It is the only one that needs to be tqrepainted
int widgetWidth = width()-m_pScrollBar->width();
if(widgetWidth < KVI_IRCVIEW_PIXMAP_SEPARATOR_AND_DOUBLEBORDER_WIDTH+10)return; //can't show stuff here
int widgetHeight = height();
@@ -2751,14 +2747,14 @@ void KviIrcView::fastScroll(int lines)
}
#ifdef COMPILE_USE_QT4
- scroll(0,-(heightToPaint-1),QRect(1,1,widgetWidth-2,widgetHeight-2));
+ scroll(0,-(heightToPaint-1),TQRect(1,1,widgetWidth-2,widgetHeight-2));
#else
bitBlt(this,1,1,this,1,heightToPaint,widgetWidth -2,widgetHeight - (heightToPaint + KVI_IRCVIEW_VERTICAL_BORDER));
- QRect r(0,widgetHeight - (heightToPaint + KVI_IRCVIEW_VERTICAL_BORDER),
+ TQRect r(0,widgetHeight - (heightToPaint + KVI_IRCVIEW_VERTICAL_BORDER),
widgetWidth,heightToPaint + KVI_IRCVIEW_VERTICAL_BORDER);
- QPaintEvent * e = new QPaintEvent(r);
+ TQPaintEvent * e = new TQPaintEvent(r);
paintEvent(e);
delete e;
#endif
@@ -2782,7 +2778,7 @@ void KviIrcView::fastScroll(int lines)
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-void KviIrcView::paintEvent(QPaintEvent *p)
+void KviIrcView::paintEvent(TQPaintEvent *p)
{
//
// THIS FUNCTION IS A MONSTER
@@ -2792,7 +2788,7 @@ void KviIrcView::paintEvent(QPaintEvent *p)
int widgetWidth = width() - scrollbarWidth;
if(!isVisible() || (widgetWidth < 20))
{
- m_iUnprocessedPaintEventRequests = 0; // assume a full repaint when this widget is shown...
+ m_iUnprocessedPaintEventRequests = 0; // assume a full tqrepaint when this widget is shown...
return; //can't show stuff here
}
@@ -2804,22 +2800,22 @@ void KviIrcView::paintEvent(QPaintEvent *p)
(m_pKviWindow->mdiParent() != g_pFrame->mdiManager()->topChild()) &&
(m_pKviWindow->mdiParent()))
{
- m_iUnprocessedPaintEventRequests = 0; // assume a full repaint when this widget is shown...
+ m_iUnprocessedPaintEventRequests = 0; // assume a full tqrepaint when this widget is shown...
return; // totally hidden behind other windows
}
int widgetHeight = height();
- static QRect r; // static: avoid calling constructor and destructor every time...
+ static TQRect r; // static: avoid calling constructor and destructor every time...
if(p)
{
r=p->rect(); // app triggered , or self triggered from fastScroll (in that case m_iUnprocessedPaintEventRequests is set to 0 there)
if(r == rect())
- m_iUnprocessedPaintEventRequests = 0; // only full repaints reset
+ m_iUnprocessedPaintEventRequests = 0; // only full tqrepaints reset
} else {
// A self triggered event
- m_iUnprocessedPaintEventRequests = 0; // only full repaints reset
+ m_iUnprocessedPaintEventRequests = 0; // only full tqrepaints reset
r = rect();
}
@@ -2831,32 +2827,32 @@ void KviIrcView::paintEvent(QPaintEvent *p)
if(rectWidth > widgetWidth)rectWidth = widgetWidth;
#ifdef COMPILE_USE_QT4
- QPainter pa(this); // we use qt4 double buffering
+ TQPainter pa(this); // we use qt4 double buffering
#else
KviDoubleBuffer doublebuffer(width(),height());
- QPixmap * pDoubleBufferPixmap = doublebuffer.pixmap();
+ TQPixmap * pDoubleBufferPixmap = doublebuffer.pixmap();
- QPainter pa(pDoubleBufferPixmap);
+ TQPainter pa(pDoubleBufferPixmap);
#endif
SET_ANTI_ALIASING(pa);
pa.setFont(font());
if(!m_pFm)
{
- // note that QFontMetrics(pa.font()) may be not the same as QFontMetrics(font())
- // because the painter might effectively use an approximation of the QFont specified
+ // note that TQFontMetrics(pa.font()) may be not the same as TQFontMetrics(font())
+ // because the painter might effectively use an approximation of the TQFont specified
// by font().
- recalcFontVariables(QFontMetrics(pa.font()),pa.fontInfo());
+ recalcFontVariables(TQFontMetrics(pa.font()),pa.fontInfo());
}
#ifdef COMPILE_PSEUDO_TRANSPARENCY
if(g_pShadedChildGlobalDesktopBackground)
{
- QPoint pnt = mapToGlobal(QPoint(rectLeft,rectTop));
+ TQPoint pnt = mapToGlobal(TQPoint(rectLeft,rectTop));
pa.drawTiledPixmap(rectLeft,rectTop,rectWidth,rectHeight,*g_pShadedChildGlobalDesktopBackground,pnt.x(),pnt.y());
} else {
#endif
- QPixmap * pix = m_pPrivateBackgroundPixmap;
+ TQPixmap * pix = m_pPrivateBackgroundPixmap;
if(!pix)
pix = KVI_OPTION_PIXMAP(KviOption_pixmapIrcViewBackground).pixmap();
@@ -2924,7 +2920,7 @@ void KviIrcView::paintEvent(QPaintEvent *p)
//Calculate the position of the image
//imageYPos = curBottomCoord - (pixmapHeight(16) + ((m_iFontLineSpacing - 16)/2) );
int imageYPos = curBottomCoord - m_iRelativePixmapY;
- //Set the mask if needed
+ //Set the tqmask if needed
int iPixId = KVI_OPTION_MSGTYPE(pCurTextLine->iMsgType).pixId();
if(iPixId > 0)
pa.drawPixmap(KVI_IRCVIEW_HORIZONTAL_BORDER,imageYPos,*(g_pIconManager->getSmallIcon(iPixId)));
@@ -3124,7 +3120,7 @@ void KviIrcView::paintEvent(QPaintEvent *p)
}
#define DRAW_SELECTED_TEXT(_text_str,_text_idx,_text_len,_text_width) \
- SET_PEN(KVI_OPTION_MSGTYPE(KVI_OUT_SELECT).fore(),block->pChunk ? block->pChunk->customFore : QColor()); \
+ SET_PEN(KVI_OPTION_MSGTYPE(KVI_OUT_SELECT).fore(),block->pChunk ? block->pChunk->customFore : TQColor()); \
{ \
int theWdth = _text_width; \
if(theWdth < 0) \
@@ -3136,7 +3132,7 @@ void KviIrcView::paintEvent(QPaintEvent *p)
curLeftCoord += _text_width;
#define DRAW_NORMAL_TEXT(_text_str,_text_idx,_text_len,_text_width) \
- SET_PEN(curFore,block->pChunk ? block->pChunk->customFore : QColor()); \
+ SET_PEN(curFore,block->pChunk ? block->pChunk->customFore : TQColor()); \
if(curBack != KVI_TRANSPARENT){ \
int theWdth = _text_width; \
if(theWdth < 0) \
@@ -3176,20 +3172,20 @@ void KviIrcView::paintEvent(QPaintEvent *p)
case KVI_TEXT_UNDERLINE:
case KVI_TEXT_REVERSE:
case KVI_TEXT_RESET:
- m_szLastSelectionLine.append(QChar(block->pChunk->type));
+ m_szLastSelectionLine.append(TQChar(block->pChunk->type));
break;
case KVI_TEXT_COLOR:
- m_szLastSelectionLine.append(QChar(block->pChunk->type));
+ m_szLastSelectionLine.append(TQChar(block->pChunk->type));
if((block->pChunk->colors.fore != KVI_NOCHANGE) && (block->pChunk->colors.fore != KVI_TRANSPARENT))
{
- if(curFore > 9)m_szLastSelectionLine.append(QChar('1'));
- m_szLastSelectionLine.append(QChar((curFore%10)+'0'));
+ if(curFore > 9)m_szLastSelectionLine.append(TQChar('1'));
+ m_szLastSelectionLine.append(TQChar((curFore%10)+'0'));
}
if((block->pChunk->colors.back != KVI_NOCHANGE) && (block->pChunk->colors.back != KVI_TRANSPARENT) )
{
- m_szLastSelectionLine.append(QChar(','));
- if(curBack > 9)m_szLastSelectionLine.append(QChar('1'));
- m_szLastSelectionLine.append(QChar((curBack%10)+'0'));
+ m_szLastSelectionLine.append(TQChar(','));
+ if(curBack > 9)m_szLastSelectionLine.append(TQChar('1'));
+ m_szLastSelectionLine.append(TQChar((curBack%10)+'0'));
}
break;
}
@@ -3234,8 +3230,8 @@ void KviIrcView::paintEvent(QPaintEvent *p)
if(theWdth < 0)theWdth=width()-(curLeftCoord+KVI_IRCVIEW_HORIZONTAL_BORDER+scrollbarWidth);
pa.fillRect(curLeftCoord,curBottomCoord - m_iFontLineSpacing + m_iFontDescent,theWdth,m_iFontLineSpacing,KVI_OPTION_MIRCCOLOR(KVI_OPTION_MSGTYPE(KVI_OUT_SELECT).back()));
kvi_wslen_t the_len = kvi_wstrlen(block->pChunk->szPayload);
- m_szLastSelectionLine.append(QChar(block->pChunk->type));
- QString tmp;
+ m_szLastSelectionLine.append(TQChar(block->pChunk->type));
+ TQString tmp;
tmp.setUnicodeCodes(block->pChunk->szPayload,the_len);
m_szLastSelectionLine.append(tmp);
goto no_selection_paint;
@@ -3267,14 +3263,14 @@ no_selection_paint:
int wdth = block->block_width;
if(wdth < 0)wdth = widgetWidth - (curLeftCoord + KVI_IRCVIEW_HORIZONTAL_BORDER);
int imageYPos = curBottomCoord - m_iRelativePixmapY;
- //Set the mask if needed
+ //Set the tqmask if needed
if(curBack != KVI_TRANSPARENT && curBack < 16)
{
pa.fillRect(curLeftCoord,curBottomCoord - m_iFontLineSpacing + m_iFontDescent,wdth,m_iFontLineSpacing,KVI_OPTION_MIRCCOLOR((unsigned char)curBack));
}
- QString tmpQ;
+ TQString tmpQ;
tmpQ.setUnicodeCodes(block->pChunk->szSmileId,kvi_wstrlen(block->pChunk->szSmileId));
- QPixmap * daIcon =0;
+ TQPixmap * daIcon =0;
KviTextIcon* pIcon = g_pTextIconManager->lookupTextIcon(tmpQ);
if(pIcon)
{
@@ -3301,7 +3297,7 @@ no_selection_paint:
// FIXME: We could avoid this XSetForeground if the curFore was not changed....
- SET_PEN(curFore,block->pChunk ? block->pChunk->customFore : QColor());
+ SET_PEN(curFore,block->pChunk ? block->pChunk->customFore : TQColor());
if(curBack != KVI_TRANSPARENT && curBack < 16 )
{
@@ -3310,7 +3306,7 @@ no_selection_paint:
if(curLink)
{
- SET_PEN(KVI_OPTION_MSGTYPE(KVI_OUT_LINK).fore(),block->pChunk ? block->pChunk->customFore : QColor());
+ SET_PEN(KVI_OPTION_MSGTYPE(KVI_OUT_LINK).fore(),block->pChunk ? block->pChunk->customFore : TQColor());
pa.drawText(curLeftCoord,curBottomCoord,pCurTextLine->szText,block->block_start,block->block_len);
pa.drawText(curLeftCoord+1,curBottomCoord,pCurTextLine->szText,block->block_start,block->block_len);
pa.drawLine(curLeftCoord,curBottomCoord+2,curLeftCoord+wdth,curBottomCoord+2);
@@ -3337,13 +3333,13 @@ no_selection_paint:
// paint the cursor line
int iH = lineWrapsHeight + m_iFontLineSpacing;
#ifdef COMPILE_USE_QT4
- pa.setCompositionMode(QPainter::CompositionMode_SourceOut);
+ pa.setCompositionMode(TQPainter::CompositionMode_SourceOut);
#else
pa.setRasterOp(NotROP);
#endif
- pa.fillRect(0,curBottomCoord - iH,widgetWidth,iH + (m_iFontDescent << 1),Qt::black);
+ pa.fillRect(0,curBottomCoord - iH,widgetWidth,iH + (m_iFontDescent << 1),TQt::black);
#ifdef COMPILE_USE_QT4
- pa.setCompositionMode(QPainter::CompositionMode_SourceOver);
+ pa.setCompositionMode(TQPainter::CompositionMode_SourceOver);
#else
pa.setRasterOp(CopyROP);
#endif
@@ -3369,9 +3365,9 @@ no_selection_paint:
bLineMarkPainted = true;
//pa.setRasterOp(NotROP);
#ifdef COMPILE_USE_QT4
- pa.setPen(QPen(KVI_OPTION_COLOR(KviOption_colorIrcViewMarkLine),1,Qt::DotLine));
+ pa.setPen(TQPen(KVI_OPTION_COLOR(KviOption_colorIrcViewMarkLine),1,TQt::DotLine));
#else
- pa.setPen(QPen(KVI_OPTION_COLOR(KviOption_colorIrcViewMarkLine),1,QPen::DotLine));
+ pa.setPen(TQPen(KVI_OPTION_COLOR(KviOption_colorIrcViewMarkLine),1,TQPen::DotLine));
#endif
pa.drawLine(0,curBottomCoord,widgetWidth,curBottomCoord);
//pa.setRasterOp(CopyROP);
@@ -3413,11 +3409,11 @@ no_selection_paint:
{
// need to mark it!
//pa.setRasterOp(NotROP);
- //pa.setPen(Qt::black);
+ //pa.setPen(TQt::black);
#ifdef COMPILE_USE_QT4
- pa.setPen(QPen(KVI_OPTION_COLOR(KviOption_colorIrcViewMarkLine),1,Qt::DotLine));
+ pa.setPen(TQPen(KVI_OPTION_COLOR(KviOption_colorIrcViewMarkLine),1,TQt::DotLine));
#else
- pa.setPen(QPen(KVI_OPTION_COLOR(KviOption_colorIrcViewMarkLine),1,QPen::DotLine));
+ pa.setPen(TQPen(KVI_OPTION_COLOR(KviOption_colorIrcViewMarkLine),1,TQPen::DotLine));
#endif
int x = widgetWidth - 8;
int y = KVI_IRCVIEW_VERTICAL_BORDER;
@@ -3432,19 +3428,19 @@ no_selection_paint:
}
//Need to draw the sunken rect around the view now...
- pa.setPen(colorGroup().dark());
+ pa.setPen(tqcolorGroup().dark());
pa.drawLine(0,0,widgetWidth,0);
pa.drawLine(0,0,0,widgetHeight);
- pa.setPen(colorGroup().light());
+ pa.setPen(tqcolorGroup().light());
widgetWidth--;
pa.drawLine(1,widgetHeight-1,widgetWidth,widgetHeight-1);
pa.drawLine(widgetWidth,1,widgetWidth,widgetHeight);
// COPY TO THE DISPLAY
#ifndef COMPILE_USE_QT4
- bitBlt(this,rectLeft,rectTop,pDoubleBufferPixmap,rectLeft,rectTop,rectWidth,rectHeight,Qt::CopyROP);
+ bitBlt(this,rectLeft,rectTop,pDoubleBufferPixmap,rectLeft,rectTop,rectWidth,rectHeight,TQt::CopyROP);
#endif
-// else we use the Qt4 native double buffering
+// else we use the TQt4 native double buffering
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -3453,7 +3449,7 @@ no_selection_paint:
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-#define IRCVIEW_WCHARWIDTH(__c) (((__c).unicode() < 0xff) ? m_iFontCharacterWidth[(__c).unicode()] : m_pFm->width(__c))
+#define IRCVIEW_WCHARWIDTH(__c) (((__c).tqunicode() < 0xff) ? m_iFontCharacterWidth[(__c).tqunicode()] : m_pFm->width(__c))
void KviIrcView::calculateLineWraps(KviIrcViewLine *ptr,int maxWidth)
{
@@ -3480,12 +3476,12 @@ void KviIrcView::calculateLineWraps(KviIrcViewLine *ptr,int maxWidth)
int maxBlockLen = ptr->pChunks->iTextLen; // ptr->pChunks[0].iTextLen
- const QChar * unicode = ptr->szText.unicode();
+ const TQChar * tqunicode = ptr->szText.tqunicode();
for(;;)
{
//Calculate the block_width
- register const QChar * p = unicode + ptr->pBlocks[ptr->iBlockCount].block_start;
+ register const TQChar * p = tqunicode + ptr->pBlocks[ptr->iBlockCount].block_start;
int curBlockLen = 0;
int curBlockWidth = 0;
@@ -3550,7 +3546,7 @@ void KviIrcView::calculateLineWraps(KviIrcViewLine *ptr,int maxWidth)
ptr->pBlocks[ptr->iBlockCount].block_width = 0;
ptr->iBlockCount++;
ptr->pBlocks = (KviIrcViewWrappedBlock *)kvi_realloc(ptr->pBlocks,(ptr->iBlockCount + 1) * sizeof(KviIrcViewWrappedBlock));
- ptr->pBlocks[ptr->iBlockCount].block_start = p - unicode;
+ ptr->pBlocks[ptr->iBlockCount].block_start = p - tqunicode;
ptr->pBlocks[ptr->iBlockCount].block_len = 0;
ptr->pBlocks[ptr->iBlockCount].block_width = 0;
ptr->pBlocks[ptr->iBlockCount].pChunk = &(ptr->pChunks[curAttrBlock]);
@@ -3583,7 +3579,7 @@ void KviIrcView::calculateLineWraps(KviIrcViewLine *ptr,int maxWidth)
maxBlockLen-=curBlockLen;
ptr->iBlockCount++;
ptr->pBlocks = (KviIrcViewWrappedBlock *)kvi_realloc(ptr->pBlocks,(ptr->iBlockCount + 1) * sizeof(KviIrcViewWrappedBlock));
- ptr->pBlocks[ptr->iBlockCount].block_start = p - unicode;
+ ptr->pBlocks[ptr->iBlockCount].block_start = p - tqunicode;
ptr->pBlocks[ptr->iBlockCount].block_len = 0;
ptr->pBlocks[ptr->iBlockCount].block_width = 0;
ptr->pBlocks[ptr->iBlockCount].pChunk = 0;
@@ -3636,8 +3632,8 @@ bool KviIrcView::checkSelectionBlock(KviIrcViewLine * line,int left,int bottom,i
//
// Yahoo!!!!
//
- const QChar * unicode = line->szText.unicode();
- register const QChar * p = unicode + line->pBlocks[bufIndex].block_start;
+ const TQChar * tqunicode = line->szText.tqunicode();
+ register const TQChar * p = tqunicode + line->pBlocks[bufIndex].block_start;
int top = bottom-m_iFontLineSpacing;
int right = ((line->pBlocks[bufIndex].block_width >= 0) ? \
@@ -3824,11 +3820,11 @@ bool KviIrcView::checkSelectionBlock(KviIrcViewLine * line,int left,int bottom,i
//============ recalcFontVariables ==============//
-void KviIrcView::recalcFontVariables(const QFontMetrics &fm,const QFontInfo &fi)
+void KviIrcView::recalcFontVariables(const TQFontMetrics &fm,const TQFontInfo &fi)
{
// FIXME: #warning "OPTIMIZE THIS: GLOBAL VARIABLES"
if(m_pFm)delete m_pFm;
- m_pFm = new QFontMetrics(fm);
+ m_pFm = new TQFontMetrics(fm);
m_iFontLineSpacing = m_pFm->lineSpacing();
if(m_iFontLineSpacing < KVI_IRCVIEW_PIXMAP_SIZE && KVI_OPTION_BOOL(KviOption_boolIrcViewShowImages))
{
@@ -3839,7 +3835,7 @@ void KviIrcView::recalcFontVariables(const QFontMetrics &fm,const QFontInfo &fi)
// cache the first 256 characters
for(unsigned short i=0;i<256;i++)
{
- m_iFontCharacterWidth[i]=m_pFm->width(QChar(i));
+ m_iFontCharacterWidth[i]=m_pFm->width(TQChar(i));
}
if(m_iFontLineWidth==0)m_iFontLineWidth=1;
m_iWrapMargin = m_pFm->width("wwww");
@@ -3860,9 +3856,9 @@ void KviIrcView::recalcFontVariables(const QFontMetrics &fm,const QFontInfo &fi)
//================ resizeEvent ===============//
-void KviIrcView::resizeEvent(QResizeEvent *)
+void KviIrcView::resizeEvent(TQResizeEvent *)
{
- int iScr = m_pScrollBar->sizeHint().width();
+ int iScr = m_pScrollBar->tqsizeHint().width();
int iLeft = width()-iScr;
m_pToolsButton->setGeometry(iLeft,0,iScr,iScr);
m_pScrollBar->setGeometry(iLeft,iScr,iScr,height() - iScr);
@@ -3877,9 +3873,9 @@ void KviIrcView::resizeEvent(QResizeEvent *)
}
}
-QSize KviIrcView::sizeHint() const
+TQSize KviIrcView::tqsizeHint() const
{
- QSize ret(KVI_IRCVIEW_SIZEHINT_WIDTH,KVI_IRCVIEW_SIZEHINT_HEIGHT);
+ TQSize ret(KVI_IRCVIEW_SIZEHINT_WIDTH,KVI_IRCVIEW_SIZEHINT_HEIGHT);
return ret;
}
@@ -3891,34 +3887,34 @@ void KviIrcView::showToolsPopup()
m_pToolsPopup->clear();
if(m_pToolWidget)
- m_pToolsPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SEARCH)),__tr2qs("Hide Find Window"),this,SLOT(toggleToolWidget()));
+ m_pToolsPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SEARCH)),__tr2qs("Hide Find Window"),this,TQT_SLOT(toggleToolWidget()));
else
- m_pToolsPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SEARCH)),__tr2qs("Show Find Window"),this,SLOT(toggleToolWidget()));
+ m_pToolsPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SEARCH)),__tr2qs("Show Find Window"),this,TQT_SLOT(toggleToolWidget()));
m_pToolsPopup->insertSeparator();
- m_pToolsPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_PLUS)),__tr2qs("Zoom In"),this,SLOT(increaseFontSize()));
- m_pToolsPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MINUS)),__tr2qs("Zoom Out"),this,SLOT(decreaseFontSize()));
- m_pToolsPopup->insertItem(__tr2qs("Choose Temporary Font..."),this,SLOT(chooseFont()));
- m_pToolsPopup->insertItem(__tr2qs("Choose Temporary Background..."),this,SLOT(chooseBackground()));
- int id = m_pToolsPopup->insertItem(__tr2qs("Reset Temporary Background"),this,SLOT(resetBackground()));
+ m_pToolsPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_PLUS)),__tr2qs("Zoom In"),this,TQT_SLOT(increaseFontSize()));
+ m_pToolsPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MINUS)),__tr2qs("Zoom Out"),this,TQT_SLOT(decreaseFontSize()));
+ m_pToolsPopup->insertItem(__tr2qs("Choose Temporary Font..."),this,TQT_SLOT(chooseFont()));
+ m_pToolsPopup->insertItem(__tr2qs("Choose Temporary Background..."),this,TQT_SLOT(chooseBackground()));
+ int id = m_pToolsPopup->insertItem(__tr2qs("Reset Temporary Background"),this,TQT_SLOT(resetBackground()));
m_pToolsPopup->setItemEnabled(id,m_pPrivateBackgroundPixmap != 0);
m_pToolsPopup->insertSeparator();
- m_pToolsPopup->insertItem(__tr2qs("Clear Buffer"),this,SLOT(clearBuffer()));
+ m_pToolsPopup->insertItem(__tr2qs("Clear Buffer"),this,TQT_SLOT(clearBuffer()));
- QSize s = m_pToolsPopup->sizeHint();
+ TQSize s = m_pToolsPopup->tqsizeHint();
- m_pToolsPopup->popup(m_pToolsButton->mapToGlobal(QPoint(m_pToolsButton->width() - s.width(),m_pToolsButton->height())));
+ m_pToolsPopup->popup(m_pToolsButton->mapToGlobal(TQPoint(m_pToolsButton->width() - s.width(),m_pToolsButton->height())));
}
void KviIrcView::increaseFontSize()
{
- QFont f = font();
+ TQFont f = font();
f.setPointSize(f.pointSize() + 1);
setFont(f);
}
void KviIrcView::decreaseFontSize()
{
- QFont f = font();
+ TQFont f = font();
int p = f.pointSize();
if(p > 2)p--;
f.setPointSize(p);
@@ -3928,20 +3924,20 @@ void KviIrcView::decreaseFontSize()
void KviIrcView::chooseFont()
{
bool bOk;
- QFont f = QFontDialog::getFont(&bOk,font(),this);
+ TQFont f = TQFontDialog::getFont(&bOk,font(),this);
if(!bOk)return;
setFont(f);
}
void KviIrcView::chooseBackground()
{
- QString f;
+ TQString f;
if(!KviFileDialog::askForOpenFileName(f,__tr2qs("Choose the background image...")))return;
if(f.isEmpty())return;
- QPixmap p(f);
+ TQPixmap p(f);
if(p.isNull())
{
- QMessageBox::information(this,__tr2qs("Invalid image"),__tr2qs("Failed to load the selected image"),__tr2qs("Ok"));
+ TQMessageBox::information(this,__tr2qs("Invalid image"),__tr2qs("Failed to load the selected image"),__tr2qs("Ok"));
return;
}
setPrivateBackgroundPixmap(p);
@@ -3959,11 +3955,11 @@ void KviIrcView::toggleToolWidget()
delete m_pToolWidget;
m_pToolWidget = 0;
m_pCursorLine = 0;
- repaint();
+ tqrepaint();
} else {
m_pToolWidget = new KviIrcViewToolWidget(this);
- int w = m_pToolWidget->sizeHint().width();
+ int w = m_pToolWidget->tqsizeHint().width();
m_pToolWidget->move(width() - (w + 40),10);
m_pToolWidget->show();
}
@@ -3972,7 +3968,7 @@ void KviIrcView::toggleToolWidget()
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
-// The IrcView : find
+// The IrcView : tqfind
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -3983,7 +3979,7 @@ void KviIrcView::setCursorLine(KviIrcViewLine * l)
if(m_pCursorLine == m_pCurLine)
{
- repaint();
+ tqrepaint();
return;
}
@@ -4004,7 +4000,7 @@ void KviIrcView::setCursorLine(KviIrcViewLine * l)
m_iLastScrollBarValue = sc;
m_pScrollBar->setValue(sc);
} else {
- repaint();
+ tqrepaint();
}
} else {
// The cursor line is over the current line
@@ -4038,12 +4034,12 @@ void KviIrcView::setCursorLine(KviIrcViewLine * l)
m_iLastScrollBarValue = sc;
m_pScrollBar->setValue(sc);
} else {
- repaint();
+ tqrepaint();
}
}
}
-void KviIrcView::findNext(const QString& szText,bool bCaseS,bool bRegExp,bool bExtended)
+void KviIrcView::findNext(const TQString& szText,bool bCaseS,bool bRegExp,bool bExtended)
{
KviIrcViewLine * l = m_pCursorLine;
if(!l)l = m_pCurLine;
@@ -4063,15 +4059,11 @@ void KviIrcView::findNext(const QString& szText,bool bCaseS,bool bRegExp,bool bE
if(bRegExp)
{
- QRegExp re(szText,bCaseS,!bExtended);
-#if QT_VERSION >= 300
+ TQRegExp re(szText,bCaseS,!bExtended);
idx = re.search(l->szText,0);
-#else
- idx = re.find(l->szText,0);
-#endif
} else {
- QString tmp = l->szText;
- idx = tmp.find(szText,0,bCaseS);
+ TQString tmp = l->szText;
+ idx = tmp.tqfind(szText,0,bCaseS);
}
if(idx != -1)
@@ -4079,8 +4071,8 @@ void KviIrcView::findNext(const QString& szText,bool bCaseS,bool bRegExp,bool bE
setCursorLine(l);
if(m_pToolWidget)
{
- QString tmp;
- KviQString::sprintf(tmp,__tr2qs("Pos %d"),idx);
+ TQString tmp;
+ KviTQString::sprintf(tmp,__tr2qs("Pos %d"),idx);
m_pToolWidget->setFindResult(tmp);
}
return;
@@ -4094,12 +4086,12 @@ do_pNext:
} while(l != start);
}
m_pCursorLine = 0;
- repaint();
+ tqrepaint();
if(m_pToolWidget)m_pToolWidget->setFindResult(__tr2qs("Not found"));
}
-void KviIrcView::findPrev(const QString& szText,bool bCaseS,bool bRegExp,bool bExtended)
+void KviIrcView::findPrev(const TQString& szText,bool bCaseS,bool bRegExp,bool bExtended)
{
KviIrcViewLine * l = m_pCursorLine;
if(!l)l = m_pCurLine;
@@ -4120,15 +4112,11 @@ void KviIrcView::findPrev(const QString& szText,bool bCaseS,bool bRegExp,bool bE
if(bRegExp)
{
- QRegExp re(szText,bCaseS,!bExtended);
-#if QT_VERSION >= 300
+ TQRegExp re(szText,bCaseS,!bExtended);
idx = re.search(l->szText,0);
-#else
- idx = re.find(l->szText,0);
-#endif
} else {
- QString tmp = l->szText;
- idx = tmp.find(szText,0,bCaseS);;
+ TQString tmp = l->szText;
+ idx = tmp.tqfind(szText,0,bCaseS);;
}
if(idx != -1)
@@ -4136,8 +4124,8 @@ void KviIrcView::findPrev(const QString& szText,bool bCaseS,bool bRegExp,bool bE
setCursorLine(l);
if(m_pToolWidget)
{
- QString tmp;
- KviQString::sprintf(tmp,__tr2qs("Pos %d"),idx);
+ TQString tmp;
+ KviTQString::sprintf(tmp,__tr2qs("Pos %d"),idx);
m_pToolWidget->setFindResult(tmp);
}
return;
@@ -4152,7 +4140,7 @@ do_pPrev:
}
m_pCursorLine = 0;
- repaint();
+ tqrepaint();
if(m_pToolWidget)m_pToolWidget->setFindResult(__tr2qs("Not found"));
}
@@ -4181,7 +4169,7 @@ KviIrcViewLine * KviIrcView::getVisibleLineAt(int xPos,int yPos)
return 0;
}
-KviIrcViewWrappedBlock * KviIrcView::getLinkUnderMouse(int xPos,int yPos,QRect * pRect,QString * linkCmd,QString * linkText)
+KviIrcViewWrappedBlock * KviIrcView::getLinkUnderMouse(int xPos,int yPos,TQRect * pRect,TQString * linkCmd,TQString * linkText)
{
KviIrcViewLine * l = m_pCurLine;
int iTop = height() + m_iFontDescent - KVI_IRCVIEW_VERTICAL_BORDER;
@@ -4282,7 +4270,7 @@ KviIrcViewWrappedBlock * KviIrcView::getLinkUnderMouse(int xPos,int yPos,QRect *
}
if(pRect)
{
- *pRect = QRect(iLeftBorder,
+ *pRect = TQRect(iLeftBorder,
bHadWordWraps ? iLastEscapeBlockTop : iTop,
iRightBorder,
((uLineWraps + 1) * m_iFontLineSpacing) + m_iFontDescent);
@@ -4295,7 +4283,7 @@ KviIrcViewWrappedBlock * KviIrcView::getLinkUnderMouse(int xPos,int yPos,QRect *
}
if(linkText)
{
- QString szLink;
+ TQString szLink;
int iEndOfLInk = iLastEscapeBlock;
while(1)
{
@@ -4308,18 +4296,18 @@ KviIrcViewWrappedBlock * KviIrcView::getLinkUnderMouse(int xPos,int yPos,QRect *
case KVI_TEXT_UNDERLINE:
case KVI_TEXT_REVERSE:
case KVI_TEXT_RESET:
- szLink.append(QChar(l->pBlocks[iEndOfLInk].pChunk->type));
+ szLink.append(TQChar(l->pBlocks[iEndOfLInk].pChunk->type));
break;
case KVI_TEXT_COLOR:
- szLink.append(QChar(KVI_TEXT_COLOR));
+ szLink.append(TQChar(KVI_TEXT_COLOR));
if(l->pBlocks[iEndOfLInk].pChunk->colors.fore != KVI_NOCHANGE)
{
- szLink.append(QString("%1").arg((int)(l->pBlocks[iEndOfLInk].pChunk->colors.fore)));
+ szLink.append(TQString("%1").tqarg((int)(l->pBlocks[iEndOfLInk].pChunk->colors.fore)));
}
if(l->pBlocks[iEndOfLInk].pChunk->colors.back != KVI_NOCHANGE)
{
- szLink.append(QChar(','));
- szLink.append(QString("%1").arg((int)(l->pBlocks[iEndOfLInk].pChunk->colors.back)));
+ szLink.append(TQChar(','));
+ szLink.append(TQString("%1").tqarg((int)(l->pBlocks[iEndOfLInk].pChunk->colors.back)));
}
break;
}
@@ -4346,7 +4334,7 @@ KviIrcViewWrappedBlock * KviIrcView::getLinkUnderMouse(int xPos,int yPos,QRect *
{
if(pRect)
{
- *pRect = QRect(iLastLeft,
+ *pRect = TQRect(iLastLeft,
bHadWordWraps ? firstRowTop : iTop,
iBlockWidth,
((l->uLineWraps + 1) * m_iFontLineSpacing) + m_iFontDescent);
@@ -4354,7 +4342,7 @@ KviIrcViewWrappedBlock * KviIrcView::getLinkUnderMouse(int xPos,int yPos,QRect *
if(linkCmd)
{
*linkCmd = "[!txt]";
- QString tmp;
+ TQString tmp;
tmp.setUnicodeCodes(l->pBlocks[i].pChunk->szPayload,kvi_wstrlen(l->pBlocks[i].pChunk->szPayload));
linkCmd->append(tmp);
linkCmd->stripWhiteSpace();
@@ -4441,7 +4429,7 @@ KviIrcViewWrappedBlock * KviIrcView::getLinkUnderMouse(int xPos,int yPos,QRect *
These links are used internally in KVIrc , but you can use them too.[br]
The <escape_command> is a single letter this time: it defines the type of the link.[br]
Currently KVIrc uses six types of builtin links : 'n' for nickname links, 'u' for url links,
- 'c' for channel links, 'h' for hostname links, 'm' for mask links and 's' for server links.[br]
+ 'c' for channel links, 'h' for hostname links, 'm' for tqmask links and 's' for server links.[br]
Theoretically you can also use your own link types: just use any other letter or digit (you can't use ']' and <cr>),
but probably you will prefer a completely user defined link in that case anyway.[br]
Once the user interacts with the link , kvirc executes the predefined events:[br]
@@ -4459,11 +4447,11 @@ KviIrcViewWrappedBlock * KviIrcView::getLinkUnderMouse(int xPos,int yPos,QRect *
// FIXME: #warning "Finish the doc above!! Maybe some examples ?!"
-void KviIrcView::mouseDoubleClickEvent(QMouseEvent *e)
+void KviIrcView::mouseDoubleClickEvent(TQMouseEvent *e)
{
- QString cmd;
- QString linkCmd;
- QString linkText;
+ TQString cmd;
+ TQString linkCmd;
+ TQString linkText;
if(m_iMouseTimer)
{
@@ -4481,7 +4469,7 @@ void KviIrcView::mouseDoubleClickEvent(QMouseEvent *e)
return;
}
- QString szCmd(linkCmd);
+ TQString szCmd(linkCmd);
szCmd.remove(0,1);
KviKvsVariantList * pParams = new KviKvsVariantList();
@@ -4491,7 +4479,7 @@ void KviIrcView::mouseDoubleClickEvent(QMouseEvent *e)
pParams->append(szCmd);
- switch(linkCmd[0].unicode())
+ switch(linkCmd[0].tqunicode())
{
case 'n':
{
@@ -4504,8 +4492,8 @@ void KviIrcView::mouseDoubleClickEvent(QMouseEvent *e)
KVS_TRIGGER_EVENT(KviEvent_OnChannelNickDefaultActionRequest,m_pKviWindow,pParams);
} else bTrigger = true;
break;
- case KVI_WINDOW_TYPE_QUERY:
- if(KviQString::equalCI(((KviQuery *)m_pKviWindow)->windowName(),linkText))
+ case KVI_WINDOW_TYPE_TQUERY:
+ if(KviTQString::equalCI(((KviQuery *)m_pKviWindow)->windowName(),linkText))
{
KVS_TRIGGER_EVENT(KviEvent_OnQueryNickDefaultActionRequest,m_pKviWindow,pParams);
} else bTrigger = true;
@@ -4528,17 +4516,17 @@ void KviIrcView::mouseDoubleClickEvent(QMouseEvent *e)
{
if(((KviChannel *)m_pKviWindow)->isMeOp())
{
- QChar plmn = linkCmd[1];
- if((plmn.unicode() == '+') || (plmn.unicode() == '-'))
+ TQChar plmn = linkCmd[1];
+ if((plmn.tqunicode() == '+') || (plmn.tqunicode() == '-'))
{
- QString target(m_pKviWindow->windowName());
- target.replace("\\","\\\\");
- target.replace("\"","\\\"");
- target.replace(";","\\;");
- target.replace("$","\\$");
- target.replace("%","\\%");
- QChar flag = linkCmd[2];
- switch(flag.unicode())
+ TQString target(m_pKviWindow->windowName());
+ target.tqreplace("\\","\\\\");
+ target.tqreplace("\"","\\\"");
+ target.tqreplace(";","\\;");
+ target.tqreplace("$","\\$");
+ target.tqreplace("%","\\%");
+ TQChar flag = linkCmd[2];
+ switch(flag.tqunicode())
{
case 'o':
case 'v':
@@ -4549,10 +4537,10 @@ void KviIrcView::mouseDoubleClickEvent(QMouseEvent *e)
case 'I':
case 'e':
case 'k':
- KviQString::sprintf(cmd,"mode %Q %c%c $0",&target,plmn.latin1(),flag.latin1());
+ KviTQString::sprintf(cmd,"mode %Q %c%c $0",&target,plmn.latin1(),flag.latin1());
break;
default:
- KviQString::sprintf(cmd,"mode %Q %c%c",&target,plmn.latin1(),flag.latin1());
+ KviTQString::sprintf(cmd,"mode %Q %c%c",&target,plmn.latin1(),flag.latin1());
break;
}
}
@@ -4565,14 +4553,14 @@ void KviIrcView::mouseDoubleClickEvent(QMouseEvent *e)
break;
case 'u':
{
- QString urlText;
+ TQString urlText;
if(!szCmd.isEmpty()) urlText=szCmd;
else urlText=linkText;
if(
- !KviQString::cmpCIN(urlText,"irc://",6) ||
- !KviQString::cmpCIN(urlText,"irc6://",7) ||
- !KviQString::cmpCIN(urlText,"ircs://",7) ||
- !KviQString::cmpCIN(urlText,"ircs6://",8)
+ !KviTQString::cmpCIN(urlText,"irc://",6) ||
+ !KviTQString::cmpCIN(urlText,"irc6://",7) ||
+ !KviTQString::cmpCIN(urlText,"ircs://",7) ||
+ !KviTQString::cmpCIN(urlText,"ircs6://",8)
)
{
KviIrcUrl::run(urlText,KviIrcUrl::TryCurrentContext | KviIrcUrl::DoNotPartChans, console());
@@ -4585,7 +4573,7 @@ void KviIrcView::mouseDoubleClickEvent(QMouseEvent *e)
{
if(console() && console()->connection())
{
- QString szChan=linkText;
+ TQString szChan=linkText;
if(szCmd.length()>0) szChan=szCmd;
if(KviChannel * c = console()->connection()->findChannel(szChan))
{
@@ -4593,7 +4581,7 @@ void KviIrcView::mouseDoubleClickEvent(QMouseEvent *e)
c->raise();
c->setFocus();
} else {
- cmd = QString("join %1").arg(szChan);
+ cmd = TQString("join %1").tqarg(szChan);
}
}
}
@@ -4618,7 +4606,7 @@ void KviIrcView::mouseDoubleClickEvent(QMouseEvent *e)
delete pParams;
}
-void KviIrcView::mousePressEvent(QMouseEvent *e)
+void KviIrcView::mousePressEvent(TQMouseEvent *e)
{
if(m_pKviWindow->input()) m_pKviWindow->input()->setFocus();
@@ -4631,7 +4619,7 @@ void KviIrcView::mousePressEvent(QMouseEvent *e)
if(m_pToolWidget)
{
m_pCursorLine = getVisibleLineAt(e->pos().x(),e->pos().y());
- repaint();
+ tqrepaint();
}
m_mousePressPos = e->pos();
@@ -4639,7 +4627,7 @@ void KviIrcView::mousePressEvent(QMouseEvent *e)
m_bMouseIsDown = true;
- m_bShiftPressed = (e->state() & Qt::ShiftButton);
+ m_bShiftPressed = (e->state() & TQt::ShiftButton);
calculateSelectionBounds();
}
@@ -4653,21 +4641,21 @@ void KviIrcView::mousePressEvent(QMouseEvent *e)
delete m_pLastEvent;
m_pLastEvent = 0;
} else {
- m_iMouseTimer = startTimer(QApplication::doubleClickInterval());
- m_pLastEvent = new QMouseEvent(*e);
+ m_iMouseTimer = startTimer(TQApplication::doubleClickInterval());
+ m_pLastEvent = new TQMouseEvent(*e);
}
} else {
mouseRealPressEvent(e);
}
}
-void KviIrcView::mouseRealPressEvent(QMouseEvent *e)
+void KviIrcView::mouseRealPressEvent(TQMouseEvent *e)
{
- QString linkCmd;
- QString linkText;
+ TQString linkCmd;
+ TQString linkText;
getLinkUnderMouse(e->pos().x(),e->pos().y(),0,&linkCmd,&linkText);
- QString szCmd(linkCmd);
+ TQString szCmd(linkCmd);
szCmd.remove(0,1);
KviKvsVariantList * pParams = new KviKvsVariantList();
@@ -4677,11 +4665,11 @@ void KviIrcView::mouseRealPressEvent(QMouseEvent *e)
pParams->append(szCmd);
- if(!(e->state() & Qt::ControlButton))//(e->button() & Qt::RightButton) && (
+ if(!(e->state() & TQt::ControlButton))//(e->button() & Qt::RightButton) && (
{
if(!linkCmd.isEmpty())
{
- switch(linkCmd[0].unicode())
+ switch(linkCmd[0].tqunicode())
{
case 'n':
{
@@ -4699,7 +4687,7 @@ void KviIrcView::mouseRealPressEvent(QMouseEvent *e)
{
if(m_pKviWindow->inherits("KviChannel")) {
KviChannel *c = (KviChannel*)m_pKviWindow;
- QString nick;
+ TQString nick;
if(pParams->firstAsString(nick))
c->userListView()->select(nick);
}
@@ -4707,8 +4695,8 @@ void KviIrcView::mouseRealPressEvent(QMouseEvent *e)
}
} else bTrigger = true;
break;
- case KVI_WINDOW_TYPE_QUERY:
- if(KviQString::equalCI(((KviQuery *)m_pKviWindow)->windowName(),linkText))
+ case KVI_WINDOW_TYPE_TQUERY:
+ if(KviTQString::equalCI(((KviQuery *)m_pKviWindow)->windowName(),linkText))
{
if(e->button() & Qt::RightButton)
KVS_TRIGGER_EVENT(KviEvent_OnQueryNickPopupRequest,m_pKviWindow,pParams);
@@ -4760,7 +4748,7 @@ void KviIrcView::mouseRealPressEvent(QMouseEvent *e)
{
if(e->button() & Qt::RightButton)
{
- QString tmp;
+ TQString tmp;
getLinkEscapeCommand(tmp,linkCmd,"[!rbt]");
if(!tmp.isEmpty())
{
@@ -4772,10 +4760,10 @@ void KviIrcView::mouseRealPressEvent(QMouseEvent *e)
}
} else if(e->button() & Qt::RightButton) emit rightClicked();
- } else if((e->button() & Qt::MidButton) || ((e->button() & Qt::RightButton) && (e->state() & Qt::ControlButton)))
+ } else if((e->button() & Qt::MidButton) || ((e->button() & Qt::RightButton) && (e->state() & TQt::ControlButton)))
{
- QString tmp;
- getLinkEscapeCommand(tmp,linkCmd,QString("[!mbt]"));
+ TQString tmp;
+ getLinkEscapeCommand(tmp,linkCmd,TQString("[!mbt]"));
if(!tmp.isEmpty())
{
KviKvsScript::run(tmp,m_pKviWindow,pParams);
@@ -4788,19 +4776,19 @@ void KviIrcView::mouseRealPressEvent(QMouseEvent *e)
//================ mouseReleaseEvent ===============//
-void KviIrcView::mouseReleaseEvent(QMouseEvent *)
+void KviIrcView::mouseReleaseEvent(TQMouseEvent *)
{
if(m_iSelectTimer)
{
killTimer(m_iSelectTimer);
m_iSelectTimer = 0;
- QClipboard * c = QApplication::clipboard();
+ TQClipboard * c = TQApplication::tqclipboard();
if(c)
{
// copy to both!
- c->setText(m_szLastSelection,QClipboard::Clipboard);
+ c->setText(m_szLastSelection,TQClipboard::Clipboard);
if(c->supportsSelection())
- c->setText(m_szLastSelection,QClipboard::Selection);
+ c->setText(m_szLastSelection,TQClipboard::Selection);
}
}
@@ -4814,13 +4802,13 @@ void KviIrcView::mouseReleaseEvent(QMouseEvent *)
m_pMessagesStoppedWhileSelecting->removeFirst();
appendLine(l,false);
}
- repaint();
+ tqrepaint();
}
}
// FIXME: #warning "The tooltip timeout should be small, because the view scrolls!"
-void KviIrcView::mouseMoveEvent(QMouseEvent *e)
+void KviIrcView::mouseMoveEvent(TQMouseEvent *e)
{
// debug("Pos : %d,%d",e->pos().x(),e->pos().y());
if(m_bMouseIsDown && (e->state() & Qt::LeftButton)) // m_bMouseIsDown MUST BE true...(otherwise the mouse entered the window with the button pressed ?)
@@ -4846,7 +4834,7 @@ void KviIrcView::mouseMoveEvent(QMouseEvent *e)
int yPos = e->pos().y();
int rectTop;
int rectHeight;
- QRect rctLink;
+ TQRect rctLink;
KviIrcViewWrappedBlock * newLinkUnderMouse = getLinkUnderMouse(e->pos().x(),yPos,&rctLink);
rectTop = rctLink.y();
@@ -4859,7 +4847,7 @@ void KviIrcView::mouseMoveEvent(QMouseEvent *e)
m_pLastLinkUnderMouse = newLinkUnderMouse;
if(m_pLastLinkUnderMouse)
{
- setCursor(Qt::PointingHandCursor);
+ setCursor(TQt::PointingHandCursor);
if(rectTop < 0)rectTop = 0;
if((rectTop + rectHeight) > height())rectHeight = height() - rectTop;
@@ -4869,22 +4857,22 @@ void KviIrcView::mouseMoveEvent(QMouseEvent *e)
int top = (rectTop < m_iLastLinkRectTop) ? rectTop : m_iLastLinkRectTop;
int lastBottom = m_iLastLinkRectTop + m_iLastLinkRectHeight;
int thisBottom = rectTop + rectHeight;
- QRect r(0,top,width(),((lastBottom > thisBottom) ? lastBottom : thisBottom) - top);
- repaint(r);
+ TQRect r(0,top,width(),((lastBottom > thisBottom) ? lastBottom : thisBottom) - top);
+ tqrepaint(r);
} else {
// no prev link
- QRect r(0,rectTop,width(),rectHeight);
- repaint(r);
+ TQRect r(0,rectTop,width(),rectHeight);
+ tqrepaint(r);
}
m_iLastLinkRectTop = rectTop;
m_iLastLinkRectHeight = rectHeight;
} else {
- setCursor(Qt::ArrowCursor);
+ setCursor(TQt::ArrowCursor);
if(m_iLastLinkRectHeight > -1)
{
// There was a previous bottom rect
- QRect r(0,m_iLastLinkRectTop,width(),m_iLastLinkRectHeight);
- repaint(r);
+ TQRect r(0,m_iLastLinkRectTop,width(),m_iLastLinkRectHeight);
+ tqrepaint(r);
m_iLastLinkRectTop = -1;
m_iLastLinkRectHeight = -1;
}
@@ -4899,16 +4887,16 @@ KviConsole * KviIrcView::console()
return m_pKviWindow->console();
}
-void KviIrcView::doLinkToolTip(const QRect &rct,QString &linkCmd,QString &linkText)
+void KviIrcView::doLinkToolTip(const TQRect &rct,TQString &linkCmd,TQString &linkText)
{
if(linkCmd.isEmpty())return;
- QString szCmd(linkCmd);
+ TQString szCmd(linkCmd);
szCmd.remove(0,1);
- QString tip;
+ TQString tip;
- switch(linkCmd[0].unicode())
+ switch(linkCmd[0].tqunicode())
{
case 'u': // url link
{
@@ -4922,7 +4910,7 @@ void KviIrcView::doLinkToolTip(const QRect &rct,QString &linkCmd,QString &linkTe
tip += linkText;
}
tip+="</nowrap></font></u></td></tr><tr><td>";
- QMimeSourceFactory::defaultFactory()->setPixmap("url_icon",*(g_pIconManager->getSmallIcon(KVI_SMALLICON_URL)));
+ TQMimeSourceFactory::defaultFactory()->setPixmap("url_icon",*(g_pIconManager->getSmallIcon(KVI_SMALLICON_URL)));
tip += __tr2qs("Double-click to open this link");
tip += "</td></tr></table>";
}
@@ -4939,11 +4927,11 @@ void KviIrcView::doLinkToolTip(const QRect &rct,QString &linkCmd,QString &linkTe
tip += linkText;
}
tip+="</nowrap></font></u></td></tr><tr><td>";
- QMimeSourceFactory::defaultFactory()->setPixmap("host_icon",*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SERVER)));
+ TQMimeSourceFactory::defaultFactory()->setPixmap("host_icon",*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SERVER)));
- if(linkText.find('*') != -1)
+ if(linkText.tqfind('*') != -1)
{
- if(linkText.length() > 1)tip += __tr2qs("Unable to look it up hostname: Hostname appears to be masked");
+ if(linkText.length() > 1)tip += __tr2qs("Unable to look it up hostname: Hostname appears to be tqmasked");
else tip += __tr2qs("Unable to look it up hostname: Unknown host");
} else {
tip += __tr2qs("Double-click to look up this hostname<br>Right-click to view other options");
@@ -4957,7 +4945,7 @@ void KviIrcView::doLinkToolTip(const QRect &rct,QString &linkCmd,QString &linkTe
tip = "<table width=\"100%\">" \
"<tr><td valign=\"center\"><img src=\"server_icon\"> <u><font color=\"blue\"><nowrap>";
- QMimeSourceFactory::defaultFactory()->setPixmap("server_icon",*(g_pIconManager->getSmallIcon(KVI_SMALLICON_IRC)));
+ TQMimeSourceFactory::defaultFactory()->setPixmap("server_icon",*(g_pIconManager->getSmallIcon(KVI_SMALLICON_IRC)));
if(linkText.length() > 50)
{
tip += linkText.left(47);
@@ -4967,7 +4955,7 @@ void KviIrcView::doLinkToolTip(const QRect &rct,QString &linkCmd,QString &linkTe
}
tip+="</nowrap></font></u></td></tr><tr><td>";
- if(linkText.find('*') != -1)
+ if(linkText.tqfind('*') != -1)
{
if(linkText.length() > 1)tip += __tr2qs("Server appears to be a network hub<br>");
else tip += __tr2qs("Unknown server<br>"); // might happen...
@@ -4983,12 +4971,12 @@ void KviIrcView::doLinkToolTip(const QRect &rct,QString &linkCmd,QString &linkTe
{
if(((KviChannel *)m_pKviWindow)->isMeOp())
{
- QChar plmn = linkCmd[1];
- if((plmn.unicode() == '+') || (plmn.unicode() == '-'))
+ TQChar plmn = linkCmd[1];
+ if((plmn.tqunicode() == '+') || (plmn.tqunicode() == '-'))
{
tip = __tr2qs("Double-click to set<br>");
- QChar flag = linkCmd[2];
- switch(flag.unicode())
+ TQChar flag = linkCmd[2];
+ switch(flag.tqunicode())
{
case 'o':
case 'v':
@@ -4999,10 +4987,10 @@ void KviIrcView::doLinkToolTip(const QRect &rct,QString &linkCmd,QString &linkTe
case 'I':
case 'e':
case 'k':
- KviQString::appendFormatted(tip,QString("<b>mode %Q %c%c %Q</b>"),&(m_pKviWindow->windowName()),plmn.latin1(),flag.latin1(),&linkText);
+ KviTQString::appendFormatted(tip,TQString("<b>mode %Q %c%c %Q</b>"),&(m_pKviWindow->windowName()),plmn.latin1(),flag.latin1(),&linkText);
break;
default:
- KviQString::appendFormatted(tip,QString("<b>mode %Q %c%c</b>"),&(m_pKviWindow->windowName()),plmn.latin1(),flag.latin1());
+ KviTQString::appendFormatted(tip,TQString("<b>mode %Q %c%c</b>"),&(m_pKviWindow->windowName()),plmn.latin1(),flag.latin1());
break;
}
}
@@ -5019,14 +5007,14 @@ void KviIrcView::doLinkToolTip(const QRect &rct,QString &linkCmd,QString &linkTe
{
if(console()->connection())
{
- KviIrcUserEntry * e = console()->connection()->userDataBase()->find(linkText);
+ KviIrcUserEntry * e = console()->connection()->userDataBase()->tqfind(linkText);
if(e)
{
- QString buffer;
+ TQString buffer;
console()->getUserTipText(linkText,e,buffer);
tip = buffer;
- } else KviQString::sprintf(tip,__tr2qs("Nothing known about %Q"),&linkText);
- } else KviQString::sprintf(tip,__tr2qs("Nothing known about %Q (no connection)"),&linkText);
+ } else KviTQString::sprintf(tip,__tr2qs("Nothing known about %Q"),&linkText);
+ } else KviTQString::sprintf(tip,__tr2qs("Nothing known about %Q (no connection)"),&linkText);
}
}
break;
@@ -5034,30 +5022,30 @@ void KviIrcView::doLinkToolTip(const QRect &rct,QString &linkCmd,QString &linkTe
{
if(console() && console()->connection())
{
- QString szChan = linkText;
- QString buf;
+ TQString szChan = linkText;
+ TQString buf;
tip = "<img src=\"chan_icon\"> ";
- QMimeSourceFactory::defaultFactory()->setPixmap("chan_icon",*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CHANNEL)));
+ TQMimeSourceFactory::defaultFactory()->setPixmap("chan_icon",*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CHANNEL)));
if(szCmd.length()>0) szChan=szCmd;
KviChannel * c = console()->connection()->findChannel(szChan);
- QString szUrl;
+ TQString szUrl;
if(c)
{
- QString chanMode;
+ TQString chanMode;
c->getChannelModeString(chanMode);
- QString topic = KviMircCntrl::stripControlBytes(c->topicWidget()->topic());
- topic.replace("<","&lt;");
- topic.replace(">","&gt;");
+ TQString topic = KviMircCntrl::stripControlBytes(c->topicWidget()->topic());
+ topic.tqreplace("<","&lt;");
+ topic.tqreplace(">","&gt;");
KviIrcUrl::join(szUrl,console()->connection()->target()->server());
szUrl.append(szChan);
- KviQString::sprintf(buf,__tr2qs("<b>%Q</b> (<u><font color=\"blue\"><nowrap>"
+ KviTQString::sprintf(buf,__tr2qs("<b>%Q</b> (<u><font color=\"blue\"><nowrap>"
"%Q</nowrap></font></u>): <br><nowrap>+%Q (%u users)<hr>%Q</nowrap>"),&szChan,&szUrl,&chanMode,
c->count(),&topic);
} else {
KviIrcUrl::join(szUrl,console()->connection()->target()->server());
szUrl.append(szChan);
- KviQString::sprintf(buf,__tr2qs("<b>%Q</b> (<u><font color=\"blue\"><nowrap>"
+ KviTQString::sprintf(buf,__tr2qs("<b>%Q</b> (<u><font color=\"blue\"><nowrap>"
"%Q</nowrap></font></u>)<hr>Double-click to join %Q<br>Right click to view other options"),&szChan,&szUrl,&szChan);
}
@@ -5067,7 +5055,7 @@ void KviIrcView::doLinkToolTip(const QRect &rct,QString &linkCmd,QString &linkTe
break;
default:
{
- QString dbl,rbt,txt,mbt;
+ TQString dbl,rbt,txt,mbt;
getLinkEscapeCommand(dbl,linkCmd,"[!dbl]");
getLinkEscapeCommand(rbt,linkCmd,"[!rbt]");
getLinkEscapeCommand(txt,linkCmd,"[!txt]");
@@ -5077,17 +5065,17 @@ void KviIrcView::doLinkToolTip(const QRect &rct,QString &linkCmd,QString &linkTe
if(tip.isEmpty() && (!dbl.isEmpty()))
{
if(!tip.isEmpty())tip.append("<hr>");
- KviQString::appendFormatted(tip,__tr2qs("<b>Double-click:</b><br>%Q"),&dbl);
+ KviTQString::appendFormatted(tip,__tr2qs("<b>Double-click:</b><br>%Q"),&dbl);
}
if(tip.isEmpty() && (!mbt.isEmpty()))
{
if(!tip.isEmpty())tip.append("<hr>");
- KviQString::appendFormatted(tip,__tr2qs("<b>Middle-click:</b><br>%Q"),&mbt);
+ KviTQString::appendFormatted(tip,__tr2qs("<b>Middle-click:</b><br>%Q"),&mbt);
}
if(tip.isEmpty() && (!rbt.isEmpty()))
{
if(!tip.isEmpty())tip.append("<hr>");
- KviQString::appendFormatted(tip,__tr2qs("<b>Right-click:</b><br>%Q"),&rbt);
+ KviTQString::appendFormatted(tip,__tr2qs("<b>Right-click:</b><br>%Q"),&rbt);
}
}
break;
@@ -5097,7 +5085,7 @@ void KviIrcView::doLinkToolTip(const QRect &rct,QString &linkCmd,QString &linkTe
m_pToolTip->doTip(rct,tip);
}
-void KviIrcView::leaveEvent ( QEvent * )
+void KviIrcView::leaveEvent ( TQEvent * )
{
if(m_pLastLinkUnderMouse)
{
@@ -5105,14 +5093,14 @@ void KviIrcView::leaveEvent ( QEvent * )
update();
}
}
-void KviIrcView::timerEvent(QTimerEvent *e)
+void KviIrcView::timerEvent(TQTimerEvent *e)
{
- m_mouseCurrentPos = mapFromGlobal(QCursor::pos());
+ m_mouseCurrentPos = mapFromGlobal(TQCursor::pos());
if(e->timerId() == m_iSelectTimer)
{
calculateSelectionBounds();
- repaint();
+ tqrepaint();
}
if(e->timerId() == m_iMouseTimer)
{
@@ -5128,15 +5116,15 @@ void KviIrcView::timerEvent(QTimerEvent *e)
}
}
-void KviIrcView::keyPressEvent(QKeyEvent *e)
+void KviIrcView::keyPressEvent(TQKeyEvent *e)
{
switch(e->key())
{
- case Qt::Key_PageUp:
+ case TQt::Key_PageUp:
prevPage();
e->accept();
break;
- case Qt::Key_PageDown:
+ case TQt::Key_PageDown:
nextPage();
e->accept();
break;
@@ -5145,12 +5133,12 @@ void KviIrcView::keyPressEvent(QKeyEvent *e)
}
}
-void KviIrcView::maybeTip(const QPoint &pnt)
+void KviIrcView::maybeTip(const TQPoint &pnt)
{
- QString linkCmd;
- QString linkText;
+ TQString linkCmd;
+ TQString linkText;
- QRect rctLink;
+ TQRect rctLink;
KviIrcViewWrappedBlock * linkUnderMouse = getLinkUnderMouse(pnt.x(),pnt.y(),&rctLink,&linkCmd,&linkText);