[SCM] ktp-approver packaging branch, master, updated. debian/15.12.1-1-299-g62cbbd7
Maximiliano Curia
maxy at moszumanska.debian.org
Fri May 27 09:13:51 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-approver.git;a=commitdiff;h=2f819f4
The following commit has been merged in the master branch:
commit 2f819f41404df5a28d79662ffa2a9631e9ebcabe
Author: David Edmundson <kde at davidedmundson.co.uk>
Date: Mon May 6 14:21:20 2013 +0200
Add accept/reject actions to text channel approver
Add contextmenu->clear() to remove useless title
BUG: 282583
REVIEW: 110322
---
src/dispatchoperation.cpp | 11 +++++++++++
src/filetransferchannelapprover.cpp | 2 ++
src/textchannelapprover.cpp | 7 +++++++
src/tubechannelapprover.cpp | 2 ++
4 files changed, 22 insertions(+)
diff --git a/src/dispatchoperation.cpp b/src/dispatchoperation.cpp
index a1a3327..68ed8cc 100644
--- a/src/dispatchoperation.cpp
+++ b/src/dispatchoperation.cpp
@@ -21,6 +21,9 @@
#include <KDebug>
#include <TelepathyQt/PendingOperation>
+#include <TelepathyQt/TextChannel>
+#include <TelepathyQt/ReceivedMessage>
+
DispatchOperation::DispatchOperation(const Tp::ChannelDispatchOperationPtr & dispatchOperation,
QObject *parent)
: QObject(parent), m_dispatchOperation(dispatchOperation)
@@ -78,6 +81,14 @@ void DispatchOperation::onChannelRejected()
Tp::PendingOperation *operation = m_dispatchOperation->claim();
connect(operation, SIGNAL(finished(Tp::PendingOperation*)),
SLOT(onClaimFinished(Tp::PendingOperation*)));
+ Q_FOREACH(const Tp::ChannelPtr &channel, m_dispatchOperation->channels()) {
+ Tp::TextChannelPtr textChannel = Tp::TextChannelPtr::dynamicCast(channel);
+ if (textChannel) {
+ //ack everything before we close the channel. Otherwise it will reappear
+ textChannel->acknowledge(textChannel->messageQueue());
+ }
+ channel->requestClose();
+ }
}
void DispatchOperation::onClaimFinished(Tp::PendingOperation *operation)
diff --git a/src/filetransferchannelapprover.cpp b/src/filetransferchannelapprover.cpp
index f4ddc40..45affed 100644
--- a/src/filetransferchannelapprover.cpp
+++ b/src/filetransferchannelapprover.cpp
@@ -68,6 +68,8 @@ FileTransferChannelApprover::FileTransferChannelApprover(
m_notifierItem->setToolTip(QLatin1String("document-save"),
i18n("Incoming file transfer from %1", sender->alias()),
QString());
+
+ m_notifierItem->contextMenu()->clear(); //calling clear removes the pointless title
m_notifierItem->contextMenu()->addAction(i18n("Accept"), this, SIGNAL(channelAccepted()));
m_notifierItem->contextMenu()->addAction(i18n("Reject"), this, SIGNAL(channelRejected()));
connect(m_notifierItem, SIGNAL(activateRequested(bool,QPoint)), SIGNAL(channelAccepted()));
diff --git a/src/textchannelapprover.cpp b/src/textchannelapprover.cpp
index f8225ef..b5a6c02 100644
--- a/src/textchannelapprover.cpp
+++ b/src/textchannelapprover.cpp
@@ -23,6 +23,8 @@
#include <KGlobal>
#include <KDebug>
#include <KAboutData>
+#include <KMenu>
+
#include <TelepathyQt/ReceivedMessage>
#include <TelepathyQt/AvatarData>
#include <TelepathyQt/ContactManager>
@@ -78,6 +80,10 @@ void TextChannelApprover::onMessageReceived(const Tp::ReceivedMessage & msg)
connect(m_notification.data(), SIGNAL(action1Activated()), SIGNAL(channelAccepted()));
}
+ m_notifierItem.data()->contextMenu()->clear(); //calling clear removes the pointless title
+ m_notifierItem.data()->contextMenu()->addAction(i18n("Accept"), this, SIGNAL(channelAccepted()));
+ m_notifierItem.data()->contextMenu()->addAction(i18n("Close"), this, SIGNAL(channelRejected()));
+
m_notification.data()->setText(msg.text().simplified());
m_notification.data()->sendEvent();
}
@@ -96,6 +102,7 @@ QSharedPointer<KStatusNotifierItem> TextChannelApprover::getNotifierItem()
notifierItem->setAttentionIconByName(QLatin1String("mail-unread-new"));
notifierItem->setStandardActionsEnabled(false);
notifierItem->setProperty("approver_new_channels_count", 0U);
+
*s_notifierItem = notifierItem;
}
diff --git a/src/tubechannelapprover.cpp b/src/tubechannelapprover.cpp
index 83978c3..aaf7171 100644
--- a/src/tubechannelapprover.cpp
+++ b/src/tubechannelapprover.cpp
@@ -124,6 +124,8 @@ void TubeChannelApprover::showNotification(const QString& title, const QString&
m_notifierItem.data()->setToolTip(QLatin1String("document-save"),
i18n("Incoming %1 request from %2", title, sender->alias()),
QString());
+
+ m_notifierItem.data()->contextMenu()->clear(); //calling clear removes the pointless title
m_notifierItem.data()->contextMenu()->addAction(i18n("Accept"), this, SIGNAL(channelAccepted()));
m_notifierItem.data()->contextMenu()->addAction(i18n("Reject"), this, SIGNAL(channelRejected()));
connect(this, SIGNAL(channelAccepted()), SLOT(onChannelAccepted()));
--
ktp-approver packaging
More information about the pkg-kde-commits
mailing list