|
|
2010-08-24
, 11:06
|
|
|
Posts: 1,637 |
Thanked: 4,424 times |
Joined on Apr 2009
@ Germany
|
#2
|
If it is not possible, how could i make it update on "switching desktop" for example ?
|
|
2010-08-24
, 17:56
|
|
Posts: 187 |
Thanked: 41 times |
Joined on May 2010
|
#3
|
|
|
2010-08-24
, 21:47
|
|
Posts: 56 |
Thanked: 31 times |
Joined on Jul 2008
@ Austria
|
#4
|
| The Following User Says Thank You to dannym For This Useful Post: | ||
I have no idea how to do it.; Could anyone help me ?
Bellow is the widget ui code.
class SMS_widget(hildondesktop.HomePluginItem): def callback_function(self, button, data=""): self.update_widget() def __init__(self): hildondesktop.HomePluginItem.__init__(self) self.set_settings(False) self.all = sms_counter() self.table = gtk.Table(1,2,False) self.this_month_sent = gtk.Label('0') self.table.attach(self.this_month_sent, 1, 2, 1, 2) self.sent_title = gtk.Label('Sent SMSs: ') self.box_for_sent = gtk.HBox() self.box_for_sent.pack_end(self.sent_title, False, False) self.table.attach(self.box_for_sent, 0, 1, 1, 2, xpadding=6) self.update_widget() self.table.show_all() self.add(self.table) self.listen() def update_widget(self, dummy1="", dummy2="", dummy3="", dummy4="", dummy5=""): self.all.update_counters() self.this_month_sent.set_text(str(self.all.sent_messages)) def listen(self): DBusGMainLoop(set_as_default=True) self.bus = dbus.SystemBus() self.bus.add_signal_receiver(self.update_widget, path='/com/nokia/phone/SMS', dbus_interface='Phone.SMS', signal_name='IncomingSegment') self.bus.add_signal_receiver(self.update_widget, path='/com/nokia/phone/SMS/ba212ae1', dbus_interface='com.nokia.csd.SMS.Outgoing', signal_name='OutgoingSegment')If it is not possible, how could i make it update on "switching desktop" for example ?