summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordknn <yoann.blein@free.fr>2012-08-06 14:40:13 (GMT)
committerdknn <yoann.blein@free.fr>2012-09-22 09:32:38 (GMT)
commitd62f8088b8cc42417f97a3b5c3f99bf9288593d4 (patch)
tree46861355d40bfe5e18088496abc9654e0dbaa00c /Swift/QtUI/QtChatView.cpp
parent343f88e3048887e83cc91bb710510b3aa618f779 (diff)
downloadswift-contrib-d62f8088b8cc42417f97a3b5c3f99bf9288593d4.zip
swift-contrib-d62f8088b8cc42417f97a3b5c3f99bf9288593d4.tar.bz2
Add support for multiple sharing and control in chat view
Diffstat (limited to 'Swift/QtUI/QtChatView.cpp')
-rw-r--r--Swift/QtUI/QtChatView.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/Swift/QtUI/QtChatView.cpp b/Swift/QtUI/QtChatView.cpp
index 81820a3..25b786f 100644
--- a/Swift/QtUI/QtChatView.cpp
+++ b/Swift/QtUI/QtChatView.cpp
@@ -444,6 +444,48 @@ void QtChatView::setWhiteboardSessionStatus(QString id, const ChatWindow::Whiteb
divElement.setInnerXml(newInnerHTML);
}
+void QtChatView::setScreenSharingStatus(QString id, ScreenSharing::SCState state, const QString& /*msg*/)
+{
+ QWebElement ftElement = findDivElementWithID(document_, id);
+ if (ftElement.isNull()) {
+ SWIFT_LOG(debug) << "Tried to access screen sharing UI via invalid id! id = " << Q2PSTRING(id) << std::endl;
+ return;
+ }
+
+ QString newInnerHTML = "";
+ if (state == ScreenSharing::WaitingForAccept) {
+ newInnerHTML = tr("Waiting for other side to accept the sharing.") + "<br/>" +
+ QtChatWindow::buildChatWindowButton(tr("Cancel"), QtChatWindow::ButtonScreenSharingCancel, id);
+ }
+ if (state == ScreenSharing::Negotiating) {
+ newInnerHTML = tr("Negotiating...") + "<br/>" +
+ QtChatWindow::buildChatWindowButton(tr("Cancel"), QtChatWindow::ButtonScreenSharingCancel, id);
+ }
+ if (state == ScreenSharing::Connecting) {
+ newInnerHTML = tr("Connecting...") + "<br/>" +
+ QtChatWindow::buildChatWindowButton(tr("Cancel"), QtChatWindow::ButtonScreenSharingCancel, id);
+ }
+ if (state == ScreenSharing::BroadCasting) {
+ newInnerHTML = tr("Broadcasting the desktop...") + "<br/>" +
+ QtChatWindow::buildChatWindowButton(tr("Terminate"), QtChatWindow::ButtonScreenSharingStop, id);
+ }
+ else if (state == ScreenSharing::Receiving) {
+ newInnerHTML = tr("Receiving desktop from the other party...") + "<br/>" +
+ QtChatWindow::buildChatWindowButton(tr("Terminate"), QtChatWindow::ButtonScreenSharingStop, id);
+ }
+ else if (state == ScreenSharing::Canceled) {
+ newInnerHTML = tr("Sharing has been canceled!");
+ }
+ else if (state == ScreenSharing::Finished) {
+ newInnerHTML = tr("Sharing finished.");
+ }
+ else if (state == ScreenSharing::Failed) {
+ newInnerHTML = tr("Sharing failed.");
+ }
+
+ ftElement.setInnerXml(newInnerHTML);
+}
+
void QtChatView::setMUCInvitationJoined(QString id) {
QWebElement divElement = findElementWithID(document_, "div", id);
QWebElement buttonElement = findElementWithID(divElement, "input", "mucinvite");