From 4449a34101406bffe508dd40b8b653f7c7d14c7d Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 27 Apr 2009 15:36:19 -0400 Subject: Commit the rest of the attachment UI rewrite Oops, last commit only included the -new- files. This also removes EExpander, which is no longer used. --- composer/e-composer-actions.c | 66 ++++--------------------------------------- 1 file changed, 5 insertions(+), 61 deletions(-) (limited to 'composer/e-composer-actions.c') diff --git a/composer/e-composer-actions.c b/composer/e-composer-actions.c index 61ad1e9a90..e46aba4192 100644 --- a/composer/e-composer-actions.c +++ b/composer/e-composer-actions.c @@ -31,69 +31,13 @@ static void action_attach_cb (GtkAction *action, EMsgComposer *composer) { - EAttachmentBar *bar; - GtkWidget *dialog; - GtkWidget *option; - GSList *uris, *iter; - const gchar *disposition; - gboolean active; - gint response; - - bar = E_ATTACHMENT_BAR (composer->priv->attachment_bar); - - dialog = gtk_file_chooser_dialog_new ( - _("Insert Attachment"), - GTK_WINDOW (composer), - GTK_FILE_CHOOSER_ACTION_OPEN, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - _("A_ttach"), GTK_RESPONSE_OK, - NULL); - - gtk_dialog_set_default_response ( - GTK_DIALOG (dialog), GTK_RESPONSE_OK); - gtk_file_chooser_set_local_only ( - GTK_FILE_CHOOSER (dialog), FALSE); - gtk_file_chooser_set_select_multiple ( - GTK_FILE_CHOOSER (dialog), TRUE); - gtk_window_set_icon_name ( - GTK_WINDOW (dialog), "mail-message-new"); + EAttachmentView *view; + EAttachmentStore *store; - option = gtk_check_button_new_with_mnemonic ( - _("_Suggest automatic display of attachment")); - gtk_widget_show (option); - gtk_file_chooser_set_extra_widget ( - GTK_FILE_CHOOSER (dialog), option); + view = e_msg_composer_get_attachment_view (composer); + store = e_attachment_view_get_store (view); - response = gtkhtml_editor_file_chooser_dialog_run ( - GTKHTML_EDITOR (composer), dialog); - - if (response != GTK_RESPONSE_OK) - goto exit; - - uris = gtk_file_chooser_get_uris (GTK_FILE_CHOOSER (dialog)); - active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (option)); - disposition = active ? "inline" : "attachment"; - - for (iter = uris; iter != NULL; iter = iter->next) { - CamelURL *url; - - url = camel_url_new (iter->data, NULL); - if (url == NULL) - continue; - - if (!g_ascii_strcasecmp (url->protocol, "file")) - e_attachment_bar_attach (bar, url->path, disposition); - else - e_attachment_bar_attach_remote_file (bar, iter->data, disposition); - - camel_url_free (url); - } - - g_slist_foreach (uris, (GFunc) g_free, NULL); - g_slist_free (uris); - -exit: - gtk_widget_destroy (dialog); + e_attachment_store_run_load_dialog (store, GTK_WINDOW (composer)); } static void -- cgit v1.2.3