aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
authorGravatar Fabio Bas2010-01-04 22:19:15 +0000
committerGravatar Fabio Bas2010-01-04 22:19:15 +0000
commite8d8d8167285a053552504c74a142aa67821361c (patch)
tree66ad35a9f7c50ecda6b34c06a4d12322ade97a09 /src/modules
parentfixed doc (diff)
downloadKVIrc-e8d8d8167285a053552504c74a142aa67821361c.tar.gz
KVIrc-e8d8d8167285a053552504c74a142aa67821361c.tar.bz2
KVIrc-e8d8d8167285a053552504c74a142aa67821361c.zip
implemented #668
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@3794 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/dcc/chat.cpp31
-rw-r--r--src/modules/options/optw_dcc.cpp17
2 files changed, 47 insertions, 1 deletions
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 <QEvent>
#include <QResizeEvent>
#include <QByteArray>
+#include <QTextDocument> //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 = "<b>";
+ szMsg += m_pDescriptor->szNick;
+ szMsg += "</b> ";
+ 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("<center>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.</center>","options"));
+#endif
+
+ b2 = addBoolSelector(0,3,0,3, __tr2qs_ctx("Popup notifier on new dcc chat message","options"),KviOption_boolPopupNotifierOnNewDccChatMessages);
+ mergeTip(b,
+ __tr2qs_ctx("<center>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.</center>","options"));
+
+ addRowSpacer(0,4,0,4);
}
KviDccChatOptionsWidget::~KviDccChatOptionsWidget()