diff options
| author | Tobias Markmann <tm@ayena.de> | 2015-06-17 20:40:41 (GMT) |
|---|---|---|
| committer | Tobias Markmann <tm@ayena.de> | 2015-07-10 14:56:43 (GMT) |
| commit | b54aa689ffc6bec7987c193e28c641d2f0f73236 (patch) | |
| tree | ad9984fc3f9633e21fe0ff5ef8728f6d420ca07f /Swift/Controllers/FileTransfer/FileTransferController.h | |
| parent | 7af21fdd59af3b3112cff69996301605859af84c (diff) | |
| download | swift-b54aa689ffc6bec7987c193e28c641d2f0f73236.zip swift-b54aa689ffc6bec7987c193e28c641d2f0f73236.tar.bz2 | |
Implement logic behind 'Clear all' button
The 'Clear all' button in the file transfer overview window
was only present in the UI, without any logic behind. That's fixed now.
Test-Information:
Send a file in between two Swift instances. Verified that the button is
enabled/disabled at appropriate times and works as expected if pressed.
Change-Id: Ib92621cba479683ade8d815ce5ace9768449a499
Diffstat (limited to 'Swift/Controllers/FileTransfer/FileTransferController.h')
| -rw-r--r-- | Swift/Controllers/FileTransfer/FileTransferController.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/Swift/Controllers/FileTransfer/FileTransferController.h b/Swift/Controllers/FileTransfer/FileTransferController.h index 3d6f7d5..490773d 100644 --- a/Swift/Controllers/FileTransfer/FileTransferController.h +++ b/Swift/Controllers/FileTransfer/FileTransferController.h | |||
| @@ -2,22 +2,29 @@ | |||
| 2 | * Copyright (c) 2011 Tobias Markmann | 2 | * Copyright (c) 2011 Tobias Markmann |
| 3 | * Licensed under the simplified BSD license. | 3 | * Licensed under the simplified BSD license. |
| 4 | * See Documentation/Licenses/BSD-simplified.txt for more information. | 4 | * See Documentation/Licenses/BSD-simplified.txt for more information. |
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | /* | ||
| 8 | * Copyright (c) 2015 Isode Limited. | ||
| 9 | * All rights reserved. | ||
| 10 | * See the COPYING file for more information. | ||
| 11 | */ | ||
| 12 | |||
| 7 | #pragma once | 13 | #pragma once |
| 8 | 14 | ||
| 9 | #include <string> | 15 | #include <string> |
| 10 | 16 | ||
| 11 | #include <boost/shared_ptr.hpp> | ||
| 12 | #include <boost/cstdint.hpp> | 17 | #include <boost/cstdint.hpp> |
| 18 | #include <boost/shared_ptr.hpp> | ||
| 13 | 19 | ||
| 14 | #include <Swiften/JID/JID.h> | ||
| 15 | #include <Swiften/FileTransfer/FileTransfer.h> | ||
| 16 | #include <Swiften/FileTransfer/IncomingFileTransfer.h> | ||
| 17 | #include <Swiften/FileTransfer/FileReadBytestream.h> | 20 | #include <Swiften/FileTransfer/FileReadBytestream.h> |
| 21 | #include <Swiften/FileTransfer/FileTransfer.h> | ||
| 18 | #include <Swiften/FileTransfer/FileWriteBytestream.h> | 22 | #include <Swiften/FileTransfer/FileWriteBytestream.h> |
| 23 | #include <Swiften/FileTransfer/IncomingFileTransfer.h> | ||
| 24 | #include <Swiften/JID/JID.h> | ||
| 25 | |||
| 19 | #include <Swift/Controllers/FileTransfer/FileTransferProgressInfo.h> | 26 | #include <Swift/Controllers/FileTransfer/FileTransferProgressInfo.h> |
| 20 | 27 | ||
| 21 | namespace Swift { | 28 | namespace Swift { |
| 22 | 29 | ||
| 23 | class FileTransferManager; | 30 | class FileTransferManager; |
| @@ -47,18 +54,18 @@ public: | |||
| 47 | bool isIncoming() const; | 54 | bool isIncoming() const; |
| 48 | FileTransfer::State getState() const; | 55 | FileTransfer::State getState() const; |
| 49 | int getProgress() const; | 56 | int getProgress() const; |
| 50 | boost::uintmax_t getSize() const; | 57 | boost::uintmax_t getSize() const; |
| 51 | 58 | ||
| 52 | boost::signal<void ()> onStateChage; | 59 | boost::signal<void ()> onStateChanged; |
| 53 | boost::signal<void ()> onProgressChange; | 60 | boost::signal<void ()> onProgressChange; |
| 54 | 61 | ||
| 55 | private: | 62 | private: |
| 56 | void handleFileTransferStateChange(FileTransfer::State); | 63 | void handleFileTransferStateChange(FileTransfer::State); |
| 57 | void handleProgressPercentageChange(int percentage); | 64 | void handleProgressPercentageChange(int percentage); |
| 58 | 65 | ||
| 59 | private: | 66 | private: |
| 60 | bool sending; | 67 | bool sending; |
| 61 | JID otherParty; | 68 | JID otherParty; |
| 62 | std::string filename; | 69 | std::string filename; |
| 63 | FileTransfer::ref transfer; | 70 | FileTransfer::ref transfer; |
| 64 | boost::shared_ptr<FileReadBytestream> fileReadStream; | 71 | boost::shared_ptr<FileReadBytestream> fileReadStream; |
Swift