From 0822a01317ed088a14aa9268f1d086ff73cb423c Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Tue, 24 May 2005 08:45:16 +0000 Subject: Added the support to DnD remote URL to the attachment window. It downloads 2005-05-24 Srinivasa Ragavan * gui/dialogs/cal-attachment-bar.c, gui/dialogs/cal-attachment-bar.h, gui/dialogs/cal-attachment.c, gui/dialogs/cal-attachment.h, gui/dialogs/comp-editor.c, calendar.error.xml: Added the support to DnD remote URL to the attachment window. It downloads asynchronously and attaches. svn path=/trunk/; revision=29405 --- calendar/gui/dialogs/comp-editor.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'calendar/gui/dialogs/comp-editor.c') diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 49a5240b31..cba7968268 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -255,17 +255,23 @@ drop_action(CompEditor *editor, GdkDragContext *context, guint32 action, GtkSele g_free (str); } else { url = camel_url_new (str, NULL); - g_free (str); - if (url == NULL) + if (url == NULL) { + g_free (str); continue; + } if (!g_ascii_strcasecmp (url->protocol, "file")) cal_attachment_bar_attach (CAL_ATTACHMENT_BAR (editor->priv->attachment_bar), url->path); + else + cal_attachment_bar_attach_remote_file + (CAL_ATTACHMENT_BAR (editor->priv->attachment_bar), + str); camel_url_free (url); + g_free (str); } } @@ -785,6 +791,24 @@ response_cb (GtkWidget *widget, int response, gpointer data) switch (response) { case GTK_RESPONSE_OK: + /* Check whether the downloads are completed */ + if (cal_attachment_bar_get_download_count (CAL_ATTACHMENT_BAR (editor->priv->attachment_bar)) ){ + ECalComponentVType vtype = e_cal_component_get_vtype(editor->priv->comp); + gboolean response; + + if (vtype == E_CAL_COMPONENT_EVENT) + response = em_utils_prompt_user((GtkWindow *)widget, + NULL, + "calendar:ask-send-event-pending-download", + NULL); + else + response = em_utils_prompt_user((GtkWindow *)widget, + NULL, + "calendar:ask-send-task-pending-download", + NULL); + if (!response) + return; + } commit_all_fields (editor); if (e_cal_component_is_instance (priv->comp)) -- cgit v1.2.3