summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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");