summaryrefslogtreecommitdiffstats
path: root/src/modules/dcc
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 18:31:12 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 18:31:12 +0000
commit0a80cfd57d271dd44221467efb426675fa470356 (patch)
tree6f503a31aa078eaf8fa015cf1749808529d49fc9 /src/modules/dcc
parent3329e5a804e28ef3f5eb51d1e7affdd5a508e8f2 (diff)
downloadkvirc-0a80cfd57d271dd44221467efb426675fa470356.tar.gz
kvirc-0a80cfd57d271dd44221467efb426675fa470356.zip
TQt4 port kvirc
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1238719 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/modules/dcc')
-rw-r--r--src/modules/dcc/adpcmcodec.h2
-rw-r--r--src/modules/dcc/broker.cpp140
-rw-r--r--src/modules/dcc/broker.h17
-rw-r--r--src/modules/dcc/canvas.cpp38
-rw-r--r--src/modules/dcc/canvas.h17
-rw-r--r--src/modules/dcc/canvaswidget.cpp462
-rw-r--r--src/modules/dcc/canvaswidget.h167
-rw-r--r--src/modules/dcc/chat.cpp88
-rw-r--r--src/modules/dcc/chat.h25
-rw-r--r--src/modules/dcc/descriptor.cpp6
-rw-r--r--src/modules/dcc/descriptor.h72
-rw-r--r--src/modules/dcc/dialogs.cpp88
-rw-r--r--src/modules/dcc/dialogs.h20
-rw-r--r--src/modules/dcc/libkvidcc.cpp148
-rw-r--r--src/modules/dcc/marshal.cpp40
-rw-r--r--src/modules/dcc/marshal.h35
-rw-r--r--src/modules/dcc/requests.cpp68
-rw-r--r--src/modules/dcc/send.cpp312
-rw-r--r--src/modules/dcc/send.h60
-rw-r--r--src/modules/dcc/thread.cpp2
-rw-r--r--src/modules/dcc/thread.h8
-rw-r--r--src/modules/dcc/utils.cpp8
-rw-r--r--src/modules/dcc/utils.h2
-rw-r--r--src/modules/dcc/voice.cpp101
-rw-r--r--src/modules/dcc/voice.h59
-rw-r--r--src/modules/dcc/window.h1
26 files changed, 973 insertions, 1013 deletions
diff --git a/src/modules/dcc/adpcmcodec.h b/src/modules/dcc/adpcmcodec.h
index 63343df0..49913518 100644
--- a/src/modules/dcc/adpcmcodec.h
+++ b/src/modules/dcc/adpcmcodec.h
@@ -30,7 +30,7 @@
// 16384 32768 | 8192 | ~110 250 290
//
-#include <qstring.h> // fix for qtextstream.h
+#include <tqstring.h> // fix for qtextstream.h
#include "codec.h"
typedef struct adpcm_state
diff --git a/src/modules/dcc/broker.cpp b/src/modules/dcc/broker.cpp
index b6548e0c..d183ebbf 100644
--- a/src/modules/dcc/broker.cpp
+++ b/src/modules/dcc/broker.cpp
@@ -44,13 +44,13 @@
extern KVIRC_API KviMediaManager * g_pMediaManager;
extern KVIRC_API KviSharedFilesManager * g_pSharedFilesManager;
-#include <qfileinfo.h>
-#include <qstring.h>
+#include <tqfileinfo.h>
+#include <tqstring.h>
//#warning "The broker might lookup the remote host name"
KviDccBroker::KviDccBroker()
-: QObject(0,"dcc_broker")
+: TQObject(0,"dcc_broker")
{
KviDccFileTransfer::init();
@@ -60,7 +60,7 @@ KviDccBroker::KviDccBroker()
m_pDccWindowList = new KviPointerList<KviWindow>;
m_pDccWindowList->setAutoDelete(false);
- m_pZeroPortTags = new KviPointerHashTable<QString,KviDccZeroPortTag>(17);
+ m_pZeroPortTags = new KviPointerHashTable<TQString,KviDccZeroPortTag>(17);
m_pZeroPortTags->setAutoDelete(true);
}
@@ -81,7 +81,7 @@ KviDccZeroPortTag * KviDccBroker::addZeroPortTag()
static unsigned int g_uNextZeroPortTag = 0;
g_uNextZeroPortTag++;
KviDccZeroPortTag * t = new KviDccZeroPortTag;
- t->m_tTimestamp = QDateTime::currentDateTime();
+ t->m_tTimestamp = TQDateTime::tqcurrentDateTime();
t->m_szTag.setNum(g_uNextZeroPortTag);
//t->m_szTag.prepend("mIrc-zero-port-");
t->m_uResumePosition = 0;
@@ -90,11 +90,11 @@ KviDccZeroPortTag * KviDccBroker::addZeroPortTag()
return t;
}
-KviDccZeroPortTag * KviDccBroker::findZeroPortTag(const QString &szTag)
+KviDccZeroPortTag * KviDccBroker::findZeroPortTag(const TQString &szTag)
{
- KviDccZeroPortTag * t = m_pZeroPortTags->find(szTag);
+ KviDccZeroPortTag * t = m_pZeroPortTags->tqfind(szTag);
if(!t)return 0;
- if(t->m_tTimestamp.secsTo(QDateTime::currentDateTime()) > 180)
+ if(t->m_tTimestamp.secsTo(TQDateTime::tqcurrentDateTime()) > 180)
{
// too late man...
m_pZeroPortTags->remove(szTag);
@@ -103,7 +103,7 @@ KviDccZeroPortTag * KviDccBroker::findZeroPortTag(const QString &szTag)
return t;
}
-void KviDccBroker::removeZeroPortTag(const QString &szTag)
+void KviDccBroker::removeZeroPortTag(const TQString &szTag)
{
m_pZeroPortTags->remove(szTag);
}
@@ -145,14 +145,14 @@ void KviDccBroker::cancelDcc(KviDccBox *box,KviDccDescriptor * dcc)
void KviDccBroker::rsendManage(KviDccDescriptor * dcc)
{
// We need the filename...
- QFileInfo fi(dcc->szLocalFileName);
+ TQFileInfo fi(dcc->szLocalFileName);
if(fi.exists())rsendExecute(0,dcc);
else rsendAskForFileName(dcc);
}
void KviDccBroker::rsendAskForFileName(KviDccDescriptor * dcc)
{
- QStringList filenames;
+ TQStringList filenames;
if(
KviFileDialog::askForOpenFileNames(filenames,
__tr2qs_ctx("Choose Files to Send - KVIrc","dcc"),"")
@@ -161,7 +161,7 @@ void KviDccBroker::rsendAskForFileName(KviDccDescriptor * dcc)
{
KviDccDescriptor * d;
KviDccDescriptor * templ = dcc;
- QStringList::Iterator it=filenames.begin();
+ TQStringList::Iterator it=filenames.begin();
while(it != filenames.end())
{
d = new KviDccDescriptor(*dcc);
@@ -193,7 +193,7 @@ void KviDccBroker::rsendExecute(KviDccDescriptor * dcc)
}
// Ok...we need the file to exist
- QFileInfo fi(dcc->szLocalFileName);
+ TQFileInfo fi(dcc->szLocalFileName);
if(!(fi.exists() && fi.isReadable() && (fi.isFile()) && (fi.size() > 0)))
{
dcc->console()->output(KVI_OUT_DCCERROR,__tr2qs_ctx("Can't open file %Q for reading","dcc"),
@@ -203,12 +203,12 @@ void KviDccBroker::rsendExecute(KviDccDescriptor * dcc)
}
dcc->szFileName = dcc->szLocalFileName;
- dcc->szFileName = QFileInfo(dcc->szFileName).fileName();
+ dcc->szFileName = TQFileInfo(dcc->szFileName).fileName();
- QString fName = dcc->szFileName;
- fName.replace(' ',"\\040"); // be cool :)
+ TQString fName = dcc->szFileName;
+ fName.tqreplace(' ',"\\040"); // be cool :)
- QString szTag;
+ TQString szTag;
if(dcc->isZeroPortRequest())
{
// actually we tagged it as "nonempty" in /dcc.rsend --zero-port
@@ -239,7 +239,7 @@ void KviDccBroker::rsendExecute(KviDccDescriptor * dcc)
// now add a file offer , so he we will accept it automatically
// 120 secs is a reasonable timeout
- QString szMask = dcc->szNick;
+ TQString szMask = dcc->szNick;
szMask += "!*@*";
g_pSharedFilesManager->addSharedFile(szTag,dcc->szLocalFileName,szMask,120);
@@ -265,10 +265,10 @@ void KviDccBroker::handleChatRequest(KviDccDescriptor * dcc)
{
// FIXME: better message ? Secure Direct Client Connection...eventually
// need confirmation
- QString tmp = __tr2qs_ctx( \
+ TQString tmp = __tr2qs_ctx( \
"<b>%1 [%2@%3]</b> requests a " \
"<b>Direct Client Connection</b> in <b>%4</b> mode.<br>", \
- "dcc").arg(dcc->szNick).arg(dcc->szUser).arg(dcc->szHost).arg(dcc->szType);
+ "dcc").tqarg(dcc->szNick).tqarg(dcc->szUser).tqarg(dcc->szHost).tqarg(dcc->szType);
#ifdef COMPILE_SSL_SUPPORT
if(dcc->bIsSSL)tmp += __tr2qs_ctx("The connection will be secured using SSL.<br>","dcc");
@@ -282,19 +282,19 @@ void KviDccBroker::handleChatRequest(KviDccDescriptor * dcc)
} else {
tmp += __tr2qs_ctx( \
"The connection target will be host <b>%1</b> on port <b>%2</b><br>" \
- ,"dcc").arg(dcc->szIp).arg(dcc->szPort);
+ ,"dcc").tqarg(dcc->szIp).tqarg(dcc->szPort);
}
- QString caption = __tr2qs_ctx("DCC %1 Request - KVIrc","dcc").arg(dcc->szType);
+ TQString caption = __tr2qs_ctx("DCC %1 Request - KVIrc","dcc").tqarg(dcc->szType);
KviDccAcceptBox * box = new KviDccAcceptBox(this,dcc,tmp,caption);
m_pBoxList->append(box);
- connect(box,SIGNAL(accepted(KviDccBox *,KviDccDescriptor *)),
- this,SLOT(executeChat(KviDccBox *,KviDccDescriptor *)));
- connect(box,SIGNAL(rejected(KviDccBox *,KviDccDescriptor *)),
- this,SLOT(cancelDcc(KviDccBox *,KviDccDescriptor *)));
+ connect(box,TQT_SIGNAL(accepted(KviDccBox *,KviDccDescriptor *)),
+ this,TQT_SLOT(executeChat(KviDccBox *,KviDccDescriptor *)));
+ connect(box,TQT_SIGNAL(rejected(KviDccBox *,KviDccDescriptor *)),
+ this,TQT_SLOT(cancelDcc(KviDccBox *,KviDccDescriptor *)));
box->show();
} else {
// auto accept
@@ -315,7 +315,7 @@ void KviDccBroker::executeChat(KviDccBox *box,KviDccDescriptor * dcc)
KviStr szSubProto = dcc->szType;
szSubProto.toLower();
- QString tmp = QString("dcc: %1 %2@%3:%4").arg(szSubProto.ptr()).arg(dcc->szNick).arg(dcc->szIp).arg(dcc->szPort);
+ TQString tmp = TQString("dcc: %1 %2@%3:%4").tqarg(szSubProto.ptr()).tqarg(dcc->szNick).tqarg(dcc->szIp).tqarg(dcc->szPort);
KviDccChat * chat = new KviDccChat(dcc->console()->frame(),dcc,tmp.utf8().data());
bool bMinimized = dcc->bOverrideMinimize ? dcc->bShowMinimized : \
@@ -336,19 +336,19 @@ void KviDccBroker::activeVoiceManage(KviDccDescriptor * dcc)
if(!dcc->bAutoAccept)
{
// need confirmation
- QString tmp = __tr2qs_ctx(
+ TQString tmp = __tr2qs_ctx(
"<b>%1 [%2@%3]</b> requests a<br>" \
"<b>Direct Client Connection</b> in <b>VOICE</b> mode.<br>" \
"The connection target will be host <b>%4</b> on port <b>%5</b><br>" \
,"dcc" \
- ).arg(dcc->szNick).arg(dcc->szUser).arg(dcc->szHost).arg(dcc->szIp).arg(dcc->szPort);
+ ).tqarg(dcc->szNick).tqarg(dcc->szUser).tqarg(dcc->szHost).tqarg(dcc->szIp).tqarg(dcc->szPort);
KviDccAcceptBox * box = new KviDccAcceptBox(this,dcc,tmp,__tr2qs_ctx("DCC VOICE request","dcc"));
m_pBoxList->append(box);
- connect(box,SIGNAL(accepted(KviDccBox *,KviDccDescriptor *)),
- this,SLOT(activeVoiceExecute(KviDccBox *,KviDccDescriptor *)));
- connect(box,SIGNAL(rejected(KviDccBox *,KviDccDescriptor *)),
- this,SLOT(cancelDcc(KviDccBox *,KviDccDescriptor *)));
+ connect(box,TQT_SIGNAL(accepted(KviDccBox *,KviDccDescriptor *)),
+ this,TQT_SLOT(activeVoiceExecute(KviDccBox *,KviDccDescriptor *)));
+ connect(box,TQT_SIGNAL(rejected(KviDccBox *,KviDccDescriptor *)),
+ this,TQT_SLOT(cancelDcc(KviDccBox *,KviDccDescriptor *)));
box->show();
} else {
// auto accept
@@ -407,19 +407,19 @@ void KviDccBroker::activeCanvasManage(KviDccDescriptor * dcc)
if(!dcc->bAutoAccept)
{
// need confirmation
- QString tmp = __tr2qs_ctx( \
+ TQString tmp = __tr2qs_ctx( \
"<b>%1 [%2@%3]</b> requests a<br>" \
"<b>Direct Client Connection</b> in <b>CANVAS</b> mode.<br>" \
"The connection target will be host <b>%4</b> on port <b>%5</b><br>" \
,"dcc" \
- ).arg(dcc->szNick).arg(dcc->szUser).arg(dcc->szHost).arg(dcc->szIp).arg(dcc->szPort);
+ ).tqarg(dcc->szNick).tqarg(dcc->szUser).tqarg(dcc->szHost).tqarg(dcc->szIp).tqarg(dcc->szPort);
KviDccAcceptBox * box = new KviDccAcceptBox(this,dcc,tmp,__tr2qs_ctx("DCC CANVAS request","dcc"));
m_pBoxList->append(box);
- connect(box,SIGNAL(accepted(KviDccBox *,KviDccDescriptor *)),
- this,SLOT(activeCanvasExecute(KviDccBox *,KviDccDescriptor *)));
- connect(box,SIGNAL(rejected(KviDccBox *,KviDccDescriptor *)),
- this,SLOT(cancelDcc(KviDccBox *,KviDccDescriptor *)));
+ connect(box,TQT_SIGNAL(accepted(KviDccBox *,KviDccDescriptor *)),
+ this,TQT_SLOT(activeCanvasExecute(KviDccBox *,KviDccDescriptor *)));
+ connect(box,TQT_SIGNAL(rejected(KviDccBox *,KviDccDescriptor *)),
+ this,TQT_SLOT(cancelDcc(KviDccBox *,KviDccDescriptor *)));
box->show();
} else {
// auto accept
@@ -493,7 +493,7 @@ void KviDccBroker::recvFileManage(KviDccDescriptor * dcc)
if(!dcc->bAutoAccept)
{
// need confirmation
- QString tmp;
+ TQString tmp;
if(dcc->bActive)
{
@@ -505,9 +505,9 @@ void KviDccBroker::recvFileManage(KviDccDescriptor * dcc)
"<b>%5</b> large.<br>" \
"The connection target will be host <b>%6</b> on port <b>%7</b><br>" \
,"dcc" \
- ).arg(dcc->szNick).arg(dcc->szUser).arg(dcc->szHost).arg(
- dcc->szFileName).arg(KviQString::makeSizeReadable(dcc->szFileSize.toInt())).arg(
- dcc->szIp).arg(dcc->szPort);
+ ).tqarg(dcc->szNick).tqarg(dcc->szUser).tqarg(dcc->szHost).tqarg(
+ dcc->szFileName).tqarg(KviTQString::makeSizeReadable(dcc->szFileSize.toInt())).tqarg(
+ dcc->szIp).tqarg(dcc->szPort);
} else {
// passive: we will be listening!
@@ -518,8 +518,8 @@ void KviDccBroker::recvFileManage(KviDccDescriptor * dcc)
"<b>%5</b> large.<br>" \
"You will be the passive side of the connection.<br>" \
,"dcc" \
- ).arg(dcc->szNick).arg(dcc->szUser).arg(dcc->szHost).arg(
- dcc->szFileName).arg(KviQString::makeSizeReadable(dcc->szFileSize.toInt()));
+ ).tqarg(dcc->szNick).tqarg(dcc->szUser).tqarg(dcc->szHost).tqarg(
+ dcc->szFileName).tqarg(KviTQString::makeSizeReadable(dcc->szFileSize.toInt()));
}
if(dcc->bIsIncomingAvatar)
@@ -540,14 +540,14 @@ void KviDccBroker::recvFileManage(KviDccDescriptor * dcc)
//#warning "Maybe remove the pending avatar if rejected ?"
- QString title = __tr2qs_ctx("DCC %1 Request - KVIrc","dcc").arg(dcc->szType);
+ TQString title = __tr2qs_ctx("DCC %1 Request - KVIrc","dcc").tqarg(dcc->szType);
KviDccAcceptBox * box = new KviDccAcceptBox(this,dcc,tmp,title);
m_pBoxList->append(box);
- connect(box,SIGNAL(accepted(KviDccBox *,KviDccDescriptor *)),
- this,SLOT(chooseSaveFileName(KviDccBox *,KviDccDescriptor *)));
- connect(box,SIGNAL(rejected(KviDccBox *,KviDccDescriptor *)),
- this,SLOT(cancelDcc(KviDccBox *,KviDccDescriptor *)));
+ connect(box,TQT_SIGNAL(accepted(KviDccBox *,KviDccDescriptor *)),
+ this,TQT_SLOT(chooseSaveFileName(KviDccBox *,KviDccDescriptor *)));
+ connect(box,TQT_SIGNAL(rejected(KviDccBox *,KviDccDescriptor *)),
+ this,TQT_SLOT(cancelDcc(KviDccBox *,KviDccDescriptor *)));
box->show();
} else {
// auto accept
@@ -586,7 +586,7 @@ void KviDccBroker::chooseSaveFileName(KviDccBox *box,KviDccDescriptor *dcc)
}
if(KVI_OPTION_BOOL(KviOption_boolSortReceivedByDccFilesByNicks))
{
- KviQString::ensureLastCharIs(dcc->szLocalFileName,KVI_PATH_SEPARATOR_CHAR);
+ KviTQString::ensureLastCharIs(dcc->szLocalFileName,KVI_PATH_SEPARATOR_CHAR);
dcc->szLocalFileName.append(dcc->szNick);
KviFileUtils::adjustFilePath(dcc->szLocalFileName);
}
@@ -601,7 +601,7 @@ void KviDccBroker::chooseSaveFileName(KviDccBox *box,KviDccDescriptor *dcc)
g_pApp->getLocalKvircDirectory(dcc->szLocalFileName,KviApp::Incoming);
if(KVI_OPTION_BOOL(KviOption_boolSortReceivedByDccFilesByNicks))
{
- KviQString::ensureLastCharIs(dcc->szLocalFileName,KVI_PATH_SEPARATOR_CHAR);
+ KviTQString::ensureLastCharIs(dcc->szLocalFileName,KVI_PATH_SEPARATOR_CHAR);
dcc->szLocalFileName.append(dcc->szNick);
KviFileUtils::adjustFilePath(dcc->szLocalFileName);
KviFileUtils::makeDir(dcc->szLocalFileName);
@@ -609,7 +609,7 @@ void KviDccBroker::chooseSaveFileName(KviDccBox *box,KviDccDescriptor *dcc)
}
}
KviFileUtils::adjustFilePath(dcc->szLocalFileName);
- KviQString::ensureLastCharIs(dcc->szLocalFileName,KVI_PATH_SEPARATOR_CHAR);
+ KviTQString::ensureLastCharIs(dcc->szLocalFileName,KVI_PATH_SEPARATOR_CHAR);
if(!(dcc->bAutoAccept))
{
@@ -641,7 +641,7 @@ void KviDccBroker::renameOverwriteResume(KviDccBox *box,KviDccDescriptor * dcc)
if(box)box->forgetDescriptor();
// Check if file exists
- QFileInfo fi(dcc->szLocalFileName);
+ TQFileInfo fi(dcc->szLocalFileName);
if(fi.exists() && (fi.size() > 0)) // 0 byte files are senseless for us
{
dcc->szLocalFileSize.setNum(fi.size());
@@ -655,7 +655,7 @@ void KviDccBroker::renameOverwriteResume(KviDccBox *box,KviDccDescriptor * dcc)
if(!dcc->bAutoAccept)
{
- QString tmp;
+ TQString tmp;
bool bDisableResume = false;
if((iRemoteSize > -1) || // remote size is unknown
@@ -669,7 +669,7 @@ void KviDccBroker::renameOverwriteResume(KviDccBox *box,KviDccDescriptor * dcc)
"<b>auto-rename</b> the new file, or<br>" \
"<b>resume</b> an incomplete download?" \
,"dcc" \
- ).arg(dcc->szLocalFileName).arg(KviQString::makeSizeReadable(fi.size()));
+ ).tqarg(dcc->szLocalFileName).tqarg(KviTQString::makeSizeReadable(fi.size()));
} else {
bDisableResume = true;
// the file on disk is larger or equal to the remote one
@@ -680,17 +680,17 @@ void KviDccBroker::renameOverwriteResume(KviDccBox *box,KviDccDescriptor * dcc)
"<b>overwrite</b> the existing file, or<br> " \
"<b>auto-rename</b> the new file ?" \
,"dcc" \
- ).arg(dcc->szLocalFileName);
+ ).tqarg(dcc->szLocalFileName);
}
KviDccRenameBox * box = new KviDccRenameBox(this,dcc,tmp,bDisableResume);
m_pBoxList->append(box);
- connect(box,SIGNAL(renameSelected(KviDccBox *,KviDccDescriptor *)),
- this,SLOT(renameDccSendFile(KviDccBox *,KviDccDescriptor *)));
- connect(box,SIGNAL(overwriteSelected(KviDccBox *,KviDccDescriptor *)),
- this,SLOT(recvFileExecute(KviDccBox *,KviDccDescriptor *)));
- connect(box,SIGNAL(cancelSelected(KviDccBox *,KviDccDescriptor *)),
- this,SLOT(cancelDcc(KviDccBox *,KviDccDescriptor *)));
+ connect(box,TQT_SIGNAL(renameSelected(KviDccBox *,KviDccDescriptor *)),
+ this,TQT_SLOT(renameDccSendFile(KviDccBox *,KviDccDescriptor *)));
+ connect(box,TQT_SIGNAL(overwriteSelected(KviDccBox *,KviDccDescriptor *)),
+ this,TQT_SLOT(recvFileExecute(KviDccBox *,KviDccDescriptor *)));
+ connect(box,TQT_SIGNAL(cancelSelected(KviDccBox *,KviDccDescriptor *)),
+ this,TQT_SLOT(cancelDcc(KviDccBox *,KviDccDescriptor *)));
box->show();
return;
} else {
@@ -720,7 +720,7 @@ void KviDccBroker::renameDccSendFile(KviDccBox *box,KviDccDescriptor * dcc)
if(box)box->forgetDescriptor();
- if(QFileInfo(dcc->szLocalFileName).exists())
+ if(TQFileInfo(dcc->szLocalFileName).exists())
{
KviStr szOrig = dcc->szLocalFileName;
int i = 1;
@@ -740,7 +740,7 @@ void KviDccBroker::renameDccSendFile(KviDccBox *box,KviDccDescriptor * dcc)
dcc->szLocalFileName += szNum;
}
i++;
- } while(QFileInfo(dcc->szLocalFileName).exists());
+ } while(TQFileInfo(dcc->szLocalFileName).exists());
if(_OUTPUT_VERBOSE)
{
@@ -777,7 +777,7 @@ void KviDccBroker::recvFileExecute(KviDccBox *box,KviDccDescriptor * dcc)
void KviDccBroker::sendFileManage(KviDccDescriptor * dcc)
{
- QStringList filenames;
+ TQStringList filenames;
if(
KviFileDialog::askForOpenFileNames(filenames,
__tr2qs_ctx("Choose Files to Send - KVIrc","dcc"),"")
@@ -786,7 +786,7 @@ void KviDccBroker::sendFileManage(KviDccDescriptor * dcc)
{
KviDccDescriptor * d;
KviDccDescriptor * templ = dcc;
- QStringList::Iterator it=filenames.begin();
+ TQStringList::Iterator it=filenames.begin();
while(it != filenames.end())
{
d = new KviDccDescriptor(*dcc);
@@ -815,7 +815,7 @@ void KviDccBroker::sendFileExecute(KviDccBox * box,KviDccDescriptor *dcc)
dcc->setConsole(g_pApp->activeConsole());
}
- QFileInfo fi(dcc->szLocalFileName);
+ TQFileInfo fi(dcc->szLocalFileName);
if(!(fi.exists() && fi.isReadable() && (fi.isFile()) && (fi.size() > 0)))
{
dcc->console()->output(KVI_OUT_DCCERROR,__tr2qs_ctx("Can't open file %Q for reading","dcc"),
@@ -825,7 +825,7 @@ void KviDccBroker::sendFileExecute(KviDccBox * box,KviDccDescriptor *dcc)
}
dcc->szFileName = dcc->szLocalFileName;
- dcc->szFileName = QFileInfo(dcc->szFileName).fileName();
+ dcc->szFileName = TQFileInfo(dcc->szFileName).fileName();
dcc->szLocalFileSize.setNum(fi.size());
@@ -859,7 +859,7 @@ bool KviDccBroker::handleResumeRequest(KviDccRequest * dcc,const char * filename
if(kvi_strEqualCI("0",port) && szZeroPortTag)
{
// zero port resume request (we have sent out a DCC SEND <filename> <fakeip> 0 <tag>
- KviDccZeroPortTag * t = findZeroPortTag(QString(szZeroPortTag));
+ KviDccZeroPortTag * t = findZeroPortTag(TQString(szZeroPortTag));
if(t)
{
//debug("FOUND");
diff --git a/src/modules/dcc/broker.h b/src/modules/dcc/broker.h
index 80fa9768..837699e5 100644
--- a/src/modules/dcc/broker.h
+++ b/src/modules/dcc/broker.h
@@ -37,8 +37,8 @@
#include "kvi_sparser.h"
#include "kvi_pointerhashtable.h"
-#include <qdatetime.h>
-#include <qobject.h>
+#include <tqdatetime.h>
+#include <tqobject.h>
class KviConsole;
class KviDccBroker;
@@ -50,26 +50,27 @@ class KviDccBox;
class KviDccZeroPortTag
{
public:
- QDateTime m_tTimestamp;
- QString m_szTag;
+ TQDateTime m_tTimestamp;
+ TQString m_szTag;
unsigned int m_uFileSize; // outgoing file size, valid only for file transfers obviously
unsigned int m_uResumePosition; // if 0 = no resume, valid only for file transfers obviously
};
-class KviDccBroker : public QObject
+class KviDccBroker : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
KviDccBroker();
~KviDccBroker();
protected:
KviPointerList<KviDccBox> * m_pBoxList;
KviPointerList<KviWindow> * m_pDccWindowList;
- KviPointerHashTable<QString,KviDccZeroPortTag> * m_pZeroPortTags;
+ KviPointerHashTable<TQString,KviDccZeroPortTag> * m_pZeroPortTags;
public:
KviDccZeroPortTag * addZeroPortTag();
- KviDccZeroPortTag * findZeroPortTag(const QString &szTag);
- void removeZeroPortTag(const QString &szTag);
+ KviDccZeroPortTag * findZeroPortTag(const TQString &szTag);
+ void removeZeroPortTag(const TQString &szTag);
unsigned int dccWindowsCount(){ return m_pDccWindowList->count(); };
unsigned int dccBoxCount();
diff --git a/src/modules/dcc/canvas.cpp b/src/modules/dcc/canvas.cpp
index e80272ae..6b5f6872 100644
--- a/src/modules/dcc/canvas.cpp
+++ b/src/modules/dcc/canvas.cpp
@@ -20,7 +20,7 @@
// Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
-#define QT_MODULE_CANVAS
+#define TQT_MODULE_CANVAS
#include "canvas.h"
@@ -50,7 +50,7 @@
#include "kvi_themedlabel.h"
#include "kvi_ircconnection.h"
-#include <qsplitter.h>
+#include <tqsplitter.h>
extern KviDccBroker * g_pDccBroker;
@@ -58,7 +58,7 @@ extern KviDccBroker * g_pDccBroker;
KviDccCanvas::KviDccCanvas(KviFrame *pFrm,KviDccDescriptor * dcc,const char * name)
: KviDccWindow(KVI_WINDOW_TYPE_DCCCANVAS,pFrm,name,dcc)
{
- m_pSplitter = new QSplitter(QSplitter::Vertical,this,"splitter");
+ m_pSplitter = new TQSplitter(Qt::Vertical,this,"splitter");
m_pCanvas = new KviCanvasWidget(m_pSplitter);
@@ -68,8 +68,8 @@ KviDccCanvas::KviDccCanvas(KviFrame *pFrm,KviDccDescriptor * dcc,const char * na
// setFocusHandler(m_pInput,this);
m_pMarshal = new KviDccMarshal(this);
- connect(m_pMarshal,SIGNAL(error(int)),this,SLOT(handleMarshalError(int)));
- connect(m_pMarshal,SIGNAL(connected()),this,SLOT(connected()));
+ connect(m_pMarshal,TQT_SIGNAL(error(int)),this,TQT_SLOT(handleMarshalError(int)));
+ connect(m_pMarshal,TQT_SIGNAL(connected()),this,TQT_SLOT(connected()));
if(!(m_pDescriptor->bActive))
@@ -85,8 +85,8 @@ KviDccCanvas::KviDccCanvas(KviFrame *pFrm,KviDccDescriptor * dcc,const char * na
if(dcc->bSendRequest)
{
- QString ip = !dcc->szFakeIp.isEmpty() ? dcc->szFakeIp : dcc->szListenIp;
- QString port = !dcc->szFakePort.isEmpty() ? dcc->szFakePort.utf8().data() : m_pMarshal->localPort();
+ TQString ip = !dcc->szFakeIp.isEmpty() ? dcc->szFakeIp : dcc->szListenIp;
+ TQString port = !dcc->szFakePort.isEmpty() ? dcc->szFakePort.utf8().data() : m_pMarshal->localPort();
//#warning "OPTION FOR SENDING 127.0.0.1 and so on (not an unsigned number)"
struct in_addr a;
if(kvi_stringIpToBinaryIp(ip.utf8().data(),&a))ip.setNum(htonl(a.s_addr));
@@ -119,12 +119,12 @@ KviDccCanvas::~KviDccCanvas()
// delete m_pSlaveThread;
// m_pSlaveThread = 0;
// }
- KviThreadManager::killPendingEvents(this);
+ KviThreadManager::killPendingEvents(TQT_TQOBJECT(this));
// delete m_pDescriptor;
// delete m_pMarshal;
}
-const QString & KviDccCanvas::target()
+const TQString & KviDccCanvas::target()
{
// This may change on the fly...
m_szTarget.sprintf("%s@%s:%s",
@@ -140,12 +140,12 @@ void KviDccCanvas::fillCaptionBuffers()
m_szPlainTextCaption = tmp;
m_szHtmlActiveCaption.sprintf("<nobr><font color=\"%s\"><b>%s</b></font></nobr>",
- KVI_OPTION_COLOR(KviOption_colorCaptionTextActive).name().ascii(),tmp.ptr());
+ TQString(KVI_OPTION_COLOR(KviOption_colorCaptionTextActive).name()).ascii(),tmp.ptr());
m_szHtmlInactiveCaption.sprintf("<nobr><font color=\"%s\"><b>%s</b></font></nobr>",
- KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive).name().ascii(),tmp.ptr());
+ TQString(KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive).name()).ascii(),tmp.ptr());
}
-QPixmap * KviDccCanvas::myIconPtr()
+TQPixmap * KviDccCanvas::myIconPtr()
{
return g_pIconManager->getSmallIcon(KVI_SMALLICON_CANVAS);
}
@@ -172,7 +172,7 @@ void KviDccCanvas::ownAction(const char * text)
output(KVI_OUT_ACTION,"%Q %s",&(m_pDescriptor->szLocalNick),text);
}
-bool KviDccCanvas::event(QEvent *e)
+bool KviDccCanvas::event(TQEvent *e)
{
// if(e->type() == KVI_THREAD_EVENT)
// {
@@ -255,25 +255,25 @@ bool KviDccCanvas::event(QEvent *e)
return KviWindow::event(e);
}
-void KviDccCanvas::resizeEvent(QResizeEvent *e)
+void KviDccCanvas::resizeEvent(TQResizeEvent *e)
{
int hght = m_pInput->heightHint();
-// int hght2 = m_pTopSplitter->sizeHint().height();
+// int hght2 = m_pTopSplitter->tqsizeHint().height();
// m_pTopSplitter->setGeometry(0,0,width(),hght2);
m_pSplitter->setGeometry(0,0,width(),height() - hght);
m_pInput->setGeometry(0,height() - hght,width(),hght);
}
-QSize KviDccCanvas::sizeHint() const
+TQSize KviDccCanvas::tqsizeHint() const
{
- QSize ret(m_pIrcView->sizeHint().width(),
- m_pIrcView->sizeHint().height() + m_pInput->heightHint());
+ TQSize ret(m_pIrcView->tqsizeHint().width(),
+ m_pIrcView->tqsizeHint().height() + m_pInput->heightHint());
return ret;
}
void KviDccCanvas::handleMarshalError(int err)
{
- QString sss = KviError::getDescription(err);
+ TQString sss = KviError::getDescription(err);
output(KVI_OUT_DCCERROR,__tr2qs_ctx("DCC Failed: %Q","dcc"),&sss);
}
diff --git a/src/modules/dcc/canvas.h b/src/modules/dcc/canvas.h
index 8e6b1fb3..38349cae 100644
--- a/src/modules/dcc/canvas.h
+++ b/src/modules/dcc/canvas.h
@@ -40,28 +40,29 @@
class KviDccMarshal;
class KviCanvasWidget;
-class QSplitter;
+class TQSplitter;
class KviDccCanvas : public KviDccWindow
{
Q_OBJECT
+ TQ_OBJECT
public:
KviDccCanvas(KviFrame *pFrm,KviDccDescriptor * dcc,const char * name);
~KviDccCanvas();
protected:
// KviDccCanvasThread * m_pSlaveThread;
KviCanvasWidget * m_pCanvas;
-// QSplitter * m_pTopSplitter;
- QString m_szTarget;
+// TQSplitter * m_pTopSplitter;
+ TQString m_szTarget;
protected:
- virtual const QString &target();
+ virtual const TQString &target();
virtual void fillCaptionBuffers();
virtual void getBaseLogFileName(KviStr &buffer);
- virtual QPixmap * myIconPtr();
- virtual void resizeEvent(QResizeEvent *e);
- virtual QSize sizeHint() const;
- virtual bool event(QEvent *e);
+ virtual TQPixmap * myIconPtr();
+ virtual void resizeEvent(TQResizeEvent *e);
+ virtual TQSize tqsizeHint() const;
+ virtual bool event(TQEvent *e);
virtual void ownMessage(const char *text);
virtual void ownAction(const char *text);
protected slots:
diff --git a/src/modules/dcc/canvaswidget.cpp b/src/modules/dcc/canvaswidget.cpp
index 203e0b36..65c37175 100644
--- a/src/modules/dcc/canvaswidget.cpp
+++ b/src/modules/dcc/canvaswidget.cpp
@@ -25,12 +25,12 @@
#ifdef COMPILE_DCC_CANVAS
-#include <qcursor.h>
-#include <qpainter.h>
-#include <qsimplerichtext.h>
-#include <qlineedit.h>
-#include <qcombobox.h>
-#include <qvalidator.h>
+#include <tqcursor.h>
+#include <tqpainter.h>
+#include <tqsimplerichtext.h>
+#include <tqlineedit.h>
+#include <tqcombobox.h>
+#include <tqvalidator.h>
#include <stdlib.h>
#include "kvi_string.h"
@@ -45,8 +45,8 @@
// KviCanvasRectangleItem
//
-KviCanvasRectangleItem::KviCanvasRectangleItem(QCanvas * c,int x,int y,int w,int h)
-: QCanvasRectangle(x,y,w,h,c)
+KviCanvasRectangleItem::KviCanvasRectangleItem(TQCanvas * c,int x,int y,int w,int h)
+: TQCanvasRectangle(x,y,w,h,c)
{
}
@@ -54,21 +54,21 @@ KviCanvasRectangleItem::~KviCanvasRectangleItem()
{
}
-void KviCanvasRectangleItem::drawSelection(QPainter &p)
+void KviCanvasRectangleItem::drawSelection(TQPainter &p)
{
p.setRasterOp(NotROP);
- p.fillRect((int)x() + 1,(int)y() + 1,width() - 2,height() - 2,QBrush(Dense6Pattern));
- p.setPen(QPen(DotLine));
+ p.fillRect((int)x() + 1,(int)y() + 1,width() - 2,height() - 2,TQBrush(Dense6Pattern));
+ p.setPen(TQPen(DotLine));
p.drawRect((int)x(),(int)y(),width(),height());
p.setRasterOp(CopyROP);
}
-void KviCanvasRectangleItem::setProperty(const QString &property,const QVariant &val)
+void KviCanvasRectangleItem::setProperty(const TQString &property,const TQVariant &val)
{
if(m_properties[property].isValid())
{
- m_properties.replace(property,val);
+ m_properties.tqreplace(property,val);
hide();
show();
}
@@ -83,14 +83,14 @@ void KviCanvasRectangleItem::setProperty(const QString &property,const QVariant
//
-KviCanvasPolygon::KviCanvasPolygon(QCanvas * c,int x,int y,QPointArray &pnts,double dScaleFactor)
-: QCanvasPolygon(c)
+KviCanvasPolygon::KviCanvasPolygon(TQCanvas * c,int x,int y,TQPointArray &pnts,double dScaleFactor)
+: TQCanvasPolygon(c)
{
- m_properties.insert("clrForeground",QVariant(QColor(0,0,0)));
- m_properties.insert("uLineWidth",QVariant((unsigned int)0));
+ m_properties.insert("clrForeground",TQVariant(TQColor(0,0,0)));
+ m_properties.insert("uLineWidth",TQVariant((unsigned int)0));
- m_properties.insert("clrBackground",QVariant(QColor(0,0,0)));
- m_properties.insert("bHasBackground",QVariant(false,1));
+ m_properties.insert("clrBackground",TQVariant(TQColor(0,0,0)));
+ m_properties.insert("bHasBackground",TQVariant(false,1));
m_dScaleFactor = dScaleFactor;
m_points = pnts;
@@ -110,7 +110,7 @@ void KviCanvasPolygon::setScaleFactor(double dScaleFactor)
resetPoints();
}
-void KviCanvasPolygon::setInternalPoints(const QPointArray &pnts)
+void KviCanvasPolygon::setInternalPoints(const TQPointArray &pnts)
{
m_points = pnts;
resetPoints();
@@ -119,7 +119,7 @@ void KviCanvasPolygon::setInternalPoints(const QPointArray &pnts)
void KviCanvasPolygon::resetPoints()
{
- QPointArray scaled(m_points.size());
+ TQPointArray scaled(m_points.size());
for(unsigned int i=0;i<m_points.size();i++)
{
int px;
@@ -137,55 +137,47 @@ int KviCanvasPolygon::rtti() const
return KVI_CANVAS_RTTI_POLYGON;
}
-void KviCanvasPolygon::setProperty(const QString &property,const QVariant &val)
+void KviCanvasPolygon::setProperty(const TQString &property,const TQVariant &val)
{
if(m_properties[property].isValid())
{
- m_properties.replace(property,val);
+ m_properties.tqreplace(property,val);
if((property == "clrForeground") || (property == "uLineWidth"))
{
- setPen(QPen(m_properties["clrForeground"].asColor(),m_properties["uLineWidth"].toInt()));
+ setPen(TQPen(m_properties["clrForeground"].asColor(),m_properties["uLineWidth"].toInt()));
} else if((property == "clrBackground") || (property == "bHasBackground"))
{
if(m_properties["bHasBackground"].asBool())
- setBrush(QBrush(m_properties["clrBackground"].asColor()));
+ setBrush(TQBrush(m_properties["clrBackground"].asColor()));
else
- setBrush(QBrush());
+ setBrush(TQBrush());
} else {
hide(); show();
}
}
}
-void KviCanvasPolygon::draw(QPainter &p)
+void KviCanvasPolygon::draw(TQPainter &p)
{
-#if QT_VERSION >= 300
if(isEnabled())
-#else
- if(enabled())
-#endif
{
p.setBrush(brush());
p.setPen(pen());
p.drawPolygon(areaPoints());
}
-#if QT_VERSION >=300
if(isSelected())
-#else
- if(selected())
-#endif
{
p.setRasterOp(NotROP);
- p.setPen(QPen(DotLine));
+ p.setPen(TQPen(DotLine));
p.drawPolygon(areaPoints());
- p.setBrush(QBrush());
+ p.setBrush(TQBrush());
double dVal = 10;
p.drawEllipse((int)(x() - dVal),(int)(y() - dVal),(int)(dVal * 2),(int)(dVal * 2));
p.drawLine((int)(x() - (dVal * 2)),(int)y(),(int)(x() + (dVal * 2)),(int)y());
p.drawLine((int)x(),(int)(y() - (dVal * 2)),(int)x(),(int)(y() + (dVal * 2)));
p.setRasterOp(CopyROP);
- canvas()->setChanged(QRect((int)(x() - dVal),(int)(y() - dVal),(int)(dVal * 4),(int)(dVal * 4)));
+ canvas()->setChanged(TQRect((int)(x() - dVal),(int)(y() - dVal),(int)(dVal * 4),(int)(dVal * 4)));
}
}
@@ -194,59 +186,51 @@ void KviCanvasPolygon::draw(QPainter &p)
// KviCanvasEllipticItem
//
-KviCanvasEllipticItem::KviCanvasEllipticItem(QCanvas * c,int x,int y,int w,int h)
+KviCanvasEllipticItem::KviCanvasEllipticItem(TQCanvas * c,int x,int y,int w,int h)
: KviCanvasRectangleItem(c,x,y,w,h)
{
- m_properties.insert("clrForeground",QVariant(QColor(0,0,0)));
- m_properties.insert("uLineWidth",QVariant((unsigned int)0));
+ m_properties.insert("clrForeground",TQVariant(TQColor(0,0,0)));
+ m_properties.insert("uLineWidth",TQVariant((unsigned int)0));
- m_properties.insert("clrBackground",QVariant(QColor(0,0,0)));
- m_properties.insert("bHasBackground",QVariant(false,1));
+ m_properties.insert("clrBackground",TQVariant(TQColor(0,0,0)));
+ m_properties.insert("bHasBackground",TQVariant(false,1));
-// m_properties.insert("iStartAngle",QVariant(0));
-// m_properties.insert("iEndAngle",QVariant(360));
+// m_properties.insert("iStartAngle",TQVariant(0));
+// m_properties.insert("iEndAngle",TQVariant(360));
}
KviCanvasEllipticItem::~KviCanvasEllipticItem()
{
}
-void KviCanvasEllipticItem::draw(QPainter &p)
+void KviCanvasEllipticItem::draw(TQPainter &p)
{
-#if QT_VERSION >= 300
if(isEnabled())
-#else
- if(enabled())
-#endif
{
- QBrush b = p.brush();
+ TQBrush b = p.brush();
if(m_properties["bHasBackground"].asBool())p.setBrush(m_properties["clrBackground"].asColor());
- else p.setBrush(QBrush());
+ else p.setBrush(TQBrush());
p.setPen(pen());
drawContent(p);
p.setBrush(b);
}
-#if QT_VERSION >= 300
if(isSelected())drawSelection(p);
-#else
- if(selected())drawSelection(p);
-#endif
}
-void KviCanvasEllipticItem::drawContent(QPainter &p)
+void KviCanvasEllipticItem::drawContent(TQPainter &p)
{
}
-void KviCanvasEllipticItem::setProperty(const QString & property,const QVariant &val)
+void KviCanvasEllipticItem::setProperty(const TQString & property,const TQVariant &val)
{
if(m_properties[property].isValid())
{
- m_properties.replace(property,val);
+ m_properties.tqreplace(property,val);
if((property == "clrForeground") || (property == "uLineWidth"))
{
- setPen(QPen(m_properties["clrForeground"].asColor(),m_properties["uLineWidth"].toInt()));
+ setPen(TQPen(m_properties["clrForeground"].asColor(),m_properties["uLineWidth"].toInt()));
} else {
hide(); show();
}
@@ -265,7 +249,7 @@ int KviCanvasEllipticItem::rtti() const
//
-KviCanvasEllipse::KviCanvasEllipse(QCanvas * c,int x,int y,int w,int h)
+KviCanvasEllipse::KviCanvasEllipse(TQCanvas * c,int x,int y,int w,int h)
: KviCanvasEllipticItem(c,x,y,w,h)
{
}
@@ -279,7 +263,7 @@ int KviCanvasEllipse::rtti() const
return KVI_CANVAS_RTTI_ELLIPSE;
}
-void KviCanvasEllipse::drawContent(QPainter &p)
+void KviCanvasEllipse::drawContent(TQPainter &p)
{
p.drawEllipse((int)x(),(int)y(),width(),height());
}
@@ -290,11 +274,11 @@ void KviCanvasEllipse::drawContent(QPainter &p)
//
-KviCanvasPie::KviCanvasPie(QCanvas * c,int x,int y,int w,int h)
+KviCanvasPie::KviCanvasPie(TQCanvas * c,int x,int y,int w,int h)
: KviCanvasEllipticItem(c,x,y,w,h)
{
- m_properties.insert("iStartAngle",QVariant((int)0));
- m_properties.insert("iExtensionAngle",QVariant((int)360));
+ m_properties.insert("iStartAngle",TQVariant((int)0));
+ m_properties.insert("iExtensionAngle",TQVariant((int)360));
}
KviCanvasPie::~KviCanvasPie()
@@ -306,7 +290,7 @@ int KviCanvasPie::rtti() const
return KVI_CANVAS_RTTI_PIE;
}
-void KviCanvasPie::drawContent(QPainter &p)
+void KviCanvasPie::drawContent(TQPainter &p)
{
int iStartAngle = m_properties["iStartAngle"].asInt() * 16;
int iEndAngle = m_properties["iExtensionAngle"].asInt() * 16;
@@ -320,11 +304,11 @@ void KviCanvasPie::drawContent(QPainter &p)
//
-KviCanvasChord::KviCanvasChord(QCanvas * c,int x,int y,int w,int h)
+KviCanvasChord::KviCanvasChord(TQCanvas * c,int x,int y,int w,int h)
: KviCanvasEllipticItem(c,x,y,w,h)
{
- m_properties.insert("iStartAngle",QVariant((int)0));
- m_properties.insert("iExtensionAngle",QVariant((int)360));
+ m_properties.insert("iStartAngle",TQVariant((int)0));
+ m_properties.insert("iExtensionAngle",TQVariant((int)360));
}
KviCanvasChord::~KviCanvasChord()
@@ -336,7 +320,7 @@ int KviCanvasChord::rtti() const
return KVI_CANVAS_RTTI_CHORD;
}
-void KviCanvasChord::drawContent(QPainter &p)
+void KviCanvasChord::drawContent(TQPainter &p)
{
int iStartAngle = m_properties["iStartAngle"].asInt() * 16;
int iEndAngle = m_properties["iExtensionAngle"].asInt() * 16;
@@ -348,14 +332,14 @@ void KviCanvasChord::drawContent(QPainter &p)
// KviCanvasRectangle
//
-KviCanvasRectangle::KviCanvasRectangle(QCanvas * c,int x,int y,int w,int h)
+KviCanvasRectangle::KviCanvasRectangle(TQCanvas * c,int x,int y,int w,int h)
: KviCanvasRectangleItem(c,x,y,w,h)
{
- m_properties.insert("clrForeground",QVariant(QColor(0,0,0)));
- m_properties.insert("uLineWidth",QVariant((unsigned int)0));
+ m_properties.insert("clrForeground",TQVariant(TQColor(0,0,0)));
+ m_properties.insert("uLineWidth",TQVariant((unsigned int)0));
- m_properties.insert("clrBackground",QVariant(QColor(0,0,0)));
- m_properties.insert("bHasBackground",QVariant(false,1));
+ m_properties.insert("clrBackground",TQVariant(TQColor(0,0,0)));
+ m_properties.insert("bHasBackground",TQVariant(false,1));
}
KviCanvasRectangle::~KviCanvasRectangle()
@@ -368,27 +352,23 @@ int KviCanvasRectangle::rtti() const
}
-void KviCanvasRectangle::setProperty(const QString &property,const QVariant &val)
+void KviCanvasRectangle::setProperty(const TQString &property,const TQVariant &val)
{
if(m_properties[property].isValid())
{
- m_properties.replace(property,val);
+ m_properties.tqreplace(property,val);
if((property == "clrForeground") || (property == "uLineWidth"))
{
- setPen(QPen(m_properties["clrForeground"].asColor(),m_properties["uLineWidth"].toInt()));
+ setPen(TQPen(m_properties["clrForeground"].asColor(),m_properties["uLineWidth"].toInt()));
} else {
hide(); show();
}
}
}
-void KviCanvasRectangle::draw(QPainter & p)
+void KviCanvasRectangle::draw(TQPainter & p)
{
-#if QT_VERSION >= 300
if(isEnabled())
-#else
- if(enabled())
-#endif
{
if(m_properties["bHasBackground"].asBool())
{
@@ -397,11 +377,7 @@ void KviCanvasRectangle::draw(QPainter & p)
p.setPen(pen());
p.drawRect((int)x(),(int)y(),width(),height());
}
-#if QT_VERSION >= 300
if(isSelected())drawSelection(p);
-#else
- if(selected())drawSelection(p);
-#endif
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -409,14 +385,14 @@ void KviCanvasRectangle::draw(QPainter & p)
// KviCanvasRichText
//
-KviCanvasRichText::KviCanvasRichText(QCanvas * c,int x,int y,int w,int h)
+KviCanvasRichText::KviCanvasRichText(TQCanvas * c,int x,int y,int w,int h)
: KviCanvasRectangleItem(c,x,y,w,h)
{
- QFont f = QFont();
- f.setStyleHint(QFont::SansSerif);
+ TQFont f = TQFont();
+ f.setStyleHint(TQFont::SansSerif);
f.setPointSize(12);
- m_properties.insert("szText",QVariant(QString("<center>Insert here your <font color=\"#FF0000\"><b>RICH TEXT</b></font></center>")));
- m_properties.insert("fntDefault",QVariant(f));
+ m_properties.insert("szText",TQVariant(TQString("<center>Insert here your <font color=\"#FF0000\"><b>RICH TEXT</b></font></center>")));
+ m_properties.insert("fntDefault",TQVariant(f));
}
KviCanvasRichText::~KviCanvasRichText()
@@ -428,28 +404,16 @@ int KviCanvasRichText::rtti() const
return KVI_CANVAS_RTTI_RICHTEXT;
}
-void KviCanvasRichText::draw(QPainter & p)
+void KviCanvasRichText::draw(TQPainter & p)
{
-#if QT_VERSION >= 300
if(isEnabled())
-#else
- if(enabled())
-#endif
{
- QString szText = m_properties["szText"].asString();
- QSimpleRichText text(szText,m_properties["fntDefault"].asFont());
+ TQString szText = m_properties["szText"].asString();
+ TQSimpleRichText text(szText,m_properties["fntDefault"].asFont());
text.setWidth(width());
-#if QT_VERSION >= 300
- text.draw(&p,(int)x() + 1,(int)y() + 1,QRegion(QRect((int)x() + 1,(int)y() + 1,width(),height())),QColorGroup());
-#else
- text.draw(&p,(int)x() + 1,(int)y() + 1,QRegion(QRect((int)x() + 1,(int)y() + 1,width(),height())),QPalette());
-#endif
+ text.draw(&p,(int)x() + 1,(int)y() + 1,TQRegion(TQRect((int)x() + 1,(int)y() + 1,width(),height())),TQColorGroup());
}
-#if QT_VERSION >= 300
if(isSelected())drawSelection(p);
-#else
- if(selected())drawSelection(p);
-#endif
}
@@ -461,24 +425,24 @@ void KviCanvasRichText::draw(QPainter & p)
//
-KviCanvasLine::KviCanvasLine(QCanvas * c,int x1,int y1,int x2,int y2)
-: QCanvasLine(c)
+KviCanvasLine::KviCanvasLine(TQCanvas * c,int x1,int y1,int x2,int y2)
+: TQCanvasLine(c)
{
setPoints(x1,y1,x2,y2);
- m_properties.insert("uLineWidth",QVariant((unsigned int)0));
- m_properties.insert("clrForeground",QVariant(QColor()));
+ m_properties.insert("uLineWidth",TQVariant((unsigned int)0));
+ m_properties.insert("clrForeground",TQVariant(TQColor()));
}
KviCanvasLine::~KviCanvasLine()
{
}
-void KviCanvasLine::setProperty(const QString &property,const QVariant &val)
+void KviCanvasLine::setProperty(const TQString &property,const TQVariant &val)
{
- m_properties.replace(property,val);
+ m_properties.tqreplace(property,val);
if((property == "uLineWidth") || (property == "clrForeground"))
{
- setPen(QPen(m_properties["clrForeground"].asColor(),m_properties["uLineWidth"].toInt()));
+ setPen(TQPen(m_properties["clrForeground"].asColor(),m_properties["uLineWidth"].toInt()));
}
}
@@ -487,26 +451,18 @@ int KviCanvasLine::rtti() const
return KVI_CANVAS_RTTI_LINE;
}
-void KviCanvasLine::draw(QPainter &p)
+void KviCanvasLine::draw(TQPainter &p)
{
-#if QT_VERSION >= 300
if(isEnabled())
-#else
- if(enabled())
-#endif
{
p.setPen(pen());
p.drawLine(startPoint(),endPoint());
}
-#if QT_VERSION >= 300
if(isSelected())
-#else
- if(selected())
-#endif
{
p.setRasterOp(NotROP);
- p.setPen(QPen(DotLine));
+ p.setPen(TQPen(DotLine));
p.drawLine(startPoint(),endPoint());
p.setRasterOp(CopyROP);
}
@@ -517,8 +473,8 @@ void KviCanvasLine::draw(QPainter &p)
// KviCanvasView
//
-KviCanvasView::KviCanvasView(QCanvas * c,KviCanvasWidget * cw,QWidget * par)
-: QCanvasView(c,par)
+KviCanvasView::KviCanvasView(TQCanvas * c,KviCanvasWidget * cw,TQWidget * par)
+: TQCanvasView(c,par)
{
m_pCanvasWidget = cw;
m_state = Idle;
@@ -610,7 +566,7 @@ void KviCanvasView::insertPolygonHexagon()
#define M_PI 3.14159265358979323846
#endif
-static void calcPolygonPoints(QPointArray &pnts,unsigned int nVertices)
+static void calcPolygonPoints(TQPointArray &pnts,unsigned int nVertices)
{
double dDelta = (2 * M_PI) / nVertices;
for(unsigned int i=0;i<nVertices;i++)
@@ -622,9 +578,9 @@ static void calcPolygonPoints(QPointArray &pnts,unsigned int nVertices)
}
}
-void KviCanvasView::insertObjectAt(const QPoint & pnt,ObjectType o)
+void KviCanvasView::insertObjectAt(const TQPoint & pnt,ObjectType o)
{
- QCanvasItem * r = 0;
+ TQCanvasItem * r = 0;
switch(o)
{
@@ -648,7 +604,7 @@ void KviCanvasView::insertObjectAt(const QPoint & pnt,ObjectType o)
break;
case PolygonTriangle:
{
- QPointArray pa(3);
+ TQPointArray pa(3);
pa.setPoint(0,0,-500);
pa.setPoint(1,-450,220);
pa.setPoint(2,450,220);
@@ -657,7 +613,7 @@ void KviCanvasView::insertObjectAt(const QPoint & pnt,ObjectType o)
break;
case PolygonRectangle:
{
- QPointArray pa(4);
+ TQPointArray pa(4);
pa.setPoint(0,-350,-350);
pa.setPoint(1,350,-350);
pa.setPoint(2,350,350);
@@ -667,14 +623,14 @@ void KviCanvasView::insertObjectAt(const QPoint & pnt,ObjectType o)
break;
case PolygonPentagon:
{
- QPointArray pa(5);
+ TQPointArray pa(5);
calcPolygonPoints(pa,5);
r = new KviCanvasPolygon(canvas(),pnt.x(),pnt.y(),pa,0.1);
}
break;
case PolygonHexagon:
{
- QPointArray pa(6);
+ TQPointArray pa(6);
calcPolygonPoints(pa,6);
r = new KviCanvasPolygon(canvas(),pnt.x(),pnt.y(),pa,0.1);
}
@@ -704,7 +660,7 @@ void KviCanvasView::insertObjectAt(const QPoint & pnt,ObjectType o)
// canvas()->update();
}
-void KviCanvasView::setItemSelected(QCanvasItem * it)
+void KviCanvasView::setItemSelected(TQCanvasItem * it)
{
clearSelection();
it->setSelected(true);
@@ -723,9 +679,9 @@ void KviCanvasView::clearSelection()
-void KviCanvasView::beginDragLine(KviCanvasLine * it,const QPoint &p,bool bInitial)
+void KviCanvasView::beginDragLine(KviCanvasLine * it,const TQPoint &p,bool bInitial)
{
- QPoint sp = it->startPoint();
+ TQPoint sp = it->startPoint();
m_dragBegin = p - sp;
@@ -755,26 +711,26 @@ void KviCanvasView::beginDragLine(KviCanvasLine * it,const QPoint &p,bool bIniti
setCursor(pointingHandCursor);
}
-void KviCanvasView::dragLine(KviCanvasLine * it,const QPoint &p)
+void KviCanvasView::dragLine(KviCanvasLine * it,const TQPoint &p)
{
switch(m_dragMode)
{
case Bottom:
{
- QPoint sp = it->startPoint();
+ TQPoint sp = it->startPoint();
it->setPoints(sp.x(),sp.y(),p.x(),p.y());
}
break;
case Top:
{
- QPoint ep = it->endPoint();
+ TQPoint ep = it->endPoint();
it->setPoints(p.x(),p.y(),ep.x(),ep.y());
}
break;
case All:
{
- QPoint sp = p - m_dragBegin;
- QPoint ep = sp + (it->endPoint() - it->startPoint());
+ TQPoint sp = p - m_dragBegin;
+ TQPoint ep = sp + (it->endPoint() - it->startPoint());
it->setPoints(sp.x(),sp.y(),ep.x(),ep.y());
}
break;
@@ -833,15 +789,15 @@ static double ssm_hypot(double a,double b)
return sqrt((a * a) + (b * b));
}
-void KviCanvasView::beginDragPolygon(KviCanvasPolygon * it,const QPoint &p,bool bShift,bool bCtrl)
+void KviCanvasView::beginDragPolygon(KviCanvasPolygon * it,const TQPoint &p,bool bShift,bool bCtrl)
{
- m_dragBegin = QPoint((int)(p.x() - it->x()),(int)(p.y() - it->y()));
+ m_dragBegin = TQPoint((int)(p.x() - it->x()),(int)(p.y() - it->y()));
- QPointArray pa = it->areaPoints();
+ TQPointArray pa = it->areaPoints();
for(unsigned int i=0;i<pa.size();i++)
{
- QPoint pnt = pa.point(i);
+ TQPoint pnt = pa.point(i);
double dX = pnt.x() - p.x();
double dY = pnt.y() - p.y();
double dHypot = sqrt((dX * dX) + (dY * dY));
@@ -876,7 +832,7 @@ void KviCanvasView::beginDragPolygon(KviCanvasPolygon * it,const QPoint &p,bool
setCursor(pointingHandCursor);
}
-void KviCanvasView::dragPolygon(KviCanvasPolygon * it,const QPoint &p)
+void KviCanvasView::dragPolygon(KviCanvasPolygon * it,const TQPoint &p)
{
switch(m_dragMode)
{
@@ -885,7 +841,7 @@ void KviCanvasView::dragPolygon(KviCanvasPolygon * it,const QPoint &p)
break;
case SinglePoint:
{
- QPointArray pnt = it->internalPoints();
+ TQPointArray pnt = it->internalPoints();
pnt.setPoint(m_dragPointIndex,(int)((p.x() - it->x()) / it->scaleFactor()),(int)((p.y() - it->y()) / it->scaleFactor()));
it->setInternalPoints(pnt);
}
@@ -901,13 +857,13 @@ void KviCanvasView::dragPolygon(KviCanvasPolygon * it,const QPoint &p)
break;
case Rotate:
{
- QPoint act((int)(p.x() - it->x()),(int)(p.y() - it->y()));
+ TQPoint act((int)(p.x() - it->x()),(int)(p.y() - it->y()));
double dAngle = ssm_2d_rotationAngle(m_dragBegin.x(),m_dragBegin.y(),act.x(),act.y());
// debug("%d,%d %d,%d %f",m_dragBegin.x(),m_dragBegin.y(),act.x(),act.y(),dAngle);
- QPointArray thePoints = m_dragPointArray.copy();
+ TQPointArray thePoints = m_dragPointArray.copy();
for(unsigned int i=0;i<thePoints.size();i++)
{
- QPoint tmp = thePoints.point(i);
+ TQPoint tmp = thePoints.point(i);
double dx = tmp.x();
double dy = tmp.y();
ssm_2d_rotate(dx,dy,dAngle);
@@ -922,9 +878,9 @@ void KviCanvasView::dragPolygon(KviCanvasPolygon * it,const QPoint &p)
canvas()->update();
}
-void KviCanvasView::beginDragRectangle(KviCanvasRectangleItem * it,const QPoint & p,bool bInitial)
+void KviCanvasView::beginDragRectangle(KviCanvasRectangleItem * it,const TQPoint & p,bool bInitial)
{
- m_dragBegin = QPoint((int)(p.x() - it->x()),(int)(p.y() - it->y()));
+ m_dragBegin = TQPoint((int)(p.x() - it->x()),(int)(p.y() - it->y()));
if(bInitial)
{
@@ -998,7 +954,7 @@ void KviCanvasView::beginDragRectangle(KviCanvasRectangleItem * it,const QPoint
setCursor(pointingHandCursor);
}
-void KviCanvasView::dragRectangle(KviCanvasRectangleItem * it,const QPoint & p)
+void KviCanvasView::dragRectangle(KviCanvasRectangleItem * it,const TQPoint & p)
{
int aux1,aux2,aux3,aux4;
@@ -1098,19 +1054,15 @@ void KviCanvasView::dragRectangle(KviCanvasRectangleItem * it,const QPoint & p)
canvas()->update();
}
-void KviCanvasView::contentsMouseMoveEvent(QMouseEvent *e)
+void KviCanvasView::contentsMouseMoveEvent(TQMouseEvent *e)
{
-// QPoint p = inverseWorldMatrix().map(e->pos());
- QPoint p = e->pos();
+// TQPoint p = inverseWorldMatrix().map(e->pos());
+ TQPoint p = e->pos();
if(e->state() & Qt::LeftButton)
{
if((m_dragMode != None) && (m_pSelectedItem))
{
-#if QT_VERSION >= 300
if(m_pSelectedItem->isEnabled())m_pSelectedItem->setEnabled(false);
-#else
- if(m_pSelectedItem->enabled())m_pSelectedItem->setEnabled(false);
-#endif
switch(KVI_CANVAS_RTTI_CONTROL_TYPE(m_pSelectedItem))
{
case KVI_CANVAS_RTTI_CONTROL_TYPE_RECTANGLE:
@@ -1128,13 +1080,13 @@ void KviCanvasView::contentsMouseMoveEvent(QMouseEvent *e)
// Without buttons
if(m_state == Idle)
{
- QCanvasItemList l = canvas()->collisions(p);
- QCanvasItemList::Iterator it = l.begin();
+ TQCanvasItemList l = canvas()->collisions(p);
+ TQCanvasItemList::Iterator it = l.begin();
if(it != l.end())
{
// Got an item
- QCanvasItem * hit = (QCanvasItem *)*it;
+ TQCanvasItem * hit = (TQCanvasItem *)*it;
// Now find the point on that we have clicked it
if(hit == m_pSelectedItem)
{
@@ -1159,7 +1111,7 @@ void KviCanvasView::contentsMouseMoveEvent(QMouseEvent *e)
}
}
-void KviCanvasView::contentsMouseReleaseEvent(QMouseEvent *e)
+void KviCanvasView::contentsMouseReleaseEvent(TQMouseEvent *e)
{
if(m_dragMode != None)
{
@@ -1174,12 +1126,12 @@ void KviCanvasView::contentsMouseReleaseEvent(QMouseEvent *e)
}
}
-void KviCanvasView::contentsMousePressEvent(QMouseEvent *e)
+void KviCanvasView::contentsMousePressEvent(TQMouseEvent *e)
{
if(e->button() & Qt::LeftButton)
{
-// QPoint p = inverseWorldMatrix().map(e->pos());
- QPoint p = e->pos();
+// TQPoint p = inverseWorldMatrix().map(e->pos());
+ TQPoint p = e->pos();
switch(m_state)
{
@@ -1193,13 +1145,13 @@ void KviCanvasView::contentsMousePressEvent(QMouseEvent *e)
case Idle:
{
- QCanvasItemList l = canvas()->collisions(p);
- QCanvasItemList::Iterator it = l.begin();
+ TQCanvasItemList l = canvas()->collisions(p);
+ TQCanvasItemList::Iterator it = l.begin();
if(it != l.end())
{
// Got an item
- QCanvasItem * hit = *it;
+ TQCanvasItem * hit = *it;
if(hit != m_pSelectedItem)
{
// Was not selected yet
@@ -1216,7 +1168,7 @@ void KviCanvasView::contentsMousePressEvent(QMouseEvent *e)
beginDragLine(((KviCanvasLine *)hit),p);
break;
case KVI_CANVAS_RTTI_CONTROL_TYPE_POLYGON:
- beginDragPolygon(((KviCanvasPolygon *)hit),p,e->state() & Qt::ShiftButton,e->state() & Qt::ControlButton);
+ beginDragPolygon(((KviCanvasPolygon *)hit),p,e->state() & TQt::ShiftButton,e->state() & TQt::ControlButton);
break;
}
} else {
@@ -1231,7 +1183,7 @@ void KviCanvasView::contentsMousePressEvent(QMouseEvent *e)
}
-void KviCanvasView::propertyChanged(const QString &s,const QVariant &v)
+void KviCanvasView::propertyChanged(const TQString &s,const TQVariant &v)
{
if(!m_pSelectedItem)return;
@@ -1260,8 +1212,8 @@ void KviCanvasView::propertyChanged(const QString &s,const QVariant &v)
-KviVariantTableItem::KviVariantTableItem(QTable * t,const QVariant & property)
-: QTableItem(t,QTableItem::WhenCurrent,QString::null)
+KviVariantTableItem::KviVariantTableItem(TQTable * t,const TQVariant & property)
+: TQTableItem(t,TQTableItem::WhenCurrent,TQString())
{
m_property = property;
}
@@ -1271,65 +1223,65 @@ KviVariantTableItem::~KviVariantTableItem()
}
-QWidget * KviVariantTableItem::createEditor() const
+TQWidget * KviVariantTableItem::createEditor() const
{
switch(m_property.type())
{
- case QVariant::String:
+ case TQVariant::String:
{
- QLineEdit * e = new QLineEdit(table()->viewport());
+ TQLineEdit * e = new TQLineEdit(table()->viewport());
e->setText(m_property.toString());
return e;
}
break;
- case QVariant::Int:
+ case TQVariant::Int:
{
- QLineEdit * e = new QLineEdit(table()->viewport());
- QString sz;
+ TQLineEdit * e = new TQLineEdit(table()->viewport());
+ TQString sz;
sz.setNum(m_property.toInt());
e->setText(sz);
- e->setValidator(new QIntValidator(e));
+ e->setValidator(new TQIntValidator(TQT_TQOBJECT(e)));
return e;
}
break;
- case QVariant::UInt:
+ case TQVariant::UInt:
{
- QLineEdit * e = new QLineEdit(table()->viewport());
- QString sz;
+ TQLineEdit * e = new TQLineEdit(table()->viewport());
+ TQString sz;
sz.setNum(m_property.toInt());
e->setText(sz);
- QIntValidator * i = new QIntValidator(e);
+ TQIntValidator * i = new TQIntValidator(TQT_TQOBJECT(e));
i->setBottom(0);
e->setValidator(i);
return e;
}
break;
- case QVariant::Bool:
+ case TQVariant::Bool:
{
- QComboBox * b = new QComboBox(false,table()->viewport());
+ TQComboBox * b = new TQComboBox(false,table()->viewport());
b->insertItem("FALSE");
b->insertItem("TRUE");
b->setCurrentItem(m_property.toBool() ? 1 : 0);
return b;
}
break;
- case QVariant::Color:
+ case TQVariant::Color:
{
- QLineEdit * e = new QLineEdit(table()->viewport());
+ TQLineEdit * e = new TQLineEdit(table()->viewport());
e->setText(m_property.toColor().name());
return e;
}
break;
- case QVariant::Font:
+ case TQVariant::Font:
{
- QComboBox * b = new QComboBox(true,table()->viewport());
+ TQComboBox * b = new TQComboBox(true,table()->viewport());
- QString tmp;
- QString tmpDefault;
- QFont f = QFont();
- f.setStyleHint(QFont::SansSerif);
+ TQString tmp;
+ TQString tmpDefault;
+ TQFont f = TQFont();
+ f.setStyleHint(TQFont::SansSerif);
tmpDefault = f.family();
- f.setStyleHint(QFont::TypeWriter);
+ f.setStyleHint(TQFont::TypeWriter);
tmp.setNum(m_property.toFont().pointSize());
tmp.prepend(", ");
tmp.prepend(m_property.toFont().family());
@@ -1346,7 +1298,7 @@ QWidget * KviVariantTableItem::createEditor() const
b->insertItem(tmpDefault + ", 32");
b->insertItem(tmpDefault + ", 40");
b->insertItem(tmpDefault + ", 48");
- b->insertItem(f.family() + ", 12");
+ b->insertItem(TQString(f.family()) + ", 12");
b->setCurrentItem(0);
b->setCurrentItem(m_property.toBool() ? 1 : 0);
@@ -1359,28 +1311,28 @@ QWidget * KviVariantTableItem::createEditor() const
return 0;
}
-void KviVariantTableItem::setContentFromEditor(QWidget * w)
+void KviVariantTableItem::setContentFromEditor(TQWidget * w)
{
switch(m_property.type())
{
- case QVariant::String:
- m_property = QVariant(((QLineEdit *)w)->text());
+ case TQVariant::String:
+ m_property = TQVariant(((TQLineEdit *)w)->text());
break;
- case QVariant::Int:
- m_property = QVariant(((QLineEdit *)w)->text().toInt());
+ case TQVariant::Int:
+ m_property = TQVariant(((TQLineEdit *)w)->text().toInt());
break;
- case QVariant::UInt:
- m_property = QVariant(((QLineEdit *)w)->text().toUInt());
+ case TQVariant::UInt:
+ m_property = TQVariant(((TQLineEdit *)w)->text().toUInt());
break;
- case QVariant::Bool:
- m_property = QVariant(((QComboBox *)w)->currentItem(),1);
+ case TQVariant::Bool:
+ m_property = TQVariant(((TQComboBox *)w)->currentItem(),1);
break;
- case QVariant::Color:
- m_property.asColor().setNamedColor(((QLineEdit *)w)->text());
+ case TQVariant::Color:
+ m_property.asColor().setNamedColor(((TQLineEdit *)w)->text());
break;
- case QVariant::Font:
+ case TQVariant::Font:
{
- KviStr txt = ((QComboBox *)w)->currentText();
+ KviStr txt = ((TQComboBox *)w)->currentText();
if(txt.hasData())
{
KviStr fam = txt;
@@ -1392,7 +1344,7 @@ void KviVariantTableItem::setContentFromEditor(QWidget * w)
bool bOk;
unsigned int uSize = psz.toUInt(&bOk);
if(!bOk)uSize = 12;
- m_property = QVariant(QFont(fam.ptr(),uSize));
+ m_property = TQVariant(TQFont(fam.ptr(),uSize));
}
}
@@ -1403,39 +1355,39 @@ void KviVariantTableItem::setContentFromEditor(QWidget * w)
}
-void KviVariantTableItem::paint(QPainter *p,const QColorGroup &cg,const QRect &cr,bool)
+void KviVariantTableItem::paint(TQPainter *p,const TQColorGroup &cg,const TQRect &cr,bool)
{
p->fillRect(0,0,cr.width(),cr.height(),cg.base());
- if(m_property.type() == QVariant::Color)
+ if(m_property.type() == TQVariant::Color)
{
p->fillRect(3,3,cr.width() - 6,cr.height() - 6,m_property.asColor());
} else {
- QString sz;
+ TQString sz;
switch(m_property.type())
{
- case QVariant::String:
+ case TQVariant::String:
sz = m_property.toString();
break;
- case QVariant::Bool:
+ case TQVariant::Bool:
sz = m_property.toBool() ? "TRUE" : "FALSE";
break;
- case QVariant::Font:
+ case TQVariant::Font:
sz.setNum(m_property.toFont().pointSize());
sz.prepend(", ");
sz.prepend(m_property.toFont().family());
break;
- case QVariant::Int:
+ case TQVariant::Int:
sz.setNum(m_property.toInt());
break;
- case QVariant::UInt:
+ case TQVariant::UInt:
sz.setNum(m_property.toUInt());
break;
default:
break;
}
p->setPen(cg.text());
- p->drawText(0,0,cr.width(),cr.height(),Qt::AlignLeft | Qt::AlignTop,sz);
+ p->drawText(0,0,cr.width(),cr.height(),TQt::AlignLeft | TQt::AlignTop,sz);
}
}
@@ -1446,10 +1398,10 @@ void KviVariantTableItem::paint(QPainter *p,const QColorGroup &cg,const QRect &c
//
-KviCanvasItemPropertiesWidget::KviCanvasItemPropertiesWidget(QWidget * par)
-: QTable(par)
+KviCanvasItemPropertiesWidget::KviCanvasItemPropertiesWidget(TQWidget * par)
+: TQTable(par)
{
- setSelectionMode(QTable::NoSelection);
+ setSelectionMode(TQTable::NoSelection);
setColumnMovingEnabled(false);
setRowMovingEnabled(false);
setShowGrid(true);
@@ -1457,7 +1409,7 @@ KviCanvasItemPropertiesWidget::KviCanvasItemPropertiesWidget(QWidget * par)
setSorting(false);
setLeftMargin(0);
verticalHeader()->hide();
- connect(this,SIGNAL(valueChanged(int,int)),this,SLOT(cellEdited(int,int)));
+ connect(this,TQT_SIGNAL(valueChanged(int,int)),this,TQT_SLOT(cellEdited(int,int)));
}
KviCanvasItemPropertiesWidget::~KviCanvasItemPropertiesWidget()
@@ -1466,15 +1418,15 @@ KviCanvasItemPropertiesWidget::~KviCanvasItemPropertiesWidget()
void KviCanvasItemPropertiesWidget::cellEdited(int row,int)
{
- QTableItem * it = item(row,0);
+ TQTableItem * it = item(row,0);
if(!it)return;
- QString szName = it->text();
+ TQString szName = it->text();
it = item(row,1);
if(!it)return;
emit propertyChanged(szName,((KviVariantTableItem *)it)->property());
}
-void KviCanvasItemPropertiesWidget::editItem(QCanvasItem * it)
+void KviCanvasItemPropertiesWidget::editItem(TQCanvasItem * it)
{
if(!it)
{
@@ -1488,7 +1440,7 @@ void KviCanvasItemPropertiesWidget::editItem(QCanvasItem * it)
return;
}
- QMap<QString,QVariant> * m = 0;
+ TQMap<TQString,TQVariant> * m = 0;
switch(KVI_CANVAS_RTTI_CONTROL_TYPE(it))
{
@@ -1518,13 +1470,13 @@ void KviCanvasItemPropertiesWidget::editItem(QCanvasItem * it)
setNumRows(m->count());
- QTableItem * item;
+ TQTableItem * item;
int idx = 0;
- for(QMap<QString,QVariant>::ConstIterator iter = m->begin();iter != m->end();++iter)
+ for(TQMap<TQString,TQVariant>::ConstIterator iter = m->begin();iter != m->end();++iter)
{
- item = new QTableItem(this,QTableItem::Never,iter.key().utf8().data());
+ item = new TQTableItem(this,TQTableItem::Never,iter.key().utf8().data());
setItem(idx,0,item);
item = new KviVariantTableItem(this,iter.data());
setItem(idx,1,item);
@@ -1538,42 +1490,42 @@ void KviCanvasItemPropertiesWidget::editItem(QCanvasItem * it)
// KviCanvasWidget
//
-KviCanvasWidget::KviCanvasWidget(QWidget * par)
-: QWidget(par,"canvas_widget")
+KviCanvasWidget::KviCanvasWidget(TQWidget * par)
+: TQWidget(par,"canvas_widget")
{
- m_pCanvas = new QCanvas(this);
+ m_pCanvas = new TQCanvas(TQT_TQOBJECT(this));
//#warning "Make this size as parameter of Dcc ?"
m_pCanvas->resize(648,480);
- m_pMenuBar = new QMenuBar(this);
- m_pSplitter = new QSplitter(QSplitter::Horizontal,this);
+ m_pMenuBar = new TQMenuBar(this);
+ m_pSplitter = new TQSplitter(Qt::Horizontal,this);
m_pCanvasView = new KviCanvasView(m_pCanvas,this,m_pSplitter);
- m_pStatusLabel = new QLabel(this);
+ m_pStatusLabel = new TQLabel(this);
m_pPropertiesWidget = new KviCanvasItemPropertiesWidget(m_pSplitter);
- QValueList<int> l;
+ TQValueList<int> l;
l.append(80);
l.append(20);
m_pSplitter->setSizes(l);
- connect(m_pPropertiesWidget,SIGNAL(propertyChanged(const QString &,const QVariant &)),m_pCanvasView,SLOT(propertyChanged(const QString &,const QVariant &)));
+ connect(m_pPropertiesWidget,TQT_SIGNAL(propertyChanged(const TQString &,const TQVariant &)),m_pCanvasView,TQT_SLOT(propertyChanged(const TQString &,const TQVariant &)));
KviTalPopupMenu * add = new KviTalPopupMenu(m_pMenuBar);
- KviTalPopupMenu * shapes = new KviTalPopupMenu(add);
+ KviTalPopupMenu * tqshapes = new KviTalPopupMenu(add);
KviTalPopupMenu * polygons = new KviTalPopupMenu(add);
KviTalPopupMenu * items = new KviTalPopupMenu(add);
- shapes->insertItem(__tr2qs_ctx("&Line","dcc"),m_pCanvasView,SLOT(insertLine()));
- shapes->insertItem(__tr2qs_ctx("&Rectangle","dcc"),m_pCanvasView,SLOT(insertRectangle()));
- shapes->insertItem(__tr2qs_ctx("&Ellipse","dcc"),m_pCanvasView,SLOT(insertEllipse()));
- shapes->insertItem(__tr2qs_ctx("&Pie","dcc"),m_pCanvasView,SLOT(insertPie()));
- shapes->insertItem(__tr2qs_ctx("&Chord","dcc"),m_pCanvasView,SLOT(insertChord()));
+ tqshapes->insertItem(__tr2qs_ctx("&Line","dcc"),m_pCanvasView,TQT_SLOT(insertLine()));
+ tqshapes->insertItem(__tr2qs_ctx("&Rectangle","dcc"),m_pCanvasView,TQT_SLOT(insertRectangle()));
+ tqshapes->insertItem(__tr2qs_ctx("&Ellipse","dcc"),m_pCanvasView,TQT_SLOT(insertEllipse()));
+ tqshapes->insertItem(__tr2qs_ctx("&Pie","dcc"),m_pCanvasView,TQT_SLOT(insertPie()));
+ tqshapes->insertItem(__tr2qs_ctx("&Chord","dcc"),m_pCanvasView,TQT_SLOT(insertChord()));
- items->insertItem(__tr2qs_ctx("&Rich text (html)","dcc"),m_pCanvasView,SLOT(insertRichText()));
+ items->insertItem(__tr2qs_ctx("&Rich text (html)","dcc"),m_pCanvasView,TQT_SLOT(insertRichText()));
- polygons->insertItem(__tr2qs_ctx("&Triangle","dcc"),m_pCanvasView,SLOT(insertPolygonTriangle()));
- polygons->insertItem(__tr2qs_ctx("&Rectangle","dcc"),m_pCanvasView,SLOT(insertPolygonRectangle()));
- polygons->insertItem(__tr2qs_ctx("&Pentagon","dcc"),m_pCanvasView,SLOT(insertPolygonPentagon()));
- polygons->insertItem(__tr2qs_ctx("&Hexagon","dcc"),m_pCanvasView,SLOT(insertPolygonHexagon()));
+ polygons->insertItem(__tr2qs_ctx("&Triangle","dcc"),m_pCanvasView,TQT_SLOT(insertPolygonTriangle()));
+ polygons->insertItem(__tr2qs_ctx("&Rectangle","dcc"),m_pCanvasView,TQT_SLOT(insertPolygonRectangle()));
+ polygons->insertItem(__tr2qs_ctx("&Pentagon","dcc"),m_pCanvasView,TQT_SLOT(insertPolygonPentagon()));
+ polygons->insertItem(__tr2qs_ctx("&Hexagon","dcc"),m_pCanvasView,TQT_SLOT(insertPolygonHexagon()));
- add->insertItem(__tr2qs_ctx("&Shape","dcc"),shapes);
+ add->insertItem(__tr2qs_ctx("&Shape","dcc"),tqshapes);
add->insertItem(__tr2qs_ctx("&Item","dcc"),items);
add->insertItem(__tr2qs_ctx("&Polygons","dcc"),polygons);
@@ -1586,11 +1538,11 @@ KviCanvasWidget::~KviCanvasWidget()
-void KviCanvasWidget::resizeEvent(QResizeEvent *)
+void KviCanvasWidget::resizeEvent(TQResizeEvent *)
{
- int h = m_pMenuBar->sizeHint().height();
+ int h = m_pMenuBar->tqsizeHint().height();
m_pMenuBar->setGeometry(0,0,width(),h);
- int h2 = m_pStatusLabel->sizeHint().height();
+ int h2 = m_pStatusLabel->tqsizeHint().height();
m_pStatusLabel->setGeometry(0,height() - h2,width(),h2);
m_pSplitter->setGeometry(0,h,width(),height() - (h + h2));
}
diff --git a/src/modules/dcc/canvaswidget.h b/src/modules/dcc/canvaswidget.h
index 41d451e4..04867502 100644
--- a/src/modules/dcc/canvaswidget.h
+++ b/src/modules/dcc/canvaswidget.h
@@ -27,20 +27,20 @@
#ifdef COMPILE_DCC_CANVAS
-#include <qcanvas.h>
+#include <tqcanvas.h>
-//#ifdef QT_NO_CANVAS
+//#ifdef TQT_NO_CANVAS
// #warning "HEre is not"
//#endif
-#include <qmenubar.h>
-#include <qlabel.h>
+#include <tqmenubar.h>
+#include <tqlabel.h>
-#include <qmap.h>
-#include <qvariant.h>
-#include <qtable.h>
-#include <qsplitter.h>
+#include <tqmap.h>
+#include <tqvariant.h>
+#include <tqtable.h>
+#include <tqsplitter.h>
@@ -66,49 +66,49 @@ class KviCanvasWidget;
-class KviCanvasPolygon : public QCanvasPolygon
+class KviCanvasPolygon : public TQCanvasPolygon
{
public:
- KviCanvasPolygon(QCanvas * c,int x,int y,QPointArray &pnts,double dScaleFactor);
+ KviCanvasPolygon(TQCanvas * c,int x,int y,TQPointArray &pnts,double dScaleFactor);
virtual ~KviCanvasPolygon();
protected:
- QMap<QString,QVariant> m_properties;
+ TQMap<TQString,TQVariant> m_properties;
double m_dScaleFactor;
- QPointArray m_points;
+ TQPointArray m_points;
public:
- virtual void draw(QPainter & p);
+ virtual void draw(TQPainter & p);
double scaleFactor(){ return m_dScaleFactor; };
void setScaleFactor(double dScaleFactor);
void resetPoints();
- const QPointArray & internalPoints(){ return m_points; };
- void setInternalPoints(const QPointArray &pnts);
- QMap<QString,QVariant> * properties(){ return &m_properties; };
- virtual void setProperty(const QString &property,const QVariant &val);
+ const TQPointArray & internalPoints(){ return m_points; };
+ void setInternalPoints(const TQPointArray &pnts);
+ TQMap<TQString,TQVariant> * properties(){ return &m_properties; };
+ virtual void setProperty(const TQString &property,const TQVariant &val);
virtual int rtti() const;
};
-class KviCanvasRectangleItem : public QCanvasRectangle
+class KviCanvasRectangleItem : public TQCanvasRectangle
{
friend class KviCanvasRectangle;
friend class KviCanvasRichText;
friend class KviCanvasEllipticItem;
protected:
- KviCanvasRectangleItem(QCanvas * c,int x,int y,int w,int h);
+ KviCanvasRectangleItem(TQCanvas * c,int x,int y,int w,int h);
public:
virtual ~KviCanvasRectangleItem();
protected:
- QMap<QString,QVariant> m_properties;
+ TQMap<TQString,TQVariant> m_properties;
public:
int right(){ return ((int)x()) + width(); };
int bottom(){ return ((int)y()) + height(); };
- QMap<QString,QVariant> * properties(){ return &m_properties; };
- virtual void setProperty(const QString &property,const QVariant &val);
-// QVariant property(const QString &name){ return m_properties[name]; };
+ TQMap<TQString,TQVariant> * properties(){ return &m_properties; };
+ virtual void setProperty(const TQString &property,const TQVariant &val);
+// TQVariant property(const TQString &name){ return m_properties[name]; };
protected:
- void drawSelection(QPainter &p);
+ void drawSelection(TQPainter &p);
};
@@ -118,12 +118,12 @@ class KviCanvasEllipticItem : public KviCanvasRectangleItem
friend class KviCanvasChord;
friend class KviCanvasPie;
protected:
- KviCanvasEllipticItem(QCanvas * c,int x,int y,int w,int h);
+ KviCanvasEllipticItem(TQCanvas * c,int x,int y,int w,int h);
~KviCanvasEllipticItem();
public:
- virtual void setProperty(const QString & property,const QVariant &val);
- virtual void draw(QPainter & p);
- virtual void drawContent(QPainter & p);
+ virtual void setProperty(const TQString & property,const TQVariant &val);
+ virtual void draw(TQPainter & p);
+ virtual void drawContent(TQPainter & p);
virtual int rtti() const;
};
@@ -131,10 +131,10 @@ public:
class KviCanvasEllipse : public KviCanvasEllipticItem
{
public:
- KviCanvasEllipse(QCanvas * c,int x,int y,int w,int h);
+ KviCanvasEllipse(TQCanvas * c,int x,int y,int w,int h);
~KviCanvasEllipse();
public:
- virtual void drawContent(QPainter & p);
+ virtual void drawContent(TQPainter & p);
virtual int rtti() const;
};
@@ -142,10 +142,10 @@ public:
class KviCanvasPie : public KviCanvasEllipticItem
{
public:
- KviCanvasPie(QCanvas * c,int x,int y,int w,int h);
+ KviCanvasPie(TQCanvas * c,int x,int y,int w,int h);
~KviCanvasPie();
public:
- virtual void drawContent(QPainter & p);
+ virtual void drawContent(TQPainter & p);
virtual int rtti() const;
};
@@ -153,26 +153,26 @@ public:
class KviCanvasChord : public KviCanvasEllipticItem
{
public:
- KviCanvasChord(QCanvas * c,int x,int y,int w,int h);
+ KviCanvasChord(TQCanvas * c,int x,int y,int w,int h);
~KviCanvasChord();
public:
- virtual void drawContent(QPainter & p);
+ virtual void drawContent(TQPainter & p);
virtual int rtti() const;
};
-class KviCanvasLine : public QCanvasLine
+class KviCanvasLine : public TQCanvasLine
{
public:
- KviCanvasLine(QCanvas * c,int x1,int y1,int x2,int y2);
+ KviCanvasLine(TQCanvas * c,int x1,int y1,int x2,int y2);
virtual ~KviCanvasLine();
protected:
- QMap<QString,QVariant> m_properties;
+ TQMap<TQString,TQVariant> m_properties;
public:
- QMap<QString,QVariant> * properties(){ return &m_properties; };
- virtual void setProperty(const QString &property,const QVariant &val);
-// QVariant property(const QString &name){ return m_properties[name]; };
- virtual void draw(QPainter & p);
+ TQMap<TQString,TQVariant> * properties(){ return &m_properties; };
+ virtual void setProperty(const TQString &property,const TQVariant &val);
+// TQVariant property(const TQString &name){ return m_properties[name]; };
+ virtual void draw(TQPainter & p);
virtual int rtti() const;
};
@@ -181,11 +181,11 @@ public:
class KviCanvasRectangle : public KviCanvasRectangleItem
{
public:
- KviCanvasRectangle(QCanvas * c,int x,int y,int w,int h);
+ KviCanvasRectangle(TQCanvas * c,int x,int y,int w,int h);
~KviCanvasRectangle();
public:
- virtual void draw(QPainter & p);
- virtual void setProperty(const QString &property,const QVariant &val);
+ virtual void draw(TQPainter & p);
+ virtual void setProperty(const TQString &property,const TQVariant &val);
virtual int rtti() const;
};
@@ -193,19 +193,20 @@ public:
class KviCanvasRichText : public KviCanvasRectangleItem
{
public:
- KviCanvasRichText(QCanvas * c,int x,int y,int w,int h);
+ KviCanvasRichText(TQCanvas * c,int x,int y,int w,int h);
~KviCanvasRichText();
public:
- virtual void draw(QPainter & p);
+ virtual void draw(TQPainter & p);
virtual int rtti() const;
};
-class KviCanvasView : public QCanvasView
+class KviCanvasView : public TQCanvasView
{
Q_OBJECT
+ TQ_OBJECT
public:
- KviCanvasView(QCanvas * c,KviCanvasWidget * cw,QWidget * par);
+ KviCanvasView(TQCanvas * c,KviCanvasWidget * cw,TQWidget * par);
~KviCanvasView();
public:
enum State { Idle , SelectOrigin };
@@ -226,30 +227,30 @@ protected:
ObjectType m_objectToInsert;
// Selected item
- QCanvasItem * m_pSelectedItem;
+ TQCanvasItem * m_pSelectedItem;
DragMode m_dragMode;
- QPoint m_dragBegin;
+ TQPoint m_dragBegin;
double m_dragScaleFactor;
unsigned int m_dragPointIndex;
- QPointArray m_dragPointArray;
+ TQPointArray m_dragPointArray;
protected:
- void beginDragRectangle(KviCanvasRectangleItem * it,const QPoint &p,bool bInitial = false);
- void dragRectangle(KviCanvasRectangleItem * it,const QPoint & p);
+ void beginDragRectangle(KviCanvasRectangleItem * it,const TQPoint &p,bool bInitial = false);
+ void dragRectangle(KviCanvasRectangleItem * it,const TQPoint & p);
- void beginDragLine(KviCanvasLine * it,const QPoint &p,bool bInitial = false);
- void dragLine(KviCanvasLine * it,const QPoint &p);
+ void beginDragLine(KviCanvasLine * it,const TQPoint &p,bool bInitial = false);
+ void dragLine(KviCanvasLine * it,const TQPoint &p);
- void beginDragPolygon(KviCanvasPolygon * it,const QPoint &p,bool bShift = false,bool bCtrl = false);
- void dragPolygon(KviCanvasPolygon * it,const QPoint &p);
+ void beginDragPolygon(KviCanvasPolygon * it,const TQPoint &p,bool bShift = false,bool bCtrl = false);
+ void dragPolygon(KviCanvasPolygon * it,const TQPoint &p);
- void setItemSelected(QCanvasItem * it);
+ void setItemSelected(TQCanvasItem * it);
void clearSelection();
- void insertObjectAt(const QPoint & pnt,ObjectType o);
- virtual void contentsMousePressEvent(QMouseEvent *e);
- virtual void contentsMouseMoveEvent(QMouseEvent *e);
- virtual void contentsMouseReleaseEvent(QMouseEvent *e);
+ void insertObjectAt(const TQPoint & pnt,ObjectType o);
+ virtual void contentsMousePressEvent(TQMouseEvent *e);
+ virtual void contentsMouseMoveEvent(TQMouseEvent *e);
+ virtual void contentsMouseReleaseEvent(TQMouseEvent *e);
public slots:
void insertRectangle();
void insertRichText();
@@ -261,59 +262,61 @@ public slots:
void insertPolygonRectangle();
void insertPolygonPentagon();
void insertPolygonHexagon();
- void propertyChanged(const QString &s,const QVariant &v);
+ void propertyChanged(const TQString &s,const TQVariant &v);
};
-// For Qt3.0 this might need to be changed
+// For TQt3.0 this might need to be changed
-class KviVariantTableItem : public QTableItem
+class KviVariantTableItem : public TQTableItem
{
public:
- KviVariantTableItem(QTable * t,const QVariant & property);
+ KviVariantTableItem(TQTable * t,const TQVariant & property);
~KviVariantTableItem();
private:
- QVariant m_property;
+ TQVariant m_property;
public:
- virtual QWidget * createEditor() const;
- virtual void setContentFromEditor(QWidget *w);
- QVariant & property(){ return m_property; };
- virtual void paint(QPainter *p,const QColorGroup &cg,const QRect &cr,bool selected);
+ virtual TQWidget * createEditor() const;
+ virtual void setContentFromEditor(TQWidget *w);
+ TQVariant & property(){ return m_property; };
+ virtual void paint(TQPainter *p,const TQColorGroup &cg,const TQRect &cr,bool selected);
};
-class KviCanvasItemPropertiesWidget : public QTable
+class KviCanvasItemPropertiesWidget : public TQTable
{
Q_OBJECT
+ TQ_OBJECT
public:
- KviCanvasItemPropertiesWidget(QWidget * par);
+ KviCanvasItemPropertiesWidget(TQWidget * par);
~KviCanvasItemPropertiesWidget();
public:
- void editItem(QCanvasItem * it);
+ void editItem(TQCanvasItem * it);
protected slots:
void cellEdited(int row,int col);
signals:
- void propertyChanged(const QString &s,const QVariant &v);
+ void propertyChanged(const TQString &s,const TQVariant &v);
};
-class KviCanvasWidget : public QWidget
+class KviCanvasWidget : public TQWidget
{
friend class KviCanvasView;
Q_OBJECT
+ TQ_OBJECT
public:
- KviCanvasWidget(QWidget * par);
+ KviCanvasWidget(TQWidget * par);
~KviCanvasWidget();
protected:
- QSplitter * m_pSplitter;
- QCanvas * m_pCanvas;
- QMenuBar * m_pMenuBar;
+ TQSplitter * m_pSplitter;
+ TQCanvas * m_pCanvas;
+ TQMenuBar * m_pMenuBar;
KviCanvasView * m_pCanvasView;
- QLabel * m_pStatusLabel;
+ TQLabel * m_pStatusLabel;
KviCanvasItemPropertiesWidget * m_pPropertiesWidget;
protected:
- virtual void resizeEvent(QResizeEvent *);
+ virtual void resizeEvent(TQResizeEvent *);
};
diff --git a/src/modules/dcc/chat.cpp b/src/modules/dcc/chat.cpp
index 715d17b9..09778d76 100644
--- a/src/modules/dcc/chat.cpp
+++ b/src/modules/dcc/chat.cpp
@@ -63,8 +63,8 @@
#include "kvi_mirccntrl.h"
#endif
-#include <qsplitter.h>
-#include <qevent.h>
+#include <tqsplitter.h>
+#include <tqevent.h>
#include "kvi_tal_vbox.h"
@@ -89,7 +89,7 @@ extern KviDccBroker * g_pDccBroker;
KviDccChat::KviDccChat(KviFrame *pFrm,KviDccDescriptor * dcc,const char * name)
: KviDccWindow(KVI_WINDOW_TYPE_DCCCHAT,pFrm,name,dcc)
{
- m_pTopSplitter = new QSplitter(Qt::Horizontal,this,"top_splitter");
+ m_pTopSplitter = new TQSplitter(Qt::Horizontal,this,"top_splitter");
KviThemedLabel * dummy;
dummy = new KviThemedLabel(m_pTopSplitter,"dummy_label");
KviTalVBox * box = new KviTalVBox(m_pTopSplitter);
@@ -98,9 +98,9 @@ KviDccChat::KviDccChat(KviFrame *pFrm,KviDccDescriptor * dcc,const char * name)
createCryptControllerButton(box);
#endif
- m_pSplitter = new QSplitter(Qt::Horizontal,this,"splitter");
+ m_pSplitter = new TQSplitter(Qt::Horizontal,this,"splitter");
m_pIrcView = new KviIrcView(m_pSplitter,pFrm,this);
- connect(m_pIrcView,SIGNAL(rightClicked()),this,SLOT(textViewRightClicked()));
+ connect(m_pIrcView,TQT_SIGNAL(rightClicked()),this,TQT_SLOT(textViewRightClicked()));
m_pInput = new KviInput(this);
//setFocusHandler(m_pInput,this);
@@ -110,12 +110,12 @@ KviDccChat::KviDccChat(KviFrame *pFrm,KviDccDescriptor * dcc,const char * name)
if(KVI_OPTION_BOOL(KviOption_boolAutoLogDccChat))m_pIrcView->startLogging();
m_pMarshal = new KviDccMarshal(this);
- connect(m_pMarshal,SIGNAL(error(int)),this,SLOT(handleMarshalError(int)));
- connect(m_pMarshal,SIGNAL(connected()),this,SLOT(connected()));
- connect(m_pMarshal,SIGNAL(inProgress()),this,SLOT(connectionInProgress()));
+ connect(m_pMarshal,TQT_SIGNAL(error(int)),this,TQT_SLOT(handleMarshalError(int)));
+ connect(m_pMarshal,TQT_SIGNAL(connected()),this,TQT_SLOT(connected()));
+ connect(m_pMarshal,TQT_SIGNAL(inProgress()),this,TQT_SLOT(connectionInProgress()));
#ifdef COMPILE_SSL_SUPPORT
- connect(m_pMarshal,SIGNAL(startingSSLHandshake()),this,SLOT(startingSSLHandshake()));
- connect(m_pMarshal,SIGNAL(sslError(const char *)),this,SLOT(sslError(const char *)));
+ connect(m_pMarshal,TQT_SIGNAL(startingSSLHandshake()),this,TQT_SLOT(startingSSLHandshake()));
+ connect(m_pMarshal,TQT_SIGNAL(sslError(const char *)),this,TQT_SLOT(sslError(const char *)));
#endif
m_pSlaveThread = 0;
@@ -132,7 +132,7 @@ KviDccChat::~KviDccChat()
delete m_pSlaveThread;
m_pSlaveThread = 0;
}
- KviThreadManager::killPendingEvents(this);
+ KviThreadManager::killPendingEvents(TQT_TQOBJECT(this));
}
void KviDccChat::textViewRightClicked()
@@ -215,13 +215,13 @@ void KviDccChat::connectionInProgress()
}
}
- QString port = !m_pDescriptor->szFakePort.isEmpty() ? m_pDescriptor->szFakePort : QString(m_pMarshal->localPort());
+ TQString port = !m_pDescriptor->szFakePort.isEmpty() ? m_pDescriptor->szFakePort : TQString(m_pMarshal->localPort());
//FIXME: #warning "OPTION FOR SENDING 127.0.0.1 and so on (not an unsigned number)"
struct in_addr a;
if(kvi_stringIpToBinaryIp(ip.ptr(),&a))ip.setNum(htonl(a.s_addr));
- QString szReq = QString("PRIVMSG %1 :%2DCC %3 chat %4 %5").arg(m_pDescriptor->szNick).arg((char)0x01).arg(m_pDescriptor->szType).arg(ip.ptr()).arg(port);
+ TQString szReq = TQString("PRIVMSG %1 :%2DCC %3 chat %4 %5").tqarg(m_pDescriptor->szNick).tqarg((char)0x01).tqarg(m_pDescriptor->szType).tqarg(ip.ptr()).tqarg(port);
if(m_pDescriptor->isZeroPortRequest())
{
@@ -250,12 +250,12 @@ void KviDccChat::startingSSLHandshake()
void KviDccChat::sslError(const char * msg)
{
#ifdef COMPILE_SSL_SUPPORT
- if(!KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnDCCChatError,this,QString(msg),m_pDescriptor->idString()))
+ if(!KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnDCCChatError,this,TQString(msg),m_pDescriptor->idString()))
output(KVI_OUT_DCCERROR,__tr2qs_ctx("[SSL ERROR]: %s","dcc"),msg);
#endif
}
-const QString & KviDccChat::target()
+const TQString & KviDccChat::target()
{
// This may change on the fly...
m_szTarget = m_pDescriptor->szNick;
@@ -268,23 +268,23 @@ const QString & KviDccChat::target()
void KviDccChat::fillCaptionBuffers()
{
- QString tmp = QString("DCC %1 %2@%3:%4").arg(
+ TQString tmp = TQString("DCC %1 %2@%3:%4").tqarg(
#ifdef COMPILE_SSL_SUPPORT
- m_pDescriptor->bIsSSL ? "SChat" : "Chat").arg(
+ m_pDescriptor->bIsSSL ? "SChat" : "Chat").tqarg(
#else
- "Chat").arg(
+ "Chat").tqarg(
#endif
- m_pDescriptor->szNick).arg(m_pDescriptor->szIp).arg(m_pDescriptor->szPort);
+ m_pDescriptor->szNick).tqarg(m_pDescriptor->szIp).tqarg(m_pDescriptor->szPort);
m_szPlainTextCaption = tmp;
m_szHtmlActiveCaption.sprintf("<nobr><font color=\"%s\"><b>%s</b></font></nobr>",
- KVI_OPTION_COLOR(KviOption_colorCaptionTextActive).name().ascii(),tmp.utf8().data());
+ TQString(KVI_OPTION_COLOR(KviOption_colorCaptionTextActive).name()).ascii(),tmp.utf8().data());
m_szHtmlInactiveCaption.sprintf("<nobr><font color=\"%s\"><b>%s</b></font></nobr>",
- KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive).name().ascii(),tmp.utf8().data());
+ TQString(KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive).name()).ascii(),tmp.utf8().data());
}
-QPixmap * KviDccChat::myIconPtr()
+TQPixmap * KviDccChat::myIconPtr()
{
return g_pIconManager->getSmallIcon(KVI_SMALLICON_DCCMSG);
}
@@ -295,7 +295,7 @@ void KviDccChat::getBaseLogFileName(KviStr &buffer)
buffer.sprintf("%s_%s_%s",m_pDescriptor->szNick.utf8().data(),m_pDescriptor->szIp.utf8().data(),m_pDescriptor->szPort.utf8().data());
}
-void KviDccChat::ownMessage(const QString &text)
+void KviDccChat::ownMessage(const TQString &text)
{
if(!m_pSlaveThread)
{
@@ -303,7 +303,7 @@ void KviDccChat::ownMessage(const QString &text)
return;
}
- KviQCString szData = encodeText(text);
+ KviTQCString szData = encodeText(text);
const char * d = szData.data();
if(!d)return;
@@ -331,7 +331,7 @@ void KviDccChat::ownMessage(const QString &text)
{
KviStr buf(KviStr::Format,"%s\r\n",encrypted.ptr());
m_pSlaveThread->sendRawData(buf.ptr(),buf.len());
- QString encr = decodeText(encrypted.ptr());
+ TQString encr = decodeText(encrypted.ptr());
m_pFrm->firstConsole()->outputPrivmsg(this,KVI_OUT_OWNPRIVMSG,
m_pDescriptor->szLocalNick.utf8().data(),m_pDescriptor->szLocalUser.utf8().data(),
m_pDescriptor->szLocalHost.utf8().data(),encr,KviConsole::NoNotifications);
@@ -339,7 +339,7 @@ void KviDccChat::ownMessage(const QString &text)
break;
default: // also case KviCryptEngine::EncryptError
{
- QString szErr = cryptSessionInfo()->pEngine->lastError();
+ TQString szErr = cryptSessionInfo()->pEngine->lastError();
output(KVI_OUT_SYSTEMERROR,
__tr2qs_ctx("The crypto engine was not able to encrypt the current message (%Q): %Q, no data was sent to the remote end","dcc"),
&text,&szErr);
@@ -350,7 +350,7 @@ void KviDccChat::ownMessage(const QString &text)
} else {
d++; //eat the escape code
KviStr buf(KviStr::Format,"%s\r\n",d);
- QString tmp = text.right(text.length() - 1);
+ TQString tmp = text.right(text.length() - 1);
m_pSlaveThread->sendRawData(buf.ptr(),buf.len());
m_pFrm->firstConsole()->outputPrivmsg(this,KVI_OUT_OWNPRIVMSG,
m_pDescriptor->szLocalNick.utf8().data(),m_pDescriptor->szLocalUser.utf8().data(),
@@ -367,18 +367,18 @@ void KviDccChat::ownMessage(const QString &text)
m_pDescriptor->szLocalHost.utf8().data(),text,KviConsole::NoNotifications);
}
-const QString & KviDccChat::localNick()
+const TQString & KviDccChat::localNick()
{
// FIXME: This is just a complete HACK
m_szLocalNick = m_pDescriptor->szLocalNick;
return m_szLocalNick;
}
-void KviDccChat::ownAction(const QString &text)
+void KviDccChat::ownAction(const TQString &text)
{
if(m_pSlaveThread)
{
- KviQCString szData = encodeText(text);
+ KviTQCString szData = encodeText(text);
const char * d = szData.data();
if(!d)return;
KviStr buf(KviStr::Format,"%cACTION %s%c\r\n",0x01,d,0x01);
@@ -389,7 +389,7 @@ void KviDccChat::ownAction(const QString &text)
}
}
-bool KviDccChat::event(QEvent *e)
+bool KviDccChat::event(TQEvent *e)
{
if(e->type() == KVI_THREAD_EVENT)
{
@@ -398,7 +398,7 @@ bool KviDccChat::event(QEvent *e)
case KVI_DCC_THREAD_EVENT_ERROR:
{
int * err = ((KviThreadDataEvent<int> *)e)->getData();
- QString szErr = KviError::getDescription(*err);
+ TQString szErr = KviError::getDescription(*err);
if(!KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnDCCChatError,this,szErr,m_pDescriptor->idString()))
output(KVI_OUT_DCCERROR,__tr2qs_ctx("ERROR: %Q","dcc"),&szErr);
KVS_TRIGGER_EVENT_1(KviEvent_OnDCCChatDisconnected,this,m_pDescriptor->idString());
@@ -430,7 +430,7 @@ bool KviDccChat::event(QEvent *e)
case KviCryptEngine::DecryptOkWasEncrypted:
case KviCryptEngine::DecryptOkWasEncoded:
case KviCryptEngine::DecryptOkWasPlainText:
- if(!KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnDCCChatMessage,this,QString(decryptedStuff.ptr()),m_pDescriptor->idString()))
+ if(!KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnDCCChatMessage,this,TQString(decryptedStuff.ptr()),m_pDescriptor->idString()))
{
m_pFrm->firstConsole()->outputPrivmsg(this,KVI_OUT_DCCCHATMSG,
m_pDescriptor->szNick.utf8().data(),m_pDescriptor->szUser.utf8().data(),
@@ -442,7 +442,7 @@ bool KviDccChat::event(QEvent *e)
default: // also case KviCryptEngine::DecryptError
{
- QString szErr = cinf->pEngine->lastError();
+ TQString szErr = cinf->pEngine->lastError();
output(KVI_OUT_SYSTEMERROR,
__tr2qs_ctx("The following message appears to be encrypted, but the crypto engine failed to decode it: %Q","dcc"),
&szErr);
@@ -453,7 +453,7 @@ bool KviDccChat::event(QEvent *e)
} else {
#endif
// FIXME!
- if(!KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnDCCChatMessage,this,QString(d.ptr()),m_pDescriptor->idString()))
+ if(!KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnDCCChatMessage,this,TQString(d.ptr()),m_pDescriptor->idString()))
m_pFrm->firstConsole()->outputPrivmsg(this,KVI_OUT_DCCCHATMSG,
m_pDescriptor->szNick.utf8().data(),m_pDescriptor->szUser.utf8().data(),
m_pDescriptor->szHost.utf8().data(),d.ptr());
@@ -470,25 +470,25 @@ bool KviDccChat::event(QEvent *e)
return KviWindow::event(e);
}
-void KviDccChat::resizeEvent(QResizeEvent *e)
+void KviDccChat::resizeEvent(TQResizeEvent *e)
{
int hght = m_pInput->heightHint();
- int hght2 = m_pTopSplitter->sizeHint().height();
+ int hght2 = m_pTopSplitter->tqsizeHint().height();
m_pTopSplitter->setGeometry(0,0,width(),hght2);
m_pSplitter->setGeometry(0,hght2,width(),height() - (hght + hght2));
m_pInput->setGeometry(0,height() - hght,width(),hght);
}
-QSize KviDccChat::sizeHint() const
+TQSize KviDccChat::tqsizeHint() const
{
- QSize ret(m_pIrcView->sizeHint().width(),
- m_pIrcView->sizeHint().height() + m_pInput->heightHint());
+ TQSize ret(m_pIrcView->tqsizeHint().width(),
+ m_pIrcView->tqsizeHint().height() + m_pInput->heightHint());
return ret;
}
void KviDccChat::handleMarshalError(int err)
{
- QString szErr = KviError::getDescription(err);
+ TQString szErr = KviError::getDescription(err);
if(!KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnDCCChatError,this,szErr,m_pDescriptor->idString()))
output(KVI_OUT_DCCERROR,__tr2qs_ctx("DCC %Q failed: %Q","dcc"),&(m_pDescriptor->szType),&szErr);
}
@@ -537,7 +537,7 @@ void KviDccChat::connected()
KviDccChatThread::KviDccChatThread(KviWindow *wnd,kvi_socket_t fd)
-: KviDccThread(wnd,fd)
+: KviDccThread(TQT_TQOBJECT(wnd),fd)
{
m_pOutBuffers = new KviPointerList<KviDataBuffer>;
m_pOutBuffers->setAutoDelete(true);
@@ -714,7 +714,7 @@ bool KviDccChatThread::handleIncomingData(KviDccThreadIncomingData * data,bool b
kvi_free(data->buffer);
data->buffer = end = aux = 0;
}
- postEvent(parent(),e);
+ postEvent(tqparent(),e);
} else aux++;
// debug("PASSING CHAR %c",*aux);
}
@@ -732,7 +732,7 @@ bool KviDccChatThread::handleIncomingData(KviDccThreadIncomingData * data,bool b
data->iLen = 0;
kvi_free(data->buffer);
data->buffer = 0;
- postEvent(parent(),e);
+ postEvent(tqparent(),e);
}
}
return true;
diff --git a/src/modules/dcc/chat.h b/src/modules/dcc/chat.h
index ae1d51b9..c2785915 100644
--- a/src/modules/dcc/chat.h
+++ b/src/modules/dcc/chat.h
@@ -61,30 +61,31 @@ public:
};
class KviDccMarshal;
-class QSplitter;
+class TQSplitter;
class KviDccChat : public KviDccWindow
{
Q_OBJECT
+ TQ_OBJECT
public:
KviDccChat(KviFrame *pFrm,KviDccDescriptor * dcc,const char * name);
~KviDccChat();
protected:
KviDccChatThread * m_pSlaveThread;
- QSplitter * m_pTopSplitter;
- QString m_szTarget;
- QString m_szLocalNick;
+ TQSplitter * m_pTopSplitter;
+ TQString m_szTarget;
+ TQString m_szLocalNick;
protected:
- virtual const QString & target();
+ virtual const TQString & target();
virtual void fillCaptionBuffers();
virtual void getBaseLogFileName(KviStr &buffer);
- virtual QPixmap * myIconPtr();
- virtual void resizeEvent(QResizeEvent *e);
- virtual QSize sizeHint() const;
- virtual const QString & localNick();
- virtual bool event(QEvent *e);
- virtual void ownMessage(const QString &text);
- virtual void ownAction(const QString &text);
+ virtual TQPixmap * myIconPtr();
+ virtual void resizeEvent(TQResizeEvent *e);
+ virtual TQSize tqsizeHint() const;
+ virtual const TQString & localNick();
+ virtual bool event(TQEvent *e);
+ virtual void ownMessage(const TQString &text);
+ virtual void ownAction(const TQString &text);
virtual void triggerCreationEvents();
virtual void triggerDestructionEvents();
void startConnection();
diff --git a/src/modules/dcc/descriptor.cpp b/src/modules/dcc/descriptor.cpp
index b21b0561..71108210 100644
--- a/src/modules/dcc/descriptor.cpp
+++ b/src/modules/dcc/descriptor.cpp
@@ -65,7 +65,7 @@ KviDccDescriptor::KviDccDescriptor(KviConsole * pConsole)
g_pDescriptorDict = new KviPointerHashTable<int,KviDccDescriptor>;
g_pDescriptorDict->setAutoDelete(false);
}
- g_pDescriptorDict->replace((long)m_uId,this);
+ g_pDescriptorDict->tqreplace((long)m_uId,this);
szNick = __tr_ctx("unknown","dcc");
szUser = szNick;
@@ -148,10 +148,10 @@ void KviDccDescriptor::triggerCreationEvent()
}
-KviDccDescriptor * KviDccDescriptor::find(unsigned int uId)
+KviDccDescriptor * KviDccDescriptor::tqfind(unsigned int uId)
{
if(!g_pDescriptorDict)return 0;
- return g_pDescriptorDict->find((long)uId);
+ return g_pDescriptorDict->tqfind((long)uId);
}
/*
diff --git a/src/modules/dcc/descriptor.h b/src/modules/dcc/descriptor.h
index f3f6c3f3..49a705ce 100644
--- a/src/modules/dcc/descriptor.h
+++ b/src/modules/dcc/descriptor.h
@@ -46,7 +46,7 @@ protected:
KviStr m_szZeroPortRequestTag;
unsigned int m_uId; // this dcc session ID
- QString m_szId;
+ TQString m_szId;
KviDccWindow * m_pDccWindow; // 0 if it has no window
KviDccFileTransfer * m_pDccTransfer; // 0 if it is not a transfer
@@ -69,8 +69,8 @@ public:
void setZeroPortRequestTag(const KviStr &szTag){ m_szZeroPortRequestTag = szTag; };
unsigned int id() const { return m_uId; };
- const QString & idString() const { return m_szId; };
- static KviDccDescriptor * find(unsigned int uId);
+ const TQString & idString() const { return m_szId; };
+ static KviDccDescriptor * tqfind(unsigned int uId);
static KviPointerHashTable<int,KviDccDescriptor> * descriptorDict();
void triggerCreationEvent(); // this MUST be called by the creator of the descriptor!
@@ -78,28 +78,28 @@ public:
// void copyFrom(const KviDccDescriptor &src);
public:
// Generic parameters
- QString szType; // DCC protocol : CHAT , SCHAT , SEND , TSSEND....
+ TQString szType; // DCC protocol : CHAT , SCHAT , SEND , TSSEND....
bool bActive; // active or passive connection ?
- QString szNick; // remote user nickname
- QString szUser; // remote user name (unknown for passive dcc)
- QString szHost; // remote user host (unknown for passive dcc)
+ TQString szNick; // remote user nickname
+ TQString szUser; // remote user name (unknown for passive dcc)
+ TQString szHost; // remote user host (unknown for passive dcc)
- QString szLocalNick; // local user nickname (always from irc)
- QString szLocalUser; // local user username (always from irc)
- QString szLocalHost; // local user hostname (always from irc)
+ TQString szLocalNick; // local user nickname (always from irc)
+ TQString szLocalUser; // local user username (always from irc)
+ TQString szLocalHost; // local user hostname (always from irc)
- QString szIp; // remote user ip (active dcc only)
- QString szPort; // remote user port (active dcc only)
+ TQString szIp; // remote user ip (active dcc only)
+ TQString szPort; // remote user port (active dcc only)
- QString szListenIp; // passive only : ip to listen on
- QString szListenPort; // passive only : port to listen on
+ TQString szListenIp; // passive only : ip to listen on
+ TQString szListenPort; // passive only : port to listen on
bool bSendRequest; // passive only : true if we have to send the CTCP request
- QString szFakeIp; // passive only : fake ip to send in the CTCP
- QString szFakePort; // passive only : fake port to send in the CTCP
+ TQString szFakeIp; // passive only : fake ip to send in the CTCP
+ TQString szFakePort; // passive only : fake port to send in the CTCP
bool bDoTimeout; // the marshall has to setup a timeout ?
@@ -116,11 +116,11 @@ public:
// DCC SEND/RECV
- QString szFileName; // RECVFILE: incoming file name, SENDFILE: filename sent to the remote end
- QString szFileSize; // RECVFILE: incoming file size, SENDFILE: remote resume size
+ TQString szFileName; // RECVFILE: incoming file name, SENDFILE: filename sent to the remote end
+ TQString szFileSize; // RECVFILE: incoming file size, SENDFILE: remote resume size
- QString szLocalFileName; // RECVFILE: save file name selected, SENDFILE: file to send
- QString szLocalFileSize; // RECVFILE: local file size (to resume), SENDFILE: file to send size
+ TQString szLocalFileName; // RECVFILE: save file name selected, SENDFILE: file to send
+ TQString szLocalFileSize; // RECVFILE: local file size (to resume), SENDFILE: file to send size
bool bRecvFile; // do we have to RECEIVE the file or SEND it ?
@@ -134,23 +134,23 @@ public:
KviStr szCodec; // codec name
int iSampleRate; // Sample rate
public:
- // new interface... but should be converted to QString...
- QString protocol(){ return szType; };
+ // new interface... but should be converted to TQString...
+ TQString protocol(){ return szType; };
bool isActive(){ return bActive; };
- QString remoteNick(){ return szNick; };
- QString remoteUser(){ return szUser; };
- QString remoteHost(){ return szHost; };
- QString remoteIp(){ return szIp; };
- QString remotePort(){ return szPort; };
- QString remoteFileName(){ return szFileName; };
- QString remoteFileSize(){ return szFileSize; };
- QString localNick(){ return szLocalNick; };
- QString localUser(){ return szLocalUser; };
- QString localHost(){ return szLocalHost; };
- QString localIp(){ return szIp; };
- QString localPort(){ return szPort; };
- QString localFileName(){ return szLocalFileName; };
- QString localFileSize(){ return szLocalFileSize; };
+ TQString remoteNick(){ return szNick; };
+ TQString remoteUser(){ return szUser; };
+ TQString remoteHost(){ return szHost; };
+ TQString remoteIp(){ return szIp; };
+ TQString remotePort(){ return szPort; };
+ TQString remoteFileName(){ return szFileName; };
+ TQString remoteFileSize(){ return szFileSize; };
+ TQString localNick(){ return szLocalNick; };
+ TQString localUser(){ return szLocalUser; };
+ TQString localHost(){ return szLocalHost; };
+ TQString localIp(){ return szIp; };
+ TQString localPort(){ return szPort; };
+ TQString localFileName(){ return szLocalFileName; };
+ TQString localFileSize(){ return szLocalFileSize; };
bool isFileUpload();
bool isFileDownload();
bool isDccChat();
diff --git a/src/modules/dcc/dialogs.cpp b/src/modules/dcc/dialogs.cpp
index 0ec0afba..89435202 100644
--- a/src/modules/dcc/dialogs.cpp
+++ b/src/modules/dcc/dialogs.cpp
@@ -25,12 +25,12 @@
#include "kvi_iconmanager.h"
#include "kvi_app.h"
-#include <qlayout.h>
-#include <qpushbutton.h>
-#include <qlabel.h>
-#include <qstringlist.h>
-#include <qevent.h>
-#include <qdesktopwidget.h>
+#include <tqlayout.h>
+#include <tqpushbutton.h>
+#include <tqlabel.h>
+#include <tqstringlist.h>
+#include <tqevent.h>
+#include <tqdesktopwidget.h>
KviDccBox::KviDccBox(KviDccBroker * br,KviDccDescriptor * dcc)
{
@@ -50,24 +50,24 @@ void KviDccBox::forgetDescriptor()
m_pDescriptor = 0;
}
-KviDccAcceptBox::KviDccAcceptBox(KviDccBroker * br,KviDccDescriptor * dcc,const QString &text,const QString &capt)
-: QWidget(0,"dcc_accept_box") , KviDccBox(br,dcc)
+KviDccAcceptBox::KviDccAcceptBox(KviDccBroker * br,KviDccDescriptor * dcc,const TQString &text,const TQString &capt)
+: TQWidget(0,"dcc_accept_box") , KviDccBox(br,dcc)
{
- QVBoxLayout * vb = new QVBoxLayout(this,4,4);
- QLabel * l = new QLabel(text,this);
+ TQVBoxLayout * vb = new TQVBoxLayout(this,4,4);
+ TQLabel * l = new TQLabel(text,this);
#ifdef COMPILE_USE_QT4
l->setWordWrap(true);
#endif
vb->addWidget(l);
- QHBoxLayout *hb = new QHBoxLayout(4);
- vb->addLayout(hb,Qt::AlignCenter);
- QPushButton * btn = new QPushButton(__tr2qs_ctx("&Accept","dcc"),this);
+ TQHBoxLayout *hb = new TQHBoxLayout(4);
+ vb->addLayout(hb,TQt::AlignCenter);
+ TQPushButton * btn = new TQPushButton(__tr2qs_ctx("&Accept","dcc"),this);
btn->setDefault(true);
//btn->setFocus();
hb->addWidget(btn);
- connect(btn,SIGNAL(clicked()),this,SLOT(acceptClicked()));
- btn = new QPushButton(__tr2qs_ctx("&Reject","dcc"),this);
- connect(btn,SIGNAL(clicked()),this,SLOT(rejectClicked()));
+ connect(btn,TQT_SIGNAL(clicked()),this,TQT_SLOT(acceptClicked()));
+ btn = new TQPushButton(__tr2qs_ctx("&Reject","dcc"),this);
+ connect(btn,TQT_SIGNAL(clicked()),this,TQT_SLOT(rejectClicked()));
hb->addWidget(btn);
setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_DCCMSG)));
@@ -85,63 +85,63 @@ void KviDccAcceptBox::acceptClicked()
{
hide();
emit accepted(this,m_pDescriptor);
- g_pApp->collectGarbage(this);
+ g_pApp->collectGarbage(TQT_TQOBJECT(this));
}
void KviDccAcceptBox::rejectClicked()
{
hide();
emit rejected(this,m_pDescriptor);
- g_pApp->collectGarbage(this);
+ g_pApp->collectGarbage(TQT_TQOBJECT(this));
}
-void KviDccAcceptBox::closeEvent(QCloseEvent *e)
+void KviDccAcceptBox::closeEvent(TQCloseEvent *e)
{
hide();
e->ignore();
emit rejected(this,m_pDescriptor);
- g_pApp->collectGarbage(this);
+ g_pApp->collectGarbage(TQT_TQOBJECT(this));
}
-void KviDccAcceptBox::showEvent(QShowEvent *e)
+void KviDccAcceptBox::showEvent(TQShowEvent *e)
{
move((g_pApp->desktop()->width() - width()) >> 1,
(g_pApp->desktop()->height() - height()) >> 1);
- QWidget::showEvent(e);
+ TQWidget::showEvent(e);
}
-KviDccRenameBox::KviDccRenameBox(KviDccBroker * br,KviDccDescriptor * dcc,const QString &text,bool bDisableResume)
-: QWidget(0,"dcc_rename_box") , KviDccBox(br,dcc)
+KviDccRenameBox::KviDccRenameBox(KviDccBroker * br,KviDccDescriptor * dcc,const TQString &text,bool bDisableResume)
+: TQWidget(0,"dcc_rename_box") , KviDccBox(br,dcc)
{
- QVBoxLayout * vb = new QVBoxLayout(this,4,4);
- QLabel * l = new QLabel(text,this);
+ TQVBoxLayout * vb = new TQVBoxLayout(this,4,4);
+ TQLabel * l = new TQLabel(text,this);
#ifdef COMPILE_USE_QT4
l->setWordWrap(true);
#endif
vb->addWidget(l);
- QHBoxLayout *hb = new QHBoxLayout(4);
- vb->addLayout(hb,Qt::AlignCenter);
+ TQHBoxLayout *hb = new TQHBoxLayout(4);
+ vb->addLayout(hb,TQt::AlignCenter);
- QPushButton * btn = new QPushButton(__tr2qs_ctx("&Rename","dcc"),this);
+ TQPushButton * btn = new TQPushButton(__tr2qs_ctx("&Rename","dcc"),this);
hb->addWidget(btn);
- connect(btn,SIGNAL(clicked()),this,SLOT(renameClicked()));
+ connect(btn,TQT_SIGNAL(clicked()),this,TQT_SLOT(renameClicked()));
- btn = new QPushButton(__tr2qs_ctx("Over&write","dcc"),this);
+ btn = new TQPushButton(__tr2qs_ctx("Over&write","dcc"),this);
hb->addWidget(btn);
- connect(btn,SIGNAL(clicked()),this,SLOT(overwriteClicked()));
+ connect(btn,TQT_SIGNAL(clicked()),this,TQT_SLOT(overwriteClicked()));
- btn = new QPushButton(__tr2qs_ctx("Re&sume","dcc"),this);
+ btn = new TQPushButton(__tr2qs_ctx("Re&sume","dcc"),this);
hb->addWidget(btn);
- connect(btn,SIGNAL(clicked()),this,SLOT(resumeClicked()));
+ connect(btn,TQT_SIGNAL(clicked()),this,TQT_SLOT(resumeClicked()));
if(bDisableResume)btn->setEnabled(false);
- btn = new QPushButton(__tr2qs_ctx("Cancel","dcc"),this);
+ btn = new TQPushButton(__tr2qs_ctx("Cancel","dcc"),this);
hb->addWidget(btn);
- connect(btn,SIGNAL(clicked()),this,SLOT(cancelClicked()));
+ connect(btn,TQT_SIGNAL(clicked()),this,TQT_SLOT(cancelClicked()));
btn->setDefault(true);
//btn->setFocus();
@@ -153,36 +153,36 @@ KviDccRenameBox::~KviDccRenameBox()
{
}
-void KviDccRenameBox::closeEvent(QCloseEvent *e)
+void KviDccRenameBox::closeEvent(TQCloseEvent *e)
{
hide();
e->ignore();
if(m_pDescriptor)
{
emit cancelSelected(this,m_pDescriptor);
- g_pApp->collectGarbage(this);
+ g_pApp->collectGarbage(TQT_TQOBJECT(this));
}
}
-void KviDccRenameBox::showEvent(QShowEvent *e)
+void KviDccRenameBox::showEvent(TQShowEvent *e)
{
move((g_pApp->desktop()->width() - width()) >> 1,
(g_pApp->desktop()->height() - height()) >> 1);
- QWidget::showEvent(e);
+ TQWidget::showEvent(e);
}
void KviDccRenameBox::renameClicked()
{
hide();
emit renameSelected(this,m_pDescriptor);
- g_pApp->collectGarbage(this);
+ g_pApp->collectGarbage(TQT_TQOBJECT(this));
}
void KviDccRenameBox::overwriteClicked()
{
hide();
emit overwriteSelected(this,m_pDescriptor);
- g_pApp->collectGarbage(this);
+ g_pApp->collectGarbage(TQT_TQOBJECT(this));
}
void KviDccRenameBox::resumeClicked()
@@ -190,14 +190,14 @@ void KviDccRenameBox::resumeClicked()
hide();
m_pDescriptor->bResume = true;
emit overwriteSelected(this,m_pDescriptor);
- g_pApp->collectGarbage(this);
+ g_pApp->collectGarbage(TQT_TQOBJECT(this));
}
void KviDccRenameBox::cancelClicked()
{
hide();
emit cancelSelected(this,m_pDescriptor);
- g_pApp->collectGarbage(this);
+ g_pApp->collectGarbage(TQT_TQOBJECT(this));
}
diff --git a/src/modules/dcc/dialogs.h b/src/modules/dcc/dialogs.h
index 805c0147..c241b109 100644
--- a/src/modules/dcc/dialogs.h
+++ b/src/modules/dcc/dialogs.h
@@ -23,7 +23,7 @@
//
-#include <qwidget.h>
+#include <tqwidget.h>
#include "kvi_filedialog.h"
#include "broker.h"
@@ -42,15 +42,16 @@ public:
-class KviDccAcceptBox : public QWidget , public KviDccBox
+class KviDccAcceptBox : public TQWidget , public KviDccBox
{
Q_OBJECT
+ TQ_OBJECT
public:
- KviDccAcceptBox(KviDccBroker * br,KviDccDescriptor * dcc,const QString &text,const QString &capt);
+ KviDccAcceptBox(KviDccBroker * br,KviDccDescriptor * dcc,const TQString &text,const TQString &capt);
~KviDccAcceptBox();
protected:
- virtual void closeEvent(QCloseEvent *e);
- virtual void showEvent(QShowEvent *e);
+ virtual void closeEvent(TQCloseEvent *e);
+ virtual void showEvent(TQShowEvent *e);
private slots:
void acceptClicked();
void rejectClicked();
@@ -59,15 +60,16 @@ signals:
void rejected(KviDccBox *,KviDccDescriptor *);
};
-class KviDccRenameBox : public QWidget , public KviDccBox
+class KviDccRenameBox : public TQWidget , public KviDccBox
{
Q_OBJECT
+ TQ_OBJECT
public:
- KviDccRenameBox(KviDccBroker * br,KviDccDescriptor * dcc,const QString &text,bool bDisableResume);
+ KviDccRenameBox(KviDccBroker * br,KviDccDescriptor * dcc,const TQString &text,bool bDisableResume);
~KviDccRenameBox();
protected:
- virtual void closeEvent(QCloseEvent *e);
- virtual void showEvent(QShowEvent *e);
+ virtual void closeEvent(TQCloseEvent *e);
+ virtual void showEvent(TQShowEvent *e);
private slots:
void renameClicked();
void overwriteClicked();
diff --git a/src/modules/dcc/libkvidcc.cpp b/src/modules/dcc/libkvidcc.cpp
index 717f568d..50717e77 100644
--- a/src/modules/dcc/libkvidcc.cpp
+++ b/src/modules/dcc/libkvidcc.cpp
@@ -48,7 +48,7 @@
#include "send.h"
#include "window.h"
-#include <qfileinfo.h>
+#include <tqfileinfo.h>
#ifdef COMPILE_ON_WINDOWS
// Ugly Windoze compiler...
@@ -73,9 +73,9 @@ static void dcc_module_set_dcc_type(KviDccDescriptor * d,const char * szBaseType
static bool dcc_kvs_parse_default_parameters(KviDccDescriptor * d,KviKvsModuleCommandCall *c)
{
- d->bIsTdcc = c->switches()->find('t',"tdcc");
+ d->bIsTdcc = c->switches()->tqfind('t',"tdcc");
- KviKvsVariant * pSw = c->switches()->find('m',"minimize");
+ KviKvsVariant * pSw = c->switches()->tqfind('m',"minimize");
if(pSw != 0)
d->bOverrideMinimize = pSw->asBoolean();
@@ -85,7 +85,7 @@ static bool dcc_kvs_parse_default_parameters(KviDccDescriptor * d,KviKvsModuleCo
if(!d->console())
{
// We don't need a console with -c and -n , otherwise we need it
- if(!(c->switches()->find('c',"connect") || c->switches()->find('n',"no-ctcp")))
+ if(!(c->switches()->tqfind('c',"connect") || c->switches()->tqfind('n',"no-ctcp")))
{
delete d;
c->error(__tr2qs_ctx("This window has no associated IRC context (an IRC context is required unless -c or -n are passed)","dcc"));
@@ -98,7 +98,7 @@ static bool dcc_kvs_parse_default_parameters(KviDccDescriptor * d,KviKvsModuleCo
if(!d->console()->isConnected())
{
// We don't need a connection with -c and -n , otherwise we need it
- if(!(c->switches()->find('c',"connect") || c->switches()->find('n',"no-ctcp")))
+ if(!(c->switches()->tqfind('c',"connect") || c->switches()->tqfind('n',"no-ctcp")))
{
delete d;
c->error(__tr2qs_ctx("You're not connected to a server (an active connection is required unless -c or -n are passed)","dcc"));
@@ -118,10 +118,10 @@ static bool dcc_kvs_parse_default_parameters(KviDccDescriptor * d,KviKvsModuleCo
d->szLocalHost = d->console()->connection()->userInfo()->hostName();
}
- if(pSw = c->switches()->find('i',"ip"))
+ if(pSw = c->switches()->tqfind('i',"ip"))
{
pSw->asString(d->szListenIp);
- if(!(d->szListenIp.contains('.') || d->szListenIp.contains(':')))
+ if(!(d->szListenIp.tqcontains('.') || d->szListenIp.tqcontains(':')))
{
// This will magically work with the same buffer as source and dst!
if(!KviNetUtils::getInterfaceAddress(d->szListenIp,d->szListenIp))
@@ -132,7 +132,7 @@ static bool dcc_kvs_parse_default_parameters(KviDccDescriptor * d,KviKvsModuleCo
}
}
} else {
- QString tmp;
+ TQString tmp;
if(!dcc_kvs_get_listen_ip_address(c,d->console(),tmp))
{
delete d;
@@ -142,13 +142,13 @@ static bool dcc_kvs_parse_default_parameters(KviDccDescriptor * d,KviKvsModuleCo
d->szListenIp=tmp;
}
- if(pSw = c->switches()->find('p',"port"))
+ if(pSw = c->switches()->tqfind('p',"port"))
{
pSw->asString(d->szListenPort); // fixme!
}
else d->szListenPort = "0"; // any port is ok
- if(pSw = c->switches()->find('a',"fake-address"))
+ if(pSw = c->switches()->tqfind('a',"fake-address"))
{
pSw->asString(d->szFakeIp);
}
@@ -160,16 +160,16 @@ static bool dcc_kvs_parse_default_parameters(KviDccDescriptor * d,KviKvsModuleCo
}
}
- if(pSw = c->switches()->find('f',"fake-port"))
+ if(pSw = c->switches()->tqfind('f',"fake-port"))
{
pSw->asString(d->szFakePort);
}
- d->bDoTimeout = (!c->switches()->find('u',"unlimited"));
+ d->bDoTimeout = (!c->switches()->tqfind('u',"unlimited"));
#ifdef COMPILE_SSL_SUPPORT
- d->bIsSSL = c->switches()->find('s',"ssl");
+ d->bIsSSL = c->switches()->tqfind('s',"ssl");
#else
- if(c->switches()->find('s',"ssl"))c->warning(__tr2qs_ctx("This executable was built without SSL support, -s switch ignored","dcc"));
+ if(c->switches()->tqfind('s',"ssl"))c->warning(__tr2qs_ctx("This executable was built without SSL support, -s switch ignored","dcc"));
#endif
return true;
@@ -397,7 +397,7 @@ static bool dcc_kvs_parse_default_parameters(KviDccDescriptor * d,KviKvsModuleCo
static bool dcc_kvs_cmd_chat(KviKvsModuleCommandCall * c)
{
- QString szTarget;
+ TQString szTarget;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("target",KVS_PT_NONEMPTYSTRING,0,szTarget)
KVSM_PARAMETERS_END(c)
@@ -411,7 +411,7 @@ static bool dcc_kvs_cmd_chat(KviKvsModuleCommandCall * c)
if(!dcc_kvs_parse_default_parameters(d,c))return false;
dcc_module_set_dcc_type(d,"CHAT");
- if(c->switches()->find('z',"zero-port"))
+ if(c->switches()->tqfind('z',"zero-port"))
{
// we want to have it reversed... add a tag and send out the request
KviDccZeroPortTag * t = g_pDccBroker->addZeroPortTag();
@@ -426,9 +426,9 @@ static bool dcc_kvs_cmd_chat(KviKvsModuleCommandCall * c)
return true;
}
- if(c->switches()->find('c',"connect"))
+ if(c->switches()->tqfind('c',"connect"))
{
- if(!(c->switches()->find('i',"ip") && c->switches()->find('p',"port")))
+ if(!(c->switches()->tqfind('i',"ip") && c->switches()->tqfind('p',"port")))
{
delete d;
c->error(__tr2qs_ctx("-c requires -i and -p","dcc"));
@@ -443,7 +443,7 @@ static bool dcc_kvs_cmd_chat(KviKvsModuleCommandCall * c)
d->szIp = __tr2qs_ctx("unknown","dcc");
d->szPort = d->szIp;
d->bActive = false;
- d->bSendRequest = !c->switches()->find('n',"no-ctcp");
+ d->bSendRequest = !c->switches()->tqfind('n',"no-ctcp");
}
//c->window()->output(0,"%Q %Q %Q",&(d->szIp),&(d->szPort),&(d->szListenIp));
@@ -605,7 +605,7 @@ static bool dcc_kvs_cmd_chat(KviKvsModuleCommandCall * c)
static bool dcc_kvs_cmd_send(KviKvsModuleCommandCall * c)
{
- QString szTarget,szFileName;
+ TQString szTarget,szFileName;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("target",KVS_PT_NONEMPTYSTRING,0,szTarget)
KVSM_PARAMETER("file name",KVS_PT_NONEMPTYSTRING,KVS_PF_OPTIONAL,szFileName)
@@ -615,12 +615,12 @@ static bool dcc_kvs_cmd_send(KviKvsModuleCommandCall * c)
d->szNick = szTarget; // we always specify the nickname
- QString szTmp;
+ TQString szTmp;
KviKvsVariant * pSw = 0;
- if(pSw = c->switches()->find('g',"get"))
+ if(pSw = c->switches()->tqfind('g',"get"))
{
- d->szFileName = QFileInfo(szFileName).fileName();
+ d->szFileName = TQFileInfo(szFileName).fileName();
if(!pSw->isBoolean())
{
@@ -642,16 +642,16 @@ static bool dcc_kvs_cmd_send(KviKvsModuleCommandCall * c)
d->szUser = __tr2qs_ctx("unknown","dcc"); // username is always unknown
d->szHost = d->szUser; // host is always unknown
d->bRecvFile = pSw != 0;
- d->bNoAcks = c->switches()->find('b',"blind") || c->switches()->find('t',"tdcc");
+ d->bNoAcks = c->switches()->tqfind('b',"blind") || c->switches()->tqfind('t',"tdcc");
d->bResume = false;
d->bAutoAccept = pSw != 0;
d->bIsIncomingAvatar = false;
if(!dcc_kvs_parse_default_parameters(d,c))return false;
- if(c->switches()->find('c',"connect"))
+ if(c->switches()->tqfind('c',"connect"))
{
- if(!(c->switches()->find('i',"ip") && c->switches()->find('p',"port")))
+ if(!(c->switches()->tqfind('i',"ip") && c->switches()->tqfind('p',"port")))
{
delete d;
c->error(__tr2qs_ctx("-c requires -i and -p","dcc"));
@@ -666,10 +666,10 @@ static bool dcc_kvs_cmd_send(KviKvsModuleCommandCall * c)
d->szIp = __tr2qs_ctx("unknown","dcc");
d->szPort = d->szIp;
d->bActive = false;
- d->bSendRequest = !c->switches()->find('n',"no-ctcp");
+ d->bSendRequest = !c->switches()->tqfind('n',"no-ctcp");
}
- if(c->switches()->find('g',"get"))
+ if(c->switches()->tqfind('g',"get"))
{
dcc_module_set_dcc_type(d,"RECV");
d->triggerCreationEvent();
@@ -790,7 +790,7 @@ static bool dcc_kvs_cmd_send(KviKvsModuleCommandCall * c)
static bool dcc_kvs_cmd_recv(KviKvsModuleCommandCall * c)
{
- QString szTarget,szFileName;
+ TQString szTarget,szFileName;
kvs_uint_t uSize;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("target",KVS_PT_NONEMPTYSTRING,0,szTarget)
@@ -815,8 +815,8 @@ static bool dcc_kvs_cmd_recv(KviKvsModuleCommandCall * c)
d->bActive = false; // we have to listen!
d->bResume = false;
d->bRecvFile = true; // we have to receive the file!
- d->bSendRequest = !c->switches()->find('n',"no-ctcp");
- d->bNoAcks = d->bIsTdcc || c->switches()->find('b',"blind");
+ d->bSendRequest = !c->switches()->tqfind('n',"no-ctcp");
+ d->bNoAcks = d->bIsTdcc || c->switches()->tqfind('b',"blind");
d->bAutoAccept = KVI_OPTION_BOOL(KviOption_boolAutoAcceptDccSend);
d->bIsIncomingAvatar = g_pApp->findPendingAvatarChange(d->console(),d->szNick,d->szFileName);
@@ -862,7 +862,7 @@ static bool dcc_kvs_cmd_recv(KviKvsModuleCommandCall * c)
The remote end may acknowledge the request by sending a DCC RECV request.
This command effects are similar to [cmd]dcc.send[/cmd], but will work also on machines
that can't accept incoming connections (firewalling or masquerading problems).[br]
- A 120 seconds file offer is added for the specified file and mask "<nickname>!*@*".
+ A 120 seconds file offer is added for the specified file and tqmask "<nickname>!*@*".
@examples:
*/
@@ -872,25 +872,25 @@ static bool dcc_kvs_cmd_recv(KviKvsModuleCommandCall * c)
static bool dcc_kvs_cmd_rsend(KviKvsModuleCommandCall * c)
{
- QString szTarget,szFileName;
+ TQString szTarget,szFileName;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("target",KVS_PT_NONEMPTYSTRING,0,szTarget)
KVSM_PARAMETER("filename",KVS_PT_NONEMPTYSTRING,KVS_PF_OPTIONAL,szFileName)
KVSM_PARAMETERS_END(c)
- KVSM_REQUIRE_CONNECTION(c)
+ KVSM_RETQUIRE_CONNECTION(c)
KviDccDescriptor * d = new KviDccDescriptor(c->window()->console());
d->szNick = szTarget;
d->szLocalFileName = szFileName;
- d->bIsTdcc = c->switches()->find('t',"tdcc");
+ d->bIsTdcc = c->switches()->tqfind('t',"tdcc");
#ifdef COMPILE_SSL_SUPPORT
- d->bIsSSL = c->switches()->find('s',"ssl");
+ d->bIsSSL = c->switches()->tqfind('s',"ssl");
#else
- if(c->switches()->find('s',"ssl"))c->warning(__tr2qs_ctx("This executable has been built without SSL support, -s switch ignored","dcc"));
+ if(c->switches()->tqfind('s',"ssl"))c->warning(__tr2qs_ctx("This executable has been built without SSL support, -s switch ignored","dcc"));
#endif //!COMPILE_SSL_SUPPORT
- if(c->switches()->find('z',"zero-port"))
+ if(c->switches()->tqfind('z',"zero-port"))
{
dcc_module_set_dcc_type(d,"SEND");
d->setZeroPortRequestTag("nonempty"); // just to tag it
@@ -935,7 +935,7 @@ static bool dcc_kvs_cmd_rsend(KviKvsModuleCommandCall * c)
static bool dcc_kvs_cmd_get(KviKvsModuleCommandCall * c)
{
- QString szTarget,szFileName;
+ TQString szTarget,szFileName;
kvs_uint_t uSize;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("target",KVS_PT_NONEMPTYSTRING,0,szTarget)
@@ -943,11 +943,11 @@ static bool dcc_kvs_cmd_get(KviKvsModuleCommandCall * c)
KVSM_PARAMETER("size",KVS_PT_UINT,KVS_PF_OPTIONAL,uSize)
KVSM_PARAMETERS_END(c)
- KVSM_REQUIRE_CONNECTION(c)
+ KVSM_RETQUIRE_CONNECTION(c)
- KviQString::cutToLast(szFileName,'/');
+ KviTQString::cutToLast(szFileName,'/');
- if(szFileName.contains(' '))
+ if(szFileName.tqcontains(' '))
{
szFileName.prepend('"');
szFileName.append('"');
@@ -955,11 +955,11 @@ static bool dcc_kvs_cmd_get(KviKvsModuleCommandCall * c)
KviStr szDCC("GET");
#ifdef COMPILE_SSL_SUPPORT
- if(c->switches()->find('s',"ssl"))szDCC.prepend('S');
+ if(c->switches()->tqfind('s',"ssl"))szDCC.prepend('S');
#else
- if(c->switches()->find('s',"ssl"))c->warning(__tr2qs_ctx("This executable has no SSL support, -s switch ignored","dcc"));
+ if(c->switches()->tqfind('s',"ssl"))c->warning(__tr2qs_ctx("This executable has no SSL support, -s switch ignored","dcc"));
#endif
- if(c->switches()->find('t',"tdcc"))szDCC.prepend('T');
+ if(c->switches()->tqfind('t',"tdcc"))szDCC.prepend('T');
if(uSize == 0)
{
@@ -1105,7 +1105,7 @@ static bool dcc_kvs_cmd_get(KviKvsModuleCommandCall * c)
static bool dcc_kvs_cmd_voice(KviKvsModuleCommandCall * c)
{
- QString szTarget;
+ TQString szTarget;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("target",KVS_PT_NONEMPTYSTRING,0,szTarget)
KVSM_PARAMETERS_END(c)
@@ -1124,7 +1124,7 @@ static bool dcc_kvs_cmd_voice(KviKvsModuleCommandCall * c)
if(!dcc_kvs_parse_default_parameters(d,c))return false;
- if(KviKvsVariant * pSR = c->switches()->find('h',"sample-rate"))
+ if(KviKvsVariant * pSR = c->switches()->tqfind('h',"sample-rate"))
{
kvs_int_t iSR;
if(!pSR->asInteger(iSR))
@@ -1138,9 +1138,9 @@ static bool dcc_kvs_cmd_voice(KviKvsModuleCommandCall * c)
d->szCodec = "adpcm";
- if(KviKvsVariant * pCodec = c->switches()->find('g',"codec"))
+ if(KviKvsVariant * pCodec = c->switches()->tqfind('g',"codec"))
{
- QString szCodec;
+ TQString szCodec;
pCodec->asString(szCodec);
if(!kvi_dcc_voice_is_valid_codec(szCodec))
@@ -1151,9 +1151,9 @@ static bool dcc_kvs_cmd_voice(KviKvsModuleCommandCall * c)
}
dcc_module_set_dcc_type(d,"VOICE");
- if(c->switches()->find('c',"connect"))
+ if(c->switches()->tqfind('c',"connect"))
{
- if(!(c->switches()->find('i',"ip") && c->switches()->find('p',"port")))
+ if(!(c->switches()->tqfind('i',"ip") && c->switches()->tqfind('p',"port")))
{
delete d;
c->error(__tr2qs_ctx("-c requires -i and -p","dcc"));
@@ -1171,7 +1171,7 @@ static bool dcc_kvs_cmd_voice(KviKvsModuleCommandCall * c)
d->szIp = __tr2qs_ctx("unknown","dcc");
d->szPort = d->szIp;
d->bActive = false;
- d->bSendRequest = !(c->switches()->find('n',"no-ctcp"));
+ d->bSendRequest = !(c->switches()->tqfind('n',"no-ctcp"));
d->triggerCreationEvent();
g_pDccBroker->passiveVoiceExecute(d);
@@ -1244,7 +1244,7 @@ static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c)
if(c->hasSwitch('i'))
{
c->getSwitchValue('i',d->szListenIp);
- if(!(d->szListenIp.contains('.') || d->szListenIp.contains(':')))
+ if(!(d->szListenIp.tqcontains('.') || d->szListenIp.tqcontains(':')))
{
// This will magically work with the same buffer as source and dst!
if(!kvi_getInterfaceAddress(d->szListenIp.ptr(),d->szListenIp))
@@ -1543,8 +1543,8 @@ static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c)
[br]
[big]DCC File Transfer[/big][br]
DCC Send: Send a file, sender is passive, receiver is active (not good for firewalled senders)[br]
- DCC Recv: Receive a file, sender is active, receiver is passive (not good for firewalled receivers)[br]
- DCC RSend: Send a file, sender is active, receiver is passive (not good for firewalled receivers)[br]
+ DCC Recv: Receive a file, sender is active, receiver is passive (not good for firewalled tqreceivers)[br]
+ DCC RSend: Send a file, sender is active, receiver is passive (not good for firewalled tqreceivers)[br]
DCC Get: Receive a file, sender is passive if not firewalled, receiver active if sender not firewalled (will fail only if both are firewalled)[br]
The "turbo" extension disables the stream of acknowledges and is activated by prepending the 'T' character to the DCC subprotocol name[br]
The "SSL" extension causes a Secure Socket Layer to be used and is activated by prepending the 'S' character to the DCC subprotocol name[br]
@@ -1577,7 +1577,7 @@ static KviDccDescriptor * dcc_kvs_find_dcc_descriptor(const kvs_uint_t &uId,KviK
c->warning(__tr2qs_ctx("The current window has no associated DCC session","dcc"));
return dcc;
}
- dcc = KviDccDescriptor::find(uId);
+ dcc = KviDccDescriptor::tqfind(uId);
if((!dcc) && bWarn)
c->warning(__tr2qs_ctx("The specified parameter is not a valid DCC identifier","dcc"));
return dcc;
@@ -1615,7 +1615,7 @@ static bool dcc_kvs_cmd_abort(KviKvsModuleCommandCall * c)
KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId)
KVSM_PARAMETERS_END(c)
- KviDccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c,!c->switches()->find('q',"quiet"));
+ KviDccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c,!c->switches()->tqfind('q',"quiet"));
if(dcc)
{
@@ -1655,11 +1655,11 @@ static bool dcc_kvs_cmd_setBandwidthLimit(KviKvsModuleCommandCall * c)
KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId)
KVSM_PARAMETERS_END(c)
- KviDccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c,!c->switches()->find('q',"quiet"));
+ KviDccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c,!c->switches()->tqfind('q',"quiet"));
if(dcc)
{
if (dcc->transfer())dcc->transfer()->setBandwidthLimit(uVal);
- else if (!c->switches()->find('q',"quiet"))c->warning(__tr2qs_ctx("This DCC session is not a DCC transfer session","dcc"));
+ else if (!c->switches()->tqfind('q',"quiet"))c->warning(__tr2qs_ctx("This DCC session is not a DCC transfer session","dcc"));
}
return true;
}
@@ -2082,7 +2082,7 @@ static bool dcc_kvs_fnc_localFileSize(KviKvsModuleFunctionCall * c)
KviDccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c);
- if(dcc)c->returnValue()->setString(dcc->localFileSize().isEmpty() ? QString("0") : dcc->localFileSize());
+ if(dcc)c->returnValue()->setString(dcc->localFileSize().isEmpty() ? TQString("0") : dcc->localFileSize());
return true;
}
@@ -2324,7 +2324,7 @@ static bool dcc_kvs_fnc_remoteFileSize(KviKvsModuleFunctionCall * c)
KviDccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c);
- if(dcc)c->returnValue()->setString(dcc->remoteFileSize().isEmpty() ? QString("0") : dcc->remoteFileSize());
+ if(dcc)c->returnValue()->setString(dcc->remoteFileSize().isEmpty() ? TQString("0") : dcc->remoteFileSize());
return true;
}
@@ -2369,16 +2369,16 @@ static bool dcc_kvs_fnc_ircContext(KviKvsModuleFunctionCall * c)
/*
- @doc: dcc.transferStatus
+ @doc: dcc.transfertqStatus
@type:
function
@title:
- $dcc.transferStatus
+ $dcc.transfertqStatus
@short:
Returns the current status of a dcc file transfer
@syntax:
- <string> $dcc.transferStatus
- <string> $dcc.transferStatus(<dcc_id:uint>)
+ <string> $dcc.transfertqStatus
+ <string> $dcc.transfertqStatus(<dcc_id:uint>)
@description:
Returns the status in the specified DCC session.[br]
The status is one of the strings "connecting", "transferring", "success" and "failure".
@@ -2393,7 +2393,7 @@ static bool dcc_kvs_fnc_ircContext(KviKvsModuleFunctionCall * c)
See the [module:dcc]dcc module[/module] documentation for more informations.[br]
*/
-static bool dcc_kvs_fnc_transferStatus(KviKvsModuleFunctionCall * c)
+static bool dcc_kvs_fnc_transfertqStatus(KviKvsModuleFunctionCall * c)
{
kvs_uint_t uDccId;
KVSM_PARAMETERS_BEGIN(c)
@@ -2406,7 +2406,7 @@ static bool dcc_kvs_fnc_transferStatus(KviKvsModuleFunctionCall * c)
{
if(dcc->transfer())
{
- QString tmp;
+ TQString tmp;
dcc->transfer()->fillStatusString(tmp);
c->returnValue()->setString(tmp);
}
@@ -2527,7 +2527,7 @@ static bool dcc_kvs_fnc_averageSpeed(KviKvsModuleFunctionCall * c)
static bool dcc_kvs_fnc_session(KviKvsModuleFunctionCall * c)
{
- QString szWinId;
+ TQString szWinId;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("window_id",KVS_PT_STRING,KVS_PF_OPTIONAL,szWinId)
KVSM_PARAMETERS_END(c)
@@ -2590,7 +2590,7 @@ static bool dcc_kvs_fnc_session(KviKvsModuleFunctionCall * c)
static bool dcc_kvs_fnc_sessionList(KviKvsModuleFunctionCall * c)
{
- QString szFlags;
+ TQString szFlags;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("filter",KVS_PT_STRING,KVS_PF_OPTIONAL,szFlags)
KVSM_PARAMETERS_END(c)
@@ -2614,9 +2614,9 @@ static bool dcc_kvs_fnc_sessionList(KviKvsModuleFunctionCall * c)
++it;
}
} else {
- bool bWantFileUploads = szFlags.find('u',false) != -1;
- bool bWantFileDownloads = szFlags.contains('d',false) != -1;
- bool bWantChats = szFlags.contains('c',false) != -1;
+ bool bWantFileUploads = szFlags.tqfind('u',false) != -1;
+ bool bWantFileDownloads = szFlags.tqcontains('d',false) != -1;
+ bool bWantChats = szFlags.tqcontains('c',false) != -1;
while(KviDccDescriptor * dcc = it.current())
{
@@ -2669,7 +2669,7 @@ static bool dcc_kvs_fnc_sessionList(KviKvsModuleFunctionCall * c)
[fnc]$dcc.sessionList[/fnc][br]
[fnc]$dcc.protocol[/fnc][br]
[fnc]$dcc.connectionType[/fnc][br]
- [fnc]$dcc.transferStatus[/fnc][br]
+ [fnc]$dcc.transfertqStatus[/fnc][br]
[fnc]$dcc.isFileTransfer[/fnc][br]
[fnc]$dcc.isFileUpload[/fnc][br]
[fnc]$dcc.isFileDownload[/fnc][br]
@@ -2708,7 +2708,7 @@ static bool dcc_module_init(KviModule * m)
// FIXME: file upload / download state ?
- KVSM_REGISTER_FUNCTION(m,"transferStatus",dcc_kvs_fnc_transferStatus);
+ KVSM_REGISTER_FUNCTION(m,"transfertqStatus",dcc_kvs_fnc_transfertqStatus);
KVSM_REGISTER_FUNCTION(m,"protocol",dcc_kvs_fnc_protocol);
KVSM_REGISTER_FUNCTION(m,"connectionType",dcc_kvs_fnc_connectionType);
KVSM_REGISTER_FUNCTION(m,"isFileTransfer",dcc_kvs_fnc_isFileTransfer);
diff --git a/src/modules/dcc/marshal.cpp b/src/modules/dcc/marshal.cpp
index 9aedec41..6d69dccf 100644
--- a/src/modules/dcc/marshal.cpp
+++ b/src/modules/dcc/marshal.cpp
@@ -38,7 +38,7 @@
KviDccMarshal::KviDccMarshal(KviDccMarshalOutputContext * ctx)
-: QObject(0,"dcc_marshal")
+: TQObject(0,"dcc_marshal")
{
m_pSn = 0;
m_fd = KVI_INVALID_SOCKET;
@@ -104,7 +104,7 @@ void KviDccMarshal::reset()
m_bIpV6 = false;
}
-int KviDccMarshal::dccListen(const QString &ip,const QString &port,bool bUseTimeout,bool bUseSSL)
+int KviDccMarshal::dccListen(const TQString &ip,const TQString &port,bool bUseTimeout,bool bUseSSL)
{
if(m_fd != KVI_INVALID_SOCKET)return KviError_anotherConnectionInProgress;
@@ -122,8 +122,8 @@ int KviDccMarshal::dccListen(const QString &ip,const QString &port,bool bUseTime
#endif
if(m_pTimeoutTimer)delete m_pTimeoutTimer;
- m_pTimeoutTimer = new QTimer();
- connect(m_pTimeoutTimer,SIGNAL(timeout()),this,SLOT(doListen()));
+ m_pTimeoutTimer = new TQTimer();
+ connect(m_pTimeoutTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(doListen()));
m_pTimeoutTimer->start(100,true);
return KviError_success;
@@ -276,8 +276,8 @@ void KviDccMarshal::doListen()
}
// and setup the READ notifier...
- m_pSn = new QSocketNotifier(m_fd,QSocketNotifier::Read);
- QObject::connect(m_pSn,SIGNAL(activated(int)),this,SLOT(snActivated(int)));
+ m_pSn = new TQSocketNotifier(m_fd,TQSocketNotifier::Read);
+ TQObject::connect(m_pSn,TQT_SIGNAL(activated(int)),this,TQT_SLOT(snActivated(int)));
m_pSn->setEnabled(true);
// set the timer
@@ -286,8 +286,8 @@ void KviDccMarshal::doListen()
if(m_bUseTimeout)
{
- m_pTimeoutTimer = new QTimer();
- connect(m_pTimeoutTimer,SIGNAL(timeout()),this,SLOT(connectionTimedOut()));
+ m_pTimeoutTimer = new TQTimer();
+ connect(m_pTimeoutTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(connectionTimedOut()));
m_pTimeoutTimer->start(KVI_OPTION_UINT(KviOption_uintDccSocketTimeout) * 1000,true);
}
// and wait for connect
@@ -311,8 +311,8 @@ int KviDccMarshal::dccConnect(const char * ip,const char * port,bool bUseTimeout
#endif
if(m_pTimeoutTimer)delete m_pTimeoutTimer;
- m_pTimeoutTimer = new QTimer();
- connect(m_pTimeoutTimer,SIGNAL(timeout()),this,SLOT(doConnect()));
+ m_pTimeoutTimer = new TQTimer();
+ connect(m_pTimeoutTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(doConnect()));
m_pTimeoutTimer->start(100,true);
return KviError_success;
@@ -414,8 +414,8 @@ void KviDccMarshal::doConnect()
// and setup the WRITE notifier...
- m_pSn = new QSocketNotifier(m_fd,QSocketNotifier::Write);
- QObject::connect(m_pSn,SIGNAL(activated(int)),this,SLOT(snActivated(int)));
+ m_pSn = new TQSocketNotifier(m_fd,TQSocketNotifier::Write);
+ TQObject::connect(m_pSn,TQT_SIGNAL(activated(int)),this,TQT_SLOT(snActivated(int)));
m_pSn->setEnabled(true);
// set the timer
@@ -424,8 +424,8 @@ void KviDccMarshal::doConnect()
if(m_bUseTimeout)
{
- m_pTimeoutTimer = new QTimer();
- connect(m_pTimeoutTimer,SIGNAL(timeout()),this,SLOT(connectionTimedOut()));
+ m_pTimeoutTimer = new TQTimer();
+ connect(m_pTimeoutTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(connectionTimedOut()));
m_pTimeoutTimer->start(KVI_OPTION_UINT(KviOption_uintDccSocketTimeout) * 1000,true);
}
@@ -586,13 +586,13 @@ void KviDccMarshal::doSSLHandshake(int)
// debug("CONNECTED EMITTED");
break;
case KviSSL::WantRead:
- m_pSn = new QSocketNotifier((int)m_fd,QSocketNotifier::Read);
- QObject::connect(m_pSn,SIGNAL(activated(int)),this,SLOT(doSSLHandshake(int)));
+ m_pSn = new TQSocketNotifier((int)m_fd,TQSocketNotifier::Read);
+ TQObject::connect(m_pSn,TQT_SIGNAL(activated(int)),this,TQT_SLOT(doSSLHandshake(int)));
m_pSn->setEnabled(true);
break;
case KviSSL::WantWrite:
- m_pSn = new QSocketNotifier((int)m_fd,QSocketNotifier::Write);
- QObject::connect(m_pSn,SIGNAL(activated(int)),this,SLOT(doSSLHandshake(int)));
+ m_pSn = new TQSocketNotifier((int)m_fd,TQSocketNotifier::Write);
+ TQObject::connect(m_pSn,TQT_SIGNAL(activated(int)),this,TQT_SLOT(doSSLHandshake(int)));
m_pSn->setEnabled(true);
break;
case KviSSL::RemoteEndClosedConnection:
@@ -606,8 +606,8 @@ void KviDccMarshal::doSSLHandshake(int)
if(kvi_socket_recoverableError(err))
{
// can recover ? (EAGAIN , EINTR ?)
- m_pSn = new QSocketNotifier((int)m_fd,QSocketNotifier::Write);
- QObject::connect(m_pSn,SIGNAL(activated(int)),this,SLOT(doSSLHandshake(int)));
+ m_pSn = new TQSocketNotifier((int)m_fd,TQSocketNotifier::Write);
+ TQObject::connect(m_pSn,TQT_SIGNAL(activated(int)),this,TQT_SLOT(doSSLHandshake(int)));
m_pSn->setEnabled(true);
return;
} else {
diff --git a/src/modules/dcc/marshal.h b/src/modules/dcc/marshal.h
index 9665e09a..7b915dea 100644
--- a/src/modules/dcc/marshal.h
+++ b/src/modules/dcc/marshal.h
@@ -24,9 +24,9 @@
#include "kvi_string.h"
#include "kvi_sockettype.h"
-#include <qobject.h>
-#include <qsocketnotifier.h>
-#include <qtimer.h>
+#include <tqobject.h>
+#include <tqsocketnotifier.h>
+#include <tqtimer.h>
#include "kvi_inttypes.h"
class KviWindow;
@@ -48,26 +48,27 @@ protected:
virtual const char * dccMarshalOutputContextString() = 0;
};
-class KviDccMarshal : public QObject
+class KviDccMarshal : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
KviDccMarshal(KviDccMarshalOutputContext * ctx);
~KviDccMarshal();
protected:
// DCC DESCRIPTOR
- QString m_szIp; // Dcc initiator ip address (the one that listens)
- QString m_szPort; // Dcc initiator port (the one that listens)
+ TQString m_szIp; // Dcc initiator ip address (the one that listens)
+ TQString m_szPort; // Dcc initiator port (the one that listens)
// other info
bool m_bIpV6; // Dcc mode
kvi_u32_t m_uPort; // Dcc initiator port
bool m_bOutgoing; // true if WE have connected to the remote host (so m_szIp is the remote host ip)
- QString m_szSecondaryIp; // Ip of the client that has connected to the remote host
- QString m_szSecondaryPort; // Port of the client that has connected to the remote host
+ TQString m_szSecondaryIp; // Ip of the client that has connected to the remote host
+ TQString m_szSecondaryPort; // Port of the client that has connected to the remote host
// internals
kvi_socket_t m_fd; // socket
- QSocketNotifier * m_pSn;
- QTimer * m_pTimeoutTimer;
+ TQSocketNotifier * m_pSn;
+ TQTimer * m_pTimeoutTimer;
bool m_bUseTimeout;
#ifdef COMPILE_SSL_SUPPORT
KviSSL * m_pSSL;
@@ -75,13 +76,13 @@ protected:
#endif
KviDccMarshalOutputContext * m_pOutputContext;
public:
- const QString & dccIp() const { return m_szIp; };
- const QString & dccPort() const { return m_szPort; };
- const QString & localIp() const { return m_bOutgoing ? m_szSecondaryIp : m_szIp; };
- const QString & localPort() const { return m_bOutgoing ? m_szSecondaryPort : m_szPort; };
- const QString & remoteIp() const { return m_bOutgoing ? m_szIp : m_szSecondaryIp; };
- const QString & remotePort() const { return m_bOutgoing ? m_szPort : m_szSecondaryPort; };
- int dccListen(const QString &ip,const QString &port,bool bUseTimeout,bool bUseSSL = false);
+ const TQString & dccIp() const { return m_szIp; };
+ const TQString & dccPort() const { return m_szPort; };
+ const TQString & localIp() const { return m_bOutgoing ? m_szSecondaryIp : m_szIp; };
+ const TQString & localPort() const { return m_bOutgoing ? m_szSecondaryPort : m_szPort; };
+ const TQString & remoteIp() const { return m_bOutgoing ? m_szIp : m_szSecondaryIp; };
+ const TQString & remotePort() const { return m_bOutgoing ? m_szPort : m_szSecondaryPort; };
+ int dccListen(const TQString &ip,const TQString &port,bool bUseTimeout,bool bUseSSL = false);
int dccConnect(const char * ip,const char * port,bool bUseTimeout,bool bUseSSL = false);
kvi_socket_t releaseSocket();
#ifdef COMPILE_SSL_SUPPORT
diff --git a/src/modules/dcc/requests.cpp b/src/modules/dcc/requests.cpp
index e1e18143..29e6b424 100644
--- a/src/modules/dcc/requests.cpp
+++ b/src/modules/dcc/requests.cpp
@@ -50,7 +50,7 @@
#include "utils.h"
#include "send.h"
-#include <qfileinfo.h>
+#include <tqfileinfo.h>
#ifdef COMPILE_ON_WINDOWS
// Ugly Windoze compiler...
@@ -62,7 +62,7 @@
extern KVIRC_API KviSharedFilesManager * g_pSharedFilesManager;
extern KviDccBroker * g_pDccBroker;
-static void dcc_module_reply_errmsg(KviDccRequest * dcc,const QString& errText)
+static void dcc_module_reply_errmsg(KviDccRequest * dcc,const TQString& errText)
{
dcc->ctcpMsg->msg->console()->connection()->sendFmtData(
"NOTICE %s :%cERRMSG %s%c",
@@ -71,7 +71,7 @@ static void dcc_module_reply_errmsg(KviDccRequest * dcc,const QString& errText)
,0x01);
}
-static void dcc_module_request_error(KviDccRequest * dcc,const QString& errText)
+static void dcc_module_request_error(KviDccRequest * dcc,const TQString& errText)
{
dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCERROR,
__tr2qs_ctx("Unable to process the above request: %Q, %Q","dcc"),
@@ -80,7 +80,7 @@ static void dcc_module_request_error(KviDccRequest * dcc,const QString& errText)
if(KVI_OPTION_BOOL(KviOption_boolNotifyFailedDccHandshakes))
{
- QString szError = QString("Sorry, your DCC %1 request can't be satisfied: %2").arg(dcc->szType.ptr()).arg(errText);
+ TQString szError = TQString("Sorry, your DCC %1 request can't be satisfied: %2").tqarg(dcc->szType.ptr()).tqarg(errText);
dcc_module_reply_errmsg(dcc,szError);
}
}
@@ -164,7 +164,7 @@ static bool dcc_module_normalize_target_data(KviDccRequest * dcc,KviStr &ipaddr,
if(ipaddr.isUnsignedNum())
{
addr.s_addr = htonl((unsigned long)ipaddr.toULong());
- QString tmp;
+ TQString tmp;
if(!kvi_binaryIpToStringIp(addr,tmp))
{
if(!dcc->ctcpMsg->msg->haltOutput())
@@ -263,9 +263,9 @@ static void dccModuleParseDccChat(KviDccRequest *dcc)
szExtensions.cutRight(4); // cut off CHAT
#ifdef COMPILE_SSL_SUPPORT
- bool bSSLExtension = szExtensions.contains('S',false);
+ bool bSSLExtension = szExtensions.tqcontains('S',false);
#else //!COMPILE_SSL_SUPPORT
- if(szExtensions.contains('S',false))
+ if(szExtensions.tqcontains('S',false))
{
dcc_module_request_error(dcc,__tr2qs_ctx("This executable has been compiled without SSL support, the SSL extension to DCC CHAT is not available","dcc"));
return;
@@ -296,7 +296,7 @@ static void dccModuleParseDccChat(KviDccRequest *dcc)
if(d->szFakeIp.isEmpty())KVI_OPTION_BOOL(KviOption_boolDccSendFakeAddressByDefault) = false;
}
d->setZeroPortRequestTag(dcc->szParam4.ptr());
- QString tmp;
+ TQString tmp;
if(!dcc_kvs_get_listen_ip_address(0,d->console(),tmp))d->szListenIp = "0.0.0.0";
else d->szListenIp=tmp;
d->szListenPort = "0"; // any port is OK
@@ -305,7 +305,7 @@ static void dccModuleParseDccChat(KviDccRequest *dcc)
} else {
// zero port acknowledge
// check if this is a tag that we have sent out
- QString szTag = QString(dcc->szParam4.ptr());
+ TQString szTag = TQString(dcc->szParam4.ptr());
KviDccZeroPortTag * t = g_pDccBroker->findZeroPortTag(szTag);
if(!t)
{
@@ -444,7 +444,7 @@ static void dccModuleParseDccSend(KviDccRequest *dcc)
dcc->szParam4 = __tr2qs_ctx("<unknown size>","dcc");
}
- if(dcc->szParam1.contains('/'))
+ if(dcc->szParam1.tqcontains('/'))
{
if(!dcc->ctcpMsg->msg->haltOutput())
{
@@ -457,11 +457,11 @@ static void dccModuleParseDccSend(KviDccRequest *dcc)
KviStr szExtensions = dcc->szType;
szExtensions.cutRight(4); // cut off SEND
- bool bTurboExtension = szExtensions.contains('T',false);
+ bool bTurboExtension = szExtensions.tqcontains('T',false);
#ifdef COMPILE_SSL_SUPPORT
- bool bSSLExtension = szExtensions.contains('S',false);
+ bool bSSLExtension = szExtensions.tqcontains('S',false);
#else //!COMPILE_SSL_SUPPORT
- if(szExtensions.contains('S',false))
+ if(szExtensions.tqcontains('S',false))
{
dcc_module_request_error(dcc,__tr2qs_ctx("This executable has been compiled without SSL support, the SSL extension to DCC SEND is not available","dcc"));
return;
@@ -487,9 +487,9 @@ static void dccModuleParseDccSend(KviDccRequest *dcc)
if(d->szFakeIp.isEmpty())KVI_OPTION_BOOL(KviOption_boolDccSendFakeAddressByDefault) = false;
}
d->setZeroPortRequestTag(dcc->szParam5.ptr());
- QString tmp;
+ TQString tmp;
if(!dcc_kvs_get_listen_ip_address(0,d->console(),tmp))d->szListenIp = "0.0.0.0";
- else d->szListenIp=QString(tmp);
+ else d->szListenIp=TQString(tmp);
d->szListenPort = "0"; // any port is OK
d->bSendRequest = true;
d->szLocalFileSize = d->szFileSize;
@@ -592,7 +592,7 @@ static void dccModuleParseDccRecv(KviDccRequest * dcc)
dcc->szParam4 = "0";
}
- if(dcc->szParam1.contains('/'))
+ if(dcc->szParam1.tqcontains('/'))
{
if(!dcc->ctcpMsg->msg->haltOutput())
{
@@ -605,11 +605,11 @@ static void dccModuleParseDccRecv(KviDccRequest * dcc)
KviStr szExtensions = dcc->szType;
szExtensions.cutRight(4); // cut off RECV
- bool bTurboExtension = szExtensions.contains('T',false);
+ bool bTurboExtension = szExtensions.tqcontains('T',false);
#ifdef COMPILE_SSL_SUPPORT
- bool bSSLExtension = szExtensions.contains('S',false);
+ bool bSSLExtension = szExtensions.tqcontains('S',false);
#else //!COMPILE_SSL_SUPPORT
- if(szExtensions.contains('S',false))
+ if(szExtensions.tqcontains('S',false))
{
dcc_module_request_error(dcc,__tr2qs_ctx("This executable has been compiled without SSL support, the SSL extension to DCC RECV is not available","dcc"));
return;
@@ -730,7 +730,7 @@ static void dccModuleParseDccRSend(KviDccRequest *dcc)
dcc->szParam2 = __tr_ctx("<unknown size>","dcc");
}
- if(dcc->szParam1.contains('/'))
+ if(dcc->szParam1.tqcontains('/'))
{
if(!dcc->ctcpMsg->msg->haltOutput())
{
@@ -743,11 +743,11 @@ static void dccModuleParseDccRSend(KviDccRequest *dcc)
KviStr szExtensions = dcc->szType;
szExtensions.cutRight(4); // cut off SEND
- bool bTurboExtension = szExtensions.contains('T',false);
+ bool bTurboExtension = szExtensions.tqcontains('T',false);
#ifdef COMPILE_SSL_SUPPORT
- bool bSSLExtension = szExtensions.contains('S',false);
+ bool bSSLExtension = szExtensions.tqcontains('S',false);
#else //!COMPILE_SSL_SUPPORT
- if(szExtensions.contains('S',false))
+ if(szExtensions.tqcontains('S',false))
{
dcc_module_request_error(dcc,__tr2qs_ctx("This executable has been compiled without SSL support, the SSL extension to DCC RSEND is not available","dcc"));
return;
@@ -762,14 +762,14 @@ static void dccModuleParseDccRSend(KviDccRequest *dcc)
d->szHost = dcc->ctcpMsg->pSource->host();
d->szIp = __tr2qs_ctx("(unknown)","dcc");
d->szPort = d->szIp;
- QString tmp;
+ TQString tmp;
if(!dcc_kvs_get_listen_ip_address(0,d->console(),tmp))
{
d->console()->output(KVI_OUT_DCCMSG,
__tr2qs_ctx("No suitable interface to listen on, trying to continue anyway...","dcc"));
d->szListenIp = "0.0.0.0";
} else
- d->szListenIp=QString(tmp);
+ d->szListenIp=TQString(tmp);
d->szListenPort = "0";
dcc_fill_local_nick_user_host(d,dcc);
@@ -826,11 +826,11 @@ static void dccModuleParseDccGet(KviDccRequest *dcc)
KviStr szExtensions = dcc->szType;
szExtensions.cutRight(3); // cut off GET
- bool bTurboExtension = szExtensions.contains('T',false);
+ bool bTurboExtension = szExtensions.tqcontains('T',false);
#ifdef COMPILE_SSL_SUPPORT
- bool bSSLExtension = szExtensions.contains('S',false);
+ bool bSSLExtension = szExtensions.tqcontains('S',false);
#else //!COMPILE_SSL_SUPPORT
- if(szExtensions.contains('S',false))
+ if(szExtensions.tqcontains('S',false))
{
dcc_module_request_error(dcc,__tr2qs_ctx("This executable has been compiled without SSL support, the SSL extension to DCC GET is not available","dcc"));
return;
@@ -866,7 +866,7 @@ static void dccModuleParseDccGet(KviDccRequest *dcc)
szSubproto.prepend(szExtensions);
- QString szFileName = QFileInfo(o->absFilePath()).fileName();
+ TQString szFileName = TQFileInfo(o->absFilePath()).fileName();
if(o->name() != szFileName)
{
// BUG
@@ -877,8 +877,8 @@ static void dccModuleParseDccGet(KviDccRequest *dcc)
// now add a file offer , so he we will accept it automatically
// 120 secs is a reasonable timeout
- QString szMask;
- dcc->ctcpMsg->pSource->mask(szMask,KviIrcMask::NickUserHost);
+ TQString szMask;
+ dcc->ctcpMsg->pSource->tqmask(szMask,KviIrcMask::NickUserHost);
KviSharedFile * pOld = o;
o = g_pSharedFilesManager->addSharedFile(szFileName,o->absFilePath(),szMask,120);
@@ -911,14 +911,14 @@ static void dccModuleParseDccGet(KviDccRequest *dcc)
d->bRecvFile = false;
dcc_fill_local_nick_user_host(d,dcc);
- QString tmp;
+ TQString tmp;
if(!dcc_kvs_get_listen_ip_address(0,d->console(),tmp))
{
d->console()->output(KVI_OUT_DCCMSG,
__tr2qs_ctx("No suitable interface to listen on, trying to continue anyway...","dcc"));
d->szListenIp = "0.0.0.0";
} else
- d->szListenIp=QString(tmp);
+ d->szListenIp=TQString(tmp);
//#warning "DO STH WITH THIS PORT (HOW TO SPECIFY IT ?)"
d->szListenPort = "0"; // any port is ok
@@ -1081,7 +1081,7 @@ static void dccModuleParseDccCanvas(KviDccRequest *dcc)
static void dccModuleParseDccList(KviDccRequest *dcc)
{
- // DCC LIST <mask> <ipaddr> <port>
+ // DCC LIST <tqmask> <ipaddr> <port>
// FIXME!
}
diff --git a/src/modules/dcc/send.cpp b/src/modules/dcc/send.cpp
index c6cc1182..c42793aa 100644
--- a/src/modules/dcc/send.cpp
+++ b/src/modules/dcc/send.cpp
@@ -60,15 +60,15 @@
#include "kvi_sparser.h"
#include "kvi_kvs_script.h"
-#include <qevent.h>
-#include <qfile.h>
-#include <qpainter.h>
-#include <qdatetime.h>
-#include <qglobal.h>
-#include <qcheckbox.h>
-#include <qspinbox.h>
-#include <qlayout.h>
-#include <qpushbutton.h>
+#include <tqevent.h>
+#include <tqfile.h>
+#include <tqpainter.h>
+#include <tqdatetime.h>
+#include <tqglobal.h>
+#include <tqcheckbox.h>
+#include <tqspinbox.h>
+#include <tqlayout.h>
+#include <tqpushbutton.h>
#define INSTANT_BANDWIDTH_CHECK_INTERVAL_IN_MSECS 3000
#define INSTANT_BANDWIDTH_CHECK_INTERVAL_IN_SECS 3
@@ -88,12 +88,12 @@ extern KVIRC_API KviMediaManager * g_pMediaManager; // kvi_app.cpp
static KviPointerList<KviDccFileTransfer> * g_pDccFileTransfers = 0;
-static QPixmap * g_pDccFileTransferIcon = 0;
+static TQPixmap * g_pDccFileTransferIcon = 0;
//#warning "The events that have a KviStr data pointer should become real classes, that take care of deleting the data pointer!"
//#warning "Otherwise, when left undispatched we will be leaking memory (event class destroyed but not the data ptr)"
-KviDccRecvThread::KviDccRecvThread(QObject * par,kvi_socket_t fd,KviDccRecvThreadOptions * opt)
+KviDccRecvThread::KviDccRecvThread(TQObject * par,kvi_socket_t fd,KviDccRecvThreadOptions * opt)
: KviDccThread(par,fd)
{
m_pOpt = opt;
@@ -158,7 +158,7 @@ void KviDccRecvThread::postMessageEvent(const char * m)
{
KviThreadDataEvent<KviStr> * e = new KviThreadDataEvent<KviStr>(KVI_DCC_THREAD_EVENT_MESSAGE);
e->setData(new KviStr(m));
- postEvent(parent(),e);
+ postEvent(tqparent(),e);
}
// FIXME: This stuff should be somewhat related to the 1448 bytes TCP basic packet size
@@ -191,7 +191,7 @@ void KviDccRecvThread::run()
int iProbableTerminationTime = 0;
- m_pFile = new QFile(QString::fromUtf8(m_pOpt->szFileName.ptr()));
+ m_pFile = new TQFile(TQString::fromUtf8(m_pOpt->szFileName.ptr()));
if(m_pOpt->bResume)
{
@@ -292,7 +292,7 @@ void KviDccRecvThread::run()
{
// Received the whole file...die
KviThreadEvent * e = new KviThreadEvent(KVI_DCC_THREAD_EVENT_SUCCESS);
- postEvent(parent(),e);
+ postEvent(tqparent(),e);
break;
}
}
@@ -327,7 +327,7 @@ void KviDccRecvThread::run()
{
// success if we got the whole file or if we don't know the file size (we trust the peer)
KviThreadEvent * e = new KviThreadEvent(KVI_DCC_THREAD_EVENT_SUCCESS);
- postEvent(parent(),e);
+ postEvent(tqparent(),e);
break;
}
}
@@ -368,7 +368,7 @@ void KviDccRecvThread::run()
// success if we got the whole file or if we don't know the file size (we trust the peer)
postMessageEvent(__tr2qs_ctx("Data transfer was terminated 30 seconds ago, closing the connection","dcc"));
KviThreadEvent * e = new KviThreadEvent(KVI_DCC_THREAD_EVENT_SUCCESS);
- postEvent(parent(),e);
+ postEvent(tqparent(),e);
break;
}
}
@@ -410,7 +410,7 @@ void KviDccRecvThread::doneGetInfo()
m_pMutex->unlock();
}
-KviDccSendThread::KviDccSendThread(QObject * par,kvi_socket_t fd,KviDccSendThreadOptions * opt)
+KviDccSendThread::KviDccSendThread(TQObject * par,kvi_socket_t fd,KviDccSendThreadOptions * opt)
: KviDccThread(par,fd)
{
m_pOpt = opt;
@@ -486,12 +486,12 @@ void KviDccSendThread::run()
int iFailedSelects = 0;
char ackbuffer[4];
int iBytesInAckBuffer = 0;
- Q_UINT32 iLastAck = 0;
+ TQ_UINT32 iLastAck = 0;
if(m_pOpt->iPacketSize < 32)m_pOpt->iPacketSize = 32;
char * buffer = (char *)kvi_malloc(m_pOpt->iPacketSize * sizeof(char));
- QFile * pFile = new QFile(QString::fromUtf8(m_pOpt->szFileName.ptr()));
+ TQFile * pFile = new TQFile(TQString::fromUtf8(m_pOpt->szFileName.ptr()));
if(!pFile->open(IO_ReadOnly))
{
@@ -550,7 +550,7 @@ void KviDccSendThread::run()
iBytesInAckBuffer += readLen;
if(iBytesInAckBuffer == 4)
{
- Q_UINT32 iNewAck = ntohl(*((Q_UINT32 *)ackbuffer));
+ TQ_UINT32 iNewAck = ntohl(*((TQ_UINT32 *)ackbuffer));
if((iNewAck > pFile->at()) || (iNewAck < iLastAck))
{
// the peer is drunk or is trying to fool us
@@ -572,7 +572,7 @@ void KviDccSendThread::run()
if(iLastAck >= pFile->size())
{
KviThreadEvent * e = new KviThreadEvent(KVI_DCC_THREAD_EVENT_SUCCESS);
- postEvent(parent(),e);
+ postEvent(tqparent(),e);
break;
}
} else {
@@ -589,7 +589,7 @@ void KviDccSendThread::run()
// done...success
updateStats();
KviThreadEvent * e = new KviThreadEvent(KVI_DCC_THREAD_EVENT_SUCCESS);
- postEvent(parent(),e);
+ postEvent(tqparent(),e);
break;
} else {
if(readLen < 0)
@@ -598,7 +598,7 @@ void KviDccSendThread::run()
} else {
KviThreadDataEvent<KviStr> * e = new KviThreadDataEvent<KviStr>(KVI_DCC_THREAD_EVENT_MESSAGE);
e->setData(new KviStr(__tr2qs_ctx("WARNING: Received data in a DCC TSEND, there should be no acknowledges","dcc")));
- postEvent(parent(),e);
+ postEvent(tqparent(),e);
}
}
}
@@ -672,7 +672,7 @@ void KviDccSendThread::run()
// not in a tdcc: we can close the file...
updateStats();
KviThreadEvent * e = new KviThreadEvent(KVI_DCC_THREAD_EVENT_SUCCESS);
- postEvent(parent(),e);
+ postEvent(tqparent(),e);
break;
} else {
// upload finished but we're waiting for the last ack
@@ -729,19 +729,19 @@ KviDccFileTransfer::KviDccFileTransfer(KviDccDescriptor * dcc)
m_pResumeTimer = 0;
m_pBandwidthDialog = 0;
- KviQString::sprintf(m_szTransferIdString,__tr2qs_ctx("TRANSFER %d","dcc"),id());
+ KviTQString::sprintf(m_szTransferIdString,__tr2qs_ctx("TRANSFER %d","dcc"),id());
m_pDescriptor = dcc;
m_pDescriptor->setTransfer(this);
m_pMarshal = new KviDccMarshal(this);
- connect(m_pMarshal,SIGNAL(error(int)),this,SLOT(handleMarshalError(int)));
- connect(m_pMarshal,SIGNAL(connected()),this,SLOT(connected()));
- connect(m_pMarshal,SIGNAL(inProgress()),this,SLOT(connectionInProgress()));
+ connect(m_pMarshal,TQT_SIGNAL(error(int)),this,TQT_SLOT(handleMarshalError(int)));
+ connect(m_pMarshal,TQT_SIGNAL(connected()),this,TQT_SLOT(connected()));
+ connect(m_pMarshal,TQT_SIGNAL(inProgress()),this,TQT_SLOT(connectionInProgress()));
#ifdef COMPILE_SSL_SUPPORT
- connect(m_pMarshal,SIGNAL(startingSSLHandshake()),this,SLOT(startingSSLHandshake()));
- connect(m_pMarshal,SIGNAL(sslError(const char *)),this,SLOT(sslError(const char *)));
+ connect(m_pMarshal,TQT_SIGNAL(startingSSLHandshake()),this,TQT_SLOT(startingSSLHandshake()));
+ connect(m_pMarshal,TQT_SIGNAL(sslError(const char *)),this,TQT_SLOT(sslError(const char *)));
#endif
m_szDccType = dcc->bIsTdcc ? (dcc->bRecvFile ? "TRECV" : "TSEND") : (dcc->bRecvFile ? "RECV" : "SEND");
@@ -753,7 +753,7 @@ KviDccFileTransfer::KviDccFileTransfer(KviDccDescriptor * dcc)
m_tTransferEndTime = 0;
m_szStatusString = __tr2qs_ctx("Setting up the connection","dcc");
- m_eGeneralStatus = Connecting;
+ m_eGeneraltqStatus = Connecting;
bool bOk;
m_uTotalFileSize = dcc->bRecvFile ? dcc->szFileSize.toUInt(&bOk) : dcc->szLocalFileSize.toUInt(&bOk);
@@ -811,18 +811,18 @@ void KviDccFileTransfer::startConnection()
if(!(m_pDescriptor->bActive))
{
// PASSIVE CONNECTION
- m_szStatusString = __tr2qs_ctx("Attempting a passive DCC %1 connection","dcc").arg(m_szDccType.ptr());
+ m_szStatusString = __tr2qs_ctx("Attempting a passive DCC %1 connection","dcc").tqarg(m_szDccType.ptr());
outputAndLog(m_szStatusString);
} else {
// ACTIVE CONNECTION
- m_szStatusString = __tr2qs_ctx("Attempting an active DCC %1 connection","dcc").arg(m_szDccType.ptr());
+ m_szStatusString = __tr2qs_ctx("Attempting an active DCC %1 connection","dcc").tqarg(m_szDccType.ptr());
outputAndLog(m_szStatusString);
}
if(m_pDescriptor->bResume && m_pDescriptor->bRecvFile)
{
- QString fName;
+ TQString fName;
KviServerParser::encodeCtcpParameter(m_pDescriptor->szFileName.utf8().data(),fName);
if(m_pDescriptor->isZeroPortRequest())
{
@@ -841,7 +841,7 @@ void KviDccFileTransfer::startConnection()
m_pDescriptor->szPort.utf8().data(),
m_pDescriptor->szLocalFileSize.utf8().data(),0x01);
}
- m_szStatusString = __tr2qs_ctx("Sent DCC RESUME request to %1, waiting for ACCEPT","dcc").arg(m_pDescriptor->szNick);
+ m_szStatusString = __tr2qs_ctx("Sent DCC RESUME request to %1, waiting for ACCEPT","dcc").tqarg(m_pDescriptor->szNick);
outputAndLog(m_szStatusString);
// setup the resume timer: we don't want to wait forever
@@ -850,8 +850,8 @@ void KviDccFileTransfer::startConnection()
KVI_OPTION_UINT(KviOption_uintDccSocketTimeout) = 5;
if(m_pResumeTimer)delete m_pResumeTimer;
- m_pResumeTimer = new QTimer(this);
- connect(m_pResumeTimer,SIGNAL(timeout()),this,SLOT(resumeTimedOut()));
+ m_pResumeTimer = new TQTimer(this);
+ connect(m_pResumeTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(resumeTimedOut()));
m_pResumeTimer->start(KVI_OPTION_UINT(KviOption_uintDccSocketTimeout) * 1000,true);
} else {
listenOrConnect();
@@ -899,7 +899,7 @@ void KviDccFileTransfer::die()
delete this;
}
-QString KviDccFileTransfer::localFileName()
+TQString KviDccFileTransfer::localFileName()
{
return m_pDescriptor->szLocalFileName;
}
@@ -919,12 +919,12 @@ void KviDccFileTransfer::abort()
else if(m_pSlaveSendThread)tmp.setNum(m_pSlaveSendThread->sentBytes());
else tmp = '0';
- m_eGeneralStatus = Failure;
+ m_eGeneraltqStatus = Failure;
m_tTransferEndTime = kvi_unixTime();
m_szStatusString = __tr2qs_ctx("Transfer failed: ","dcc");
m_szStatusString += __tr2qs_ctx("Aborted","dcc");
- KVS_TRIGGER_EVENT_3(KviEvent_OnDCCFileTransferFailed,eventWindow(),QString("Aborted by user"),QString(tmp.ptr()),m_pDescriptor->idString());
+ KVS_TRIGGER_EVENT_3(KviEvent_OnDCCFileTransferFailed,eventWindow(),TQString("Aborted by user"),TQString(tmp.ptr()),m_pDescriptor->idString());
outputAndLog(KVI_OUT_DCCERROR,m_szStatusString);
displayUpdate();
@@ -933,15 +933,15 @@ void KviDccFileTransfer::abort()
void KviDccFileTransfer::fillContextPopup(KviTalPopupMenu * m,int column)
{
- m->insertItem(__tr2qs_ctx("Configure Bandwidth...","dcc"),this,SLOT(configureBandwidth()));
+ m->insertItem(__tr2qs_ctx("Configure Bandwidth...","dcc"),this,TQT_SLOT(configureBandwidth()));
m->insertSeparator();
- m->insertItem(__tr2qs_ctx("Resend DCC","dcc"),this,SLOT(retryDCC()));
- m->insertItem(__tr2qs_ctx("Resend TDCC","dcc"),this,SLOT(retryTDCC()));
- m->insertItem(__tr2qs_ctx("Resend RevDCC","dcc"),this,SLOT(retryRevDCC()));
+ m->insertItem(__tr2qs_ctx("Resend DCC","dcc"),this,TQT_SLOT(retryDCC()));
+ m->insertItem(__tr2qs_ctx("Resend TDCC","dcc"),this,TQT_SLOT(retryTDCC()));
+ m->insertItem(__tr2qs_ctx("Resend RevDCC","dcc"),this,TQT_SLOT(retryRevDCC()));
/* FIX ME credo che il problema sia che se riavvio un trasferimento, a sua volta gia'
avviato, questo non ha irc contex, perche' la finestra "in cui e' nato"e' sta
quella della dcc. Conservarsi l'id della finestra? */
- int id = m->insertItem(__tr2qs_ctx("Abort","dcc"),this,SLOT(abort()));
+ int id = m->insertItem(__tr2qs_ctx("Abort","dcc"),this,TQT_SLOT(abort()));
if(!active())m->setItemEnabled(id,false);
}
@@ -949,7 +949,7 @@ void KviDccFileTransfer::configureBandwidth()
{
if(m_pBandwidthDialog)return;
m_pBandwidthDialog = new KviDccFileTransferBandwidthDialog(g_pFrame,this);
- connect(m_pBandwidthDialog,SIGNAL(destroyed()),this,SLOT(bandwidthDialogDestroyed()));
+ connect(m_pBandwidthDialog,TQT_SIGNAL(destroyed()),this,TQT_SLOT(bandwidthDialogDestroyed()));
m_pBandwidthDialog->setModal(true);
m_pBandwidthDialog->show();
}
@@ -957,38 +957,38 @@ void KviDccFileTransfer::configureBandwidth()
void KviDccFileTransfer::retryDCC()
{
abort();
- QString szRemoteNick = m_pDescriptor->remoteNick();
- QString szFileName = m_pDescriptor->localFileName();
- QString szId;
+ TQString szRemoteNick = m_pDescriptor->remoteNick();
+ TQString szFileName = m_pDescriptor->localFileName();
+ TQString szId;
szId.setNum(m_pDescriptor->id());
- QString szCommand = "dcc.send -r=$console($dcc.irccontext(" + szId + ")) " + szRemoteNick + " " + "\"" + szFileName + "\"";
+ TQString szCommand = "dcc.send -r=$console($dcc.irccontext(" + szId + ")) " + szRemoteNick + " " + "\"" + szFileName + "\"";
KviKvsScript::run(szCommand,g_pActiveWindow);
}
void KviDccFileTransfer::retryTDCC()
{
abort();
- QString szRemoteNick = m_pDescriptor->remoteNick();
- QString szFileName = m_pDescriptor->localFileName();
- QString szId;
+ TQString szRemoteNick = m_pDescriptor->remoteNick();
+ TQString szFileName = m_pDescriptor->localFileName();
+ TQString szId;
szId.setNum(m_pDescriptor->id());
- QString szCommand = "dcc.send -r=$console($dcc.irccontext(" + szId + ")) -t " + szRemoteNick + " " + "\"" + szFileName + "\"";
+ TQString szCommand = "dcc.send -r=$console($dcc.irccontext(" + szId + ")) -t " + szRemoteNick + " " + "\"" + szFileName + "\"";
KviKvsScript::run(szCommand,g_pActiveWindow);
}
void KviDccFileTransfer::retryRevDCC()
{
abort();
- QString szRemoteNick = m_pDescriptor->remoteNick();
- QString szFileName = m_pDescriptor->localFileName();
- QString szId;
+ TQString szRemoteNick = m_pDescriptor->remoteNick();
+ TQString szFileName = m_pDescriptor->localFileName();
+ TQString szId;
szId.setNum(m_pDescriptor->id());
- QString szCommand = "dcc.rsend -z -r=$console($dcc.irccontext(" + szId + ")) " + szRemoteNick + " " + "\"" + szFileName + "\"";
+ TQString szCommand = "dcc.rsend -z -r=$console($dcc.irccontext(" + szId + ")) " + szRemoteNick + " " + "\"" + szFileName + "\"";
KviKvsScript::run(szCommand,g_pActiveWindow);
}
-void KviDccFileTransfer::fillStatusString(QString &szBuffer)
+void KviDccFileTransfer::fillStatusString(TQString &szBuffer)
{
- switch(m_eGeneralStatus)
+ switch(m_eGeneraltqStatus)
{
case Connecting:
szBuffer = "connecting";
@@ -1010,7 +1010,7 @@ void KviDccFileTransfer::fillStatusString(QString &szBuffer)
bool KviDccFileTransfer::active()
{
- return ((m_eGeneralStatus == Connecting) || (m_eGeneralStatus == Transferring));
+ return ((m_eGeneraltqStatus == Connecting) || (m_eGeneraltqStatus == Transferring));
}
int KviDccFileTransfer::bandwidthLimit()
@@ -1104,11 +1104,11 @@ unsigned int KviDccFileTransfer::transferredBytes()
return uTransferred;
}
-void KviDccFileTransfer::displayPaint(QPainter * p,int column,int width,int height)
+void KviDccFileTransfer::displayPaint(TQPainter * p,int column,int width,int height)
{
- QString txt;
- bool bIsTerminated = ((m_eGeneralStatus == Success) || (m_eGeneralStatus == Failure));
+ TQString txt;
+ bool bIsTerminated = ((m_eGeneraltqStatus == Success) || (m_eGeneraltqStatus == Failure));
switch(column)
{
@@ -1117,7 +1117,7 @@ void KviDccFileTransfer::displayPaint(QPainter * p,int column,int width,int heig
int xoffset = 0;
int yoffset = 0;
if(m_pDescriptor->bRecvFile)yoffset = 64;
- switch(m_eGeneralStatus)
+ switch(m_eGeneraltqStatus)
{
case Connecting: xoffset = 0; break;
case Transferring: xoffset = 48; break;
@@ -1130,10 +1130,10 @@ void KviDccFileTransfer::displayPaint(QPainter * p,int column,int width,int heig
case COLUMN_FILEINFO:
{
- QFontMetrics fm(p->font());
+ TQFontMetrics fm(p->font());
- QString szFrom = __tr2qs_ctx("From: ","dcc");
- QString szTo = __tr2qs_ctx("To: ","dcc");
+ TQString szFrom = __tr2qs_ctx("From: ","dcc");
+ TQString szTo = __tr2qs_ctx("To: ","dcc");
int daW1 = fm.width(szFrom);
int daW2 = fm.width(szTo);
@@ -1142,43 +1142,43 @@ void KviDccFileTransfer::displayPaint(QPainter * p,int column,int width,int heig
int iY = 4;
- p->setPen(Qt::black);
+ p->setPen(TQt::black);
KviStr szRemote(KviStr::Format,"dcc://%s@%s:%s/%s",m_pDescriptor->szNick.utf8().data(),m_pDescriptor->szIp.utf8().data(),m_pDescriptor->szPort.utf8().data(),
m_pDescriptor->szFileName.utf8().data());
- p->drawText(4 + daW1,iY,width - (8 + daW1),height - 8,Qt::AlignTop | Qt::AlignLeft,
+ p->drawText(4 + daW1,iY,width - (8 + daW1),height - 8,TQt::AlignTop | TQt::AlignLeft,
m_pDescriptor->bRecvFile ? szRemote.ptr() : m_pDescriptor->szLocalFileName.utf8().data());
iY += iLineSpacing;
- p->drawText(4 + daW1,iY,width - (8 + daW1),height - 8,Qt::AlignTop | Qt::AlignLeft,
+ p->drawText(4 + daW1,iY,width - (8 + daW1),height - 8,TQt::AlignTop | TQt::AlignLeft,
m_pDescriptor->bRecvFile ? m_pDescriptor->szLocalFileName.utf8().data() : szRemote.ptr());
iY += iLineSpacing;
- p->setPen(Qt::darkGray);
+ p->setPen(TQt::darkGray);
- p->drawText(4,4,width - 8,height - 8,Qt::AlignTop | Qt::AlignLeft,szFrom);
- p->drawText(4,4 + iLineSpacing,width - 8,height - 8,Qt::AlignTop | Qt::AlignLeft,szTo);
+ p->drawText(4,4,width - 8,height - 8,TQt::AlignTop | TQt::AlignLeft,szFrom);
+ p->drawText(4,4 + iLineSpacing,width - 8,height - 8,TQt::AlignTop | TQt::AlignLeft,szTo);
- p->setPen(QColor(180,180,200));
+ p->setPen(TQColor(180,180,200));
iLineSpacing += 2;
p->drawRect(4,height - (iLineSpacing + 4),width - 8,iLineSpacing);
- p->fillRect(5,height - (iLineSpacing + 3),width - 10,iLineSpacing - 2,bIsTerminated ? QColor(210,210,210) : QColor(190,190,240));
+ p->fillRect(5,height - (iLineSpacing + 3),width - 10,iLineSpacing - 2,bIsTerminated ? TQColor(210,210,210) : TQColor(190,190,240));
- p->setPen(Qt::black);
+ p->setPen(TQt::black);
- p->drawText(7,height - (iLineSpacing + 4),width - 14,iLineSpacing,Qt::AlignVCenter | Qt::AlignLeft,m_szStatusString);
+ p->drawText(7,height - (iLineSpacing + 4),width - 14,iLineSpacing,TQt::AlignVCenter | TQt::AlignLeft,m_szStatusString);
}
break;
case COLUMN_PROGRESS:
{
- QFontMetrics fm(p->font());
+ TQFontMetrics fm(p->font());
int iW = width - 8;
int iAvgBandwidth = -1;
@@ -1211,7 +1211,7 @@ void KviDccFileTransfer::displayPaint(QPainter * p,int column,int width,int heig
}
}
- p->setPen(bIsTerminated ? Qt::lightGray : QColor(210,210,240));
+ p->setPen(bIsTerminated ? TQt::lightGray : TQColor(210,210,240));
p->drawRect(4,4,iW,12);
iW -= 2;
@@ -1233,26 +1233,26 @@ void KviDccFileTransfer::displayPaint(QPainter * p,int column,int width,int heig
double dPerc2 = (double)(((double)iAckedBytes) * 100.0) / (double)m_uTotalFileSize;
int iL2 = (int) ((((double)iW) * dPerc2) / 100.0);
int iW2 = iL1 - iL2;
- if(iW2 > 0)p->fillRect(5 + iL2,5,iW2,10,bIsTerminated ? QColor(150,130,110) : QColor(220,170,100));
- p->fillRect(5,5,iL2,10,bIsTerminated ? QColor(140,110,110) : QColor(200,100,100));
+ if(iW2 > 0)p->fillRect(5 + iL2,5,iW2,10,bIsTerminated ? TQColor(150,130,110) : TQColor(220,170,100));
+ p->fillRect(5,5,iL2,10,bIsTerminated ? TQColor(140,110,110) : TQColor(200,100,100));
- txt = QString(__tr2qs_ctx("%1 of %2 (%3%)","dcc")).arg(KviQString::makeSizeReadable(iAckedBytes)).arg(KviQString::makeSizeReadable(m_uTotalFileSize)).arg(dPerc2,0,'f',2);
+ txt = TQString(__tr2qs_ctx("%1 of %2 (%3%)","dcc")).tqarg(KviTQString::makeSizeReadable(iAckedBytes)).tqarg(KviTQString::makeSizeReadable(m_uTotalFileSize)).tqarg(dPerc2,0,'f',2);
} else {
// we are receiving a file or not sending acks
double dPerc = (double)(((double)uTransferred) * 100.0) / (double)m_uTotalFileSize;
int iL = (int) ((((double)iW) * dPerc) / 100.0);
- p->fillRect(5,5,iL,10,bIsTerminated ? QColor(140,110,110) : QColor(200,100,100));
+ p->fillRect(5,5,iL,10,bIsTerminated ? TQColor(140,110,110) : TQColor(200,100,100));
- txt = QString(__tr2qs_ctx("%1 of %2 (%3%)","dcc")).arg(KviQString::makeSizeReadable(uTransferred)).arg(KviQString::makeSizeReadable(m_uTotalFileSize)).arg(dPerc,0,'f',2);
+ txt = TQString(__tr2qs_ctx("%1 of %2 (%3%)","dcc")).tqarg(KviTQString::makeSizeReadable(uTransferred)).tqarg(KviTQString::makeSizeReadable(m_uTotalFileSize)).tqarg(dPerc,0,'f',2);
}
} else {
- txt = QString(__tr2qs_ctx("%1","dcc")).arg(KviQString::makeSizeReadable(uTransferred));
+ txt = TQString(__tr2qs_ctx("%1","dcc")).tqarg(KviTQString::makeSizeReadable(uTransferred));
}
- p->setPen(Qt::black);
+ p->setPen(TQt::black);
- p->drawText(4,19,width - 8,height - 8,Qt::AlignTop | Qt::AlignLeft,txt);
+ p->drawText(4,19,width - 8,height - 8,TQt::AlignTop | TQt::AlignLeft,txt);
int iLeftHalf = (iW - 2) / 2;
int iRightHalf = iW - (iLeftHalf + 1);
@@ -1264,7 +1264,7 @@ void KviDccFileTransfer::displayPaint(QPainter * p,int column,int width,int heig
txt += " ";
if(iInstantSpeed >= 0)
{
- QString tmpisp;
+ TQString tmpisp;
KviNetUtils::formatNetworkBandwidthString(tmpisp,iInstantSpeed);
txt += tmpisp;
} else {
@@ -1279,7 +1279,7 @@ void KviDccFileTransfer::displayPaint(QPainter * p,int column,int width,int heig
txt += " ";
if(iAvgBandwidth >= 0)
{
- QString tmpspd;
+ TQString tmpspd;
KviNetUtils::formatNetworkBandwidthString(tmpspd,iAvgBandwidth);
txt += tmpspd;
} else {
@@ -1293,17 +1293,17 @@ void KviDccFileTransfer::displayPaint(QPainter * p,int column,int width,int heig
int iDaH = height - (iLineSpacing + 4);
- p->setPen(QColor(180,180,200));
+ p->setPen(TQColor(180,180,200));
p->drawRect(4,iDaH,iLeftHalf,iLineSpacing);
- p->fillRect(5,iDaH + 1,iLeftHalf - 2,iLineSpacing - 2,bIsTerminated ? QColor(210,210,210) : QColor(190,190,240));
- p->setPen(bIsTerminated ? Qt::darkGray : Qt::black);
- p->drawText(6,iDaH,iLeftHalf - 4,iLineSpacing,Qt::AlignLeft | Qt::AlignVCenter,txt);
+ p->fillRect(5,iDaH + 1,iLeftHalf - 2,iLineSpacing - 2,bIsTerminated ? TQColor(210,210,210) : TQColor(190,190,240));
+ p->setPen(bIsTerminated ? TQt::darkGray : TQt::black);
+ p->drawText(6,iDaH,iLeftHalf - 4,iLineSpacing,TQt::AlignLeft | TQt::AlignVCenter,txt);
if(bIsTerminated)
{
if((m_tTransferStartTime != 0) && (m_tTransferEndTime != 0))
{
- QString tot = KviTimeUtils::formatTimeInterval(kvi_timeSpan(m_tTransferEndTime,m_tTransferStartTime),KviTimeUtils::NoLeadingEmptyIntervals | KviTimeUtils::NoLeadingZeroes);
+ TQString tot = KviTimeUtils::formatTimeInterval(kvi_timeSpan(m_tTransferEndTime,m_tTransferStartTime),KviTimeUtils::NoLeadingEmptyIntervals | KviTimeUtils::NoLeadingZeroes);
txt = "TOT: ";
txt += tot;
} else {
@@ -1312,7 +1312,7 @@ void KviDccFileTransfer::displayPaint(QPainter * p,int column,int width,int heig
} else {
if(iEta >= 0)
{
- QString eta = KviTimeUtils::formatTimeInterval(iEta,KviTimeUtils::NoLeadingEmptyIntervals | KviTimeUtils::NoLeadingZeroes);
+ TQString eta = KviTimeUtils::formatTimeInterval(iEta,KviTimeUtils::NoLeadingEmptyIntervals | KviTimeUtils::NoLeadingZeroes);
txt = "ETA: ";
txt += eta;
} else {
@@ -1320,11 +1320,11 @@ void KviDccFileTransfer::displayPaint(QPainter * p,int column,int width,int heig
}
}
- p->setPen(QColor(180,180,200));
+ p->setPen(TQColor(180,180,200));
p->drawRect(width - (4 + iRightHalf),iDaH,iRightHalf,iLineSpacing);
- p->fillRect(width - (3 + iRightHalf),iDaH + 1,iRightHalf - 2,iLineSpacing - 2,bIsTerminated ? QColor(210,210,210) : QColor(190,190,240));
- p->setPen(bIsTerminated ? Qt::darkGray : Qt::black);
- p->drawText(width - (2 + iRightHalf),iDaH,iRightHalf - 4,iLineSpacing,Qt::AlignLeft | Qt::AlignVCenter,txt);
+ p->fillRect(width - (3 + iRightHalf),iDaH + 1,iRightHalf - 2,iLineSpacing - 2,bIsTerminated ? TQColor(210,210,210) : TQColor(190,190,240));
+ p->setPen(bIsTerminated ? TQt::darkGray : TQt::black);
+ p->drawText(width - (2 + iRightHalf),iDaH,iRightHalf - 4,iLineSpacing,TQt::AlignLeft | TQt::AlignVCenter,txt);
}
break;
@@ -1338,12 +1338,12 @@ int KviDccFileTransfer::displayHeight(int iLineSpacing)
return iH >= 70 ? iH : 70;
}
-QString KviDccFileTransfer::tipText()
+TQString KviDccFileTransfer::tipText()
{
- QString s;
+ TQString s;
- s = QString("<table><tr><td bgcolor=\"#000000\"><font color=\"#FFFFFF\"><b>DCC %1 (ID %2)</b></font></td></tr>").arg(m_szDccType.ptr()).arg(id());
+ s = TQString("<table><tr><td bgcolor=\"#000000\"><font color=\"#FFFFFF\"><b>DCC %1 (ID %2)</b></font></td></tr>").tqarg(m_szDccType.ptr()).tqarg(id());
s += "<tr><td bgcolor=\"#404040\"><font color=\"#FFFFFF\">";
s += __tr2qs_ctx("Transfer Log","dcc");
@@ -1362,9 +1362,9 @@ void KviDccFileTransfer::init()
g_pDccFileTransfers = new KviPointerList<KviDccFileTransfer>;
g_pDccFileTransfers->setAutoDelete(false);
- QPixmap * pix = g_pIconManager->getImage("kvi_dccfiletransfericons.png");
- if(pix)g_pDccFileTransferIcon = new QPixmap(*pix);
- else g_pDccFileTransferIcon = new QPixmap(192,128);
+ TQPixmap * pix = g_pIconManager->getImage("kvi_dccfiletransfericons.png");
+ if(pix)g_pDccFileTransferIcon = new TQPixmap(*pix);
+ else g_pDccFileTransferIcon = new TQPixmap(192,128);
}
void KviDccFileTransfer::done()
@@ -1384,7 +1384,7 @@ unsigned int KviDccFileTransfer::transferCount()
return g_pDccFileTransfers->count();
}
-KviDccFileTransfer * KviDccFileTransfer::nonFailedTransferWithLocalFileName(const QString &szLocalFileName)
+KviDccFileTransfer * KviDccFileTransfer::nonFailedTransferWithLocalFileName(const TQString &szLocalFileName)
{
if(!g_pDccFileTransfers)return 0;
for(KviDccFileTransfer * t = g_pDccFileTransfers->first();t;t = g_pDccFileTransfers->next())
@@ -1396,7 +1396,7 @@ KviDccFileTransfer * KviDccFileTransfer::nonFailedTransferWithLocalFileName(cons
if(t->localFileName() == szLocalFileName)
#endif
{
- if(t->m_eGeneralStatus != Failure)
+ if(t->m_eGeneraltqStatus != Failure)
return t;
}
}
@@ -1439,14 +1439,14 @@ bool KviDccFileTransfer::handleResumeRequest(const char * filename,const char *
return false;
}
-void KviDccFileTransfer::outputAndLog(const QString &s)
+void KviDccFileTransfer::outputAndLog(const TQString &s)
{
KviWindow * out = transferWindow();
addToTransferLog(s);
if(out)out->output(KVI_OUT_DCCMSG,"[%Q]: %Q",&m_szTransferIdString,&s);
}
-void KviDccFileTransfer::outputAndLog(int msgtype,const QString &s)
+void KviDccFileTransfer::outputAndLog(int msgtype,const TQString &s)
{
KviWindow * out = transferWindow();
addToTransferLog(s);
@@ -1454,10 +1454,10 @@ void KviDccFileTransfer::outputAndLog(int msgtype,const QString &s)
}
-void KviDccFileTransfer::addToTransferLog(const QString &s)
+void KviDccFileTransfer::addToTransferLog(const TQString &s)
{
- QDateTime dt = QDateTime::currentDateTime();
- QString ts;
+ TQDateTime dt = TQDateTime::tqcurrentDateTime();
+ TQString ts;
ts.sprintf("[%4d.%2d.%2d %2d:%2d:%2d] ",dt.date().year(),dt.date().month(),dt.date().day(),dt.time().hour(),dt.time().minute(),dt.time().second());
m_szTransferLog += ts+s;
m_szTransferLog += "<br>";
@@ -1477,19 +1477,19 @@ void KviDccFileTransfer::connectionInProgress()
// if(TRIGGER_EVENT_5PARAM_RETVALUE(KviEvent_OnDCCSendConnected,this,m_pDescriptor->szPort.ptr(),m_pDescriptor->szFileName.ptr(),m_pDescriptor->szNick.ptr(),m_pDescriptor->szUser.ptr(),m_pDescriptor->szHost.ptr()));
// }
//
- m_szStatusString = __tr2qs_ctx("Contacting host %1 on port %2","dcc").arg(m_pDescriptor->szIp).arg(m_pDescriptor->szPort);
+ m_szStatusString = __tr2qs_ctx("Contacting host %1 on port %2","dcc").tqarg(m_pDescriptor->szIp).tqarg(m_pDescriptor->szPort);
outputAndLog(m_szStatusString);
displayUpdate();
return;
}
// PASSIVE CONNECTION
- m_szStatusString = __tr2qs_ctx("Listening on interface %1 port %2","dcc").arg(m_pMarshal->localIp()).arg(m_pMarshal->localPort());
+ m_szStatusString = __tr2qs_ctx("Listening on interface %1 port %2","dcc").tqarg(m_pMarshal->localIp()).tqarg(m_pMarshal->localPort());
outputAndLog(m_szStatusString);
if(m_pDescriptor->bSendRequest)
{
- QString ip;
+ TQString ip;
if(!m_pDescriptor->szFakeIp.isEmpty())
{
ip = m_pDescriptor->szFakeIp;
@@ -1503,11 +1503,11 @@ void KviDccFileTransfer::connectionInProgress()
// try to get the IP that the IRC server can see
if(m_pDescriptor->console())
{
- QString tmp = m_pDescriptor->console()->connection() ? m_pDescriptor->console()->connection()->userInfo()->hostIp() : "";
+ TQString tmp = m_pDescriptor->console()->connection() ? m_pDescriptor->console()->connection()->userInfo()->hostIp() : "";
if(!tmp.isEmpty())
{
ip = tmp;
- outputAndLog(__tr2qs_ctx("The local IP address is private, determining from IRC server: %1","dcc").arg(ip));
+ outputAndLog(__tr2qs_ctx("The local IP address is private, determining from IRC server: %1","dcc").tqarg(ip));
} else {
outputAndLog(__tr2qs_ctx("The local IP address is private, but unable to determine it from the IRC server","dcc"));
}
@@ -1523,16 +1523,16 @@ void KviDccFileTransfer::connectionInProgress()
struct in_addr a;
if(KviNetUtils::stringIpToBinaryIp(ip,&a))ip.setNum(htonl(a.s_addr));
- QString tmp = m_pDescriptor->szFileName;
+ TQString tmp = m_pDescriptor->szFileName;
// just to be sure
- KviQString::cutToLast(tmp,'/');
- KviQString::cutToLast(tmp,'\\');
+ KviTQString::cutToLast(tmp,'/');
+ KviTQString::cutToLast(tmp,'\\');
- QString fName;
+ TQString fName;
// BUG-TO-BUG mIrc compatibility
if(KVI_OPTION_BOOL(KviOption_boolDCCFileTransferReplaceOutgoingSpacesWithUnderscores))
- tmp.replace(" ","_");
+ tmp.tqreplace(" ","_");
KviServerParser::encodeCtcpParameter(tmp.utf8().data(),fName);
// Zero port requests want DCC SEND as back-request
@@ -1558,9 +1558,9 @@ void KviDccFileTransfer::connectionInProgress()
ip.utf8().data(),port.ptr(),
&(m_pDescriptor->szLocalFileSize),0x01);
}
- outputAndLog(__tr2qs_ctx("Sent DCC %1 request to %2, waiting for remote client to connect...","dcc").arg(szReq.ptr()).arg(m_pDescriptor->szNick));
+ outputAndLog(__tr2qs_ctx("Sent DCC %1 request to %2, waiting for remote client to connect...","dcc").tqarg(szReq.ptr()).tqarg(m_pDescriptor->szNick));
} else {
- outputAndLog(__tr2qs_ctx("DCC %1 request not sent, awaiting manual connection","dcc").arg(m_szDccType.ptr()));
+ outputAndLog(__tr2qs_ctx("DCC %1 request not sent, awaiting manual connection","dcc").tqarg(m_szDccType.ptr()));
}
KVS_TRIGGER_EVENT_1(KviEvent_OnDCCFileTransferConnectionInProgress,eventWindow(),m_pDescriptor->idString());
@@ -1579,14 +1579,14 @@ void KviDccFileTransfer::startingSSLHandshake()
void KviDccFileTransfer::sslError(const char * msg)
{
#ifdef COMPILE_SSL_SUPPORT
- outputAndLog(KVI_OUT_DCCERROR,__tr2qs_ctx("[SSL ERROR]: %1","dcc").arg(msg));
+ outputAndLog(KVI_OUT_DCCERROR,__tr2qs_ctx("[SSL ERROR]: %1","dcc").tqarg(msg));
#endif
}
-bool KviDccFileTransfer::event(QEvent *e)
+bool KviDccFileTransfer::event(TQEvent *e)
{
if(e->type() == KVI_THREAD_EVENT)
{
@@ -1595,14 +1595,14 @@ bool KviDccFileTransfer::event(QEvent *e)
case KVI_DCC_THREAD_EVENT_ERROR:
{
int * err = ((KviThreadDataEvent<int> *)e)->getData();
- QString szErrorString = KviError::getDescription(*err);
+ TQString szErrorString = KviError::getDescription(*err);
delete err;
if(m_pDescriptor->bRecvFile)
g_pApp->fileDownloadTerminated(false,m_pDescriptor->szFileName.utf8().data(),m_pDescriptor->szLocalFileName.utf8().data(),m_pDescriptor->szNick.utf8().data(),szErrorString.utf8().data());
m_szStatusString = __tr2qs_ctx("Transfer failed: ","dcc");
m_szStatusString += szErrorString;
- m_eGeneralStatus = Failure;
+ m_eGeneraltqStatus = Failure;
m_tTransferEndTime = kvi_unixTime();
KVS_TRIGGER_EVENT_3(KviEvent_OnDCCFileTransferFailed,
@@ -1634,15 +1634,15 @@ bool KviDccFileTransfer::event(QEvent *e)
// Also add an optional message to the notifier, unless it is an AVATAR download!
if(KVI_OPTION_BOOL(KviOption_boolNotifiDccDownloadSuccessInNotifier))
{
- QString szMsg;
- KviQString::sprintf(szMsg,__tr2qs_ctx(""));
+ TQString szMsg;
+ KviTQString::sprintf(szMsg,__tr2qs_ctx(""));
g_pApp->notifierMessage(0,KVI_SMALLICON_DCCMSG,szMsg,30);
}
*/
if(m_pDescriptor->bRecvFile)g_pApp->fileDownloadTerminated(true,m_pDescriptor->szFileName.utf8().data(),m_pDescriptor->szLocalFileName.utf8().data(),m_pDescriptor->szNick.utf8().data());
m_szStatusString = __tr2qs_ctx("Transfer completed","dcc");
outputAndLog(m_szStatusString);
- m_eGeneralStatus = Success;
+ m_eGeneraltqStatus = Success;
m_tTransferEndTime = kvi_unixTime();
KVS_TRIGGER_EVENT_2(KviEvent_OnDCCFileTransferSuccess,
@@ -1659,7 +1659,7 @@ bool KviDccFileTransfer::event(QEvent *e)
case KVI_DCC_THREAD_EVENT_MESSAGE:
{
KviStr * str = ((KviThreadDataEvent<KviStr> *)e)->getData();
- outputAndLog(QString(__tr_no_xgettext_ctx(str->ptr(),"dcc")));
+ outputAndLog(TQString(__tr_no_xgettext_ctx(str->ptr(),"dcc")));
delete str;
return true;
}
@@ -1670,14 +1670,14 @@ bool KviDccFileTransfer::event(QEvent *e)
}
}
//#warning "Remove this!"
-// if(e->type() == QEvent::Close)debug("Close event received");
+// if(e->type() == TQEvent::Close)debug("Close event received");
return KviFileTransfer::event(e);
}
void KviDccFileTransfer::handleMarshalError(int err)
{
- QString szErr = KviError::getDescription(err);
- m_eGeneralStatus = Failure;
+ TQString szErr = KviError::getDescription(err);
+ m_eGeneraltqStatus = Failure;
m_szStatusString = __tr2qs_ctx("Transfer failed: ","dcc");
m_szStatusString += szErr;
outputAndLog(m_szStatusString);
@@ -1687,8 +1687,8 @@ void KviDccFileTransfer::handleMarshalError(int err)
void KviDccFileTransfer::connected()
{
- outputAndLog(__tr2qs_ctx("Connected to %1:%2","dcc").arg(m_pMarshal->remoteIp()).arg(m_pMarshal->remotePort()));
- outputAndLog(__tr2qs_ctx("Local end is %1:%2","dcc").arg(m_pMarshal->localIp()).arg(m_pMarshal->localPort()));
+ outputAndLog(__tr2qs_ctx("Connected to %1:%2","dcc").tqarg(m_pMarshal->remoteIp()).tqarg(m_pMarshal->remotePort()));
+ outputAndLog(__tr2qs_ctx("Local end is %1:%2","dcc").tqarg(m_pMarshal->localIp()).tqarg(m_pMarshal->localPort()));
m_tTransferStartTime = kvi_unixTime();
@@ -1731,7 +1731,7 @@ void KviDccFileTransfer::connected()
m_pSlaveSendThread->start();
}
- m_eGeneralStatus = Transferring;
+ m_eGeneraltqStatus = Transferring;
m_szStatusString = __tr2qs_ctx("Transferring data","dcc");
KVS_TRIGGER_EVENT_1(KviEvent_OnDCCFileTransferBegin,eventWindow(),m_pDescriptor->idString());
@@ -1758,7 +1758,7 @@ bool KviDccFileTransfer::resumeAccepted(const char *filename,const char *port,co
delete m_pResumeTimer;
m_pResumeTimer = 0;
- outputAndLog(__tr2qs_ctx("RESUME accepted, transfer will begin at position %1","dcc").arg(m_pDescriptor->szLocalFileSize));
+ outputAndLog(__tr2qs_ctx("RESUME accepted, transfer will begin at position %1","dcc").tqarg(m_pDescriptor->szLocalFileSize));
listenOrConnect();
@@ -1768,7 +1768,7 @@ bool KviDccFileTransfer::resumeAccepted(const char *filename,const char *port,co
if(ret != KviError_success)handleMarshalError(ret);
else {
- m_szStatusString = __tr2qs_ctx("Contacting host %1 on port %2","dcc").arg(m_pDescriptor->szIp).arg(m_pDescriptor->szPort);
+ m_szStatusString = __tr2qs_ctx("Contacting host %1 on port %2","dcc").tqarg(m_pDescriptor->szIp).tqarg(m_pDescriptor->szPort);
outputAndLog(m_szStatusString);
displayUpdate();
}
@@ -1779,10 +1779,10 @@ bool KviDccFileTransfer::resumeAccepted(const char *filename,const char *port,co
bool KviDccFileTransfer::doResume(const char * filename,const char * port,unsigned int filePos)
{
- if(KviQString::equalCI(port,m_pMarshal->dccPort()) &&
+ if(KviTQString::equalCI(port,m_pMarshal->dccPort()) &&
(!m_pSlaveRecvThread) && (!m_pDescriptor->bRecvFile))
{
- if(KviQString::equalCI(filename,m_pDescriptor->szFileName) || KVI_OPTION_BOOL(KviOption_boolAcceptBrokenFileNameDccResumeRequests))
+ if(KviTQString::equalCI(filename,m_pDescriptor->szFileName) || KVI_OPTION_BOOL(KviOption_boolAcceptBrokenFileNameDccResumeRequests))
{
bool bOk;
unsigned int iLocalFileSize = m_pDescriptor->szLocalFileSize.toUInt(&bOk);
@@ -1794,11 +1794,11 @@ bool KviDccFileTransfer::doResume(const char * filename,const char * port,unsign
}
if(iLocalFileSize <= filePos)
{
- outputAndLog(KVI_OUT_DCCERROR,__tr2qs_ctx("Invalid RESUME request: Position %1 is larger than file size","dcc").arg(filePos));
+ outputAndLog(KVI_OUT_DCCERROR,__tr2qs_ctx("Invalid RESUME request: Position %1 is larger than file size","dcc").tqarg(filePos));
return false;
}
- outputAndLog(KVI_OUT_DCCERROR,__tr2qs_ctx("Accepting RESUME request, transfer will begin at position %1","dcc").arg(filePos));
+ outputAndLog(KVI_OUT_DCCERROR,__tr2qs_ctx("Accepting RESUME request, transfer will begin at position %1","dcc").tqarg(filePos));
m_pDescriptor->szFileSize.setNum(filePos);
@@ -1822,15 +1822,15 @@ bool KviDccFileTransfer::doResume(const char * filename,const char * port,unsign
-KviDccFileTransferBandwidthDialog::KviDccFileTransferBandwidthDialog(QWidget * pParent,KviDccFileTransfer * t)
-: QDialog(pParent)
+KviDccFileTransferBandwidthDialog::KviDccFileTransferBandwidthDialog(TQWidget * pParent,KviDccFileTransfer * t)
+: TQDialog(pParent)
{
- QGridLayout * g = new QGridLayout(this,3,3,4,4);
+ TQGridLayout * g = new TQGridLayout(this,3,3,4,4);
m_pTransfer = t;
int iVal = m_pTransfer->bandwidthLimit();
- QString szText = __tr2qs_ctx("Configure bandwidth for DCC transfer %1","dcc").arg(t->id());
+ TQString szText = __tr2qs_ctx("Configure bandwidth for DCC transfer %1","dcc").tqarg(t->id());
setCaption(szText);
szText = t->isFileUpload() ? __tr2qs_ctx("Limit upload bandwidth to","dcc") : __tr2qs_ctx("Limit download bandwidth to","dcc");
@@ -1840,9 +1840,9 @@ KviDccFileTransferBandwidthDialog::KviDccFileTransferBandwidthDialog(QWidget * p
m_pEnableLimitCheck->setChecked((iVal >= 0) && (iVal < MAX_DCC_BANDWIDTH_LIMIT));
- m_pLimitBox = new QSpinBox(0,MAX_DCC_BANDWIDTH_LIMIT-1,1,this);
+ m_pLimitBox = new TQSpinBox(0,MAX_DCC_BANDWIDTH_LIMIT-1,1,this);
m_pLimitBox->setEnabled((iVal >= 0) && (iVal < MAX_DCC_BANDWIDTH_LIMIT));
- connect(m_pEnableLimitCheck,SIGNAL(toggled(bool)),m_pLimitBox,SLOT(setEnabled(bool)));
+ connect(m_pEnableLimitCheck,TQT_SIGNAL(toggled(bool)),m_pLimitBox,TQT_SLOT(setEnabled(bool)));
g->addMultiCellWidget(m_pLimitBox,0,0,1,2);
szText = " ";
@@ -1850,13 +1850,13 @@ KviDccFileTransferBandwidthDialog::KviDccFileTransferBandwidthDialog(QWidget * p
m_pLimitBox->setSuffix(szText);
m_pLimitBox->setValue(iVal < MAX_DCC_BANDWIDTH_LIMIT ? iVal : 0);
- QPushButton * pb = new QPushButton(__tr2qs_ctx("OK","dcc"),this);
- connect(pb,SIGNAL(clicked()),this,SLOT(okClicked()));
+ TQPushButton * pb = new TQPushButton(__tr2qs_ctx("OK","dcc"),this);
+ connect(pb,TQT_SIGNAL(clicked()),this,TQT_SLOT(okClicked()));
pb->setMinimumWidth(80);
g->addWidget(pb,2,2);
- pb = new QPushButton(__tr2qs_ctx("Cancel","dcc"),this);
- connect(pb,SIGNAL(clicked()),this,SLOT(cancelClicked()));
+ pb = new TQPushButton(__tr2qs_ctx("Cancel","dcc"),this);
+ connect(pb,TQT_SIGNAL(clicked()),this,TQT_SLOT(cancelClicked()));
pb->setMinimumWidth(80);
g->addWidget(pb,2,1);
@@ -1886,7 +1886,7 @@ void KviDccFileTransferBandwidthDialog::cancelClicked()
delete this;
}
-void KviDccFileTransferBandwidthDialog::closeEvent(QCloseEvent * e)
+void KviDccFileTransferBandwidthDialog::closeEvent(TQCloseEvent * e)
{
e->ignore();
delete this;
diff --git a/src/modules/dcc/send.h b/src/modules/dcc/send.h
index 636f2b3b..a5e80be9 100644
--- a/src/modules/dcc/send.h
+++ b/src/modules/dcc/send.h
@@ -34,13 +34,13 @@
#include "kvi_sockettype.h"
#include "kvi_pointerlist.h"
-#include <qlabel.h>
-#include <qprogressbar.h>
+#include <tqlabel.h>
+#include <tqprogressbar.h>
#include "kvi_tal_popupmenu.h"
#include "kvi_tal_hbox.h"
#include "kvi_tal_vbox.h"
-#include <qfile.h>
-#include <qdialog.h>
+#include <tqfile.h>
+#include <tqdialog.h>
#include "kvi_filetransfer.h"
#include "kvi_time.h"
@@ -62,7 +62,7 @@ typedef struct _KviDccSendThreadOptions
class KviDccSendThread : public KviDccThread
{
public:
- KviDccSendThread(QObject * par,kvi_socket_t fd,KviDccSendThreadOptions * opt);
+ KviDccSendThread(TQObject * par,kvi_socket_t fd,KviDccSendThreadOptions * opt);
~KviDccSendThread();
private:
// stats: SHARED!!!
@@ -108,7 +108,7 @@ typedef struct _KviDccRecvThreadOptions
class KviDccRecvThread : public KviDccThread
{
public:
- KviDccRecvThread(QObject * par,kvi_socket_t fd,KviDccRecvThreadOptions * opt);
+ KviDccRecvThread(TQObject * par,kvi_socket_t fd,KviDccRecvThreadOptions * opt);
~KviDccRecvThread();
protected:
KviDccRecvThreadOptions * m_pOpt;
@@ -124,7 +124,7 @@ protected:
KviMSecTimeInterval * m_pTimeInterval; // used for computing the instant bandwidth
int m_iInstantReceivedBytes;
unsigned long m_uInstantSpeedInterval;
- QFile * m_pFile;
+ TQFile * m_pFile;
public:
void initGetInfo();
int averageSpeed(){ return m_iAverageSpeed; };
@@ -143,23 +143,24 @@ protected:
};
class KviDccFileTransfer;
-class QSpinBox;
-class QTimer;
+class TQSpinBox;
+class TQTimer;
#include "kvi_styled_controls.h"
-class KviDccFileTransferBandwidthDialog : public QDialog
+class KviDccFileTransferBandwidthDialog : public TQDialog
{
Q_OBJECT
+ TQ_OBJECT
public:
- KviDccFileTransferBandwidthDialog(QWidget * pParent,KviDccFileTransfer * t);
+ KviDccFileTransferBandwidthDialog(TQWidget * pParent,KviDccFileTransfer * t);
~KviDccFileTransferBandwidthDialog();
protected:
KviDccFileTransfer * m_pTransfer;
KviStyledCheckBox * m_pEnableLimitCheck;
- QSpinBox * m_pLimitBox;
+ TQSpinBox * m_pLimitBox;
protected:
- virtual void closeEvent(QCloseEvent *e);
+ virtual void closeEvent(TQCloseEvent *e);
protected slots:
void okClicked();
void cancelClicked();
@@ -167,13 +168,14 @@ protected slots:
class KviDccMarshal;
-class QPainter;
+class TQPainter;
class KviTalPopupMenu;
class KviDccFileTransfer : public KviFileTransfer, public KviDccMarshalOutputContext
{
- enum GeneralStatus { Connecting , Transferring , Success , Failure };
+ enum GeneraltqStatus { Connecting , Transferring , Success , Failure };
Q_OBJECT
+ TQ_OBJECT
public:
KviDccFileTransfer(KviDccDescriptor * dcc);
~KviDccFileTransfer();
@@ -185,12 +187,12 @@ private:
KviStr m_szTarget;
KviStr m_szDccType;
- QString m_szTransferIdString;
+ TQString m_szTransferIdString;
- QString m_szStatusString;
- GeneralStatus m_eGeneralStatus;
+ TQString m_szStatusString;
+ GeneraltqStatus m_eGeneraltqStatus;
- QString m_szTransferLog; // html
+ TQString m_szTransferLog; // html
kvi_time_t m_tTransferStartTime;
kvi_time_t m_tTransferEndTime;
@@ -200,7 +202,7 @@ private:
unsigned int m_uMaxBandwidth;
KviDccFileTransferBandwidthDialog * m_pBandwidthDialog;
- QTimer * m_pResumeTimer; // used to signal resume timeout
+ TQTimer * m_pResumeTimer; // used to signal resume timeout
public:
bool resumeAccepted(const char * filename,const char * port,const char *szZeroPortTag);
bool doResume(const char * filename,const char * port,unsigned int filePos);
@@ -208,24 +210,24 @@ public:
static void init();
static void done();
static unsigned int runningTransfersCount();
- static KviDccFileTransfer * nonFailedTransferWithLocalFileName(const QString &szLocalFileName);
+ static KviDccFileTransfer * nonFailedTransferWithLocalFileName(const TQString &szLocalFileName);
static unsigned int transferCount();
static bool handleResumeAccepted(const char * filename,const char * port,const char * szZeroPortTag);
static bool handleResumeRequest(const char * filename,const char * port,unsigned int filePos);
- virtual bool event(QEvent *e);
+ virtual bool event(TQEvent *e);
virtual KviWindow * dccMarshalOutputWindow();
virtual const char * dccMarshalOutputContextString();
- virtual void displayPaint(QPainter * p,int column,int width,int height);
+ virtual void displayPaint(TQPainter * p,int column,int width,int height);
virtual int displayHeight(int iLineSpacing);
virtual void fillContextPopup(KviTalPopupMenu * m,int column);
- virtual void fillStatusString(QString &szBuffer);
+ virtual void fillStatusString(TQString &szBuffer);
virtual bool active();
virtual void die();
- virtual QString tipText();
- virtual QString localFileName();
+ virtual TQString tipText();
+ virtual TQString localFileName();
bool isFileUpload(){ return m_pDescriptor->isFileUpload(); };
@@ -237,9 +239,9 @@ public:
protected:
void startConnection();
void listenOrConnect();
- void addToTransferLog(const QString &s);
- void outputAndLog(const QString &s);
- void outputAndLog(int msgtype,const QString &s);
+ void addToTransferLog(const TQString &s);
+ void outputAndLog(const TQString &s);
+ void outputAndLog(int msgtype,const TQString &s);
KviWindow * eventWindow();
protected slots:
void connectionInProgress();
diff --git a/src/modules/dcc/thread.cpp b/src/modules/dcc/thread.cpp
index 7ae38bbe..d985f473 100644
--- a/src/modules/dcc/thread.cpp
+++ b/src/modules/dcc/thread.cpp
@@ -33,7 +33,7 @@
#include "kvi_sslmaster.h"
#endif
-KviDccThread::KviDccThread(QObject * par,kvi_socket_t fd)
+KviDccThread::KviDccThread(TQObject * par,kvi_socket_t fd)
: KviSensitiveThread()
{
m_pParent = par;
diff --git a/src/modules/dcc/thread.h b/src/modules/dcc/thread.h
index 3d56661d..b91e2a20 100644
--- a/src/modules/dcc/thread.h
+++ b/src/modules/dcc/thread.h
@@ -28,7 +28,7 @@
#include "kvi_pointerlist.h"
-#include <qobject.h>
+#include <tqobject.h>
#ifdef COMPILE_SSL_SUPPORT
#include "kvi_ssl.h"
@@ -54,19 +54,19 @@ typedef struct _KviDccThreadIncomingData
class KviDccThread : public KviSensitiveThread
{
public:
- KviDccThread(QObject * par,kvi_socket_t fd);
+ KviDccThread(TQObject * par,kvi_socket_t fd);
~KviDccThread();
protected:
KviMutex * m_pMutex; // OWNED! PROTECTS m_pOutBuffers
kvi_socket_t m_fd;
- QObject * m_pParent; // READ ONLY!
+ TQObject * m_pParent; // READ ONLY!
#ifdef COMPILE_SSL_SUPPORT
KviSSL * m_pSSL;
#endif
protected:
bool handleInvalidSocketRead(int readLen);
public:
- QObject * parent(){ return m_pParent; };
+ TQObject * tqparent(){ return m_pParent; };
void postErrorEvent(int err);
// Warning!..newer call __tr() here!...use __tr_no_lookup()
void postMessageEvent(const char * message);
diff --git a/src/modules/dcc/utils.cpp b/src/modules/dcc/utils.cpp
index 8d3229e7..d8882ce4 100644
--- a/src/modules/dcc/utils.cpp
+++ b/src/modules/dcc/utils.cpp
@@ -31,7 +31,7 @@
#include "kvi_qstring.h"
/*
-bool dcc_module_get_listen_ip_address(KviCommand *c,KviConsole * pConsole,QString &szListenIp)
+bool dcc_module_get_listen_ip_address(KviCommand *c,KviConsole * pConsole,TQString &szListenIp)
{
//
// Find an interface suitable for listening....
@@ -45,7 +45,7 @@ bool dcc_module_get_listen_ip_address(KviCommand *c,KviConsole * pConsole,QStrin
{
if(kvi_isValidStringIp(KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).utf8().data()))
{
- if(KviQString::equalCI(KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface),"0.0.0.0"))
+ if(KviTQString::equalCI(KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface),"0.0.0.0"))
{
// Try to find the first available IpV4 interface
if(!kvi_getLocalHostAddress(szListenIp))
@@ -100,7 +100,7 @@ bool dcc_module_get_listen_ip_address(KviCommand *c,KviConsole * pConsole,QStrin
*/
-bool dcc_kvs_get_listen_ip_address(KviKvsModuleCommandCall *c,KviConsole * pConsole,QString &szListenIp)
+bool dcc_kvs_get_listen_ip_address(KviKvsModuleCommandCall *c,KviConsole * pConsole,TQString &szListenIp)
{
//
// Find an interface suitable for listening....
@@ -114,7 +114,7 @@ bool dcc_kvs_get_listen_ip_address(KviKvsModuleCommandCall *c,KviConsole * pCons
{
if(kvi_isValidStringIp(KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).utf8().data()))
{
- if(KviQString::equalCI(KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface),"0.0.0.0"))
+ if(KviTQString::equalCI(KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface),"0.0.0.0"))
{
// Try to find the first available IpV4 interface
if(!kvi_getLocalHostAddress(szListenIp))
diff --git a/src/modules/dcc/utils.h b/src/modules/dcc/utils.h
index 992814f2..8e4478e8 100644
--- a/src/modules/dcc/utils.h
+++ b/src/modules/dcc/utils.h
@@ -28,7 +28,7 @@
#include "kvi_kvs_moduleinterface.h"
#ifndef _UTILS_CPP_
- extern bool dcc_kvs_get_listen_ip_address(KviKvsModuleCommandCall *c,KviConsole * pConsole,QString &szListenIp);
+ extern bool dcc_kvs_get_listen_ip_address(KviKvsModuleCommandCall *c,KviConsole * pConsole,TQString &szListenIp);
#endif
#endif //_UTILS_H_
diff --git a/src/modules/dcc/voice.cpp b/src/modules/dcc/voice.cpp
index 2e34df2f..4bf9ad9d 100644
--- a/src/modules/dcc/voice.cpp
+++ b/src/modules/dcc/voice.cpp
@@ -40,11 +40,11 @@
#include "adpcmcodec.h"
#include "gsmcodec.h"
-#include <qframe.h>
-#include <qsplitter.h>
+#include <tqframe.h>
+#include <tqsplitter.h>
#include "kvi_tal_vbox.h"
-#include <qslider.h>
-#include <qtooltip.h>
+#include <tqslider.h>
+#include <tqtooltip.h>
#ifndef COMPILE_ON_WINDOWS
#include <sys/time.h>
@@ -119,7 +119,7 @@ static KviDccVoiceCodec * kvi_dcc_voice_get_codec(const char * codecName)
KviDccVoiceThread::KviDccVoiceThread(KviWindow * wnd,kvi_socket_t fd,KviDccVoiceThreadOptions * opt)
-: KviDccThread(wnd,fd)
+: KviDccThread(TQT_TQOBJECT(wnd),fd)
{
#ifndef COMPILE_DISABLE_DCC_VOICE
m_pOpt = opt;
@@ -533,7 +533,7 @@ void KviDccVoiceThread::startRecording()
// debug("Posting event");
KviThreadDataEvent<int> * e = new KviThreadDataEvent<int>(KVI_DCC_THREAD_EVENT_ACTION);
e->setData(new int(KVI_DCC_VOICE_THREAD_ACTION_START_RECORDING));
- postEvent(parent(),e);
+ postEvent(tqparent(),e);
m_bRecording = true;
m_bRecordingRequestPending = false;
@@ -552,7 +552,7 @@ void KviDccVoiceThread::stopRecording()
KviThreadDataEvent<int> * e = new KviThreadDataEvent<int>(KVI_DCC_THREAD_EVENT_ACTION);
e->setData(new int(KVI_DCC_VOICE_THREAD_ACTION_STOP_RECORDING));
- postEvent(parent(),e);
+ postEvent(tqparent(),e);
m_bRecording = false;
if(!m_bPlaying)closeSoundcard();
@@ -569,7 +569,7 @@ void KviDccVoiceThread::startPlaying()
{
KviThreadDataEvent<int> * e = new KviThreadDataEvent<int>(KVI_DCC_THREAD_EVENT_ACTION);
e->setData(new int(KVI_DCC_VOICE_THREAD_ACTION_START_PLAYING));
- postEvent(parent(),e);
+ postEvent(tqparent(),e);
m_bPlaying = true;
}
#endif
@@ -583,7 +583,7 @@ void KviDccVoiceThread::stopPlaying()
KviThreadDataEvent<int> * e = new KviThreadDataEvent<int>(KVI_DCC_THREAD_EVENT_ACTION);
e->setData(new int(KVI_DCC_VOICE_THREAD_ACTION_STOP_PLAYING));
- postEvent(parent(),e);
+ postEvent(tqparent(),e);
m_bPlaying = false;
if(!m_bRecording)closeSoundcard();
@@ -652,57 +652,52 @@ KviDccVoice::KviDccVoice(KviFrame *pFrm,KviDccDescriptor * dcc,const char * name
m_pDescriptor = dcc;
m_pSlaveThread = 0;
- m_pSplitter = new QSplitter(Qt::Horizontal,this,"splitter");
+ m_pSplitter = new TQSplitter(Qt::Horizontal,this,"splitter");
m_pIrcView = new KviIrcView(m_pSplitter,pFrm,this);
m_pHBox = new KviTalHBox(this);
KviTalVBox * vbox = new KviTalVBox(m_pHBox);
- m_pInputLabel = new QLabel(__tr2qs_ctx("Input buffer","dcc"),vbox);
- m_pInputLabel->setFrameStyle(QFrame::Sunken | QFrame::Panel);
- m_pOutputLabel = new QLabel(__tr2qs_ctx("Output buffer","dcc"),vbox);
- m_pOutputLabel->setFrameStyle(QFrame::Sunken | QFrame::Panel);
+ m_pInputLabel = new TQLabel(__tr2qs_ctx("Input buffer","dcc"),vbox);
+ m_pInputLabel->setFrameStyle(TQFrame::Sunken | TQFrame::Panel);
+ m_pOutputLabel = new TQLabel(__tr2qs_ctx("Output buffer","dcc"),vbox);
+ m_pOutputLabel->setFrameStyle(TQFrame::Sunken | TQFrame::Panel);
vbox->setSpacing(1);
KviTalVBox * vbox2 = new KviTalVBox(m_pHBox);
- m_pRecordingLabel = new QLabel(vbox2);
+ m_pRecordingLabel = new TQLabel(vbox2);
m_pRecordingLabel->setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_RECORD)));
m_pRecordingLabel->setEnabled(false);
- m_pRecordingLabel->setFrameStyle(QFrame::Raised | QFrame::Panel);
+ m_pRecordingLabel->setFrameStyle(TQFrame::Raised | TQFrame::Panel);
- m_pPlayingLabel = new QLabel(vbox2);
+ m_pPlayingLabel = new TQLabel(vbox2);
m_pPlayingLabel->setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_PLAY)));
m_pPlayingLabel->setEnabled(false);
- m_pPlayingLabel->setFrameStyle(QFrame::Raised | QFrame::Panel);
+ m_pPlayingLabel->setFrameStyle(TQFrame::Raised | TQFrame::Panel);
vbox2->setSpacing(1);
//#warning "The volume slider should be enabled only when receiving data"
- m_pVolumeSlider = new QSlider(-100, 0, 10, 0, Qt::Vertical, m_pHBox, "dcc_voice_volume_slider");
+ m_pVolumeSlider = new TQSlider(-100, 0, 10, 0, Qt::Vertical, m_pHBox, "dcc_voice_volume_slider");
m_pVolumeSlider->setValue(getMixerVolume());
/* Update the tooltip */
setMixerVolume(m_pVolumeSlider->value());
m_pVolumeSlider->setMaximumWidth(16);
m_pVolumeSlider->setMaximumHeight(2*m_pPlayingLabel->height());
- connect(m_pVolumeSlider, SIGNAL(valueChanged(int)), this, SLOT(setMixerVolume(int)));
+ connect(m_pVolumeSlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(setMixerVolume(int)));
- m_pTalkButton = new QToolButton(m_pHBox);
+ m_pTalkButton = new TQToolButton(m_pHBox);
m_pTalkButton->setEnabled(false);
m_pTalkButton->setToggleButton(true);
-#if QT_VERSION >= 300
- QIconSet iset;
- iset.setPixmap(*(g_pIconManager->getBigIcon(KVI_BIGICON_DISCONNECTED)),QIconSet::Large,QIconSet::Normal,QIconSet::Off);
- iset.setPixmap(*(g_pIconManager->getBigIcon(KVI_BIGICON_CONNECTED)),QIconSet::Large,QIconSet::Normal,QIconSet::On);
+ TQIconSet iset;
+ iset.setPixmap(*(g_pIconManager->getBigIcon(KVI_BIGICON_DISCONNECTED)),TQIconSet::Large,TQIconSet::Normal,TQIconSet::Off);
+ iset.setPixmap(*(g_pIconManager->getBigIcon(KVI_BIGICON_CONNECTED)),TQIconSet::Large,TQIconSet::Normal,TQIconSet::On);
m_pTalkButton->setIconSet(iset);
-#else
- m_pTalkButton->setOffIconSet(*(g_pIconManager->getBigIcon(KVI_BIGICON_DISCONNECTED)));
- m_pTalkButton->setOnIconSet(*(g_pIconManager->getBigIcon(KVI_BIGICON_CONNECTED)));
-#endif
m_pTalkButton->setUsesBigPixmap(true);
- connect(m_pTalkButton,SIGNAL(toggled(bool)),this,SLOT(startOrStopTalking(bool)));
+ connect(m_pTalkButton,TQT_SIGNAL(toggled(bool)),this,TQT_SLOT(startOrStopTalking(bool)));
m_pHBox->setStretchFactor(vbox,1);
m_pHBox->setMargin(2);
@@ -711,11 +706,11 @@ KviDccVoice::KviDccVoice(KviFrame *pFrm,KviDccDescriptor * dcc,const char * name
//setFocusHandler(m_pIrcView,this);
m_pMarshal = new KviDccMarshal(this);
- connect(m_pMarshal,SIGNAL(error(int)),this,SLOT(handleMarshalError(int)));
- connect(m_pMarshal,SIGNAL(connected()),this,SLOT(connected()));
- connect(m_pMarshal,SIGNAL(inProgress()),this,SLOT(connectionInProgress()));
+ connect(m_pMarshal,TQT_SIGNAL(error(int)),this,TQT_SLOT(handleMarshalError(int)));
+ connect(m_pMarshal,TQT_SIGNAL(connected()),this,TQT_SLOT(connected()));
+ connect(m_pMarshal,TQT_SIGNAL(inProgress()),this,TQT_SLOT(connectionInProgress()));
- m_pUpdateTimer = new QTimer();
+ m_pUpdateTimer = new TQTimer();
startConnection();
}
@@ -730,7 +725,7 @@ KviDccVoice::~KviDccVoice()
m_pSlaveThread = 0;
}
- KviThreadManager::killPendingEvents(this);
+ KviThreadManager::killPendingEvents(TQT_TQOBJECT(this));
delete m_pUpdateTimer;
// delete m_pDescriptor;
@@ -782,7 +777,7 @@ void KviDccVoice::connectionInProgress()
}
}
-const QString & KviDccVoice::target()
+const TQString & KviDccVoice::target()
{
// This may change on the fly...
m_szTarget.sprintf("%s@%s:%s",
@@ -804,17 +799,17 @@ void KviDccVoice::fillCaptionBuffers()
m_szPlainTextCaption = tmp;
m_szHtmlActiveCaption.sprintf("<nobr><font color=\"%s\"><b>%s</b></font></nobr>",
- KVI_OPTION_COLOR(KviOption_colorCaptionTextActive).name().ascii(),tmp.ptr());
+ TQString(KVI_OPTION_COLOR(KviOption_colorCaptionTextActive).name()).ascii(),tmp.ptr());
m_szHtmlInactiveCaption.sprintf("<nobr><font color=\"%s\"><b>%s</b></font></nobr>",
- KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive).name().ascii(),tmp.ptr());
+ TQString(KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive).name()).ascii(),tmp.ptr());
}
-QPixmap * KviDccVoice::myIconPtr()
+TQPixmap * KviDccVoice::myIconPtr()
{
return g_pIconManager->getSmallIcon(KVI_SMALLICON_DCCVOICE);
}
-bool KviDccVoice::event(QEvent *e)
+bool KviDccVoice::event(TQEvent *e)
{
if(e->type() == KVI_THREAD_EVENT)
{
@@ -823,7 +818,7 @@ bool KviDccVoice::event(QEvent *e)
case KVI_DCC_THREAD_EVENT_ERROR:
{
int * err = ((KviThreadDataEvent<int> *)e)->getData();
- QString ssss = KviError::getDescription(*err);
+ TQString ssss = KviError::getDescription(*err);
output(KVI_OUT_DCCERROR,__tr2qs_ctx("ERROR: %Q","dcc"),&(ssss));
delete err;
m_pUpdateTimer->stop();
@@ -889,24 +884,24 @@ void KviDccVoice::updateInfo()
}
}
-void KviDccVoice::resizeEvent(QResizeEvent *e)
+void KviDccVoice::resizeEvent(TQResizeEvent *e)
{
- int hght2 = m_pHBox->sizeHint().height();
+ int hght2 = m_pHBox->tqsizeHint().height();
m_pHBox->setGeometry(0,0,width(),hght2);
m_pSplitter->setGeometry(0,hght2,width(),height() - hght2);
}
-QSize KviDccVoice::sizeHint() const
+TQSize KviDccVoice::tqsizeHint() const
{
- int w = m_pIrcView->sizeHint().width();
- int w2 = m_pHBox->sizeHint().width();
- QSize ret(w > w2 ? w : w2, m_pIrcView->sizeHint().height() + m_pHBox->sizeHint().height());
+ int w = m_pIrcView->tqsizeHint().width();
+ int w2 = m_pHBox->tqsizeHint().width();
+ TQSize ret(w > w2 ? w : w2, m_pIrcView->tqsizeHint().height() + m_pHBox->tqsizeHint().height());
return ret;
}
void KviDccVoice::handleMarshalError(int err)
{
- QString ssss = KviError::getDescription(err);
+ TQString ssss = KviError::getDescription(err);
output(KVI_OUT_DCCERROR,__tr2qs_ctx("DCC Failed: %Q","dcc"),&ssss);
m_pTalkButton->setEnabled(false);
m_pTalkButton->setOn(false);
@@ -928,7 +923,7 @@ void KviDccVoice::connected()
}
updateCaption();
- connect(m_pUpdateTimer,SIGNAL(timeout()),this,SLOT(updateInfo()));
+ connect(m_pUpdateTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(updateInfo()));
m_pUpdateTimer->start(1000);
KviDccVoiceThreadOptions * opt = new KviDccVoiceThreadOptions;
@@ -945,7 +940,7 @@ void KviDccVoice::connected()
opt->iSampleRate = m_pDescriptor->iSampleRate;
m_pSlaveThread = new KviDccVoiceThread(this,m_pMarshal->releaseSocket(),opt);
- connect(m_pUpdateTimer,SIGNAL(timeout()),this,SLOT(updateInfo()));
+ connect(m_pUpdateTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(updateInfo()));
m_pSlaveThread->start();
m_pTalkButton->setEnabled(true);
@@ -1019,9 +1014,9 @@ void KviDccVoice::setMixerVolume(int vol)
::ioctl(fd, req, &val);
::close(fd);
- QString s;
+ TQString s;
s.sprintf(__tr_ctx("Volume: %i","dcc"), -vol);
- QToolTip::add(m_pVolumeSlider, s);
+ TQToolTip::add(m_pVolumeSlider, s);
#endif
}
@@ -1029,7 +1024,7 @@ void KviDccVoice::setMixerVolume(int vol)
/* The code below doesn't work. Guess I have to catch some other widget's focusInEvent. Which one ? */
/* The point is to move the volume slider to correct position if for example user switched to
* another KVirc window, fired up xmms, changed the volume, and returned to our dcc voice window */
-void KviDccVoice::focusInEvent(QFocusEvent *e)
+void KviDccVoice::focusInEvent(TQFocusEvent *e)
{
// debug("focusInEvent()");
m_pVolumeSlider->setValue(getMixerVolume());
diff --git a/src/modules/dcc/voice.h b/src/modules/dcc/voice.h
index c74c677c..c241f4a1 100644
--- a/src/modules/dcc/voice.h
+++ b/src/modules/dcc/voice.h
@@ -33,9 +33,9 @@
#include "window.h"
#include "kvi_tal_hbox.h"
-#include <qlabel.h>
-#include <qtoolbutton.h>
-#include <qtimer.h>
+#include <tqlabel.h>
+#include <tqtoolbutton.h>
+#include <tqtimer.h>
#ifndef _DCC_VOICE_CPP_
extern bool kvi_dcc_voice_is_valid_codec(const char * codecName);
@@ -98,33 +98,34 @@ protected:
};
class KviDccMarshal;
-class QSlider;
+class TQSlider;
class KviDccVoice : public KviDccWindow
{
Q_OBJECT
+ TQ_OBJECT
public:
KviDccVoice(KviFrame *pFrm,KviDccDescriptor * dcc,const char * name);
~KviDccVoice();
protected:
KviTalHBox * m_pHBox;
- QSlider * m_pVolumeSlider;
- QLabel * m_pInputLabel;
- QLabel * m_pOutputLabel;
- QLabel * m_pRecordingLabel;
- QLabel * m_pPlayingLabel;
- QToolButton * m_pTalkButton;
- QTimer * m_pUpdateTimer;
- QString m_szTarget;
+ TQSlider * m_pVolumeSlider;
+ TQLabel * m_pInputLabel;
+ TQLabel * m_pOutputLabel;
+ TQLabel * m_pRecordingLabel;
+ TQLabel * m_pPlayingLabel;
+ TQToolButton * m_pTalkButton;
+ TQTimer * m_pUpdateTimer;
+ TQString m_szTarget;
KviDccVoiceThread * m_pSlaveThread;
protected:
- virtual void focusInEvent(QFocusEvent *);
- virtual const QString & target();
+ virtual void focusInEvent(TQFocusEvent *);
+ virtual const TQString & target();
virtual void fillCaptionBuffers();
- virtual QPixmap * myIconPtr();
- virtual void resizeEvent(QResizeEvent *e);
- virtual QSize sizeHint() const;
- virtual bool event(QEvent *e);
+ virtual TQPixmap * myIconPtr();
+ virtual void resizeEvent(TQResizeEvent *e);
+ virtual TQSize tqsizeHint() const;
+ virtual bool event(TQEvent *e);
virtual void getBaseLogFileName(KviStr &buffer);
void startTalking();
void stopTalking();
@@ -168,22 +169,22 @@ CODEC DEFINITION
class KviVoiceParty
{
public:
- KviVoiceParty(const QString &szNick,const QString &szIp,unsigned short uPort);
+ KviVoiceParty(const TQString &szNick,const TQString &szIp,unsigned short uPort);
~KviVoiceParty();
protected:
- QString m_szIp;
+ TQString m_szIp;
unsigned short m_uPort;
- QString m_szNick;
+ TQString m_szNick;
KviPointerList<KviVoiceParty> * m_pChildrenTree;
public:
- const QString & ip(){ return m_szIp; };
+ const TQString & ip(){ return m_szIp; };
unsigned short port(){ return m_uPort; };
- const QString & nick(){ return m_szNick; };
+ const TQString & nick(){ return m_szNick; };
void addChild(KviVoiceParty * pChild);
};
-KviVoiceParty::KviVoiceParty(const QString &szNick,const QString &szIp,unsigned short uPort)
+KviVoiceParty::KviVoiceParty(const TQString &szNick,const TQString &szIp,unsigned short uPort)
: m_szIp(szIp), m_uPort(uPort), m_szNick(szNick)
{
m_pChildrenTree = 0;
@@ -230,18 +231,18 @@ public:
KviVoiceLink(KviVoiceParty * pRemoteParty);
~KviVoiceLink();
protected:
- QString m_szId;
+ TQString m_szId;
KviVoiceParty * m_pRemoteParty;
KviVoiceAudioEncoder * m_pAudioEncoder;
KviVoiceAudioDecoder * m_pAudioDecoder;
public:
- const QStirng & id(){ return m_szId; };
+ const TQStirng & id(){ return m_szId; };
KviVoiceParty * remoteParty(){ return m_pRemoteParty; };
};
KviVoiceLink::KviVoiceLink(KviVoiceParty * pRemoteParty)
{
- KviQString::sprintf("%Q:%u",&(pRemoteParty->nick()),pRemoteParty->port());
+ KviTQString::sprintf("%Q:%u",&(pRemoteParty->nick()),pRemoteParty->port());
m_pRemoteParty = pRemoteParty;
m_pAudioEncoder = 0;
m_pAudioDecoder = 0;
@@ -315,9 +316,9 @@ public:
~KviVoiceConference();
public:
KviPointerList<KviVoiceLink> * m_pLinks;
- KviPointerHashTable<QString,KviVoiceLink> *
+ KviPointerHashTable<TQString,KviVoiceLink> *
SOCKET m_hUdpSocket;
- QString m_szLastError;
+ TQString m_szLastError;
unsigned int m_uLocalAudioSampleRate; // samples/sec
unsigned int m_uLocalAudioSampleSize; // bits
diff --git a/src/modules/dcc/window.h b/src/modules/dcc/window.h
index b4bfa43d..1c3d22ee 100644
--- a/src/modules/dcc/window.h
+++ b/src/modules/dcc/window.h
@@ -30,6 +30,7 @@
class KviDccWindow : public KviWindow , public KviDccMarshalOutputContext
{
Q_OBJECT
+ TQ_OBJECT
public:
KviDccWindow(int type,KviFrame * lpFrm,const char * name,KviDccDescriptor * d);
~KviDccWindow();