Categories

Links

Blog Stats

526,175 hits

The journey to a simple ToDo widget

September 5, 2011 — Hans

Alternative title: More reasons to love Free and Open Source Software.

This is a story about how I got what I wanted through toil, sweat and tears (thankfully no blood was spilled; the sweat and tears part might also be slightly exaggerated). All thanks to the nature of Free and Open Source Software.

Like many other times, it all started with a harmless thought: “So many things to do, I think I need a ToDo list”. Before I would keep track of things to do in a Notes widget on my desktop (screenshot), but this felt a bit primitive. It was time to get something better, although still simple, as I only needed the most basic features:

A clear list of tasks that need to be done and when they must be accomplished

Easy way of adding new tasks and marking tasks as completed

Possibility to create tasks that are repeated (e.g. a task that needs to be done once every day)

Basic priority settings

with the last point being a “nice to have” rather than “must”. With this in mind, I set out on my journey to find a suitable ToDo widget for my desktop.

… And returned empty-handed. Despite the many widgets that are shipped by default, the even larger amount of widgets on KDE-apps (not to mention the vast amount of Dashboard/Web/SuperKaramba/Google Gadget widgets), I couldn’t find one that fulfilled my requirements – a ToDo list that looks good on the desktop and supports the features listed above. Was that too much to ask for?

One of the top candidates was Remember The Milk, a plasmoid written by Andrew Stromme, which is included in kdeplasma-addons and thus often installed by default. I created an account on the Remember The Milk site and played around with the widget for a bit. It supported all the features I asked for and much more – great! The way of adding new tasks was also very nice. For example, I can write “Clean room tomorrow”, and it understands that I want the task “Clean room” scheduled for tomorrow (actually, it’s much smarter than that). However, I’m a person who likes minimalism, the KISS principle and clean desktops, and unfortunately Remember The Milk made my desktop feel too cluttered for my tastes (a problem shared by many widgets, by the way).

Remember The Milk plasmoid on my desktop

That could’ve been the end of story, but there’s a reason for the alternative title of this post. For more than a decade I’ve been enjoying Free and Open Source Software (FOSS) as a user. I liked the freedom that the KDE workspaces and applications offered, the freedom to use them and make them work as I wanted, but over time I’ve come to more and more appreciate the philosophy behind FOSS and the great communities around many FOSS projects such as KDE.

I’ve been in a developer’s shoes a few times, but all I’ve done is small changes. Today I put on those shoes again and got to experience what freedom means from a programmer’s perspective.

The Remember The Milk plasmoid is licensed under a FOSS license which, as you probably already know, means that anyone can view and edit the source code. Using the nice web interface at projects.kde.org, I could easily locate the relevant repository and find the Git command to clone it. The first thing I wanted to do was to declutter the widget by removing things I didn’t need. The label that displays the text at the top was the first to go, closely followed by the tab bar and filter bar. Since I didn’t want to spend too much time on this, it was done in a very quick and dirty way – I haven’t removed the code for filtering the tasks even though the filter bar is gone, for example. This method didn’t require much understanding of the code, and anyone with a little C++ knowledge could have easily done it. But yes, it’s not a very elegant solution.

Before compiling the source to see my modifications I had to edit CMakeLists.txt. The file contains instructions to CMake on how to make the project, and I didn’t want to overwrite my current Remember The Milk plasmoid. If you ever find yourself in the same situation, I highly recommend you to take a look at how other widgets (e.g. from KDE-apps.org) do it, as well as checking the Techbase page. It’s not that hard to figure it out after seeing some examples.

The next thing to do was to improve the appearance. This seemed harder, as I’m not used to working with QPainter et al. But the code was written in such as a way that it was easy to find the things I wanted to change, and with some help from API references (especially for Qt and Plasma), I got a result that I was happy with.

Remember The Milk after modifications

There was still one thing that I wasn’t satisfied with, however. To mark a task as complete, you had to enter edit mode by clicking on the task, check the Complete checkbox, and finally click on Update Task. I wanted an easier and faster way. Driven by my recent success, I felt that it was worth to give it a try.

My first idea was to add a button next to each task, but this seemed to require quite much work. Instead I went for an easier solution – middle click on tasks to mark them as complete. It was surprisingly easy to implement since I could copy the code for updating tasks. The hard part was to figure out how to detect which mouse button was clicked, which was easily solved with a Google search. The only problem is that with my current implementation, I had to change the action from “clicked” to “pressed”, meaning that I broke drag and drop in the process. But to me, the new feature is more important.

What really hit me during all this was how much control I had over my workspace – it truly is my workspace. If I can’t configure something to work as I want, I’m always free to modify the source code. Of course, I’ve known that this was possible ever since I was introduced to FOSS, but it’s different to experience it first-hand. Even I can do it.

And so can you! If you’re interested in contributing code to KDE, I have three suggestions:

If you feel unsure, pick something that doesn’t seem too hard to achieve, for example doing small fixes like what I’ve done with Remember The Milk (although in my case, it’s not supposed to be an improvement; it’s rather an adaption to what I personally want)

Most importantly, work on something that you want. Is there a small bug that you find slightly annoying? Try to fix it! A simple application that you miss? You can create it!

I call this new plasmoid Remember The Milk Simple because I’ve stripped out some features, and the intention of the widget is to provide a simple ToDo list for the desktop. I guess you could call it a fork of the original Remember The Milk plasmoid. Before anyone asks, I want to clarify that I’m not intending to release the widget as it is now. The reason is simple – I consider this a hack, and a very ugly one at that. If there is interest I might work a bit more on it but I doubt I’ll find the time.

“But what about all this FOSS stuff you just babbled about”, you might wonder. Fair enough. If you really want this widget or are interested in contributing, e.g. by cleaning up the code, you can check out (or rather, clone) the Git repo for this project:

To use it you’ll also need the Remember The Milk dataengine which is included in kdeplasma-addons.

That’s the end of my story, I hope it’ll inspire some to roll up their sleeves and start hacking. In the end I got (what I consider) a nice-looking ToDo list on my desktop, which will be an excellent complement to a widget I created called Procrastinate No More. Now I just need to actually start working on some tasks instead of hacking on widgets that remind me to do it.

Update October 15, 2012: Updated link to new repository on GitHub.

Advertisements

Like this:

LikeLoading...

Related

11 Responses to “The journey to a simple ToDo widget”

Hi Hans, Andrew Stromme here. I should mention that my homepage should now be considered http://andrewstromme.com, that blog hasn’t been updated in quite a while. Thanks and I’m glad the widget was useful for you!

You might need to install additional development packages via your package manager in order to compile it, e.g. kdelibs5-dev.

Note: for some reason I haven’t been able to authenticate with Remember The Milk Service since yesterday. I’m not sure what the problem is, but the original widget has the same problem, and it has happened before.

Edit: Wait, the fix was after the 4.7.0 release. Maybe that’s the bug I’m experiencing right now. Hopefully it’s fixed in 4.7.1.

OK thanks, managed to compile and all that. However, as you noted it does not (more than original RTM) authenticate. Am not sure what is the problem, I read Andrew is fixing something (apologies re abandonware comment) but a small adobe air based “app” I found logs in no problems. It does not LOOK near as pretty on KDE but it works.. and stores offline status which is a must where I need.