diff options
author | Srinivasa Ragavan <sragavan@src.gnome.org> | 2006-05-25 14:04:48 +0800 |
---|---|---|
committer | Srinivasa Ragavan <sragavan@src.gnome.org> | 2006-05-25 14:04:48 +0800 |
commit | 24368cf92dd5eaae1b41b3f191a25e2cbc45e824 (patch) | |
tree | f250be111bc4afa6440414ada53ff051bb30ff0d /composer | |
parent | 0fdf8a120ccb5638527293f6155d0e16af571732 (diff) | |
download | gsoc2013-evolution-24368cf92dd5eaae1b41b3f191a25e2cbc45e824.tar gsoc2013-evolution-24368cf92dd5eaae1b41b3f191a25e2cbc45e824.tar.gz gsoc2013-evolution-24368cf92dd5eaae1b41b3f191a25e2cbc45e824.tar.bz2 gsoc2013-evolution-24368cf92dd5eaae1b41b3f191a25e2cbc45e824.tar.lz gsoc2013-evolution-24368cf92dd5eaae1b41b3f191a25e2cbc45e824.tar.xz gsoc2013-evolution-24368cf92dd5eaae1b41b3f191a25e2cbc45e824.tar.zst gsoc2013-evolution-24368cf92dd5eaae1b41b3f191a25e2cbc45e824.zip |
Added code to save/attach files/mails/events to/from remote shares
svn path=/trunk/; revision=32023
Diffstat (limited to 'composer')
-rw-r--r-- | composer/ChangeLog | 8 | ||||
-rw-r--r-- | composer/e-msg-composer-select-file.c | 16 | ||||
-rw-r--r-- | composer/e-msg-composer.c | 15 |
3 files changed, 31 insertions, 8 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog index 16c04468f2..a78ee2da77 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,11 @@ +2006-05-25 Srinivasa Ragavan <sragavan@novell.com> + + Added support to attach from remote shares + + * e-msg-composer-select-file.c: (get_selector), + (select_attach_response): + * e-msg-composer.c: (add_to_bar), (drop_action): + 2006-03-09 Sam Yang <sam.yang@sun.com> ** Fixes #333971 diff --git a/composer/e-msg-composer-select-file.c b/composer/e-msg-composer-select-file.c index 97b686ef7e..430bcb003a 100644 --- a/composer/e-msg-composer-select-file.c +++ b/composer/e-msg-composer-select-file.c @@ -83,6 +83,7 @@ get_selector(struct _EMsgComposer *composer, const char *title, guint32 flags) NULL); gtk_dialog_set_default_response (GTK_DIALOG (selection), GTK_RESPONSE_OK); + gtk_file_chooser_set_local_only (selection, FALSE); if ((flags & SELECTOR_MODE_SAVE) == 0) gtk_file_chooser_set_select_multiple ((GtkFileChooser *) selection, (flags & SELECTOR_MODE_MULTI)); @@ -192,14 +193,16 @@ select_attach_response(GtkWidget *selector, guint response, struct _EMsgComposer GSList *names; EMsgComposerSelectAttachFunc func = g_object_get_data((GObject *)selector, "callback"); GtkToggleButton *showinline = g_object_get_data((GObject *)selector, "show-inline"); - char *path; + char *path = NULL; #ifdef USE_GTKFILECHOOSER - char *filename; - names = gtk_file_chooser_get_filenames (GTK_FILE_CHOOSER (selector)); + char *filename = NULL; + names = gtk_file_chooser_get_uris (GTK_FILE_CHOOSER (selector)); filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (selector)); - path = g_path_get_dirname (filename); - g_free (filename); + if (!filename) { + path = g_path_get_dirname (filename); + g_free (filename); + } #else char **files; int i; @@ -215,7 +218,8 @@ select_attach_response(GtkWidget *selector, guint response, struct _EMsgComposer path = g_path_get_dirname (gtk_file_selection_get_filename (GTK_FILE_SELECTION (selector))); #endif - g_object_set_data_full ((GObject *) composer, "attach_path", path, g_free); + if (path) + g_object_set_data_full ((GObject *) composer, "attach_path", path, g_free); func(composer, names, gtk_toggle_button_get_active(showinline)); diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index e4bc7dbbde..fe66322c43 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -1782,8 +1782,19 @@ add_to_bar (EMsgComposer *composer, GSList *names, int is_inline) EMsgComposerPrivate *p = composer->priv; while (names) { - e_attachment_bar_attach((EAttachmentBar *)p->attachment_bar, names->data, is_inline ? "inline" : "attachment"); + CamelURL *url; + + url = camel_url_new (names->data, NULL); + if (url == NULL) + continue; + + if (!g_ascii_strcasecmp (url->protocol, "file")) { + e_attachment_bar_attach((EAttachmentBar *)p->attachment_bar, url->path, is_inline ? "inline" : "attachment"); + } else { + e_attachment_bar_attach_remote_file ((EAttachmentBar *)p->attachment_bar, names->data, is_inline ? "inline" : "attachment"); + } names = g_slist_next(names); + camel_url_free (url); } } @@ -2969,7 +2980,7 @@ drop_action(EMsgComposer *composer, GdkDragContext *context, guint32 action, Gtk } else { e_attachment_bar_attach_remote_file (E_ATTACHMENT_BAR (p->attachment_bar), - str); + str, "attachment"); } g_free (str); camel_url_free (url); |