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/QtPlainChatView.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/QtPlainChatView.cpp')
| -rw-r--r-- | Swift/QtUI/QtPlainChatView.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/Swift/QtUI/QtPlainChatView.cpp b/Swift/QtUI/QtPlainChatView.cpp index 031a41d..eabf35f 100644 --- a/Swift/QtUI/QtPlainChatView.cpp +++ b/Swift/QtUI/QtPlainChatView.cpp | |||
| @@ -6,22 +6,22 @@ | |||
| 6 | 6 | ||
| 7 | #include <Swift/QtUI/QtPlainChatView.h> | 7 | #include <Swift/QtUI/QtPlainChatView.h> |
| 8 | 8 | ||
| 9 | #include <QTextEdit> | ||
| 10 | #include <QScrollBar> | ||
| 11 | #include <QVBoxLayout> | ||
| 12 | #include <QPushButton> | ||
| 13 | #include <QLabel> | ||
| 14 | #include <QDialog> | 9 | #include <QDialog> |
| 15 | #include <QProgressBar> | ||
| 16 | #include <QFileDialog> | 10 | #include <QFileDialog> |
| 17 | #include <QInputDialog> | 11 | #include <QInputDialog> |
| 12 | #include <QLabel> | ||
| 18 | #include <QMenu> | 13 | #include <QMenu> |
| 14 | #include <QProgressBar> | ||
| 15 | #include <QPushButton> | ||
| 16 | #include <QScrollBar> | ||
| 17 | #include <QTextEdit> | ||
| 18 | #include <QVBoxLayout> | ||
| 19 | 19 | ||
| 20 | #include <Swiften/Base/foreach.h> | ||
| 21 | #include <Swiften/Base/FileSize.h> | 20 | #include <Swiften/Base/FileSize.h> |
| 21 | #include <Swiften/Base/foreach.h> | ||
| 22 | 22 | ||
| 23 | #include <Swift/Controllers/UIEvents/UIEventStream.h> | ||
| 24 | #include <Swift/Controllers/UIEvents/JoinMUCUIEvent.h> | 23 | #include <Swift/Controllers/UIEvents/JoinMUCUIEvent.h> |
| 24 | #include <Swift/Controllers/UIEvents/UIEventStream.h> | ||
| 25 | 25 | ||
| 26 | #include <Swift/QtUI/ChatSnippet.h> | 26 | #include <Swift/QtUI/ChatSnippet.h> |
| 27 | #include <Swift/QtUI/QtSwiftUtil.h> | 27 | #include <Swift/QtUI/QtSwiftUtil.h> |
| @@ -360,6 +360,13 @@ QtPlainChatView::FileTransfer::FileTransfer(QtPlainChatView* parent, bool sender | |||
| 360 | std::string status = msg; | 360 | std::string status = msg; |
| 361 | 361 | ||
| 362 | switch (state) { | 362 | switch (state) { |
| 363 | case ChatWindow::Initialisation: { | ||
| 364 | status = "Preparing to send <i>"+ filename + "</i>..."; | ||
| 365 | FileTransfer::Action* cancel = new FileTransfer::Action("Cancel", ftId); | ||
| 366 | parent->connect(cancel, SIGNAL(clicked()), SLOT(fileTransferReject())); | ||
| 367 | layout_->addWidget(cancel); | ||
| 368 | break; | ||
| 369 | } | ||
| 363 | case ChatWindow::WaitingForAccept: { | 370 | case ChatWindow::WaitingForAccept: { |
| 364 | status = "Waiting for user to accept <i>" + filename + "</i>..."; | 371 | status = "Waiting for user to accept <i>" + filename + "</i>..."; |
| 365 | FileTransfer::Action* cancel = new FileTransfer::Action("Cancel", ftId); | 372 | FileTransfer::Action* cancel = new FileTransfer::Action("Cancel", ftId); |
Swift