Thread: Dialcentral 1.0
View Single Post
epage's Avatar
Posts: 1,684 | Thanked: 1,562 times | Joined on Jun 2008 @ Austin, TX
#254
Originally Posted by DataPath View Post
I've started hacking on a home applet to provide access to a quickdial list, or messages, etc.

Given that I'd like to reuse as much Dialcentral code as possible, it's being written in python using the hildon-desktop-python-loader and python-hildondesktop bindings.

I've looked at the homememfree applet source code, which is also written in python.

But when I try to write a simple applet that displays just a label with static text, it doesn't work. It shows up in the list of available applets just fine, but when I select it, it does nothing, and going back to the list of applets shows it deselected.

If I convert the exact code I have to instead inherit from hildon.Window instead of hildondesktop.HomeItem, it runs fine as a regular program.

Anybody have any hints for debugging this kind of thing?

/usr/lib/hildon-desktop/quickdial.py
Code:
import gtk
import hildondesktop
#import hildon

class QuickDial(hildondesktop.HomeItem):
#class QuickDial(hildon.Window):
    def __init__(self):
        hildondesktop.HomeItem.__init__(self)
        #hildon.Window.__init__(self)

        self.label = gtk.Label()
        self.label.set_text("Hello World!")

        self.add(self.label)

        self.connect("destroy", gtk.main_quit)
        self.show_all()

def hd_plugin_get_objects():
    plugin = QuickDial()
    return [plugin]

if __name__ == "__main__":
    objects = hd_plugin_get_objects()
    gtk.main()
/usr/share/applications/hildon-home/quickdial.desktop
Code:
[Desktop Entry]
Name=QuickDial
Type=python
X-Path=quickdial.py
Have you verified all the dependencies are installed?

My first guess would be is that it gets some kind of exception thrown on import/load and automatically disables it. A way to debug this is to append to a file debug messages throughout the module scope and in the __init__ function.
__________________
770, n810, n900, Ideapad S10-3t
TheOneRing, DialCentral, Gonvert, Quicknote, Multilist, ejpi, nQa, Waters of Shiloah
Programming Blog