[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:06:19 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=83802a9
The following commit has been merged in the master branch:
commit 83802a9afb7583216d16ec43a901d7c1f13df21d
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date: Thu May 5 00:32:51 2011 +0200
Added the missing implementation to start audio/video from contact list (using overlay button or context menu).
Reviewed by: George Kiagiadakis
REVIEW: 101293
---
main-widget.cpp | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
main-widget.h | 6 +++--
2 files changed, 80 insertions(+), 3 deletions(-)
diff --git a/main-widget.cpp b/main-widget.cpp
index b929572..2a00fab 100644
--- a/main-widget.cpp
+++ b/main-widget.cpp
@@ -62,6 +62,7 @@
#define PREFERRED_TEXTCHAT_HANDLER "org.freedesktop.Telepathy.Client.KDE.TextUi"
#define PREFERRED_FILETRANSFER_HANDLER "org.freedesktop.Telepathy.Client.KDE.FileTransfer"
+#define PREFERRED_AUDIO_VIDEO_HANDLER "org.freedesktop.Telepathy.Client.telepathy_kde_call_ui"
bool kde_tp_filter_contacts_by_publication_status(const Tp::ContactPtr &contact)
{
@@ -452,9 +453,51 @@ void MainWidget::startTextChannel(const QModelIndex &index)
Tp::PendingChannelRequest* channelRequest = account->ensureTextChat(contact,
QDateTime::currentDateTime(),
PREFERRED_TEXTCHAT_HANDLER);
- connect(channelRequest, SIGNAL(finished(Tp::PendingOperation*)), SLOT(slotGenericOperationFinished(Tp::PendingOperation*)));
+ connect(channelRequest, SIGNAL(finished(Tp::PendingOperation*)),
+ this, SLOT(slotGenericOperationFinished(Tp::PendingOperation*)));
+}
+
+void MainWidget::startAudioChannel(const QModelIndex& index)
+{
+ if (! index.isValid()) {
+ return;
+ }
+
+ QModelIndex realIndex = m_modelFilter->mapToSource(index);
+ Tp::ContactPtr contact = m_model->data(realIndex, AccountsModel::ItemRole).value<ContactModelItem*>()->contact();
+
+ kDebug() << "Requesting audio for contact" << contact->alias();
+
+ Tp::AccountPtr account = m_model->accountForContactIndex(realIndex);
+
+ Tp::PendingChannelRequest* channelRequest = account->ensureStreamedMediaAudioCall(contact,
+ QDateTime::currentDateTime(),
+ PREFERRED_AUDIO_VIDEO_HANDLER);
+ connect(channelRequest, SIGNAL(finished(Tp::PendingOperation*)),
+ this, SLOT(slotGenericOperationFinished(Tp::PendingOperation*)));
+}
+
+void MainWidget::startVideoChannel(const QModelIndex& index)
+{
+ if (! index.isValid()) {
+ return;
+ }
+
+ QModelIndex realIndex = m_modelFilter->mapToSource(index);
+ Tp::ContactPtr contact = m_model->data(realIndex, AccountsModel::ItemRole).value<ContactModelItem*>()->contact();
+
+ kDebug() << "Requesting video for contact" << contact->alias();
+
+ Tp::AccountPtr account = m_model->accountForContactIndex(realIndex);
+
+ Tp::PendingChannelRequest* channelRequest = account->ensureStreamedMediaVideoCall(contact, true,
+ QDateTime::currentDateTime(),
+ PREFERRED_AUDIO_VIDEO_HANDLER);
+ connect(channelRequest, SIGNAL(finished(Tp::PendingOperation*)),
+ this, SLOT(slotGenericOperationFinished(Tp::PendingOperation*)));
}
+
void MainWidget::startFileTransferChannel(const QModelIndex &index)
{
if (! index.isValid()) {
@@ -585,6 +628,12 @@ void MainWidget::addOverlayButtons()
connect(fileOverlay, SIGNAL(activated(QModelIndex)),
this, SLOT(startFileTransferChannel(QModelIndex)));
+
+ connect(audioOverlay, SIGNAL(activated(QModelIndex)),
+ this, SLOT(startAudioChannel(QModelIndex)));
+
+ connect(videoOverlay, SIGNAL(activated(QModelIndex)),
+ this, SLOT(startVideoChannel(QModelIndex)));
}
void MainWidget::toggleSearchWidget(bool show)
@@ -661,6 +710,8 @@ void MainWidget::onCustomContextMenuRequested(const QPoint &)
action = menu->addAction(i18n("Start Audio Call..."));
action->setIcon(KIcon("voicecall"));
action->setDisabled(true);
+ connect(action, SIGNAL(triggered(bool)),
+ SLOT(slotStartAudioChat()));
if (index.data(AccountsModel::AudioCallCapabilityRole).toBool()) {
action->setEnabled(true);
@@ -669,6 +720,8 @@ void MainWidget::onCustomContextMenuRequested(const QPoint &)
action = menu->addAction(i18n("Start Video Call..."));
action->setIcon(KIcon("webcamsend"));
action->setDisabled(true);
+ connect(action, SIGNAL(triggered(bool)),
+ SLOT(slotStartVideoChat()));
if (index.data(AccountsModel::VideoCallCapabilityRole).toBool()) {
action->setEnabled(true);
@@ -822,6 +875,28 @@ void MainWidget::slotStartTextChat()
startTextChannel(index);
}
+void MainWidget::slotStartAudioChat()
+{
+ QModelIndex index = m_contactsListView->currentIndex();
+ if (!index.isValid()) {
+ kDebug() << "Invalid index provided.";
+ return;
+ }
+
+ startAudioChannel(index);
+}
+
+void MainWidget::slotStartVideoChat()
+{
+ QModelIndex index = m_contactsListView->currentIndex();
+ if (!index.isValid()) {
+ kDebug() << "Invalid index provided.";
+ return;
+ }
+
+ startVideoChannel(index);
+}
+
void MainWidget::slotStartFileTransfer()
{
QModelIndex index = m_contactsListView->currentIndex();
diff --git a/main-widget.h b/main-widget.h
index c103a66..396c08b 100644
--- a/main-widget.h
+++ b/main-widget.h
@@ -84,8 +84,8 @@ public Q_SLOTS:
void selectAvatarFromAccount(const QString &accountUID);
void selectAvatarFromAccount();
void loadAvatarFromFile();
- // void startAudioChannel();
- // void startVideoChannel();
+ void startAudioChannel(const QModelIndex &index);
+ void startVideoChannel(const QModelIndex &index);
void onCustomContextMenuRequested(const QPoint &point);
private Q_SLOTS:
@@ -94,6 +94,8 @@ private Q_SLOTS:
void slotDeleteContact();
void slotGenericOperationFinished(Tp::PendingOperation *operation); /** called when a Tp::PendingOperation finishes. Used to check for errors */
void slotStartTextChat();
+ void slotStartAudioChat();
+ void slotStartVideoChat();
void slotStartFileTransfer();
void slotUnblockContactTriggered();
void onAvatarFetched(KJob*);
--
ktp-contact-list packaging
More information about the pkg-kde-commits
mailing list