diff options
author | Tobias Markmann <tm@ayena.de> | 2015-06-22 09:06:58 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2015-07-10 11:46:50 (GMT) |
commit | ed7a1fbf61d7879fd33896f36effd2f154753438 (patch) | |
tree | 4904bf7298a7b25ece1e56c6d29aace1a60e9020 /Swift/QtUI/QtWebKitChatView.cpp | |
parent | 84dcfb6263b46b62504706d69198675690f759be (diff) | |
download | swift-ed7a1fbf61d7879fd33896f36effd2f154753438.zip swift-ed7a1fbf61d7879fd33896f36effd2f154753438.tar.bz2 |
Show collecting of file transfer candidates in UI
Show the user the collection of possible file transfer candidates
after pressing the 'Start' button for a file transfer. Previously the
buttons remained in the UI giving no feedback to the user at all. If
no UPnP/NAT-PMP device is present, it this stage can take a couple
seconds to timeout and move on to the next stage.
Furthermore this commit adds documentation for the different states
in the ChatWindow::FileTransferState enum.
Test-Information:
Tested this in a network environment with no UPnP/NAT-PMP device
between two Swift instances.
Change-Id: I76ec6e641a2acd683938fe2d8f542d023a244145
Diffstat (limited to 'Swift/QtUI/QtWebKitChatView.cpp')
-rw-r--r-- | Swift/QtUI/QtWebKitChatView.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Swift/QtUI/QtWebKitChatView.cpp b/Swift/QtUI/QtWebKitChatView.cpp index d6dc6f5..b7f96f6 100644 --- a/Swift/QtUI/QtWebKitChatView.cpp +++ b/Swift/QtUI/QtWebKitChatView.cpp @@ -435,24 +435,28 @@ void QtWebKitChatView::setFileTransferStatus(QString id, const ChatWindow::FileT if (ftElement.isNull()) { SWIFT_LOG(debug) << "Tried to access FT UI via invalid id! id = " << Q2PSTRING(id) << std::endl; return; } QString newInnerHTML = ""; - if (state == ChatWindow::WaitingForAccept) { - newInnerHTML = tr("Waiting for other side to accept the transfer.") + "<br/>" + + if (state == ChatWindow::Initialisation) { + newInnerHTML = tr("Preparing to send.") + "<br/>" + buildChatWindowButton(tr("Cancel"), ButtonFileTransferCancel, id); } - if (state == ChatWindow::Negotiating) { + else if (state == ChatWindow::WaitingForAccept) { + newInnerHTML = tr("Waiting for other side to accept the transfer.") + "<br/>" + + buildChatWindowButton(tr("Cancel"), ButtonFileTransferCancel, id); + } + else if (state == ChatWindow::Negotiating) { // replace with text "Negotiaging" + Cancel button - newInnerHTML = tr("Negotiating...") + "<br/>" + + newInnerHTML = tr("Negotiating...") + "<br/>" + buildChatWindowButton(tr("Cancel"), ButtonFileTransferCancel, id); } else if (state == ChatWindow::Transferring) { // progress bar + Cancel Button - newInnerHTML = "<div style=\"position: relative; width: 90%; height: 20px; border: 2px solid grey; -webkit-border-radius: 10px;\">" + newInnerHTML = "<div style=\"position: relative; width: 90%; height: 20px; border: 2px solid grey; -webkit-border-radius: 10px;\">" "<div class=\"progressbar\" style=\"width: 0%; height: 100%; background: #AAA; -webkit-border-radius: 6px;\">" "<div class=\"progressbar-value\" style=\"position: absolute; top: 0px; left: 0px; width: 100%; text-align: center; padding-top: 2px;\">" "0%" "</div>" "</div>" "</div>" + |