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 127552 - Evolution/iPod synchronization
Evolution/iPod synchronization
Status: RESOLVED OBSOLETE
Product: bounties
Classification: Infrastructure
Component: Misc
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Bounty Bug List
Bounty Bug List
Depends on:
Blocks:
 
 
Reported: 2003-11-20 20:25 UTC by Benjamin Kahn
Modified: 2008-04-15 13:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GUI mockup demo (73.15 KB, application/octet-stream)
2003-12-03 01:12 UTC, Bernard Leach
  Details
Second iteration of prototype interface (87.28 KB, application/octet-stream)
2003-12-03 21:03 UTC, Bernard Leach
  Details
copy evolution contacts to an ipod (4.89 KB, text/plain)
2004-04-28 21:59 UTC, Christophe Fergeau
  Details
Fix for Ubuntu Hoary (542 bytes, patch)
2005-01-17 11:18 UTC, Paul Cooper
none Details | Review

Description Benjamin Kahn 2003-11-20 20:25:58 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.
Comment 1 Benjamin Kahn 2003-11-20 20:26:30 UTC
Please see http://www.gnome.org/bounties/Addressbook.php3#127552 for
more information.
Comment 2 Benjamin Kahn 2003-11-20 21:01:12 UTC
Oops.  The Correct URL for more information is:
http://www.gnome.org/bounties/Miscellaneous.php3#127552
Comment 3 Bastien Nocera 2003-11-22 22:36:22 UTC
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
Comment 4 Gerald Henriksen 2003-11-23 06:05:52 UTC
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.
Comment 5 Bastien Nocera 2003-11-23 13:19:13 UTC
Get one-way right first. Getting the bounty doesn't require to have
both ways working.
Comment 6 Bernard Leach 2003-11-28 10:41:14 UTC
I'm taking a look at this.

Do we have any evolution/iPod g3 (and eveolution/iPod g1) owners out
there interested in testing?
Comment 7 Christophe Fergeau 2003-11-28 10:43:38 UTC
When I manage to get my firewire card to work again, I can test stuff
Comment 8 Christophe Fergeau 2003-11-28 10:44:14 UTC
(I've got an ipod g3)
Comment 9 Bernard Leach 2003-12-03 01:12:53 UTC
Created attachment 22034 [details]
GUI mockup demo
Comment 10 Bernard Leach 2003-12-03 01:15:39 UTC
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!
Comment 11 Bastien Nocera 2003-12-03 01:23:35 UTC
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.
Comment 12 Bernard Leach 2003-12-03 21:03:19 UTC
Created attachment 22071 [details]
Second iteration of prototype interface
Comment 13 Bastien Nocera 2003-12-04 12:42:39 UTC
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
Comment 14 Christophe Fergeau 2004-04-28 21:56:34 UTC
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.
Comment 15 Christophe Fergeau 2004-04-28 21:59:59 UTC
Created attachment 27188 [details]
copy evolution contacts to an ipod
Comment 16 Christophe Fergeau 2004-04-28 22:02:59 UTC
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>
Comment 17 Ross Burton 2004-08-05 10:29:50 UTC
I'm willing to hack on this.  Is anyone still working on it?
Comment 18 Justin Wake 2004-08-27 14:27:14 UTC
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.
Comment 19 Justin Wake 2004-08-27 15:13:03 UTC
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?
Comment 20 Christophe Fergeau 2004-08-27 16:53:33 UTC
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
Comment 21 Justin Wake 2004-08-27 17:20:51 UTC
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.
Comment 22 Justin Wake 2004-08-27 19:00:41 UTC
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.
Comment 23 Christophe Fergeau 2004-08-27 22:32:32 UTC
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.
Comment 24 Nat Friedman 2005-01-08 04:37:56 UTC
Wow, this is very cool!  I had no idea this happened.

Christophe, are you still working on this?
Comment 25 John Keller 2005-01-10 14:11:36 UTC
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.
Comment 26 Christophe Fergeau 2005-01-10 14:20:02 UTC
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 ;)
Comment 27 John Keller 2005-01-10 14:42:14 UTC
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!
Comment 28 Paul Cooper 2005-01-17 11:18:32 UTC
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.
Comment 29 Jason Quigley 2005-03-14 19:25:10 UTC
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.
Comment 30 Bastien Nocera 2008-04-15 13:39:36 UTC
Conduit supports synchronising Evolution with iPods now, closing this.