diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-04-28 03:36:19 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-04-28 03:36:19 +0800 |
commit | 4449a34101406bffe508dd40b8b653f7c7d14c7d (patch) | |
tree | e9fb2ce7efd3901cf1090040666f0ce15ad70554 /composer/e-composer-actions.c | |
parent | e377ea5e61171e57f9e892652d0fd1f77953eda8 (diff) | |
download | gsoc2013-evolution-4449a34101406bffe508dd40b8b653f7c7d14c7d.tar gsoc2013-evolution-4449a34101406bffe508dd40b8b653f7c7d14c7d.tar.gz gsoc2013-evolution-4449a34101406bffe508dd40b8b653f7c7d14c7d.tar.bz2 gsoc2013-evolution-4449a34101406bffe508dd40b8b653f7c7d14c7d.tar.lz gsoc2013-evolution-4449a34101406bffe508dd40b8b653f7c7d14c7d.tar.xz gsoc2013-evolution-4449a34101406bffe508dd40b8b653f7c7d14c7d.tar.zst gsoc2013-evolution-4449a34101406bffe508dd40b8b653f7c7d14c7d.zip |
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.
Diffstat (limited to 'composer/e-composer-actions.c')
-rw-r--r-- | composer/e-composer-actions.c | 66 |
1 files changed, 5 insertions, 61 deletions
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 |