From e8d8d8167285a053552504c74a142aa67821361c Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Mon, 4 Jan 2010 22:19:15 +0000 Subject: implemented #668 git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@3794 17fca916-40b9-46aa-a4ea-0a15b648b75c --- src/modules/dcc/chat.cpp | 31 +++++++++++++++++++++++++++++++ src/modules/options/optw_dcc.cpp | 17 ++++++++++++++++- 2 files changed, 47 insertions(+), 1 deletion(-) (limited to 'src/modules') diff --git a/src/modules/dcc/chat.cpp b/src/modules/dcc/chat.cpp index a25a3a528..81e1471ba 100644 --- a/src/modules/dcc/chat.cpp +++ b/src/modules/dcc/chat.cpp @@ -61,6 +61,7 @@ #include #include #include +#include //for Qt::escape #ifdef COMPILE_CRYPT_SUPPORT #include "kvi_crypt.h" @@ -421,6 +422,22 @@ bool KviDccChat::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(KVI_OPTION_BOOL(KviOption_boolFlashDccChatWindowOnNewMessages)) + { + demandAttention(); + } + if(KVI_OPTION_BOOL(KviOption_boolPopupNotifierOnNewDccChatMessages)) + { + QString szMsg = ""; + szMsg += m_pDescriptor->szNick; + szMsg += " "; + szMsg += Qt::escape(QString(d.ptr())); + //debug("kvi_sp_ctcp.cpp:975 debug: %s",szMsg.data()); + g_pApp->notifierMessage(this,KVI_OPTION_MSGTYPE(KVI_OUT_ACTION).pixId(),szMsg,KVI_OPTION_UINT(KviOption_uintNotifierAutoHideTime)); + } + } } else { #ifdef COMPILE_CRYPT_SUPPORT @@ -458,9 +475,23 @@ bool KviDccChat::event(QEvent *e) #endif // FIXME! if(!KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnDCCChatMessage,this,QString(d.ptr()),m_pDescriptor->idString())) + { m_pFrm->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(KVI_OPTION_BOOL(KviOption_boolFlashDccChatWindowOnNewMessages)) + { + demandAttention(); + } + if(KVI_OPTION_BOOL(KviOption_boolPopupNotifierOnNewDccChatMessages)) + { + QString szMsg = Qt::escape(QString(d.ptr())); + g_pApp->notifierMessage(this,KVI_SMALLICON_DCCCHATMSG,szMsg,KVI_OPTION_UINT(KviOption_uintNotifierAutoHideTime)); + } + } + } #ifdef COMPILE_CRYPT_SUPPORT } #endif diff --git a/src/modules/options/optw_dcc.cpp b/src/modules/options/optw_dcc.cpp index ddbb8eb87..c13ed086b 100644 --- a/src/modules/options/optw_dcc.cpp +++ b/src/modules/options/optw_dcc.cpp @@ -310,7 +310,22 @@ KviDccChatOptionsWidget::KviDccChatOptionsWidget(QWidget * parent) connect(b1,SIGNAL(toggled(bool)),b,SLOT(setNotEnabled(bool))); - addRowSpacer(0,2,0,2); + KviBoolSelector * b2; + +#if (defined(COMPILE_ON_WINDOWS) || defined(COMPILE_KDE_SUPPORT) || defined(COMPILE_ON_MINGW)) + b2 = addBoolSelector(0,2,0,2,__tr2qs_ctx("Flash system taskbar on new dcc chat message","options"),KviOption_boolFlashDccChatWindowOnNewMessages); + mergeTip(b, + __tr2qs_ctx("
This option causes the system taskbar entry for KVIrc to flash when a new dcc chat message " \ + "is received and the KVIrc window is not the active.
","options")); +#endif + + b2 = addBoolSelector(0,3,0,3, __tr2qs_ctx("Popup notifier on new dcc chat message","options"),KviOption_boolPopupNotifierOnNewDccChatMessages); + mergeTip(b, + __tr2qs_ctx("
This option causes a small notifier window to pop up " \ + "in the low right corner of the screen when a new message is received " \ + "and the KVIrc window is not active.
","options")); + + addRowSpacer(0,4,0,4); } KviDccChatOptionsWidget::~KviDccChatOptionsWidget() -- cgit v1.3.1-10-gc9f91