Mercurial > libervia-backend
diff sat_bridge/DBus.py @ 52:6455fb62ff83
Connection/disconnection signals
- wix, sortilege: management of this new signals
/!\ sortilege is bugged, the contact list window is not updated correctly
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 07 Jan 2010 01:55:30 +1100 |
parents | 9c79eb49d51f |
children | a5b5fb5fc9fd |
line wrap: on
line diff
--- a/sat_bridge/DBus.py Thu Jan 07 00:17:27 2010 +1100 +++ b/sat_bridge/DBus.py Thu Jan 07 01:55:30 2010 +1100 @@ -44,6 +44,16 @@ ### signals ### @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX, + signature='') + def connected(self): + debug("Connected signal") + + @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX, + signature='') + def disconnected(self): + debug("Disconnected signal") + + @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX, signature='sa{ss}as') def newContact(self, contact, attributes, groups): debug("new contact signal (%s) sended", contact) @@ -114,6 +124,12 @@ return self.cb["disconnect"]() @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, + in_signature='', out_signature='b') + def isConnected(self): + info ("Connection status asked") + return self.cb["isConnected"]() + + @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, in_signature='', out_signature='a(sa{ss}as)') def getContacts(self): debug("getContacts...") @@ -190,12 +206,6 @@ debug("Unsubscription asked for %s", entity) return self.cb["delContact"](entity) - @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, - in_signature='', out_signature='b') - def isConnected(self): - debug("Connection status requested") - return self.cb["isConnected"]() - @dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX, in_signature='sa{ss}', out_signature='s') def launchAction(self, type, data): @@ -257,6 +267,12 @@ self.dbus_name = dbus.service.BusName(const_INT_PREFIX, self.session_bus) self.dbus_bridge = DbusObject(self.session_bus, '/org/goffi/SAT/bridge') + def connected(self): + self.dbus_bridge.connected() + + def disconnected(self): + self.dbus_bridge.disconnected() + def newContact(self, contact, attributes, groups): self.dbus_bridge.newContact(contact, attributes, groups)