Esempio n. 1
0
File: base.py Progetto: ljmljz/xpra
 def activate_menu(self, action_type, action, state, pdata):
     #locate the service and call it:
     from xpra.dbus.gtk_menuactions import get_actions_interface
     props = self._get_x11_menu_properties()
     menulog("activate_menu%s properties=%s", (action_type, action, state, pdata), props)
     if not props:
         raise Exception("no menu defined for %s" % self)
     bus_name    = props.get("bus-name")
     if not bus_name:
         raise Exception("no bus name defined for %s" % self)
     if action_type=="application":
         path = "application-path"
     elif action_type=="window":
         path = "window-path"
     else:
         raise Exception("unknown action type for menu: %s" % action_type)
     object_path = props.get(path)
     if not object_path:
         raise Exception("no object path property %s" % path)
     actions_iface = get_actions_interface(bus_name, object_path)
     actions_iface.Activate(action, state, pdata)
Esempio n. 2
0
 def activate_menu(self, action_type, action, state, pdata):
     #locate the service and call it:
     from xpra.dbus.gtk_menuactions import get_actions_interface
     props = self._get_x11_menu_properties()
     menulog("activate_menu%s properties=%s", (action_type, action, state, pdata), props)
     if not props:
         raise Exception("no menu defined for %s" % self)
     bus_name    = props.get("bus-name")
     if not bus_name:
         raise Exception("no bus name defined for %s" % self)
     if action_type=="application":
         path = "application-path"
     elif action_type=="window":
         path = "window-path"
     else:
         raise Exception("unknown action type for menu: %s" % action_type)
     object_path = props.get(path)
     if not object_path:
         raise Exception("no object path property %s" % path)
     actions_iface = get_actions_interface(bus_name, object_path)
     actions_iface.Activate(action, state, pdata)