# HG changeset patch # User Goffi # Date 1482426636 -3600 # Node ID b44558286bbb99fcffc88b8dfd5417db2e6d2f5c # Parent 071423b3a41398450f5b59cd2bedeabbb0b4a895 quick frontend (quick app): added progressFinished and progressError listeners diff -r 071423b3a413 -r b44558286bbb frontends/src/quick_frontend/constants.py --- a/frontends/src/quick_frontend/constants.py Tue Dec 20 21:07:22 2016 +0100 +++ b/frontends/src/quick_frontend/constants.py Thu Dec 22 18:10:36 2016 +0100 @@ -83,7 +83,7 @@ UPDATE_SELECTION = 'SELECTION' UPDATE_STRUCTURE = 'STRUCTURE' # high level update (i.e. not item level but organisation of items) - LISTENERS = {'avatar', 'nick', 'presence', 'profilePlugged', 'disconnect', 'gotMenus', 'menu', 'notification', 'notificationsClear'} + LISTENERS = {'avatar', 'nick', 'presence', 'profilePlugged', 'disconnect', 'gotMenus', 'menu', 'notification', 'notificationsClear', 'progressFinished', 'progressError'} # Notifications NOTIFY_MESSAGE = 'MESSAGE' # a message was received diff -r 071423b3a413 -r b44558286bbb frontends/src/quick_frontend/quick_app.py --- a/frontends/src/quick_frontend/quick_app.py Tue Dec 20 21:07:22 2016 +0100 +++ b/frontends/src/quick_frontend/quick_app.py Thu Dec 22 18:10:36 2016 +0100 @@ -363,6 +363,10 @@ 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) + - progressFinished: called when a progressing action has just finished + args: (progress_id, metadata, profile) + - progressError: called when a progressing action failed + args: (progress_id, error_msg, profile): @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. @@ -747,9 +751,11 @@ def progressFinishedHandler(self, pid, metadata, profile): log.info(u"Progress {} finished".format(pid)) + self.callListeners('progressFinished', pid, metadata, profile=profile) def progressErrorHandler(self, pid, err_msg, profile): log.warning(u"Progress {pid} error: {err_msg}".format(pid=pid, err_msg=err_msg)) + self.callListeners('progressError', pid, err_msg, profile=profile) def _subscribe_cb(self, answer, data): entity, profile = data