GNOME Bugzilla – Bug 588093
Allow Importable Files To Pass To Evolution On Command Line
Last modified: 2009-11-12 20:19:48 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:
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.
*** Bug 330505 has been marked as a duplicate of this bug. ***
*** Bug 313633 has been marked as a duplicate of this bug. ***
*** Bug 269031 has been marked as a duplicate of this bug. ***
*** Bug 271516 has been marked as a duplicate of this bug. ***
*** Bug 558484 has been marked as a duplicate of this bug. ***
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.
*** Bug 225903 has been marked as a duplicate of this bug. ***
*** Bug 517124 has been marked as a duplicate of this bug. ***
bug 517124 has a patch [1] which is in needs-work state, [1] http://bugzilla-attachments.gnome.org/attachment.cgi?id=105471
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.
Created commit 13d07fd in evo master (2.29.2+) For a preview seems to be bug #499320.
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.
(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.
Created attachment 147584 [details] [review] Add mimetypes for Evolution to handle
Reopening, missing mime information.
Created attachment 147589 [details] [review] Add mimetypes for Evolution to handle vCal, vCard, and various e-mail and mbox formats.
text/x-vcard is an alias for text/directory, so we should just need the latter, right?
(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
And text/x-calendar; otherwise I trust you, feel free to commit it.
(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.
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.
(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 } };
It should be "text/x-vcalendar", which the MIME database defines as an alias for "text/calendar".
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