added action cb mechanism for buttons. Tested with a temporary new user registration button.
This commit is contained in:
parent
bd70d6d7b6
commit
a103e8b41b
1 changed files with 226 additions and 66 deletions
|
|
@ -73,10 +73,10 @@ class DbusObject(dbus.service.Object):
|
|||
def askConfirmation(self, type, id, data):
|
||||
debug("asking for confirmation: id = [%s] type = %s data = %s", id, type, data)
|
||||
|
||||
@dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX,
|
||||
@dbus.service.signal(const_INT_PREFIX+const_REQ_SUFFIX,
|
||||
signature='ssa{ss}')
|
||||
def sendAnswer(self, type, id, data):
|
||||
debug("sending answer: id = [%s] type = %s data = %s", id, type, data)
|
||||
def actionResult(self, type, id, data):
|
||||
debug("result of action: id = [%s] type = %s data = %s", id, type, data)
|
||||
|
||||
### methods ###
|
||||
|
||||
|
|
@ -128,8 +128,8 @@ class DbusObject(dbus.service.Object):
|
|||
|
||||
@dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
|
||||
in_signature='ss', out_signature='s')
|
||||
def getParamV(self, name, category="default"):
|
||||
return self.cb["getParamV"](name, category)
|
||||
def getParamA(self, name, category="default"):
|
||||
return self.cb["getParamA"](name, category)
|
||||
|
||||
@dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
|
||||
in_signature='', out_signature='s')
|
||||
|
|
@ -170,6 +170,11 @@ class DbusObject(dbus.service.Object):
|
|||
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):
|
||||
return self.cb["launchAction"](type, data)
|
||||
|
||||
@dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX,
|
||||
in_signature='sba{ss}', out_signature='')
|
||||
def confirmationAnswer(self, id, accepted, data):
|
||||
|
|
@ -247,8 +252,8 @@ class DBusBridge(Bridge):
|
|||
def askConfirmation(self, type, id, data):
|
||||
self.dbus_bridge.askConfirmation(type, id, data)
|
||||
|
||||
def sendAnswer(self, type, id, data):
|
||||
self.dbus_bridge.sendAnswer(type, id, data)
|
||||
def actionResult(self, type, id, data):
|
||||
self.dbus_bridge.actionResult(type, id, data)
|
||||
|
||||
def register(self, name, callback):
|
||||
debug("registering DBus bridge method [%s]",name)
|
||||
|
|
|
|||
Loading…
Reference in a new issue