comparison frontends/src/quick_frontend/quick_app.py @ 1363:fa77e40eb17b frontends_multi_profiles

quick_frontends: added "menu" listeners, which is called when a menu is added or removed.
author Goffi <goffi@goffi.org>
date Tue, 17 Mar 2015 19:33:04 +0100
parents d3e9848b9574
children ba87b940f07a
comparison
equal deleted inserted replaced
1362:99d596613661 1363:fa77e40eb17b
310 """Add a listener for an event 310 """Add a listener for an event
311 311
312 /!\ don't forget to remove listener when not used anymore (e.g. if you delete a widget) 312 /!\ don't forget to remove listener when not used anymore (e.g. if you delete a widget)
313 @param type_: type of event, can be: 313 @param type_: type of event, can be:
314 - avatar: called when avatar data is updated 314 - avatar: called when avatar data is updated
315 args: (entity, avatar file, profile) 315 args: (entity, avatar file, profile)
316 - nick: called when nick data is updated 316 - nick: called when nick data is updated
317 args: (entity, new_nick, profile) 317 args: (entity, new_nick, profile)
318 - presence: called when a presence is received 318 - presence: called when a presence is received
319 args: (entity, show, priority, statuses, profile) 319 args: (entity, show, priority, statuses, profile)
320 - menu: called when a menu item is added or removed
321 args: (type_, path, path_i18n, item) were values are:
322 type_: same as in [sat.core.sat_main.SAT.importMenu]
323 path: same as in [sat.core.sat_main.SAT.importMenu]
324 path_i18n: translated path (or None if the item is removed)
325 item: instance of quick_menus.MenuItemBase or None if the item is removed
326 - gotMenus: called only once when menu are available (no arg)
320 @param callback: method to call on event 327 @param callback: method to call on event
321 @param profiles_filter (set[unicode]): if set and not empty, the 328 @param profiles_filter (set[unicode]): if set and not empty, the
322 listener will be callable only by one of the given profiles. 329 listener will be callable only by one of the given profiles.
323 """ 330 """
324 assert type_ in C.LISTENERS 331 assert type_ in C.LISTENERS