[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:20:29 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=62c729c
The following commit has been merged in the master branch:
commit 62c729c068572cd0a2ac06ecfbf7dfd9aad135f0
Author: Alin M Elena <alinm.elena at gmail.com>
Date: Wed Nov 23 11:26:23 2011 +0000
added share my desktop button. there is still auto enable to be done when the common.
---
app/chat-window.cpp | 46 +++++++++++++++++++++++++++++++++++++++++++++-
app/chat-window.h | 12 ++++++++++--
2 files changed, 55 insertions(+), 3 deletions(-)
diff --git a/app/chat-window.cpp b/app/chat-window.cpp
index 93fd66c..06342cd 100644
--- a/app/chat-window.cpp
+++ b/app/chat-window.cpp
@@ -51,6 +51,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.KDE.CallUi"
+#define PREFERRED_RFB_HANDLER "org.freedesktop.Telepathy.Client.krfb_rfb_handler"
ChatWindow::ChatWindow()
{
@@ -63,6 +64,7 @@ ChatWindow::ChatWindow()
// keyboard shortcuts for the search bar
KStandardAction::find(this, SLOT(onSearchActionToggled()), actionCollection());
+
// start disabled
KStandardAction::findNext(this, SLOT(onFindNextText()), actionCollection())->setEnabled(false);
KStandardAction::findPrev(this, SLOT(onFindPreviousText()), actionCollection())->setEnabled(false);
@@ -274,14 +276,19 @@ void ChatWindow::onCurrentIndexChanged(int index)
setAudioCallEnabled(selfCapabilities.streamedMediaAudioCalls() && contactCapabilites.streamedMediaAudioCalls());
setFileTransferEnabled(selfCapabilities.fileTransfers() && contactCapabilites.fileTransfers());
setVideoCallEnabled(selfCapabilities.streamedMediaVideoCalls() && contactCapabilites.streamedMediaVideoCalls());
+ /// TODO this shall be activated/deactivated according to capabilities. The code is already in common
+ setShareDesktopEnabled(true);
/// TODO re-activate check when invitation to chat has been sorted out
setInviteToChatEnabled(false);
+
} else {
setAudioCallEnabled(false);
setFileTransferEnabled(false);
setVideoCallEnabled(false);
+ setShareDesktopEnabled(false);
/// TODO re-activate check when invitation to chat has been sorted out
setInviteToChatEnabled(false);
+
}
}
@@ -412,6 +419,19 @@ void ChatWindow::onVideoCallTriggered()
startVideoCall(currChat->account(), currChat->textChannel()->targetContact());
}
+void ChatWindow::onShareDesktopTriggered()
+{
+ ChatWidget *currChat = qobject_cast<ChatWidget*>(m_tabWidget->currentWidget());
+
+ // This should never happen
+ if (!currChat) {
+ return;
+ }
+
+ startShareDesktop(currChat->account(), currChat->textChannel()->targetContact());
+}
+
+
void ChatWindow::showSettingsDialog()
{
kDebug();
@@ -485,12 +505,15 @@ void ChatWindow::setupCustomActions()
KAction *fileTransferAction = new KAction(KIcon(QLatin1String("mail-attachment")), i18n("&Send File"), this);
connect(fileTransferAction, SIGNAL(triggered()), this, SLOT(onFileTransferTriggered()));
- KAction *inviteToChat = new KAction(KIcon(QLatin1String("user-group-new")), i18n("&Invite to chat"), this);
+ KAction *inviteToChat = new KAction(KIcon(QLatin1String("user-group-new")), i18n("&Invite to Chat"), this);
connect(inviteToChat, SIGNAL(triggered()), this, SLOT(onInviteToChatTriggered()));
KAction *videoCallAction = new KAction(KIcon(QLatin1String("webcamsend")), i18n("&Video Call"), this);
connect(videoCallAction, SIGNAL(triggered()), this, SLOT(onVideoCallTriggered()));
+ KAction *shareDesktopAction = new KAction(KIcon(QLatin1String("krfb")), i18n("Share My &Desktop"), this);
+ connect(shareDesktopAction, SIGNAL(triggered()), this, SLOT(onShareDesktopTriggered()));
+
// add custom actions to the collection
actionCollection()->addAction(QLatin1String("separator"), separator);
actionCollection()->addAction(QLatin1String("next-tab"), nextTabAction);
@@ -499,6 +522,7 @@ void ChatWindow::setupCustomActions()
actionCollection()->addAction(QLatin1String("send-file"), fileTransferAction);
actionCollection()->addAction(QLatin1String("video-call"), videoCallAction);
actionCollection()->addAction(QLatin1String("invite-to-chat"), inviteToChat);
+ actionCollection()->addAction(QLatin1String("share-desktop"), shareDesktopAction);
}
void ChatWindow::setAudioCallEnabled(bool enable)
@@ -538,6 +562,15 @@ void ChatWindow::setVideoCallEnabled(bool enable)
}
}
+void ChatWindow::setShareDesktopEnabled(bool enable)
+{
+ QAction *action = actionCollection()->action(QLatin1String("share-desktop"));
+
+ if (action) {
+ action->setEnabled(enable);
+ }
+}
+
void ChatWindow::startAudioCall(const Tp::AccountPtr& account, const Tp::ContactPtr& contact)
{
Tp::PendingChannelRequest* channelRequest = account->ensureStreamedMediaAudioCall(contact,
@@ -584,6 +617,17 @@ void ChatWindow::startVideoCall(const Tp::AccountPtr& account, const Tp::Contact
true,
QDateTime::currentDateTime(),
QLatin1String(PREFERRED_AUDIO_VIDEO_HANDLER));
+
+ connect(channelRequest, SIGNAL(finished(Tp::PendingOperation*)), this, SLOT(onGenericOperationFinished(Tp::PendingOperation*)));
+}
+
+void ChatWindow::startShareDesktop(const Tp::AccountPtr& account, const Tp::ContactPtr& contact)
+{
+ Tp::PendingChannelRequest* channelRequest = account->createStreamTube(contact,
+ QLatin1String("rfb"),
+ QDateTime::currentDateTime(),
+ QLatin1String(PREFERRED_RFB_HANDLER));
+
connect(channelRequest, SIGNAL(finished(Tp::PendingOperation*)), this, SLOT(onGenericOperationFinished(Tp::PendingOperation*)));
}
diff --git a/app/chat-window.h b/app/chat-window.h
index bbfd401..2fb2298 100644
--- a/app/chat-window.h
+++ b/app/chat-window.h
@@ -89,6 +89,7 @@ private Q_SLOTS:
void onTabIconChanged(const KIcon &newIcon);
void onVideoCallTriggered(); /** start a video call */
void onUserTypingChanged();
+ void onShareDesktopTriggered(); /** start a desktop share */
protected Q_SLOTS:
void showSettingsDialog();
@@ -119,6 +120,7 @@ private:
void setFileTransferEnabled(bool enable);
void setInviteToChatEnabled(bool enable);
void setVideoCallEnabled(bool enable);
+ void setShareDesktopEnabled(bool enable);
/** starts audio call with given contact
* @param account account sending the audio call request
@@ -133,10 +135,16 @@ private:
void startFileTransfer(const Tp::AccountPtr &account, const Tp::ContactPtr &contact);
/** starts a video call with given contact
- * @param account account starting the file transfer
- * @param contact contact with whom to start file transfer
+ * @param account account starting the video call
+ * @param contact contact with whom to start the video call
*/
void startVideoCall(const Tp::AccountPtr &account, const Tp::ContactPtr &contact);
+
+ /** starts a desktop sharing session with given contact
+ * @param account account starting the desktop share
+ * @param contact contact with whom to start desktop share
+ */
+ void startShareDesktop(const Tp::AccountPtr &account, const Tp::ContactPtr &contact);
KTabWidget *m_tabWidget;
};
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list