# HG changeset patch # User Goffi # Date 1426617184 -3600 # Node ID fa77e40eb17b835e5e76d2a9b8179ddfadb6bcef # Parent 99d5966136612200aed3e045b8dcc86a5cf2c0fa quick_frontends: added "menu" listeners, which is called when a menu is added or removed. diff -r 99d596613661 -r fa77e40eb17b frontends/src/quick_frontend/constants.py --- a/frontends/src/quick_frontend/constants.py Tue Mar 17 19:30:43 2015 +0100 +++ b/frontends/src/quick_frontend/constants.py Tue Mar 17 19:33:04 2015 +0100 @@ -71,4 +71,4 @@ WIDGET_RAISE = 'RAISE' WIDGET_RECREATE = 'RECREATE' - LISTENERS = {'avatar', 'nick', 'presence', 'profilePlugged', 'disconnect', 'gotMenus'} + LISTENERS = {'avatar', 'nick', 'presence', 'profilePlugged', 'disconnect', 'gotMenus', 'menu'} diff -r 99d596613661 -r fa77e40eb17b frontends/src/quick_frontend/quick_app.py --- a/frontends/src/quick_frontend/quick_app.py Tue Mar 17 19:30:43 2015 +0100 +++ b/frontends/src/quick_frontend/quick_app.py Tue Mar 17 19:33:04 2015 +0100 @@ -312,11 +312,18 @@ /!\ don't forget to remove listener when not used anymore (e.g. if you delete a widget) @param type_: type of event, can be: - avatar: called when avatar data is updated - args: (entity, avatar file, profile) + args: (entity, avatar file, profile) - nick: called when nick data is updated - args: (entity, new_nick, profile) + args: (entity, new_nick, profile) - presence: called when a presence is received - args: (entity, show, priority, statuses, profile) + args: (entity, show, priority, statuses, profile) + - menu: called when a menu item is added or removed + args: (type_, path, path_i18n, item) were values are: + type_: same as in [sat.core.sat_main.SAT.importMenu] + path: same as in [sat.core.sat_main.SAT.importMenu] + path_i18n: translated path (or None if the item is removed) + item: instance of quick_menus.MenuItemBase or None if the item is removed + - gotMenus: called only once when menu are available (no arg) @param callback: method to call on event @param profiles_filter (set[unicode]): if set and not empty, the listener will be callable only by one of the given profiles.