Mar 30 2008

Diary editor

Posted by Philip Withnall

Tags: , ,

The main window of the Diary.I’ve been keeping a personal diary for a while, but recently I’ve found that my previous storage method for it – keeping each day’s entry in a separate file, stored in a folder hierarchy – was getting too unwieldy. That’s why over the last few weeks I’ve written a small program to manage a diary.

I initially started writing it in Vala, but I found that I was having to put in dirty hacks every couple of tens of lines just to get the simplest things working with an SQLite database. Either due to my own lack of knowledge of Vala, or teething problems for the language and its bindings, I couldn’t get it to work, so about a week ago I scrapped it and ported the program to old-fashioned C.

So here it is: version 0.1 of my diary program. It supports basic editing of diary entries, a calendar view of the month and the ability to add “links” to each entry. A “link” is something which connects the diary entry to the wider world, much like a hyperlink connects one web page to another. At the moment only “URI”, “file” and “note” link types are supported, but in the future I plan for one to be able to link to anything from an F-Spot album to a section of a chat log in Empathy. Such links would allow references to conversations, e-mails, photo albums (etc.) in diary entries to be easily followed to find the goodies mentioned.

I also have plans to add Evolution calendar integration, as well as potential integration with Mugshot. It would be nice to see diary entries which can show all of what happened on that day, from doctor’s appointments in Evolution to the songs Mugshot says you listened to.

Keeping my feet more grounded in reality, however, I think the next thing on the agenda is encryption for the database the diary uses, so your darkest secrets aren’t so easily discovered.

To get it, you can either download the tarball or get the latest bzr tree from my website using the following command:

bzr branch http://tecnocode.co.uk/diary/

Thanks to people in the comments for pointing out a better way of branching.

The only requirements are gtk+-2.0 >= 2.12, sqlite3 and gtkspell-2.0, and it’s built in the usual fashion.

Feedback is welcomed warmly and given somewhere to stay for the night.

Filed under : Projects |

20 Responses to “Diary editor”

  1. Daniel Schierbeck Says:

    Nice! Do you have a name for it? “DearDiary”?

    [Reply]

  2. somi Says:

    *** glibc detected *** ./diary: free(): invalid pointer: 0×08079a40 ***
    ======= Backtrace: =========
    /lib/libc.so.6[0xa7325a00]
    /lib/libc.so.6(cfree+0×89)[0xa73276f9]
    /usr/lib/libglib-2.0.so.0(g_free+0×31)[0xa74303e1]
    ./diary[0x804e778]
    /usr/lib/libgobject-2.0.so.0[0xa74d8df7]

    you’ve got something wrong in memory allocations

    [Reply]

    Philip Withnall reply on March 31st, 2008:

    Could you provide a more complete stack trace please (e-mail it to contact-march-2008 {at} tecnocode.co(.)uk)? I’ve never encountered that crash. Thanks.

    [Reply]

    wen reply on May 19th, 2008:

    I got the same problem. Did you already solve this or do you still need a backtrace?

    Cheers,
    wen

    [Reply]

    Philip Withnall reply on May 19th, 2008:

    I believe I’ve solved it, although if you want to check out bzr trunk above and see if you still get the problem, I’d be grateful.

  3. ethana2 Says:

    “Keeping my feet more grounded in reality, however, I think the next thing on the agenda is encryption for the database the diary uses, so your darkest secrets aren’t so easily discovered.”

    BINGO. Let me know when it’s ready to use. I’ll test it for you. ethana2 {at} gmail(.)com

    … by the way, ‘darkest’ makes them sound like evil or something. ‘deepest’ may simply be more accurate in many cases.

    [Reply]

  4. ethana2 Says:

    Oh, and by ‘ready to use’.. I guess I may mean .deb binaries..

    Whenever I mess with source code, bad things happen..

    [Reply]

  5. Bastien Says:

    You could also just commit it to GNOME SVN :)

    [Reply]

  6. ethana2 Says:

    Yeah, that’d be great!

    sudo apt-get install gnome-diary

    …It’s written in C and GTK, I don’t see why they wouldn’t accept it.

    [Reply]

  7. Philip Withnall Says:

    I would like to eventually move it to GNOME SVN, but I couldn’t initially put it there, as it failed prerequisite #3 for getting GNOME SVN hosting: namely that it has to have had at least one public release. (http://live.gnome.org/ProjectPrerequisites)

    [Reply]

  8. Juerg Billeter Says:

    The Vala bindings for SQLite are certainly not mature yet. However, I’d be interested in the problems you’ve had. Many issues can be fixed very quickly. Feel free to join IRC #vala on GimpNet.

    [Reply]

  9. Boke Says:

    Looks great!

    Something cool would be being able to “export” the entries as HTML output, so you could read your diary like a blog, and even make it public.

    [Reply]

  10. Olivier Lê Thanh Says:

    Look very interesting.

    Too bad it is not using a text file based format any more. I would have loved to just edit file by hand in ssh when not in front of my computer. But if that’s the price to pay for a better integration with other apps then I guess I will be happy to pay it.

    Why are you giving such complicated instruction to retrieve your tree instead of a simple :
    bzr branch http://tecnocode.co.uk/diary/

    [Reply]

    Philip Withnall reply on April 2nd, 2008:

    You could edit your diary database remotely using the `sqlite3` command-line tool if you wanted. The database schema is pretty straightforward.

    I don’t know why I’m using such a complicated instruction to branch the tree. Thanks for the simpler one.

    [Reply]

  11. Ali Sabil Says:

    Hi,

    Nice work, too bad Vala didn’t work for you, actually there is a problem in vala 0.1.7 SQLite binding, it was fixed in svn, hope this helps.

    Concerning bzr, this is maybe easier:
    bzr branch http://tecnocode.co.uk/diary/

    [Reply]

  12. Bastien Says:

    That requirement is a bit crock. You can make your release once you’ve done the import, especially as it makes it easier to install the tarball on http://ftp.gnome.org

    [Reply]

  13. sn0n Says:

    perfect as is. (@work so cant try)
    but from the screenshot , looks perfect. i like simple apps with simple goals. dont make it a new MS Office Word Blogging tool… ;-)

    [Reply]

  14. James Says:

    I assume you’ve see Drivel? http://dropline.net/drivel/

    [Reply]

    Philip Withnall reply on April 2nd, 2008:

    I have seen Drivel, and even used it, but I don’t think posting to blogs is quite the same as keeping a diary. Diaries are local, although I was thinking about some way to eventually export diary entries to a blog if required.
    Additionally, Drivel doesn’t seem to have had a release in a few years, although there may have been no need for it to have.

    [Reply]

  15. Mark Says:

    Very nice piece of work you’ve done, thanx a lot.
    I agree to Boke’s suggestion: Export to txt or html would be nice.

    [Reply]

Leave a Reply