[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:24:50 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=ab59f34

The following commit has been merged in the master branch:
commit ab59f34f732c88dba33c85d9f86b99db056ea597
Author: Marcin Ziemiński <zieminn at gmail.com>
Date:   Sun Aug 17 19:12:00 2014 +0200

    Add view action to the OTR session notifications.
---
 lib/otr-notifications.cpp | 35 +++++++++++++++++++++++------------
 lib/otr-notifications.h   |  5 +++--
 2 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/lib/otr-notifications.cpp b/lib/otr-notifications.cpp
index 883ac41..ba3172a 100644
--- a/lib/otr-notifications.cpp
+++ b/lib/otr-notifications.cpp
@@ -19,10 +19,12 @@
 
 
 #include "otr-notifications.h"
+#include "chat-widget.h"
 
 #include <TelepathyQt/AvatarData>
 
 #include <QWidget>
+#include <QObject>
 
 #include <KAboutData>
 #include <KComponentData>
@@ -49,35 +51,44 @@ namespace OTRNotifications
             notification->setPixmap(notificationPixmap);
         }
 
-        notification->setActions(QStringList(i18n("View")));
-
         return notification;
     }
 
-    void otrSessionStarted(QWidget *widget, const Tp::ContactPtr &targetContact, bool verified)
+    void otrSessionStarted(ChatWidget *widget, const Tp::ContactPtr &targetContact, bool verified)
     {
         KNotification *notification = prepareNotification(widget, targetContact);
         if(verified) {
-            notification->setText(i18n("Private OTR session started with %1", targetContact->id()));
+            notification->setText(i18n("Private OTR session started with %1", targetContact->alias()));
         } else {
-            notification->setText(i18n("Unverified OTR session started with %1", targetContact->id()));
+            notification->setText(i18n("Unverified OTR session started with %1", targetContact->alias()));
+        }
+
+        notification->setActions(QStringList(i18n("View")));
+        if(widget) {
+            QObject::connect(notification, SIGNAL(activated(uint)), widget, SIGNAL(notificationClicked()));
+            QObject::connect(notification, SIGNAL(activated(uint)), notification, SLOT(close()));
         }
 
         notification->sendEvent();
     }
 
-    void otrSessionFinished(QWidget *widget, const Tp::ContactPtr &targetContact)
+    void otrSessionFinished(ChatWidget *widget, const Tp::ContactPtr &targetContact)
     {
         KNotification *notification = prepareNotification(widget, targetContact);
-        notification->setText(i18n("Finished OTR session with %1", targetContact->id()));
+        notification->setText(i18n("Finished OTR session with %1", targetContact->alias()));
 
+        notification->setActions(QStringList(i18n("View")));
+        if(widget) {
+            QObject::connect(notification, SIGNAL(activated(uint)), widget, SIGNAL(notificationClicked()));
+            QObject::connect(notification, SIGNAL(activated(uint)), notification, SLOT(close()));
+        }
         notification->sendEvent();
     }
 
     void authenticationRequested(QWidget *widget, const Tp::ContactPtr &targetContact)
     {
         KNotification *notification = prepareNotification(widget, targetContact);
-        notification->setText(i18n("%1 has requested your authentication", targetContact->id()));
+        notification->setText(i18n("%1 has requested your authentication", targetContact->alias()));
 
         notification->sendEvent();
     }
@@ -86,9 +97,9 @@ namespace OTRNotifications
     {
         KNotification *notification = prepareNotification(widget, targetContact);
         if(success) {
-            notification->setText(i18n("Authentication with %1 completed successfully", targetContact->id()));
+            notification->setText(i18n("Authentication with %1 completed successfully", targetContact->alias()));
         } else {
-            notification->setText(i18n("Authentication with %1 failed", targetContact->id()));
+            notification->setText(i18n("Authentication with %1 failed", targetContact->alias()));
         }
 
         notification->sendEvent();
@@ -97,7 +108,7 @@ namespace OTRNotifications
     void authenticationAborted(QWidget *widget, const Tp::ContactPtr &targetContact)
     {
         KNotification *notification = prepareNotification(widget, targetContact);
-        notification->setText(i18n("Authentication with %1 was aborted", targetContact->id()));
+        notification->setText(i18n("Authentication with %1 was aborted", targetContact->alias()));
 
         notification->sendEvent();
     }
@@ -105,7 +116,7 @@ namespace OTRNotifications
     void authenticationFailed(QWidget *widget, const Tp::ContactPtr &targetContact)
     {
         KNotification *notification = prepareNotification(widget, targetContact);
-        notification->setText(i18n("Authentication with %1 failed", targetContact->id()));
+        notification->setText(i18n("Authentication with %1 failed", targetContact->alias()));
 
         notification->sendEvent();
     }
diff --git a/lib/otr-notifications.h b/lib/otr-notifications.h
index fdbc28a..bc0246c 100644
--- a/lib/otr-notifications.h
+++ b/lib/otr-notifications.h
@@ -23,12 +23,13 @@
 #include <TelepathyQt/Contact>
 
 class QWidget;
+class ChatWidget;
 
 namespace OTRNotifications
 {
-    void otrSessionStarted(QWidget *widget, const Tp::ContactPtr &targetContact, bool verified);
+    void otrSessionStarted(ChatWidget *widget, const Tp::ContactPtr &targetContact, bool verified);
 
-    void otrSessionFinished(QWidget *widget, const Tp::ContactPtr &targetContact);
+    void otrSessionFinished(ChatWidget *widget, const Tp::ContactPtr &targetContact);
 
     void authenticationRequested(QWidget *widget, const Tp::ContactPtr &targetContact);
 

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list