aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/dcc/canvas.cpp
diff options
context:
space:
mode:
authorGravatar Elvio Basello2008-04-03 23:29:02 +0000
committerGravatar Elvio Basello2008-04-03 23:29:02 +0000
commit529524db3f530e4edaf741a40a91d1a5787027ac (patch)
tree681d9b67ad62dea930a09e46aefa7e6a0cd418fd /src/modules/dcc/canvas.cpp
parentget rid of $KVI_INSTALL_PREFIX and $KVI_VERSION_BRANCH ; more cmake fixes for... (diff)
downloadKVIrc-529524db3f530e4edaf741a40a91d1a5787027ac.tar.gz
KVIrc-529524db3f530e4edaf741a40a91d1a5787027ac.tar.bz2
KVIrc-529524db3f530e4edaf741a40a91d1a5787027ac.zip
added a skel for windows on Tom's patch
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@1386 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/dcc/canvas.cpp')
-rw-r--r--src/modules/dcc/canvas.cpp527
1 files changed, 262 insertions, 265 deletions
diff --git a/src/modules/dcc/canvas.cpp b/src/modules/dcc/canvas.cpp
index dfe39e975..b89b25a87 100644
--- a/src/modules/dcc/canvas.cpp
+++ b/src/modules/dcc/canvas.cpp
@@ -26,276 +26,273 @@
#ifdef COMPILE_DCC_CANVAS
-#include "dialogs.h"
-#include "marshal.h"
-#include "canvaswidget.h"
-
-#define _KVI_DEBUG_CHECK_RANGE_
-#include "kvi_debug.h"
-#include "kvi_options.h"
-#include "kvi_input.h"
-#include "kvi_ircview.h"
-#include "kvi_iconmanager.h"
-#include "kvi_locale.h"
-#include "kvi_error.h"
-#include "kvi_out.h"
-#include "kvi_netutils.h"
-#include "kvi_console.h"
-#include "kvi_frame.h"
-#include "kvi_malloc.h"
-#include "kvi_memmove.h"
-#include "kvi_thread.h"
-#include "kvi_ircsocket.h"
-#include "kvi_settings.h"
-#include "kvi_themedlabel.h"
-#include "kvi_ircconnection.h"
-
-#include <qsplitter.h>
-
-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_pCanvas = new KviCanvasWidget(m_pSplitter);
-
- m_pIrcView = new KviIrcView(m_pSplitter,pFrm,this);
- m_pInput = new KviInput(this);
-
-// 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()));
-
-
- if(!(m_pDescriptor->bActive))
+ #include "dialogs.h"
+ #include "marshal.h"
+ #include "canvaswidget.h"
+
+ #define _KVI_DEBUG_CHECK_RANGE_
+ #include "kvi_debug.h"
+ #include "kvi_options.h"
+ #include "kvi_input.h"
+ #include "kvi_ircview.h"
+ #include "kvi_iconmanager.h"
+ #include "kvi_locale.h"
+ #include "kvi_error.h"
+ #include "kvi_out.h"
+ #include "kvi_netutils.h"
+ #include "kvi_console.h"
+ #include "kvi_frame.h"
+ #include "kvi_malloc.h"
+ #include "kvi_memmove.h"
+ #include "kvi_thread.h"
+ #include "kvi_ircsocket.h"
+ #include "kvi_settings.h"
+ #include "kvi_themedlabel.h"
+ #include "kvi_ircconnection.h"
+
+ #include <QSplitter>
+
+ extern KviDccBroker * g_pDccBroker;
+
+
+ KviDccCanvas::KviDccCanvas(KviFrame *pFrm,KviDccDescriptor * dcc,const char * name)
+ : KviDccWindow(KVI_WINDOW_TYPE_DCCCANVAS,pFrm,name,dcc)
{
- // PASSIVE CONNECTION
- output(KVI_OUT_DCCMSG,__tr2qs_ctx("Attempting a passive DCC CANVAS connection","dcc"));
- int ret = m_pMarshal->dccListen(dcc->szListenIp,dcc->szListenPort,m_pDescriptor->bDoTimeout);
- if(ret != KviError_success)handleMarshalError(ret);
- else {
-
- output(KVI_OUT_DCCMSG,__tr2qs_ctx("Listening on interface %Q port %Q","dcc"),
- &(m_pMarshal->localIp()),&(m_pMarshal->localPort()));
-
- if(dcc->bSendRequest)
- {
- QString ip = !dcc->szFakeIp.isEmpty() ? dcc->szFakeIp : dcc->szListenIp;
- QString 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));
- dcc->console()->connection()->sendFmtData("PRIVMSG %s :%cDCC CANVAS chat %Q %Q%c",
- dcc->console()->connection()->encodeText( dcc->szNick.utf8().data() ).data(),
- 0x01,&ip,
- &port,
- 0x01);
- output(KVI_OUT_DCCMSG,__tr2qs_ctx("Sent DCC CANVAS request to %Q, waiting for the remote client to connect...","dcc"),
- &(dcc->szNick));
- } else outputNoFmt(KVI_OUT_DCCMSG,__tr2qs_ctx("DCC CANVAS request not sent: awaiting manual connections","dcc"));
+ m_pSplitter = new QSplitter(QSplitter::Vertical,this,"splitter");
+
+ m_pCanvas = new KviCanvasWidget(m_pSplitter);
+
+ m_pIrcView = new KviIrcView(m_pSplitter,pFrm,this);
+ m_pInput = new KviInput(this);
+
+ // 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()));
+
+
+ if(!(m_pDescriptor->bActive))
+ {
+ // PASSIVE CONNECTION
+ output(KVI_OUT_DCCMSG,__tr2qs_ctx("Attempting a passive DCC CANVAS connection","dcc"));
+ int ret = m_pMarshal->dccListen(dcc->szListenIp,dcc->szListenPort,m_pDescriptor->bDoTimeout);
+ if(ret != KviError_success)handleMarshalError(ret);
+ else {
+
+ output(KVI_OUT_DCCMSG,__tr2qs_ctx("Listening on interface %Q port %Q","dcc"),
+ &(m_pMarshal->localIp()),&(m_pMarshal->localPort()));
+
+ if(dcc->bSendRequest)
+ {
+ QString ip = !dcc->szFakeIp.isEmpty() ? dcc->szFakeIp : dcc->szListenIp;
+ QString 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));
+ dcc->console()->connection()->sendFmtData("PRIVMSG %s :%cDCC CANVAS chat %Q %Q%c",
+ dcc->console()->connection()->encodeText( dcc->szNick.utf8().data() ).data(),
+ 0x01,&ip,
+ &port,
+ 0x01);
+ output(KVI_OUT_DCCMSG,__tr2qs_ctx("Sent DCC CANVAS request to %Q, waiting for the remote client to connect...","dcc"),
+ &(dcc->szNick));
+ } else outputNoFmt(KVI_OUT_DCCMSG,__tr2qs_ctx("DCC CANVAS request not sent: awaiting manual connections","dcc"));
+ }
+ } else {
+ // ACTIVE CONNECTION
+ outputNoFmt(KVI_OUT_DCCMSG,__tr2qs_ctx("Attempting an active DCC CANVAS connection","dcc"));
+ int ret = m_pMarshal->dccConnect(dcc->szIp.utf8().data(),dcc->szPort.utf8().data(),m_pDescriptor->bDoTimeout);
+ if(ret != KviError_success)handleMarshalError(ret);
+ else output(KVI_OUT_DCCMSG,__tr2qs_ctx("Contacting host %Q on port %Q","dcc"),&(dcc->szIp),&(dcc->szPort));
}
- } else {
- // ACTIVE CONNECTION
- outputNoFmt(KVI_OUT_DCCMSG,__tr2qs_ctx("Attempting an active DCC CANVAS connection","dcc"));
- int ret = m_pMarshal->dccConnect(dcc->szIp.utf8().data(),dcc->szPort.utf8().data(),m_pDescriptor->bDoTimeout);
- if(ret != KviError_success)handleMarshalError(ret);
- else output(KVI_OUT_DCCMSG,__tr2qs_ctx("Contacting host %Q on port %Q","dcc"),&(dcc->szIp),&(dcc->szPort));
+
+ // m_pSlaveThread = 0;
}
-
-// m_pSlaveThread = 0;
-}
-
-KviDccCanvas::~KviDccCanvas()
-{
- g_pDccBroker->unregisterDccWindow(this);
-// if(m_pSlaveThread)
-// {
-// m_pSlaveThread->terminate();
-// delete m_pSlaveThread;
-// m_pSlaveThread = 0;
-// }
- KviThreadManager::killPendingEvents(this);
-// delete m_pDescriptor;
-// delete m_pMarshal;
-}
-
-const QString & KviDccCanvas::target()
-{
- // This may change on the fly...
- m_szTarget.sprintf("%s@%s:%s",
- m_pDescriptor->szNick.utf8().data(),m_pDescriptor->szIp.utf8().data(),m_pDescriptor->szPort.utf8().data());
- return m_szTarget;
-}
-
-void KviDccCanvas::fillCaptionBuffers()
-{
- KviStr tmp(KviStr::Format,"DCC Canvas %s@%s:%s",
- m_pDescriptor->szNick.utf8().data(),m_pDescriptor->szIp.utf8().data(),m_pDescriptor->szPort.utf8().data());
-
- m_szPlainTextCaption = tmp;
-
- m_szHtmlActiveCaption.sprintf("<nobr><font color=\"%s\"><b>%s</b></font></nobr>",
- 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());
-}
-
-QPixmap * KviDccCanvas::myIconPtr()
-{
- return g_pIconManager->getSmallIcon(KVI_SMALLICON_CANVAS);
-}
-
-
-void KviDccCanvas::getBaseLogFileName(KviStr &buffer)
-{
- buffer.sprintf("%s_%s_%s",m_pDescriptor->szNick.utf8().data(),m_pDescriptor->szIp.utf8().data(),m_pDescriptor->szPort.utf8().data());
-}
-
-void KviDccCanvas::ownMessage(const char * text)
-{
- KviStr buf(KviStr::Format,"%s\r\n",text);
-// 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(),
- m_pDescriptor->szLocalHost.utf8().data(),text);
-}
-
-void KviDccCanvas::ownAction(const char * text)
-{
- KviStr buf(KviStr::Format,"%cACTION %s%c\r\n",text);
-// m_pSlaveThread->sendRawData(buf.ptr(),buf.len());
- output(KVI_OUT_ACTION,"%Q %s",&(m_pDescriptor->szLocalNick),text);
-}
-
-bool KviDccCanvas::event(QEvent *e)
-{
-// if(e->type() == KVI_THREAD_EVENT)
-// {
-// switch(((KviThreadEvent *)e)->id())
-// {
-// case KVI_DCC_THREAD_EVENT_ERROR:
-// {
-// int * err = ((KviThreadDataEvent<int> *)e)->getData();
-// output(KVI_OUT_DCCERROR,__tr("ERROR: %s"),kvi_getErrorString(*err));
-// delete err;
-// return true;
-// }
-// break;
-// case KVI_DCC_THREAD_EVENT_DATA:
-// {
-// KviStr * d = ((KviThreadDataEvent<KviStr> *)e)->getData();
-// if(d->firstCharIs(0x01))
-// {
-// d->cutLeft(1);
-// if(d->lastCharIs(0x01))d->cutRight(1);
-// if(kvi_strEqualCIN("ACTION",d->ptr(),6))d->cutLeft(6);
-// d->stripLeftWhiteSpace();
-// output(KVI_OUT_ACTION,"%s %s",m_pDescriptor->szNick.ptr(),d->ptr());
-// } else {
-//
-//#ifdef COMPILE_CRYPT_SUPPORT
-// if(KviCryptSessionInfo * cinf = cryptSessionInfo())
-// {
-// if(cinf->bDoDecrypt)
-// {
-// if(cinf->pEngine->isCryptographicEngine() && (*(d->ptr()) == KVI_TEXT_CRYPT))
-// {
-// KviStr decryptedStuff;
-// if(cinf->pEngine->decrypt(d->ptr() + 1,decryptedStuff))
-// {
-// m_pFrm->firstConsole()->outputPrivmsg(this,KVI_OUT_DCCCHATMSGCRYPTED,
-// m_pDescriptor->szNick.ptr(),m_pDescriptor->szUser.ptr(),
-// m_pDescriptor->szHost.ptr(),decryptedStuff.ptr());
-// } else {
-// output(KVI_OUT_SYSTEMERROR,
-// __tr("The following message looks like an encrypted one, but the crypting engine failed to decode it: %s"),
-// cinf->pEngine->lastError());
-// m_pFrm->firstConsole()->outputPrivmsg(this,KVI_OUT_DCCCHATMSG,
-// m_pDescriptor->szNick.ptr(),m_pDescriptor->szUser.ptr(),
-// m_pDescriptor->szHost.ptr(),d->ptr() + 1);
-// }
-// delete d;
-// return true;
-// } else {
-// if(!(cinf->pEngine->isCryptographicEngine()))
-// {
-// KviStr decryptedStuff;
-// if(cinf->pEngine->decrypt(d->ptr(),decryptedStuff))
-// {
-// m_pFrm->firstConsole()->outputPrivmsg(this,KVI_OUT_DCCCHATMSG,
-// m_pDescriptor->szNick.ptr(),m_pDescriptor->szUser.ptr(),
-// m_pDescriptor->szHost.ptr(),decryptedStuff.ptr());
-// delete d;
-// return true;
-// } else {
-// output(KVI_OUT_SYSTEMERROR,
-// __tr("The following message looks like an encrypted one, but the crypting engine failed to decode it: %s"),
-// cinf->pEngine->lastError());
-// }
-// }
-// }
-// }
-// }
-//#endif
-// m_pFrm->firstConsole()->outputPrivmsg(this,KVI_OUT_DCCCHATMSG,
-// m_pDescriptor->szNick.ptr(),m_pDescriptor->szUser.ptr(),
-// m_pDescriptor->szHost.ptr(),d->ptr());
-// }
-// delete d;
-// return true;
-// }
-// break;
-// }
-// }
- return KviWindow::event(e);
-}
-
-void KviDccCanvas::resizeEvent(QResizeEvent *e)
-{
- int hght = m_pInput->heightHint();
-// int hght2 = m_pTopSplitter->sizeHint().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
-{
- QSize ret(m_pIrcView->sizeHint().width(),
- m_pIrcView->sizeHint().height() + m_pInput->heightHint());
- return ret;
-}
-
-void KviDccCanvas::handleMarshalError(int err)
-{
- QString sss = KviError::getDescription(err);
- output(KVI_OUT_DCCERROR,__tr2qs_ctx("DCC Failed: %Q","dcc"),&sss);
-}
-
-void KviDccCanvas::connected()
-{
- output(KVI_OUT_DCCMSG,__tr2qs_ctx("Connected to %Q:%Q","dcc"),
- &(m_pMarshal->remoteIp()),&(m_pMarshal->remotePort()));
- output(KVI_OUT_DCCMSG,__tr2qs_ctx("Local end is %Q:%Q","dcc"),
- &(m_pMarshal->localIp()),&(m_pMarshal->localPort()));
- if(!(m_pDescriptor->bActive))
+
+ KviDccCanvas::~KviDccCanvas()
{
- // PASSIVE CONNECTION...Find out the remote end
- m_pDescriptor->szIp = m_pMarshal->remoteIp();
- m_pDescriptor->szPort = m_pMarshal->remotePort();
- m_pDescriptor->szHost = m_pMarshal->remoteIp();
+ g_pDccBroker->unregisterDccWindow(this);
+ // if(m_pSlaveThread)
+ // {
+ // m_pSlaveThread->terminate();
+ // delete m_pSlaveThread;
+ // m_pSlaveThread = 0;
+ // }
+ KviThreadManager::killPendingEvents(this);
+ // delete m_pDescriptor;
+ // delete m_pMarshal;
+ }
+
+ const QString & KviDccCanvas::target()
+ {
+ // This may change on the fly...
+ m_szTarget.sprintf("%s@%s:%s",
+ m_pDescriptor->szNick.utf8().data(),m_pDescriptor->szIp.utf8().data(),m_pDescriptor->szPort.utf8().data());
+ return m_szTarget;
+ }
+
+ void KviDccCanvas::fillCaptionBuffers()
+ {
+ KviStr tmp(KviStr::Format,"DCC Canvas %s@%s:%s",
+ m_pDescriptor->szNick.utf8().data(),m_pDescriptor->szIp.utf8().data(),m_pDescriptor->szPort.utf8().data());
+
+ m_szPlainTextCaption = tmp;
+
+ m_szHtmlActiveCaption.sprintf("<nobr><font color=\"%s\"><b>%s</b></font></nobr>",
+ 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());
+ }
+
+ QPixmap * KviDccCanvas::myIconPtr()
+ {
+ return g_pIconManager->getSmallIcon(KVI_SMALLICON_CANVAS);
}
- updateCaption();
-// m_pSlaveThread = new KviDccCanvasThread(this,m_pMarshal->releaseSocket());
-// m_pSlaveThread->start();
-}
-
-#include "m_canvas.moc"
+ void KviDccCanvas::getBaseLogFileName(KviStr &buffer)
+ {
+ buffer.sprintf("%s_%s_%s",m_pDescriptor->szNick.utf8().data(),m_pDescriptor->szIp.utf8().data(),m_pDescriptor->szPort.utf8().data());
+ }
+ void KviDccCanvas::ownMessage(const char * text)
+ {
+ KviStr buf(KviStr::Format,"%s\r\n",text);
+ // 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(),
+ m_pDescriptor->szLocalHost.utf8().data(),text);
+ }
+
+ void KviDccCanvas::ownAction(const char * text)
+ {
+ KviStr buf(KviStr::Format,"%cACTION %s%c\r\n",text);
+ // m_pSlaveThread->sendRawData(buf.ptr(),buf.len());
+ output(KVI_OUT_ACTION,"%Q %s",&(m_pDescriptor->szLocalNick),text);
+ }
+
+ bool KviDccCanvas::event(QEvent *e)
+ {
+ // if(e->type() == KVI_THREAD_EVENT)
+ // {
+ // switch(((KviThreadEvent *)e)->id())
+ // {
+ // case KVI_DCC_THREAD_EVENT_ERROR:
+ // {
+ // int * err = ((KviThreadDataEvent<int> *)e)->getData();
+ // output(KVI_OUT_DCCERROR,__tr("ERROR: %s"),kvi_getErrorString(*err));
+ // delete err;
+ // return true;
+ // }
+ // break;
+ // case KVI_DCC_THREAD_EVENT_DATA:
+ // {
+ // KviStr * d = ((KviThreadDataEvent<KviStr> *)e)->getData();
+ // if(d->firstCharIs(0x01))
+ // {
+ // d->cutLeft(1);
+ // if(d->lastCharIs(0x01))d->cutRight(1);
+ // if(kvi_strEqualCIN("ACTION",d->ptr(),6))d->cutLeft(6);
+ // d->stripLeftWhiteSpace();
+ // output(KVI_OUT_ACTION,"%s %s",m_pDescriptor->szNick.ptr(),d->ptr());
+ // } else {
+ //
+ //#ifdef COMPILE_CRYPT_SUPPORT
+ // if(KviCryptSessionInfo * cinf = cryptSessionInfo())
+ // {
+ // if(cinf->bDoDecrypt)
+ // {
+ // if(cinf->pEngine->isCryptographicEngine() && (*(d->ptr()) == KVI_TEXT_CRYPT))
+ // {
+ // KviStr decryptedStuff;
+ // if(cinf->pEngine->decrypt(d->ptr() + 1,decryptedStuff))
+ // {
+ // m_pFrm->firstConsole()->outputPrivmsg(this,KVI_OUT_DCCCHATMSGCRYPTED,
+ // m_pDescriptor->szNick.ptr(),m_pDescriptor->szUser.ptr(),
+ // m_pDescriptor->szHost.ptr(),decryptedStuff.ptr());
+ // } else {
+ // output(KVI_OUT_SYSTEMERROR,
+ // __tr("The following message looks like an encrypted one, but the crypting engine failed to decode it: %s"),
+ // cinf->pEngine->lastError());
+ // m_pFrm->firstConsole()->outputPrivmsg(this,KVI_OUT_DCCCHATMSG,
+ // m_pDescriptor->szNick.ptr(),m_pDescriptor->szUser.ptr(),
+ // m_pDescriptor->szHost.ptr(),d->ptr() + 1);
+ // }
+ // delete d;
+ // return true;
+ // } else {
+ // if(!(cinf->pEngine->isCryptographicEngine()))
+ // {
+ // KviStr decryptedStuff;
+ // if(cinf->pEngine->decrypt(d->ptr(),decryptedStuff))
+ // {
+ // m_pFrm->firstConsole()->outputPrivmsg(this,KVI_OUT_DCCCHATMSG,
+ // m_pDescriptor->szNick.ptr(),m_pDescriptor->szUser.ptr(),
+ // m_pDescriptor->szHost.ptr(),decryptedStuff.ptr());
+ // delete d;
+ // return true;
+ // } else {
+ // output(KVI_OUT_SYSTEMERROR,
+ // __tr("The following message looks like an encrypted one, but the crypting engine failed to decode it: %s"),
+ // cinf->pEngine->lastError());
+ // }
+ // }
+ // }
+ // }
+ // }
+ //#endif
+ // m_pFrm->firstConsole()->outputPrivmsg(this,KVI_OUT_DCCCHATMSG,
+ // m_pDescriptor->szNick.ptr(),m_pDescriptor->szUser.ptr(),
+ // m_pDescriptor->szHost.ptr(),d->ptr());
+ // }
+ // delete d;
+ // return true;
+ // }
+ // break;
+ // }
+ // }
+ return KviWindow::event(e);
+ }
+
+ void KviDccCanvas::resizeEvent(QResizeEvent *e)
+ {
+ int hght = m_pInput->heightHint();
+ // int hght2 = m_pTopSplitter->sizeHint().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
+ {
+ QSize ret(m_pIrcView->sizeHint().width(),
+ m_pIrcView->sizeHint().height() + m_pInput->heightHint());
+ return ret;
+ }
+
+ void KviDccCanvas::handleMarshalError(int err)
+ {
+ QString sss = KviError::getDescription(err);
+ output(KVI_OUT_DCCERROR,__tr2qs_ctx("DCC Failed: %Q","dcc"),&sss);
+ }
+
+ void KviDccCanvas::connected()
+ {
+ output(KVI_OUT_DCCMSG,__tr2qs_ctx("Connected to %Q:%Q","dcc"),
+ &(m_pMarshal->remoteIp()),&(m_pMarshal->remotePort()));
+ output(KVI_OUT_DCCMSG,__tr2qs_ctx("Local end is %Q:%Q","dcc"),
+ &(m_pMarshal->localIp()),&(m_pMarshal->localPort()));
+ if(!(m_pDescriptor->bActive))
+ {
+ // PASSIVE CONNECTION...Find out the remote end
+ m_pDescriptor->szIp = m_pMarshal->remoteIp();
+ m_pDescriptor->szPort = m_pMarshal->remotePort();
+ m_pDescriptor->szHost = m_pMarshal->remoteIp();
+ }
+ updateCaption();
+ // m_pSlaveThread = new KviDccCanvasThread(this,m_pMarshal->releaseSocket());
+ // m_pSlaveThread->start();
+ }
+
+ #include "m_canvas.moc"
#endif