diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2007-04-18 19:09:52 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2007-04-18 19:09:52 +0800 |
commit | bb05f6e6d0541bf29c8dde4e264cc7c23ba52fbb (patch) | |
tree | b283928d6429c0cdf29869008cdad860ba3d8e87 /mail/em-format-html-display.c | |
parent | 86d3ffedacdaa16e49d98875f4804c3423466462 (diff) | |
download | gsoc2013-evolution-bb05f6e6d0541bf29c8dde4e264cc7c23ba52fbb.tar.gz gsoc2013-evolution-bb05f6e6d0541bf29c8dde4e264cc7c23ba52fbb.tar.zst gsoc2013-evolution-bb05f6e6d0541bf29c8dde4e264cc7c23ba52fbb.zip |
** Fixes bug #423766
2007-04-18 Matthew Barnes <mbarnes@redhat.com>
** Fixes bug #423766
* mail/em-format-html-display.c (attachments_save_all_clicked):
Call em_utils_save_part() if there's only one attachment to save.
* mail/em-utils.c (em_utils_save_part):
Refactor to use gtk_dialog_run() instead of a "response" callback.
* mail/em-utils.c (em_utils_save_parts):
Refactor to use gtk_dialog_run() instead of a "response" callback.
Use gtk_file_chooser_get_uri() to fetch the selected folder.
svn path=/trunk/; revision=33429
Diffstat (limited to 'mail/em-format-html-display.c')
-rw-r--r-- | mail/em-format-html-display.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c index e35db056c4..d4c7a01d11 100644 --- a/mail/em-format-html-display.c +++ b/mail/em-format-html-display.c @@ -2098,12 +2098,26 @@ attachment_bar_arrow_clicked(GtkWidget *w, EMFormatHTMLDisplay *efhd) } static void -attachments_save_all_clicked(GtkWidget *w, EMFormatHTMLDisplay *efhd) +attachments_save_all_clicked (GtkWidget *widget, EMFormatHTMLDisplay *efhd) { GSList *attachment_parts; + guint n_attachment_parts; - attachment_parts = e_attachment_bar_get_parts(E_ATTACHMENT_BAR(efhd->priv->attachment_bar)); - em_utils_save_parts(w, _("Select folder to save all attachments..."), attachment_parts); + attachment_parts = e_attachment_bar_get_parts ( + E_ATTACHMENT_BAR (efhd->priv->attachment_bar)); + n_attachment_parts = g_slist_length (attachment_parts); + g_return_if_fail (n_attachment_parts > 0); + + if (n_attachment_parts == 1) + em_utils_save_part ( + widget, _("Save attachment as"), + attachment_parts->data); + else + em_utils_save_parts ( + widget, _("Select folder to save all attachments"), + attachment_parts); + + g_slist_free (attachment_parts); } static void @@ -2143,6 +2157,7 @@ efhd_bar_save_selected(EPopup *ep, EPopupItem *item, void *data) parts = g_slist_reverse(parts); em_utils_save_parts(efhd->priv->attachment_bar, _("Select folder to save selected attachments..."), parts); + g_slist_free (parts); g_slist_foreach(attachment_parts, (GFunc)g_object_unref, NULL); g_slist_free (attachment_parts); |