[tomboy-list] Note Attachments

Jeff Tickle jeff at jefftickle.com
Thu Mar 27 18:33:24 PDT 2008


Hey everyone,

I'd like to get some comments on Note Attachments.  This has been in
the pipe for a little while, and will be pretty crucial for a 1.0
release, as we discussed on IRC today.

For the uninitiated, an attachment is a file that is attached to a
note.  The best way I can explain is with use cases:

If you drag an image onto a note, the image would be copied into
~/.tomboy, and if you synced the note using Conduit, the image would
go with the note.  Any edits to the original image would not be
reflected in the note, unless you replaced the old attachment with the
new image.

If you use the Sketching plugin to draw on a note, right now, nothing
is saved.  With a standard Attachments API, Sketching could create a
file in ~/.Tomboy that holds the binary data representing the sketch.
This would be synced with the note.  Any changes WOULD be reflected in
the note, because edits happen *within* Tomboy.

Any addin would be able to create Attachments.  Right now, the primary
focus is on images, but I'd like to make it extensible to fit any
needs that might come along.  I'm not really thinking so much about
attaching things like documents (.odt or whatever), rather those would
be linked to within a note and synced separately using Conduit,
outside of Tomboy.  I talked to Sandy about this in IRC and he agrees
that it would be a nightmare to track changes to the document, and
that this probably isn't a major use-case anyway.

Here's what I've come up with for the HOW to implement it:

Each note that has an attachment gets a ~/.tomboy/[GUID]/ directory.
Any attachments could be stored in here, either with their original
names (in the case of an attached image) or something that makes sense
to the responsible add-in (in the case of a Sketching).

The note itself is still stored in ~/.tomboy/[GUID].note, so we don't
break compatibility as bad.

A NoteAttachment class, which would contain information about
individual attachments.  I think this would really be an extension of
the NoteTag class, any thoughts here?  The main reason I think it
would need to be its own class is so that any syncing back-end (which
I honestly know little about) would have some abstract methods to call
to do any packaging necessary for syncing the attachments.  There may
be more reasons for or against a NoteAttachment class.

Any thoughts?  I haven't written any code yet, but this is pretty much
what I have to start from right now.

-Jeff


More information about the Tomboy-list mailing list