diff options
author | Srininvasa Ragavan <sragavan@novell.com> | 2005-05-23 15:10:03 +0800 |
---|---|---|
committer | Srinivasa Ragavan <sragavan@src.gnome.org> | 2005-05-23 15:10:03 +0800 |
commit | b25b709bf7fa81751810567af26ba4e8fe416b3a (patch) | |
tree | 97f476d22fbb8f2b0769ae28d8113b00667bd17f /composer/e-msg-composer.c | |
parent | f3074e998b560938b0c904aabfb317d5764e71d6 (diff) | |
download | gsoc2013-evolution-b25b709bf7fa81751810567af26ba4e8fe416b3a.tar.gz gsoc2013-evolution-b25b709bf7fa81751810567af26ba4e8fe416b3a.tar.zst gsoc2013-evolution-b25b709bf7fa81751810567af26ba4e8fe416b3a.zip |
Added attachment of remote URL. The dnd of url, downloads the files and
2005-05-23 Srininvasa Ragavan <sragavan@novell.com>
* e-msg-composer-attachment-bar.c, e-msg-composer-attachment-bar.h,
e-msg-composer-attachment.c, e-msg-composer-attachment.h, e-msg-composer.c,
e-msg-composer.h, mail-composer.error.xml : Added attachment of remote URL.
The dnd of url, downloads the files and attaches to the mail.
svn path=/trunk/; revision=29399
Diffstat (limited to 'composer/e-msg-composer.c')
-rw-r--r-- | composer/e-msg-composer.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 350b31c784..1240490b38 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -2679,6 +2679,13 @@ struct _drop_data { unsigned int aborted:1; }; +int +e_msg_composer_get_remote_download_count (EMsgComposer *composer) +{ + return e_msg_composer_attachment_bar_get_download_count + (E_MSG_COMPOSER_ATTACHMENT_BAR (composer->attachment_bar)); +} + static void drop_action(EMsgComposer *composer, GdkDragContext *context, guint32 action, GtkSelectionData *selection, guint info, guint time) { @@ -2727,16 +2734,22 @@ drop_action(EMsgComposer *composer, GdkDragContext *context, guint32 action, Gtk 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")) e_msg_composer_attachment_bar_attach (E_MSG_COMPOSER_ATTACHMENT_BAR (composer->attachment_bar), url->path); - + else { + e_msg_composer_attachment_bar_attach_remote_file + (E_MSG_COMPOSER_ATTACHMENT_BAR (composer->attachment_bar), + str); + } + g_free (str); camel_url_free (url); } } @@ -4687,6 +4700,11 @@ CamelMimeMessage * e_msg_composer_get_message (EMsgComposer *composer, gboolean save_html_object_data) { g_return_val_if_fail (E_IS_MSG_COMPOSER (composer), NULL); + if ( e_msg_composer_get_remote_download_count (composer) != 0) { + if (!em_utils_prompt_user((GtkWindow *)composer, NULL, "mail-composer:ask-send-message-pending-download", NULL)) { + return NULL; + } + } return build_message (composer, save_html_object_data); } @@ -4713,7 +4731,7 @@ e_msg_composer_get_message_draft (EMsgComposer *composer) old_flags[3] = composer->smime_encrypt; composer->smime_encrypt = FALSE; - msg = e_msg_composer_get_message (composer, TRUE); + msg = build_message (composer, TRUE); composer->send_html = old_send_html; composer->pgp_sign = old_flags[0]; |