[SCM] ktp-contact-list packaging branch, master, updated. debian/15.12.1-2-1070-g6c56f91
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:05:50 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=93e3bae
The following commit has been merged in the master branch:
commit 93e3bae6e0950ca7c937c142998fa7f0cab84a26
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date: Thu Apr 7 21:58:59 2011 +0200
Fix context menu capabilities detection
---
main-widget.cpp | 38 +++++++++++++++++++++++++++-----------
1 file changed, 27 insertions(+), 11 deletions(-)
diff --git a/main-widget.cpp b/main-widget.cpp
index 6930a3d..749c148 100644
--- a/main-widget.cpp
+++ b/main-widget.cpp
@@ -47,6 +47,7 @@
#include <KSharedConfig>
#include <KFileDialog>
#include <KMessageBox>
+#include <KAction>
#include "main-widget.h"
#include "ui_main-widget.h"
@@ -486,6 +487,7 @@ void MainWidget::onAddContactRequestFoundContacts(Tp::PendingOperation *operatio
void MainWidget::onCustomContextMenuRequested(const QPoint &)
{
QModelIndex index = m_contactsListView->currentIndex();
+
Tp::ContactPtr contact = m_model->contactForIndex(m_modelFilter->mapToSource(index));
if (contact.isNull()) {
kDebug() << "Contact is nulled";
@@ -500,33 +502,47 @@ void MainWidget::onCustomContextMenuRequested(const QPoint &)
QScopedPointer<KMenu> menu(new KMenu);
menu->addTitle(contact->alias());
+
QAction* action = menu->addAction(i18n("Start Chat..."));
action->setIcon(KIcon("mail-message-new"));
+ action->setDisabled(true);
connect(action, SIGNAL(triggered(bool)),
SLOT(slotStartTextChat()));
+ if (index.data(AccountsModel::TextChatCapabilityRole).toBool()) {
+ action->setEnabled(true);
+ }
+
Tp::ConnectionPtr accountConnection = account->connection();
if (accountConnection.isNull()) {
kDebug() << "Account connection is nulled.";
return;
}
- if (accountConnection->capabilities().streamedMediaAudioCalls()) {
- action = menu->addAction(i18n("Start Audio Call..."));
- action->setIcon(KIcon("voicecall"));
- action->setDisabled(true);
+ action = menu->addAction(i18n("Start Audio Call..."));
+ action->setIcon(KIcon("voicecall"));
+ action->setDisabled(true);
+
+ if (index.data(AccountsModel::AudioCallCapabilityRole).toBool()) {
+ action->setEnabled(true);
}
- if (accountConnection->capabilities().streamedMediaVideoCalls()) {
- action = menu->addAction(i18n("Start Video Call..."));
- action->setIcon(KIcon("webcamsend"));
- action->setDisabled(true);
+ action = menu->addAction(i18n("Start Video Call..."));
+ action->setIcon(KIcon("webcamsend"));
+ action->setDisabled(true);
+
+ if (index.data(AccountsModel::VideoCallCapabilityRole).toBool()) {
+ action->setEnabled(true);
}
- if (accountConnection->capabilities().fileTransfers()) {
- action = menu->addAction(i18n("Send File..."));
- action->setDisabled(true);
+ action = menu->addAction(i18n("Send File..."));
+ action->setIcon(KIcon("mail-attachment"));
+ action->setDisabled(true);
+
+ if (index.data(AccountsModel::FileTransferCapabilityRole).toBool()) {
+ action->setEnabled(true);
}
+
menu->addSeparator();
// remove contact action
--
ktp-contact-list packaging
More information about the pkg-kde-commits
mailing list