summaryrefslogtreecommitdiff
path: root/src/spice-client.h
diff options
context:
space:
mode:
authorJonathon Jongsma <jjongsma@redhat.com>2015-09-15 14:40:19 -0500
committerJonathon Jongsma <jjongsma@redhat.com>2015-10-09 15:42:56 -0500
commit2c26ee3c37691f51e1746d9d1004635dd356c28a (patch)
tree75eeca438128cf73be05f36718d0262d363466aa /src/spice-client.h
parent113093dd00a1cf10f6d3c3589b7589a184cec081 (diff)
New file transfer API
There were several shortcomings to the existing file transfer API, particularly in terms of monitoring ongoing file transfers. The major issue is that spice_main_file_copy_async() allows you to pass an array of files, but the progress callback does not provide a way to identify which file the callback is associated with. This makes it nearly impossible for an application to monitor file transfers. In addition, the SpiceDisplay widget automatically handles drag-and-drop actions on the widget, and initiates file transfers without allowing the application to specify a progress callback. So there's no way for an app to monitor file transfers that are initiated via drag and drop. http://lists.freedesktop.org/archives/spice-devel/2015-September/021931.html has a more detailed explanation of the issues. This change doesn't break the existing API, but adds some new API that will allow an application to monitor file transfer progress, even for transfers that are initiated within spice-gtk itself. - A new public SpiceFileTransferTask object is added. - The SpiceMainChannel object gains a "new-file-transfer" signal that is emitted whenever a new file transfer is initiated. The SpiceFileTransferTask object is passed to the signal handler. - The application can retain this object and monitor its 'progress' property to be notified when the progress of the file transfer changes. The SpiceFileTransferTask::finished signal indicates when the given file transfer has completed. The application can also cancel the file transfer by calling the _cancel() method. The 'spicy' test application has been updated to use this new API and display a simple dialog showing the progress of individual files.
Diffstat (limited to 'src/spice-client.h')
-rw-r--r--src/spice-client.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/spice-client.h b/src/spice-client.h
index aaa6775..b794472 100644
--- a/src/spice-client.h
+++ b/src/spice-client.h
@@ -50,6 +50,7 @@
#include "smartcard-manager.h"
#include "usb-device-manager.h"
#include "spice-audio.h"
+#include "spice-file-transfer-task.h"
G_BEGIN_DECLS