From b538ec203da0ad5f6ea00dc4340dac7af0169b90 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Sun, 1 Jan 2012 16:43:23 +0000 Subject: - Happy new year! - Some parts of kvirc still refered to KviMainWindow as frame(), m_pFrm, etc.. => fixed - Some parts of kvirc were still coded as if more than one KviMainWindows could exists => fixed, this involved changing KviWindows's ctor and removing KviWindow::frame(), thus the big change - The trayicon module still called itself (and was called) dockextension, and was built to support more than one KviMainWindows => renamed and fixed - Modified KviWindow::hasAttention so that is can be used everywhere instead of mixing different ways to check if a notificationm should popup - should fix #1221 and hopefully introduce little to no bugs git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@6010 17fca916-40b9-46aa-a4ea-0a15b648b75c --- src/modules/dcc/DccChatWindow.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/modules/dcc/DccChatWindow.cpp') diff --git a/src/modules/dcc/DccChatWindow.cpp b/src/modules/dcc/DccChatWindow.cpp index d3bfddfa1..ff942d7bc 100644 --- a/src/modules/dcc/DccChatWindow.cpp +++ b/src/modules/dcc/DccChatWindow.cpp @@ -81,8 +81,8 @@ extern DccBroker * g_pDccBroker; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -DccChatWindow::DccChatWindow(KviMainWindow *pFrm,DccDescriptor * dcc,const char * name) -: DccWindow(KviWindow::DccChat,pFrm,name,dcc) +DccChatWindow::DccChatWindow(DccDescriptor * dcc,const char * name) +: DccWindow(KviWindow::DccChat,name,dcc) { m_pButtonBox = new KviTalHBox(this); @@ -101,7 +101,7 @@ DccChatWindow::DccChatWindow(KviMainWindow *pFrm,DccDescriptor * dcc,const char m_pSplitter->setObjectName("dcc_chat_splitter"); m_pSplitter->setChildrenCollapsible(false); - m_pIrcView = new KviIrcView(m_pSplitter,pFrm,this); + m_pIrcView = new KviIrcView(m_pSplitter,this); connect(m_pIrcView,SIGNAL(rightClicked()),this,SLOT(textViewRightClicked())); m_pInput = new KviInput(this); @@ -319,7 +319,7 @@ void DccChatWindow::ownMessage(const QString &text, bool bUserFeedback) KviCString buf(KviCString::Format,"%s\r\n",encrypted.ptr()); m_pSlaveThread->sendRawData(buf.ptr(),buf.len()); if(bUserFeedback) - m_pFrm->firstConsole()->outputPrivmsg(this,KVI_OUT_OWNPRIVMSGCRYPTED, + g_pMainWindow->firstConsole()->outputPrivmsg(this,KVI_OUT_OWNPRIVMSGCRYPTED, m_pDescriptor->szLocalNick.toUtf8().data(),m_pDescriptor->szLocalUser.toUtf8().data(), m_pDescriptor->szLocalHost.toUtf8().data(),text,KviConsoleWindow::NoNotifications); } @@ -331,7 +331,7 @@ void DccChatWindow::ownMessage(const QString &text, bool bUserFeedback) if(bUserFeedback) { QString encr = decodeText(encrypted.ptr()); - m_pFrm->firstConsole()->outputPrivmsg(this,KVI_OUT_OWNPRIVMSG, + g_pMainWindow->firstConsole()->outputPrivmsg(this,KVI_OUT_OWNPRIVMSG, m_pDescriptor->szLocalNick.toUtf8().data(),m_pDescriptor->szLocalUser.toUtf8().data(), m_pDescriptor->szLocalHost.toUtf8().data(),encr,KviConsoleWindow::NoNotifications); } @@ -354,7 +354,7 @@ void DccChatWindow::ownMessage(const QString &text, bool bUserFeedback) m_pSlaveThread->sendRawData(buf.ptr(),buf.len()); if(bUserFeedback) - m_pFrm->firstConsole()->outputPrivmsg(this,KVI_OUT_OWNPRIVMSG, + g_pMainWindow->firstConsole()->outputPrivmsg(this,KVI_OUT_OWNPRIVMSG, m_pDescriptor->szLocalNick.toUtf8().data(),m_pDescriptor->szLocalUser.toUtf8().data(), m_pDescriptor->szLocalHost.toUtf8().data(),tmp,KviConsoleWindow::NoNotifications); return; @@ -366,7 +366,7 @@ void DccChatWindow::ownMessage(const QString &text, bool bUserFeedback) m_pSlaveThread->sendRawData(buf.ptr(),buf.len()); if(bUserFeedback) - m_pFrm->firstConsole()->outputPrivmsg(this,KVI_OUT_OWNPRIVMSG, + g_pMainWindow->firstConsole()->outputPrivmsg(this,KVI_OUT_OWNPRIVMSG, m_pDescriptor->szLocalNick.toUtf8().data(),m_pDescriptor->szLocalUser.toUtf8().data(), m_pDescriptor->szLocalHost.toUtf8().data(),text,KviConsoleWindow::NoNotifications); } @@ -431,7 +431,7 @@ bool DccChatWindow::event(QEvent *e) if(kvi_strEqualCIN("ACTION",d.ptr(),6))d.cutLeft(6); d.stripLeftWhiteSpace(); output(KVI_OUT_ACTION,"%Q %s",&(m_pDescriptor->szNick),d.ptr()); - if(!hasAttention()) + if(!hasAttention(KviWindow::MainWindowIsVisible)) { if(KVI_OPTION_BOOL(KviOption_boolFlashDccChatWindowOnNewMessages)) { @@ -462,7 +462,7 @@ bool DccChatWindow::event(QEvent *e) case KviCryptEngine::DecryptOkWasPlainText: if(!KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnDCCChatMessage,this,QString(decryptedStuff.ptr()),m_pDescriptor->idString())) { - m_pFrm->firstConsole()->outputPrivmsg(this,KVI_OUT_DCCCHATMSG, + g_pMainWindow->firstConsole()->outputPrivmsg(this,KVI_OUT_DCCCHATMSG, m_pDescriptor->szNick.toUtf8().data(),m_pDescriptor->szUser.toUtf8().data(), m_pDescriptor->szHost.toUtf8().data(),decryptedStuff.ptr()); } @@ -485,10 +485,10 @@ bool DccChatWindow::event(QEvent *e) // FIXME! if(!KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnDCCChatMessage,this,QString(d.ptr()),m_pDescriptor->idString())) { - m_pFrm->firstConsole()->outputPrivmsg(this,KVI_OUT_DCCCHATMSG, + g_pMainWindow->firstConsole()->outputPrivmsg(this,KVI_OUT_DCCCHATMSG, m_pDescriptor->szNick.toUtf8().data(),m_pDescriptor->szUser.toUtf8().data(), m_pDescriptor->szHost.toUtf8().data(),d.ptr()); - if(!hasAttention()) + if(!hasAttention(KviWindow::MainWindowIsVisible)) { if(KVI_OPTION_BOOL(KviOption_boolFlashDccChatWindowOnNewMessages)) { -- cgit v1.3.1-10-gc9f91