GNOME Bugzilla – Bug 127552
Evolution/iPod synchronization
Last modified: 2008-04-15 13:39:36 UTC
Since the iPod supports calendars and addressbooks, it would be handy for Evolution users to be able to automatically and easily synchronize their personal data to their iPods. Because the iPod is a read-only device — the iPod cannot modify the data — the "synchronization" is really just a one-way copy from Evolution to the iPod. Your solution must synchronize three kinds of data: * Contacts in the addressbook * Events in the calendar * Task list ("To Do" in the iPod) The difficult part of this work will be to create a simple and integrated user experience that doesn't require the user to do any special setup or ever drop to a command line. The winning entry will offer an all-encompassing solution. This bug is part of the Integrated Collaborative Desktop Bounty Hunt. For more information on prizes, contest rules, and other bounty tasks, visit: http://www.gnome.org/bounties/ If you would like to start working on this bounty, please create a bugzilla account and append your intention to work on this bounty to this bug. If multiple people declare their intentions to work on a task, we encourage you to join forces and work together. Please do not close this bug. The contest organizers will mark this bug as FIXED when the prize is claimed.
Please see http://www.gnome.org/bounties/Addressbook.php3#127552 for more information.
Oops. The Correct URL for more information is: http://www.gnome.org/bounties/Miscellaneous.php3#127552
Some hints for the takers: - You can put your application in the qahog module in GNOME CVS (it's the starts of a gnome-vfs method for the iPod's songs) - Add something like that in Evolution's tools menu (C-pseudo-code): path = g_find_program_in_path ("qahog-evolution-sync"); if (path != NULL) add_ipod_sync_submenu (); - There's an example of a program program that uses the address-book code called "evolution-addressbook-export" under evolution/addressbook/tools. It should be easy to modify to get addresses onto the iPod. (Crappy way: "evolution-addressbook-export > $(mount)/Contacts/evolution.vcf") - There's not much examples for the Calendar and Tasks, but it all goes under: $(mount)/Calendar/evolution.ics (Crappy way: "cat ~/evolution/*/Calendar/calendar.ics ~/evolution/*/Tasks/tasks.ics > $(mount)/Calendar/evolution.ics") - qahog contains some code to discover where the iPod is mounted from the /etc/fstab, it would be nice to parse /proc/bus/ieee1394/devices to see if the iPod is presently connected on the system (but not enough, as they can also be connected via USB-2.0) - Fedora Core's kudzu and updfstab will automatically create the proper /etc/fstab entry when the iPod is plugged. Hope this helps
I think a clarification is required regarding the requirement. The description of what needs to be done includes the statement *Because the iPod is a read-only device — the iPod cannot modify the data — the "synchronization" is really just a one-way copy from Evolution to the iPod.* It seems to me that the reverse direction (iPod -> Evolution) is also required, for example is someone uses their iPod to keep their home and work versions of Evolution up to date.
Get one-way right first. Getting the bounty doesn't require to have both ways working.
I'm taking a look at this. Do we have any evolution/iPod g3 (and eveolution/iPod g1) owners out there interested in testing?
When I manage to get my firewire card to work again, I can test stuff
(I've got an ipod g3)
Created attachment 22034 [details] GUI mockup demo
Ok, I have attached a simple program that runs through a mockup druid for configuring the synchronization. Since it uses the evolution widgets for the folders you need to build against a recent evo 1.5 version. ./confgure && make && make install && evolution-ipod-sync Feedback welcomed!
Ok, so a bunch of little things: - ENABLE_NLS is always defined for GNOME applications, no need to add ifdef's - there's no need for a wizard when it could all fit on one small dialog, and that most people will want to either sync everything, or sync all the local data. - Use C comment, not C++ ones (arf) Already a good start.
Created attachment 22071 [details] Second iteration of prototype interface
We can very easily change the GUI afterwards but: - you need to remove the shadows from the frames - make sure you have a button to close the window/start the sync
Ok, I don't know if anyone is still working on this bounty, but I wrote the following (GUI-less) code which will grab all the contacts from Evolution and write them to the iPod. The iPod mount point is currently hard coded. I'll probably write similar code for the calendar next.
Created attachment 27188 [details] copy evolution contacts to an ipod
The source is missing a bunch of includes and defines, I actually initially wrote it in the file 'main.c' from the second iteration of the prototype interface. This source file has all that is needed except from a #include <libebook/e-book.h>
I'm willing to hack on this. Is anyone still working on it?
I'm having a whack at this - actually, I have been for the better part of the last day or two, just about done. Just need to finish up the Evolution side of things and I'll upload it somewhere so people can take a gander.
Okay, here's the sync program itself: http://members.iinet.net.au/~wakes/evolution-ipod-sync-0.1.tar.bz2 It depends on DBUS and HAL to find (and mount, if necessary) the iPod. The UI is about as simple as I could think of making: http://members.iinet.net.au/~wakes/waiting.png A dialog which appears if an iPod is not immediately available and mounted - it disappears automatically once an iPod is found and mounted. http://members.iinet.net.au/~wakes/main_ui.png The UI itself. The user can specify which types of data they want to sync with the iPod, and click Export to begin the sync. http://members.iinet.net.au/~wakes/complete.png The dialog that appears once the sync is complete. One problem I have run into is that on Evolution builds with LDAP enabled, there will be five or so LDAP addressbooks by default which may cause the export process to pause momentarily while the server is contacted. I'm thinking the best thing to do would be to add some form of "Local only" option to the UI, but I can't think of the best way to do it and yet keep the UI nice and clean. Other than that, I'm just hunting through the Evolution source to find the neatest place to insert it into the menu, and then it should be done, barring any unexpected problems. Thoughts?
I quickly looked at the contact exporting code, and I don't think it's 100% working: * you need an UTF-16 string if you want to be able to display accentuated characters * iirc, it's more correct to separate vcards with \r\n instead of a single \n (and maybe putting several vcards in a single file on the iPod without using \r\n doesn't work, I don't remember) * maybe it would be better to create the Contacts and Calendar directories if they don't exist * I'm not sure automatically mounting the iPod within evolution is a good thing For the utf-16 conversion, this function: static gunichar2* utf8_to_utf16 (const char *utf8, glong *length) { guchar bom[4] = {0xEF, 0xBB, 0xBF, 0x00}; gchar *str; gunichar2 *utf16; str = g_strdup_printf ("%s%s", bom, utf8); utf16 = g_utf8_to_utf16 (str, -1, NULL, length, NULL); g_free (str); return utf16; } works for me, but now that I looked at it again, I'm not sure at all it will work on big endian machines
The \n separation between vcards seems to work on my (20gb 3rd gen) iPod, but I'll change it to \r\n just to be safe. My thinking re: mounting the iPod is that most users are likely to end up having gnome-volume-manager installed anyway, which will happily handle the mounting of the iPod; given that the description suggests that users should never have to drop to a command line, I figured I'd just automate that step of the process if it wasn't already. I just changed it so that if the iPod wasn't mounted when the program first began, it will be umounted when the program finishes - does that sound more reasonable? Also added a line or two to try creating the directories if they don't exist. I'll have a closer look into the string handling, I completely forgot about accented characters.
I've put a new version up, at http://members.iinet.net.au/~wakes/evolution-ipod-sync-0.2.tar.bz2 which should fix those issues. I *think* it should work properly for big-endian machines as well, however I cannot test that absolutely at the moment. In any case, my iPod seems to be happy enough displaying all the data (now with accents :) ) I can cram onto it.
When I said I wasn't sure it was a good idea to mount/unmount the iPod from evolution, that was only my opinion, maybe the opinion of the evolution guys will be different ;) When you change the string byte order, going with something using #if G_BYTE_ORDER==G_LITTLE_ENDIAN and/or GUINT16_FROM_LE would probably be cleaner. But after thinking a bit more about it, the BOM character at the beginning of the UTF-16 string is there so that the iPod knows the byte order of the UTF-16 string, and I think I verified it can handle both little endian and big endian ordered UTF-16 strings.
Wow, this is very cool! I had no idea this happened. Christophe, are you still working on this?
Justin, in reference to comment 21: I recently got an iPod photo and just tried copying over a monolithic vCard (all my Evolution contacts in one file). I have to do it manually via select all + save as vCard because my iPod doesn't show up yet (running Mandrakelinux cooker, some USB still broken on my machine). This doesn't directly relate to your work on the plugin/patch. But I thought you might be interested to know that a monolithic vCard, even with with \r\n breaks (which is what I exported), does not seem to work.
A monolithic vcard with no blank lines between contacts work. If it's properly encoded in utf-16, accents also work. You can give a try to cfergeau.free.fr/pody.html if you want a tool to export your evo contacts to your ipod (though you'd better get the source from arch or wait for a new release since I fixed at least 1 stupid bug since then ;)
Oops, sorry - my mistake. I just did a search-and-replace on the extra line break, and the contacts all appear. I guess I should have tried that before turning this bug into a support column. ;-) Looking forward to seeing your work integrated with Evolution. Good luck!
Created attachment 36126 [details] [review] Fix for Ubuntu Hoary I was trying this on Ubuntu Hoary (i.e. Gnome 2.9) and it seems that volume.is_filesystem is deprecated on the version of HAL installed (0.4.4). So I had to change volume.is_filesystem to volume.fsusage to get it to work.
Hey guys! Why not just use multisync? I use the backup conduit for evo2 and backup to the folders on my 2G ipod (One for contacts and another for the calendar) and all the info shows up fine on the ipod.
Conduit supports synchronising Evolution with iPods now, closing this.