comparison sat_frontends/quick_frontend/quick_widgets.py @ 3158:6032245c927e

quick frontend (app): added "explicit_close" to deleteWidget, and use it on mucRoomLeftHandler: This flag can be used by frontends to decide if the widget must be really closed or not (otherwise, it may be interesting to keep a widget in memory to avoir recreating a new one each time that the chat must be displayed).
author Goffi <goffi@goffi.org>
date Thu, 06 Feb 2020 00:01:36 +0100
parents 559a625a236b
children 30e08d904208
comparison
equal deleted inserted replaced
3157:8b4354b5c05f 3158:6032245c927e
272 widget's onDelete method will be called before deletion, and deletion will be 272 widget's onDelete method will be called before deletion, and deletion will be
273 stopped if it returns False. 273 stopped if it returns False.
274 @param widget_to_delete(QuickWidget): widget which need to deleted 274 @param widget_to_delete(QuickWidget): widget which need to deleted
275 @param *args: extra arguments to pass to onDelete 275 @param *args: extra arguments to pass to onDelete
276 @param *kwargs: extra keywords arguments to pass to onDelete 276 @param *kwargs: extra keywords arguments to pass to onDelete
277 the extra arguments are not use by QuickFrontend, it's is up to 277 the extra arguments are not used by QuickFrontend, it's is up to
278 the frontend to use them or not 278 the frontend to use them or not.
279 "all_instances" can be used as kwarg, if it evaluate to True, all 279 following extra arguments are well known:
280 instances of the widget will be deleted (if onDelete is not returning False 280 - "all_instances" can be used as kwarg, if it evaluate to True,
281 for any of the instance). This arguments is not sent to onDelete methods. 281 all instances of the widget will be deleted (if onDelete is
282 not returning False for any of the instance). This arguments
283 is not sent to onDelete methods.
284 - "explicit_close" is used when the deletion is requested by
285 the user or a leave signal, "all_instances" is usually set at
286 the same time.
282 """ 287 """
283 # TODO: all_instances must be independante kwargs, this is not possible with Python 2 288 # TODO: all_instances must be independante kwargs, this is not possible with Python 2
284 # but will be with Python 3 289 # but will be with Python 3
285 all_instances = kwargs.get('all_instances', False) 290 all_instances = kwargs.get('all_instances', False)
286 291