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 /calendar/gui/dialogs | |
parent | 0fdf8a120ccb5638527293f6155d0e16af571732 (diff) | |
download | gsoc2013-evolution-24368cf92dd5eaae1b41b3f191a25e2cbc45e824.tar.gz 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 'calendar/gui/dialogs')
-rw-r--r-- | calendar/gui/dialogs/cal-attachment-select-file.c | 3 | ||||
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 26 |
2 files changed, 25 insertions, 4 deletions
diff --git a/calendar/gui/dialogs/cal-attachment-select-file.c b/calendar/gui/dialogs/cal-attachment-select-file.c index 2b7fb4fdae..79e4a75a77 100644 --- a/calendar/gui/dialogs/cal-attachment-select-file.c +++ b/calendar/gui/dialogs/cal-attachment-select-file.c @@ -82,6 +82,7 @@ run_selector(CompEditor *editor, const char *title, guint32 flags, gboolean *sho 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)); @@ -193,7 +194,7 @@ comp_editor_select_file_attachments (CompEditor *editor, gboolean *showinline_p) #ifdef USE_GTKFILECHOOSER GSList *l, *n; - if ((l = gtk_file_chooser_get_filenames (GTK_FILE_CHOOSER (selection)))) { + if ((l = gtk_file_chooser_get_uris (GTK_FILE_CHOOSER (selection)))) { list = g_ptr_array_new (); while (l) { diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 5aa39dae90..d024eb7213 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -295,7 +295,7 @@ drop_action(CompEditor *editor, GdkDragContext *context, guint32 action, GtkSele else e_attachment_bar_attach_remote_file (E_ATTACHMENT_BAR (editor->priv->attachment_bar), - str); + str, "attachment"); camel_url_free (url); g_free (str); @@ -1060,8 +1060,18 @@ cab_add(EPopup *ep, EPopupItem *item, void *data) if (!file_list) return; for (i = 0; i < file_list->len; i++) { - e_attachment_bar_attach (bar, file_list->pdata[i], is_inline ? "inline" : "attachment"); + CamelURL *url; + + url = camel_url_new (file_list->pdata[i], NULL); + if (url == NULL) + continue; + + if (!g_ascii_strcasecmp (url->protocol, "file")) + e_attachment_bar_attach (bar, url->path, is_inline ? "inline" : "attachment"); + else + e_attachment_bar_attach_remote_file (bar, file_list->pdata[i], is_inline ? "inline" : "attachment"); g_free (file_list->pdata[i]); + camel_url_free (url); } g_ptr_array_free (file_list, TRUE); @@ -1355,8 +1365,18 @@ menu_insert_attachment_cb (BonoboUIComponent *uic, if (!file_list) return; for (i = 0; i < file_list->len; i++) { - e_attachment_bar_attach (bar, file_list->pdata[i], is_inline ? "inline" : "attachment"); + CamelURL *url; + + url = camel_url_new (file_list->pdata[i], NULL); + if (url == NULL) + continue; + + if (!g_ascii_strcasecmp (url->protocol, "file")) + e_attachment_bar_attach (bar, url->path, is_inline ? "inline" : "attachment"); + else + e_attachment_bar_attach_remote_file (bar, file_list->pdata[i], is_inline ? "inline" : "attachment"); g_free (file_list->pdata[i]); + camel_url_free (url); } g_ptr_array_free (file_list, TRUE); |