[SCM] ktp-contact-applet packaging branch, master, updated. debian/15.12.1-1-966-gde83ac5

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:12:08 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-desktop-applets.git;a=commitdiff;h=5eec08f

The following commit has been merged in the master branch:
commit 5eec08f25b58fb4867e6366a8b7ac0aa1f42c17c
Author: Francesco Nwokeka <francesco.nwokeka at gmail.com>
Date:   Tue Dec 13 15:17:22 2011 +0100

    Add tooltip with user presence message
---
 presence/src/presence-applet.cpp | 30 ++++++++++++++++++++++++++++--
 presence/src/presence-applet.h   |  2 ++
 2 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/presence/src/presence-applet.cpp b/presence/src/presence-applet.cpp
index 1a92e25..047b2f5 100644
--- a/presence/src/presence-applet.cpp
+++ b/presence/src/presence-applet.cpp
@@ -21,12 +21,14 @@
 
 #include <KAction>
 #include <KActionMenu>
-#include <KStandardDirs>
 #include <KToolInvocation>
+#include <KUser>
 
 #include <KTelepathy/global-presence.h>
 #include <KTelepathy/presence.h>
 
+#include <Plasma/ToolTipManager>
+
 #include <TelepathyQt/PendingOperation>
 #include <TelepathyQt/PendingReady>
 
@@ -46,6 +48,9 @@ TelepathyPresenceApplet::TelepathyPresenceApplet(QObject* parent, const QVariant
     setMinimumSize(QSize(iconSize, iconSize));
 
     connect(m_globalPresence, SIGNAL(currentPresenceChanged(Tp::Presence)), this, SLOT(onPresenceChanged(Tp::Presence)));
+
+    // register plasmoid for tooltip
+    Plasma::ToolTipManager::self()->registerWidget(this);
 }
 
 TelepathyPresenceApplet::~TelepathyPresenceApplet()
@@ -53,7 +58,7 @@ TelepathyPresenceApplet::~TelepathyPresenceApplet()
     m_contextActions.clear();
 }
 
-QList< QAction* > TelepathyPresenceApplet::contextualActions()
+QList<QAction*> TelepathyPresenceApplet::contextualActions()
 {
     return m_contextActions;
 }
@@ -217,6 +222,27 @@ void TelepathyPresenceApplet::startContactList() const
     KToolInvocation::startServiceByDesktopName("telepathy-kde-contactlist");
 }
 
+void TelepathyPresenceApplet::toolTipAboutToShow()
+{
+    Plasma::ToolTipContent content;
+    KUser user;
+
+    QString presenceMsg("\"");
+    presenceMsg.append(m_globalPresence->currentPresence().statusMessage());
+    presenceMsg.append("\"");
+
+    content.setImage(KIcon("telepathy-kde"));
+    content.setMainText(user.loginName());
+    content.setSubText(presenceMsg);
+    Plasma::ToolTipManager::self()->setContent(this, content);
+}
+
+void TelepathyPresenceApplet::toolTipHidden()
+{
+    Plasma::ToolTipManager::self()->clearContent(this);
+}
+
+
 
 // This is the command that links your applet to the .desktop file
 K_EXPORT_PLASMA_APPLET(telepathy-kde-presence-applet, TelepathyPresenceApplet)
diff --git a/presence/src/presence-applet.h b/presence/src/presence-applet.h
index 745f91b..7c5b311 100644
--- a/presence/src/presence-applet.h
+++ b/presence/src/presence-applet.h
@@ -64,6 +64,8 @@ private Q_SLOTS:
     void setPresenceXa();
     void startAccountManager() const;
     void startContactList() const;
+    void toolTipAboutToShow();
+    void toolTipHidden();
 
 private:
     void setupAccountManager();

-- 
ktp-contact-applet packaging



More information about the pkg-kde-commits mailing list