diff options
author | Not Zed <NotZed@Ximian.com> | 2005-02-10 12:34:29 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2005-02-10 12:34:29 +0800 |
commit | 0a50b0ab04ce94659ca09541a1d7f4fa5758c979 (patch) | |
tree | 99a5e36f650a41b0982ab98ff014c03ef3677943 /composer/e-msg-composer-attachment-bar.c | |
parent | ca399f16be942c52c1aa276392a104c9ed17c1ab (diff) | |
download | gsoc2013-evolution-0a50b0ab04ce94659ca09541a1d7f4fa5758c979.tar.gz gsoc2013-evolution-0a50b0ab04ce94659ca09541a1d7f4fa5758c979.tar.zst gsoc2013-evolution-0a50b0ab04ce94659ca09541a1d7f4fa5758c979.zip |
** See bug #66126.
2005-02-10 Not Zed <NotZed@Ximian.com>
** See bug #66126.
* e-msg-composer-attachment-bar.c (destroy): destroy async file
requesters.
(add_from_user_response, add_from_user): use async file
requesters.
* e-msg-composer.c (save): don't fallback to saveas if the
filename is null.
(saveas, saveas_response): new functions for async file
requesters.
(menu_file_save_cb): call saveas if we have no filename.
(menu_file_save_as_cb): call saveas.
(menu_file_open_cb, file_open_response): change for async file
loading (which doesn't appear to be used anymore).
(destroy): destroy async requesters.
* e-msg-composer-select-file.c (get_selector): make it no longer
modal, no longer show the window.
(select_file_response, e_msg_composer_select_file): make it async.
(select_attach_response, e_msg_composer_select_file_attachments):
same.
svn path=/trunk/; revision=28760
Diffstat (limited to 'composer/e-msg-composer-attachment-bar.c')
-rw-r--r-- | composer/e-msg-composer-attachment-bar.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/composer/e-msg-composer-attachment-bar.c b/composer/e-msg-composer-attachment-bar.c index 221deb9b37..d2e44ca8b8 100644 --- a/composer/e-msg-composer-attachment-bar.c +++ b/composer/e-msg-composer-attachment-bar.c @@ -66,6 +66,8 @@ static GnomeIconListClass *parent_class = NULL; struct _EMsgComposerAttachmentBarPrivate { + GtkWidget *attach; /* attachment file dialogue, if active */ + GList *attachments; guint num_attachments; }; @@ -385,27 +387,22 @@ edit_selected (EMsgComposerAttachmentBar *bar) } /* "Attach" dialog. */ +static void +add_from_user_response(EMsgComposer *composer, GSList *names, int is_inline) +{ + while (names) { + add_from_file((EMsgComposerAttachmentBar *)composer->attachment_bar, names->data, is_inline ? "inline" : "attachment"); + names = g_slist_next(names); + } +} static void add_from_user (EMsgComposerAttachmentBar *bar) { EMsgComposer *composer; - GPtrArray *file_list; - gboolean is_inline = FALSE; - int i; composer = E_MSG_COMPOSER (gtk_widget_get_toplevel (GTK_WIDGET (bar))); - - file_list = e_msg_composer_select_file_attachments (composer, &is_inline); - if (!file_list) - return; - - for (i = 0; i < file_list->len; i++) { - add_from_file (bar, file_list->pdata[i], is_inline ? "inline" : "attachment"); - g_free (file_list->pdata[i]); - } - - g_ptr_array_free (file_list, TRUE); + e_msg_composer_select_file_attachments(composer, &bar->priv->attach, add_from_user_response); } @@ -539,6 +536,10 @@ destroy (GtkObject *object) if (bar->priv) { free_attachment_list (bar); + + if (bar->priv->attach) + gtk_widget_destroy(bar->priv->attach); + g_free (bar->priv); bar->priv = NULL; } @@ -633,6 +634,7 @@ init (EMsgComposerAttachmentBar *bar) priv = g_new (EMsgComposerAttachmentBarPrivate, 1); + priv->attach = NULL; priv->attachments = NULL; priv->num_attachments = 0; |