summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/QtPlainChatView.cpp23
-rw-r--r--Swift/QtUI/QtWebKitChatView.cpp14
2 files changed, 24 insertions, 13 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 @@
#include <Swift/QtUI/QtPlainChatView.h>
-#include <QTextEdit>
-#include <QScrollBar>
-#include <QVBoxLayout>
-#include <QPushButton>
-#include <QLabel>
#include <QDialog>
-#include <QProgressBar>
#include <QFileDialog>
#include <QInputDialog>
+#include <QLabel>
#include <QMenu>
+#include <QProgressBar>
+#include <QPushButton>
+#include <QScrollBar>
+#include <QTextEdit>
+#include <QVBoxLayout>
-#include <Swiften/Base/foreach.h>
#include <Swiften/Base/FileSize.h>
+#include <Swiften/Base/foreach.h>
-#include <Swift/Controllers/UIEvents/UIEventStream.h>
#include <Swift/Controllers/UIEvents/JoinMUCUIEvent.h>
+#include <Swift/Controllers/UIEvents/UIEventStream.h>
#include <Swift/QtUI/ChatSnippet.h>
#include <Swift/QtUI/QtSwiftUtil.h>
@@ -360,6 +360,13 @@ QtPlainChatView::FileTransfer::FileTransfer(QtPlainChatView* parent, bool sender
std::string status = msg;
switch (state) {
+ case ChatWindow::Initialisation: {
+ status = "Preparing to send <i>"+ filename + "</i>...";
+ FileTransfer::Action* cancel = new FileTransfer::Action("Cancel", ftId);
+ parent->connect(cancel, SIGNAL(clicked()), SLOT(fileTransferReject()));
+ layout_->addWidget(cancel);
+ break;
+ }
case ChatWindow::WaitingForAccept: {
status = "Waiting for user to accept <i>" + filename + "</i>...";
FileTransfer::Action* cancel = new FileTransfer::Action("Cancel", ftId);
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
@@ -438,18 +438,22 @@ void QtWebKitChatView::setFileTransferStatus(QString id, const ChatWindow::FileT
}
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%"