From 2c26ee3c37691f51e1746d9d1004635dd356c28a Mon Sep 17 00:00:00 2001 From: Jonathon Jongsma Date: Tue, 15 Sep 2015 14:40:19 -0500 Subject: 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. --- src/spice-glib-sym-file | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/spice-glib-sym-file') diff --git a/src/spice-glib-sym-file b/src/spice-glib-sym-file index 1d62716..3817a46 100644 --- a/src/spice-glib-sym-file +++ b/src/spice-glib-sym-file @@ -20,6 +20,11 @@ spice_client_error_quark spice_cursor_channel_get_type spice_display_channel_get_type spice_display_get_primary +spice_file_transfer_task_cancel +spice_file_transfer_task_get_filename +spice_file_transfer_task_get_finished +spice_file_transfer_task_get_progress +spice_file_transfer_task_get_type spice_get_option_group spice_g_signal_connect_object spice_inputs_button_press -- cgit