comparison src/bridge/DBus.py @ 1467:ceba6fd77739

core, bridge: new signal actionNew to launch an action from the backend (e.g. display a dialog message): - SAT.actionNew is a shortcut to call bridge.actionNew with a generated id. The id may be used in the future to ignore an action (e.g.: an action is sent to all frontends to accept a file, one of the frontend did manage the dialog, the other ones can then ignore this dialog), but is not used for now.
author Goffi <goffi@goffi.org>
date Tue, 18 Aug 2015 09:01:18 +0200
parents 7590bbf44eed
children 80cd55dd5b04
comparison
equal deleted inserted replaced
1466:2184d5f496b5 1467:ceba6fd77739
124 # already exist for plugins), probably missing some initialisation, need 124 # already exist for plugins), probably missing some initialisation, need
125 # further investigations 125 # further investigations
126 pass 126 pass
127 127
128 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, 128 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
129 signature='a{ss}ss')
130 def actionNew(self, action_data, id, profile):
131 pass
132
133 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
129 signature='ssa{ss}s') 134 signature='ssa{ss}s')
130 def actionResult(self, answer_type, id, data, profile): 135 def actionResult(self, answer_type, id, data, profile):
131 pass 136 pass
132 137
133 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, 138 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
544 log.error(_(u"D-Bus is not launched, please see README to see instructions on how to launch it")) 549 log.error(_(u"D-Bus is not launched, please see README to see instructions on how to launch it"))
545 raise BridgeInitError 550 raise BridgeInitError
546 self.dbus_name = dbus.service.BusName(const_INT_PREFIX, self.session_bus) 551 self.dbus_name = dbus.service.BusName(const_INT_PREFIX, self.session_bus)
547 self.dbus_bridge = DbusObject(self.session_bus, const_OBJ_PATH) 552 self.dbus_bridge = DbusObject(self.session_bus, const_OBJ_PATH)
548 553
554 def actionNew(self, action_data, id, profile):
555 self.dbus_bridge.actionNew(action_data, id, profile)
556
549 def actionResult(self, answer_type, id, data, profile): 557 def actionResult(self, answer_type, id, data, profile):
550 self.dbus_bridge.actionResult(answer_type, id, data, profile) 558 self.dbus_bridge.actionResult(answer_type, id, data, profile)
551 559
552 def actionResultExt(self, answer_type, id, data, profile): 560 def actionResultExt(self, answer_type, id, data, profile):
553 self.dbus_bridge.actionResultExt(answer_type, id, data, profile) 561 self.dbus_bridge.actionResultExt(answer_type, id, data, profile)