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

List:       kde-bugs-dist
Subject:    [Bug 110294] Wish:  Kopete to support MSN alerts
From:       Jim Basilio <jbasilio.kde () verizon ! net>
Date:       2005-10-21 15:22:13
Message-ID: 20051021152213.21362.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
         
http://bugs.kde.org/show_bug.cgi?id=110294         
jbasilio.kde verizon net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From jbasilio.kde verizon net  2005-10-21 17:22 -------
SVN commit 472675 by basilio:

BUG: 110294
FEATURE: 110294
Implemented MSN Alert support.  Commited to kopete 0.12 branch.


 M  +16 -1     libkopete/knotification.cpp  
 M  +1 -0      libkopete/knotification.h  
 M  +27 -5     protocols/msn/msnnotifysocket.cpp  
 M  +3 -0      protocols/msn/msnnotifysocket.h  


--- branches/work/kopete/dev-0.12/kopete/libkopete/knotification.cpp #472674:472675
 @ -18,6 +18,7  @
 
 #include "knotification.h"
 
+#include <kdebug.h>
 #include <kapplication.h>
 #include <knotifyclient.h>
 #include <kmessagebox.h>
 @ -65,11 +66,11  @
 KNotification::KNotification(QObject *parent) :
 		QObject(parent) , d(new Private)
 {
+	m_linkClicked = false;
 }
 
 KNotification::~KNotification() 
 {
-	emit closed();
 	delete d;
 }
 
 @ -228,17 +229,23  @
 
 void KNotification::slotPopupLinkClicked(const QString &adr)
 {
+	m_linkClicked = true;
 	unsigned int action=adr.toUInt();
 	if(action==0)
 		return;
 
 	activate(action);
+
+	// since we've hidden the message (KNotification::notifyByPassivePopup(const \
QPixmap &pix )) +	// we must now schedule overselves for deletion
+	close();
 }
 
 void KNotification::activate(unsigned int action)
 {
 	if(action==0)
 		emit activated();
+
 	emit activated(action);
 	deleteLater();
 }
 @ -246,6 +253,14  @
 
 void KNotification::close()
 {
+	// if the user hasn't clicked the link, and if we got here, it means the dialog \
closed +	// and we were ignored
+	if (!m_linkClicked)
+	{
+		emit ignored();
+	}
+
+	emit closed();
 	deleteLater();
 }
 
--- branches/work/kopete/dev-0.12/kopete/libkopete/knotification.h #472674:472675
 @ -147,6 +147,7  @
 	 */
 	static void raiseWidget(QWidget *w);
 
+	bool m_linkClicked;
 
 private slots:
 	void notifyByMessagebox();
--- branches/work/kopete/dev-0.12/kopete/protocols/msn/msnnotifysocket.cpp \
#472674:472675  @ -45,12 +45,12  @
 #include <kconfig.h>
 #include <knotification.h>
 
-
 #include "kopeteuiglobal.h"
 #include "kopeteglobal.h"
 
 #include <ctime>
 
+
 MSNNotifySocket::MSNNotifySocket( MSNAccount *account, const QString& /*msnId*/, \
const QString &password )  : MSNSocket( account )
 {
 @ -683,6 +683,20  @
 	m_secureLoginHandler = 0L;
 }
 
+void MSNNotifySocket::slotMSNAlertUnwanted()
+{
+	// user not interested .. clean up the list of actions
+	m_msnAlertURLs.clear();
+}
+
+void MSNNotifySocket::slotMSNAlertLink(unsigned int action)
+{
+	// index into our action list and pull out the URL that was clicked ..
+	KURL tempURLForLaunch(m_msnAlertURLs[action-1]);
+	
+	KRun* urlToRun = new KRun(tempURLForLaunch);
+}
+
 void MSNNotifySocket::slotOpenInbox()
 {
 	sendCommand("URL", "INBOX" );
 @ -842,7 +856,6  @
 			QDomNode msgDOM = msgElements.item(i);
 
 			QDomNodeList msgChildren = msgDOM.childNodes();
-			kdDebug ( 14140 ) << "children " << msgChildren.length() << endl;
 			for (uint i = 0 ; i < msgChildren.length() ; i++) {
 				QDomNode child = msgChildren.item(i);
 				QDomElement element = child.toElement();
 @ -879,10 +892,18  @
 
 			}
 
-			kdDebug( 14140 ) << "subscString " << subscString << " actionString " << \
actionString << " textString " << textString << endl; +//			kdDebug( 14140 ) << \
"subscString " << subscString << " actionString " << actionString << " textString " \
<< textString << endl; +			// build an internal list of actions ... we'll need to \
index into this list when we receive an event +			QStringList actions;
+			actions.append(i18n("More Information"));
+			m_msnAlertURLs.append(actionString);
 
-			KNotification::event("msn_alert", textString);
-			
+			actions.append(i18n("Manage Subscription"));
+			m_msnAlertURLs.append(subscString);
+
+			KNotification* notification = KNotification::event("msn_alert", textString, 0L, \
0L, actions); +			QObject::connect(notification, SIGNAL(activated(unsigned int)), \
this, SLOT(slotMSNAlertLink(unsigned int))); +			QObject::connect(notification, \
SIGNAL(closed()), this, SLOT(slotMSNAlertUnwanted()));  } // end for each MSG tag
 	}
 
 @ -1270,6 +1291,7  @
 		return MSNProtocol::protocol()->UNK;
 }
 
+
 #include "msnnotifysocket.moc"
 
 // vim: set noet ts=4 sts=4 sw=4:
--- branches/work/kopete/dev-0.12/kopete/protocols/msn/msnnotifysocket.h \
#472674:472675  @ -77,6 +77,8  @
 
 public slots:
 	void slotOpenInbox();
+	void slotMSNAlertLink(unsigned int action);
+	void slotMSNAlertUnwanted();
 
 signals:
 	void newContactList();
 @ -153,6 +155,7  @
 
 	MSNAccount *m_account;
 	QString m_password;
+	QStringList m_msnAlertURLs;
 
 	unsigned int mailCount;


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

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