[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:05 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-desktop-applets.git;a=commitdiff;h=0de901b
The following commit has been merged in the master branch:
commit 0de901b9be07e236677990ddb5e1d182e77e9e33
Author: Francesco Nwokeka <francesco.nwokeka at gmail.com>
Date: Mon Dec 12 00:31:22 2011 +0100
Add contact list and account manager context actions to context menu
---
presence/src/presence-applet.cpp | 24 ++++++++++++++++++++++++
presence/src/presence-applet.h | 4 ++++
2 files changed, 28 insertions(+)
diff --git a/presence/src/presence-applet.cpp b/presence/src/presence-applet.cpp
index 68ba824..843267c 100644
--- a/presence/src/presence-applet.cpp
+++ b/presence/src/presence-applet.cpp
@@ -23,6 +23,7 @@
#include <KAction>
#include <KActionMenu>
#include <KStandardDirs>
+#include <KToolInvocation>
#include <KTelepathy/global-presence.h>
#include <KTelepathy/presence.h>
@@ -61,7 +62,9 @@ QList< QAction* > TelepathyPresenceApplet::contextualActions()
{
QList<QAction*>contextActions;
+ // presence actions
KActionMenu *presenceMenu = new KActionMenu(i18n("Set presence"), this);
+
KAction *goOnlineAction = new KAction(KIcon("user-online"), i18n("Online"), this);
KAction *goBusyAction = new KAction(KIcon("user-busy"), i18n("Busy"), this);
KAction *goAwayAction = new KAction(KIcon("user-away"), i18n("Away"), this);
@@ -69,6 +72,10 @@ QList< QAction* > TelepathyPresenceApplet::contextualActions()
KAction *goHiddenAction = new KAction(KIcon("user-invisible"), i18n("Invisible"), this);
KAction *goOfflineAction = new KAction(KIcon("user-offline"), i18n("Offline"), this);
+ // application actions
+ KAction *showAccountManagerAction = new KAction(KIcon("telepathy-kde"), i18n("Account Manager"), this);
+ KAction *showContactListAction = new KAction(KIcon("meeting-attending"), i18n("Contact List"), this);
+
// connect actions
connect(goOnlineAction, SIGNAL(triggered()), m_globalPresenceWrapper, SLOT(setPresenceOnline()));
connect(goBusyAction, SIGNAL(triggered()), m_globalPresenceWrapper, SLOT(setPresenceBusy()));
@@ -77,6 +84,9 @@ QList< QAction* > TelepathyPresenceApplet::contextualActions()
connect(goHiddenAction, SIGNAL(triggered()), m_globalPresenceWrapper, SLOT(setPresenceHidden()));
connect(goOfflineAction, SIGNAL(triggered()), m_globalPresenceWrapper, SLOT(setPresenceOffline()));
+ connect(showAccountManagerAction, SIGNAL(triggered()), this, SLOT(startAccountManager()));
+ connect(showContactListAction, SIGNAL(triggered()), this, SLOT(startContactList()));
+
presenceMenu->addAction(goOnlineAction);
presenceMenu->addAction(goBusyAction);
presenceMenu->addAction(goAwayAction);
@@ -87,6 +97,9 @@ QList< QAction* > TelepathyPresenceApplet::contextualActions()
contextActions.append(presenceMenu);
contextActions.append(presenceMenu->addSeparator());
+ contextActions.append(showAccountManagerAction);
+ contextActions.append(showContactListAction);
+ contextActions.append(presenceMenu->addSeparator());
return contextActions;
}
@@ -119,6 +132,17 @@ void TelepathyPresenceApplet::paintInterface(QPainter* p, const QStyleOptionGrap
Plasma::Applet::paintInterface(p, option, contentsRect);
}
+void TelepathyPresenceApplet::startAccountManager() const
+{
+ KToolInvocation::startServiceByDesktopName("kcm_telepathy_accounts");
+}
+
+void TelepathyPresenceApplet::startContactList() const
+{
+ KToolInvocation::startServiceByDesktopName("telepathy-kde-contactlist");
+}
+
+
// 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 8a7ac10..589d4aa 100644
--- a/presence/src/presence-applet.h
+++ b/presence/src/presence-applet.h
@@ -48,6 +48,10 @@ public:
// /** overide of config signal */
// void showConfigurationInterface();
+private Q_SLOTS:
+ void startAccountManager() const;
+ void startContactList() const;
+
private:
/// TODO
void saveConfig();
--
ktp-contact-applet packaging
More information about the pkg-kde-commits
mailing list