Active Topics

 


Reply
Thread Tools
omeriko9's Avatar
Posts: 385 | Thanked: 344 times | Joined on Jan 2010 @ Israel
#1
I'm currently doing my first steps in N900 development, working on a status-menu notification app to display a small icon in the status bar when there's a missed call.

When there is an unanswered call, the led is blinking accordingly.
After you view the missed call (by clicking the yellow window or by going straight to the call log in the phone application) the led stops.

How can I "catch" this "event" in python?
I guess it has to do with some registration to a d-bus, but I don't know how to do that in python nor (more important) what is d-bus should I register to.

Another question - I'm using "icon_theme.load_icon(...)" to get a hildon icon and display it in the status bar, but I want a custom png/gif (to display different icons according to the number of missed calls) - it seems not to be working with a file i pick from /home/opt/usr/share/icons/hicolor/...

And another one - how can I make the icon blink (like the 'you have updates' icon)? when I'm using gobject.timeout_add to hide and show it, it takes about 5.4% of CPU - which is too much. I was thinking about animated GIF, but as I said before, I don't even know how to use a PNG as an icon.

Thanks in advance!
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#2
Have no idea how to use python-dbus, sorry; can't help there.

If you can't get it to work using the gtkicontheme stuff, you can also use "pixbuf = gtk.gdk.pixbuf_new_from_file ("/path/to/png")" and pass pixbuf to set_status_area_icon. I believe set_status_area_icon only likes its icons to be 18x18 as well.

It's in C, but the updates applet appears to use g_timeout_add() too: http://maemo.gitorious.org/hildon-ap...us-menu-item.c
 

The Following User Says Thank You to qwerty12 For This Useful Post:
omeriko9's Avatar
Posts: 385 | Thanked: 344 times | Joined on Jan 2010 @ Israel
#3
qwerty12 thank you very much for the info and the time to answer my questions. So far you are the only one doing so.

Actually I've found this link on how to use d-bus with python.

Just need to know what is the d-bus I should use for this matter.

If no-one knows how to do that, another idea I had is to clear the icon on any user action (tap, touch, button etc') - what is the d-bus for that?

And last idea was to clear the icon after the user closes the yellow "missed call" window manually. For that I need to check if the process for that window is alive - any idea how do I find out what is the process name for the yellow window?
 
Posts: 883 | Thanked: 980 times | Joined on Jul 2007 @ Bern, Switzerland
#4
You can use mdbus2 (in extras-devel IIRC) to listen to and inspect d-bus. Just make a call, let it ring, stop calling.
Also, there are call log apps around, download and examine them. It might be that there is a status flag in the call log database that could be useful to you.
Use gobject.timeout_add_seconds for a more efficient blinking. Don't use animated gifs, just use two icons alternating between them.
The yellow window might be related to the hildon notification. Or just compare the process list before and after having a missed call.
__________________
-Tom (N900, N810, N800)

"the idea of truly having a computer in your pocket just moved a big step closer."
 

The Following User Says Thank You to twaelti For This Useful Post:
omeriko9's Avatar
Posts: 385 | Thanked: 344 times | Joined on Jan 2010 @ Israel
#5
Originally Posted by twaelti View Post
You can use mdbus2 (in extras-devel IIRC) to listen to and inspect d-bus. Just make a call, let it ring, stop calling.
Also, there are call log apps around, download and examine them. It might be that there is a status flag in the call log database that could be useful to you.
Use gobject.timeout_add_seconds for a more efficient blinking. Don't use animated gifs, just use two icons alternating between them.
The yellow window might be related to the hildon notification. Or just compare the process list before and after having a missed call.
Thank you very much! I'll definitely look into those ideas.
 
Reply


 
Forum Jump


All times are GMT. The time now is 02:56.