summaryrefslogtreecommitdiffstats
path: root/pica-client/dialogs
diff options
context:
space:
mode:
authorme_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac>2014-07-04 01:03:36 +0000
committerme_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac>2014-07-04 01:03:36 +0000
commit3e1c3cd989180d2085ce5af7f4db2b156d5df578 (patch)
treeeb3a0d178b9ba41133558fdd416a3e3471c2f4d2 /pica-client/dialogs
parentaf3c479447078c889b1bbb7a5e405c6f61620e82 (diff)
downloadpica-pica-3e1c3cd989180d2085ce5af7f4db2b156d5df578.tar.gz
pica-pica-3e1c3cd989180d2085ce5af7f4db2b156d5df578.zip
implemented file transfer cancellation
git-svn-id: svn://localhost/project_picapica/trunk@315 fb96df88-216d-11de-830c-f3023f12d8ac
Diffstat (limited to 'pica-client/dialogs')
-rw-r--r--pica-client/dialogs/filetransferdialog.cpp9
-rw-r--r--pica-client/dialogs/filetransferdialog.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/pica-client/dialogs/filetransferdialog.cpp b/pica-client/dialogs/filetransferdialog.cpp
index bd442c8..41ebcdb 100644
--- a/pica-client/dialogs/filetransferdialog.cpp
+++ b/pica-client/dialogs/filetransferdialog.cpp
@@ -1,6 +1,7 @@
#include "filetransferdialog.h"
#include <QVBoxLayout>
#include <QHBoxLayout>
+#include <QMessageBox>
#include <stdlib.h>
FileTransferDialog::FileTransferDialog(QByteArray peer_id, QString filename, quint64 size,
@@ -188,13 +189,21 @@ void FileTransferDialog::rightbuttonclick()
if (rightbutton->text() == tr("Deny"))
{
emit deniedFile(peer_id_);
+ setTransferStatus(DENIED);
return;
}
}
if (rightbutton->text() == tr("Cancel"))
{
+
+ if (QMessageBox::No == QMessageBox::question(this, tr("Cancel File Transfer"),
+ tr("Are you sure you want to cancel file transfer?"),
+ QMessageBox::Yes | QMessageBox::No, QMessageBox::No))
+ return;
+
emit cancelledFile(peer_id_, this);
+ setTransferStatus(CANCELLED);
}
}
diff --git a/pica-client/dialogs/filetransferdialog.h b/pica-client/dialogs/filetransferdialog.h
index 2511651..2f42e6d 100644
--- a/pica-client/dialogs/filetransferdialog.h
+++ b/pica-client/dialogs/filetransferdialog.h
@@ -26,6 +26,8 @@ public:
RECEIVINGFILE,
PAUSED,
CANCELLED,
+ PEERDISCONNECTED,
+ IOERROR,
FINISHED
};