five-a-day-applet: Countdown from 5 to 0

Bug #200432 reported by Michael Hall
8
Affects Status Importance Assigned to Milestone
five-a-day
Fix Released
Wishlist
Unassigned

Bug Description

I believe a nice feature for the five-a-day-applet would be to have it countdown from 5 to 0 so that we can keep track of how many bugs we have left to do today. The big glowing red "5" is a nice prod that reminds you to get a move on, but I believe that after one bug is submitted through the applet, it should decrease to 4, then after another bug, to 3, and so on. Finally when it hits 0, have it as a blue colour instead of red. The blue seems more calming, and more like you've done a job well done than the urgency of the red.

Changed in five-a-day:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Markus Korn (thekorn) wrote :

Hi Michael,
sounds like a good idea to me. Before we can add such a counter some work has to be done/information is needed:
 * currently the applet does not now the number of bugs a user has submitted, applet has to read user's file in the -data directory
 * looking a the stats there are many people doing more than 5 bugs a day, how should the applet handle more than 5 bugs?

My personal opinion is: the icon of an applet should never change, as an applet is identified by its icon, so maybe we should start with a counter in a tooltip and then later add a dropdown list with a counter and all bugs a user worked on (on a given date)

Markus

Revision history for this message
Daniel Hahler (blueyed) wrote :

In case somebody adds more than 5 bugs, the blue icon could be counting upwards again.
The icon changes after user interaction, so I think it's not really disturbing, but rather motivating.

add-5-a-day could be converted into a Python class and provide an interface for such actions ("status"). On the other hand, grepping the user's file works, too - add-5-a-day already does something similar when looking for bugs that have been added already on that day.

Revision history for this message
Kjell Braden (afflux) wrote :

We could have the icon statically for identifying purposes, but have a string containing the counter beside it, like the cpufreq or weather applet has. But I guess the big red 5 would be somewhat confusing, so we should change to the bug icon we use for the 5-a-day team currently.

Revision history for this message
Joe Smith (yasumoto7) wrote :

I made 5 more icons (4 to 0), now I'm trying to see if I can figure out how to update it. Has anyone been working on implementing this?

Revision history for this message
Markus Korn (thekorn) wrote :

Joe, thanks for your work,
I had a closer look at the code, the attached patch should improve the icon changing a bit, but the icon is still crashing randomly, I think it is related to the threading parts, but I'm not totally sure.

I will try to investigate further tomorrow morning.

Markus

Revision history for this message
Markus Korn (thekorn) wrote :

I just played a bit with my patch and it is not working that well, somehow the eventbox is not redrawn correctly sometimes, and this causes the applet to hang. Unfortunatly pygtk is not easy to debug.

Another solution just came in my mind: what bout using cairo? - what about only using the icon without the number and dynamically create an cairo overlay containing the number. I'm not sure if this works and if this solve the remaining issue.
(Note: this would add a python-cairo dependency)

Markus

Revision history for this message
Joe Smith (yasumoto7) wrote :

That could work, and would also cut down on the number of icons needed.

One issue with the current implementation is that there isn't a "reset" on each day, though perhaps adding a 24 hour "expiration" period, would be good, keeping track using either pickle or a text file is what I'm thinking.

Revision history for this message
Joe Smith (yasumoto7) wrote :

Looked into the PyGTK pixbuf at http://www.pygtk.org/docs/pygtk/class-gdkpixbuf.html

It says:

A gtk.gdk.Pixbuf object contains the data that describes an image using client side resources. By contrast a gtk.gdk.Pixmap uses server side resources to hold image data. Manipulating the image data in a gtk.gdk.Pixmap may involve round trip transfers between a client and a server in X11 while manipulating image data in a gtk.gdk.Pixbuf involves only client side operations. Therefore using gtk.gdk.Pixbuf objects may be more efficient than using gtk.gdk.Pixmap objects if a lot of image manipulation is necessary.

Translation:
There's also a Pixmap which may be useful, however it's supposedly slower than the pixbuf, which won't help our case. I'll look into it though.

Revision history for this message
Markus Korn (thekorn) wrote :

I started today to play with the idea of using svg and cairo to use a blank svg icon without a number in the background and only re-draw the number in the foreground at every update. I think this is working well, it does not hang for me.
I attached this in a new branch.

What do you think, is it working for you?
Note: I'm not sure about dependencies, but this is using cairo, pango and rsvg

Markus

Revision history for this message
Joe Smith (yasumoto7) wrote :

I'm finally caught up on my exams/assignments that I missed from heading up to a conference last week, so I have time to work on this again. I'll pull your branch and try it out.

Changed in five-a-day:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.