[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.5/kdenetwork/kopete
From:       Michaël Larouche <michael.larouche () kdemail ! net>
Date:       2005-08-30 0:36:56
Message-ID: 1125362216.657600.16174.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 454823 by mlarouche:

Rework notification of a buzz/nudge.
Let the user configure notification by himself in "Configure Notifications..."



 M  +6 -0      kopete/eventsrc  
 M  +7 -0      libkopete/kopetechatsession.cpp  
 M  +6 -0      libkopete/kopetechatsession.h  
 M  +0 -1      protocols/msn/msnaccount.cpp  
 M  +4 -4      protocols/msn/msnchatsession.cpp  
 M  +2 -3      protocols/yahoo/yahooaccount.cpp  


--- branches/KDE/3.5/kdenetwork/kopete/kopete/eventsrc #454822:454823
@@ -1054,3 +1054,9 @@
 Comment[tr]=Servis İç Hatası meydana geldi
 Comment[zh_CN]=发生了服务内部错误
 default_presentation=2
+
+[buzz_nudge]
+Name=Buzz/Nudge
+Comment=A contact has send you a buzz/nudge.
+default_sound=Kopete_Received.ogg
+default_presentation=17
--- branches/KDE/3.5/kdenetwork/kopete/libkopete/kopetechatsession.cpp #454822:454823
@@ -6,6 +6,7 @@
     Copyright (c) 2002-2003 by Martijn Klingens       <klingens@kde.org>
     Copyright (c) 2002-2004 by Olivier Goffart        <ogoffart @ kde.org>
     Copyright (c) 2003      by Jason Keirstead        <jason@keirstead.org>
+    Copyright (c) 2005      by Michal Larouche       <michael.larouche@kdemail.net>
 
     Kopete    (c) 2002-2003 by the Kopete developers  <kopete-devel@kde.org>
 
@@ -29,6 +30,7 @@
 #include <kglobal.h>
 #include <klocale.h>
 #include <kmessagebox.h>
+#include <knotification.h>
 
 #include "kopeteaccount.h"
 #include "kopetecommandhandler.h"
@@ -257,6 +259,11 @@
 	emit messageSuccess();
 }
 
+void Kopete::ChatSession::emitNudgeNotification()
+{
+	KNotification::event( QString::fromLatin1("buzz_nudge"), i18n("A contact send you a \
buzz/nudge.!") ); +}
+
 void Kopete::ChatSession::appendMessage( Kopete::Message &msg )
 {
 	msg.setManager( this );
--- branches/KDE/3.5/kdenetwork/kopete/libkopete/kopetechatsession.h #454822:454823
@@ -6,6 +6,7 @@
     Copyright (c) 2002-2003 by Martijn Klingens       <klingens@kde.org>
     Copyright (c) 2002-2004 by Olivier Goffart        <ogoffart @ kde.org>
     Copyright (c) 2003      by Jason Keirstead        <jason@keirstead.org>
+    Copyright (c) 2005      by Michal Larouche       <michael.larouche@kdemail.net>
 
     Kopete    (c) 2002-2003 by the Kopete developers  <kopete-devel@kde.org>
 
@@ -349,6 +350,11 @@
 	 */
 	void messageSucceeded();
 
+	/**
+	 * Protcols have to call this method if they want to emit a notification when a \
nudge/buzz is received. +	 */
+	void emitNudgeNotification();
+
 private slots:
 	void slotUpdateDisplayName();
 	void slotViewDestroyed();
--- branches/KDE/3.5/kdenetwork/kopete/protocols/msn/msnaccount.cpp #454822:454823
@@ -1316,7 +1316,6 @@
 				addGroup( group->displayName(), contactId );
 			}
 		}
-		
 	}
 
 	// After add the contact to the top-level, it will be moved to required groups \
                later.
--- branches/KDE/3.5/kdenetwork/kopete/protocols/msn/msnchatsession.cpp \
#454822:454823 @@ -39,7 +39,6 @@
 #include "kopetechatsessionmanager.h"
 #include "kopeteuiglobal.h"
 #include "kopeteglobal.h"
-//#include "kopeteutils.h"
 #include "kopeteview.h"
 
 #include "msncontact.h"
@@ -638,12 +637,13 @@
 
 void MSNChatSession::slotNudgeReceived()
 {
-	// FIXME: Better display of the nudge.
-	// FIXME: WHhen nudge is the first received message, you can't see your own message \
you send before the others send you a message. +	// FIXME: When nudge is the first \
received message, you can't see your own message you send before the others send you \
a message. +	//        Ok, this is only with chat window style which use "Parse All \
Message" flag.  QString nudgeBody = i18n( "You have received a nudge!" );
 	Kopete::Message msg = Kopete::Message(myself(), members(), nudgeBody, \
Kopete::Message::Internal, Kopete::Message::PlainText );  appendMessage( msg );
-	//Kopete::Utils::notifyBuzz( myself()->account(), nudgeBody );
+	// Emit the nudge/buzz notification (configured by user).
+	emitNudgeNotification();
 }
 
 
--- branches/KDE/3.5/kdenetwork/kopete/protocols/yahoo/yahooaccount.cpp \
#454822:454823 @@ -792,9 +792,8 @@
 	
 	Kopete::ChatSession *mm = contact(who)->manager(Kopete::Contact::CanCreate);
 	mm->appendMessage(kmsg);
-	
-	/* TODO play a sound */
-	
+	// Emit the buzz notification.
+	mm->emitNudgeNotification();
 }
 
 void YahooAccount::slotGotConfInvite( const QString & /* who */, const QString & /* \
room */, const QString & /* msg */, const QStringList & /* members */ )


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic