After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 588093 - Allow Importable Files To Pass To Evolution On Command Line
Allow Importable Files To Pass To Evolution On Command Line
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Shell
unspecified
Other All
: Normal enhancement
: ---
Assigned To: Evolution Shell Maintainers Team
Evolution QA team
evolution[kill-bonobo]
: 225903 269031 271516 313633 330505 517124 558484 (view as bug list)
Depends on:
Blocks: 339717
 
 
Reported: 2009-07-08 16:46 UTC by David Richards
Modified: 2009-11-12 20:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
evo patch (33.74 KB, patch)
2009-11-12 11:39 UTC, Milan Crha
committed Details | Review
Add mimetypes for Evolution to handle (1.08 KB, patch)
2009-11-12 15:58 UTC, Bastien Nocera
none Details | Review
Add mimetypes for Evolution to handle (1.16 KB, patch)
2009-11-12 16:34 UTC, Bastien Nocera
none Details | Review

Description David Richards 2009-07-08 16:46:11 UTC
Evolution currently allows for the import of certain types of files, but this requires users to File >> Import them and use a file manager.  We should allow them to be imported on the command line as well.

evolution /home/mbarnes/foo.vcf  

would detect vcard, and skip to the part of the import gui where it asks you for the file and jumps right to the point where it asks you which address book to use.  This would allow users to simply double-click on the files in the file manager and immediately begin the process.

As mbarnes notes on the IRC, other files would work in a similar fashion:

 vcf, mbox, ical, csv, etc

Other information:
Comment 1 David Richards 2009-07-08 16:50:27 UTC
As a followup idea:

It also would be nice to allow drop and drag of these files into the appropriate part of the GUI.  If you drop and drag an .ics file, it could be released into a calendar that you have write permissions.  If you drop and drag a vcard, it could be released into an address book.   

This would allow the wizard to be completely not seen by users and provide a complete GUI technique to accomplish their goals.
Comment 2 Milan Crha 2009-07-22 15:18:37 UTC
*** Bug 330505 has been marked as a duplicate of this bug. ***
Comment 3 Milan Crha 2009-07-22 15:19:16 UTC
*** Bug 313633 has been marked as a duplicate of this bug. ***
Comment 4 Milan Crha 2009-07-22 18:25:17 UTC
*** Bug 269031 has been marked as a duplicate of this bug. ***
Comment 5 Milan Crha 2009-07-22 18:25:35 UTC
*** Bug 271516 has been marked as a duplicate of this bug. ***
Comment 6 Milan Crha 2009-07-24 10:04:12 UTC
*** Bug 558484 has been marked as a duplicate of this bug. ***
Comment 7 Tino Keitel 2009-10-07 11:05:06 UTC
You might take a look at http://tikei.de/evolution-calendar-import/ for a
command line tool which imports iCalendar files into the Evolution calendar. I
provided the source code and 2 binaries compiled on Debian Sid i386 and amd64.

Any comment would be welcome.
Comment 8 Akhil Laddha 2009-10-13 09:05:20 UTC
*** Bug 225903 has been marked as a duplicate of this bug. ***
Comment 9 Akhil Laddha 2009-10-13 09:05:42 UTC
*** Bug 517124 has been marked as a duplicate of this bug. ***
Comment 10 Akhil Laddha 2009-10-13 09:06:53 UTC
bug 517124 has a patch [1] which is in needs-work state, 

[1] http://bugzilla-attachments.gnome.org/attachment.cgi?id=105471
Comment 11 Milan Crha 2009-11-12 11:39:46 UTC
Created attachment 147564 [details] [review]
evo patch

for evolution;

Added a new option "--import" to import files on command line. It'll bring the import dialog for unhandled URIs anyway, but it's just about doing a preview of the files before import, which is not implemented yet. The import type is chosen based on the first file given, and files which are not recognized are silently skipped. A user chooses a destination and all the files are imported there.

I also added one feature which bothered me much, with the mail importer, if it's called from a mail window, then the actively selected folder in the folder tree is preselected in the importer window. I consider it useful, thus it's there.
Comment 12 Milan Crha 2009-11-12 11:41:57 UTC
Created commit 13d07fd in evo master (2.29.2+)

For a preview seems to be bug #499320.
Comment 13 Matthew Barnes 2009-11-12 13:16:58 UTC
I would prefer not to have an --import function and instead make the shell smart enough to handle the URI directly.  That way, after we register ourselves as a handler for the MIME types we can import, simply double-clicking on the file in Nautilus will begin the import process.
Comment 14 Milan Crha 2009-11-12 15:44:47 UTC
(In reply to comment #13)
> ...instead make the shell smart enough to handle the URI directly...

It does that actually (it doesn't seem to be clear from my comment above), aka
the --import parameter is optional. That is slightly ready for the preview bug mentioned above, as I wanted to have a distinction between preview and import, and preview (though not different from import at the moment), is a default action for inside passed URIs.
Comment 15 Bastien Nocera 2009-11-12 15:58:47 UTC
Created attachment 147584 [details] [review]
Add mimetypes for Evolution to handle
Comment 16 Bastien Nocera 2009-11-12 15:59:12 UTC
Reopening, missing mime information.
Comment 17 Bastien Nocera 2009-11-12 16:34:27 UTC
Created attachment 147589 [details] [review]
Add mimetypes for Evolution to handle

vCal, vCard, and various e-mail and mbox formats.
Comment 18 Matthew Barnes 2009-11-12 16:37:36 UTC
text/x-vcard is an alias for text/directory, so we should just need the latter, right?
Comment 19 Bastien Nocera 2009-11-12 16:41:33 UTC
(In reply to comment #18)
> text/x-vcard is an alias for text/directory, so we should just need the latter,
> right?

Not quite, see:
https://bugs.freedesktop.org/show_bug.cgi?id=21680
Comment 20 Milan Crha 2009-11-12 16:55:46 UTC
And text/x-calendar;

otherwise I trust you, feel free to commit it.
Comment 21 Bastien Nocera 2009-11-12 17:50:27 UTC
(In reply to comment #20)
> And text/x-calendar;
> 
> otherwise I trust you, feel free to commit it.

What's text/x-calendar supposed to be? iCal? vCal? It's not in shared-mime-info.
Comment 22 Matthew Barnes 2009-11-12 18:13:13 UTC
Committed Bastien's patch plus a few of my own tweaks in:
http://git.gnome.org/cgit/evolution/commit/?id=48a400618b705696443f4aeacceaa1af0345a148

I'm pretty stoked about having this feature working!  Nice job, Milan.

There's a couple enhancements I'd like to make, but they can wait.  I think we're basically done here so closing this as FIXED.

Also, just for reference, I filed bug #596428 against GtkAssistant awhile back.  Matthias' proposed solution ("sealing" pages so you can't go back to them) would allow us to tidy up the import assistant a bit.
Comment 23 Milan Crha 2009-11-12 18:52:00 UTC
(In reply to comment #21)
> What's text/x-calendar supposed to be? iCal? vCal? It's not in
> shared-mime-info.

Oh, my memory is bad. I thought it's used in mails with meeting invites, but no, there is text/calendar. At lease in those generated by evolution itself.

I found we use that as a synonym for a text/calendar on some places in evo:

static GtkTargetEntry drag_types[] = {
	{ (gchar *) "text/calendar", 0, TARGET_VCALENDAR },
	{ (gchar *) "text/x-calendar", 0, TARGET_VCALENDAR }
};
Comment 24 Matthew Barnes 2009-11-12 20:15:40 UTC
It should be "text/x-vcalendar", which the MIME database defines as an alias for "text/calendar".
Comment 25 Matthew Barnes 2009-11-12 20:19:48 UTC
It just so happens I'm in the process of centralizing these target entries and I already fixed the calendar entries there.  I haven't done the drag API yet, just selection and clipboard, but here's what I have so far:

http://git.gnome.org/cgit/evolution/tree/e-util/e-selection.h
http://git.gnome.org/cgit/evolution/tree/e-util/e-selection.c