core (xmlui): added a quickNote method to easily send notes

This commit is contained in:
Goffi 2016-08-28 18:16:03 +02:00
commit 527e561a3e

View file

@ -1238,7 +1238,7 @@ class XMLUI(object):
# Some sugar for XMLUI dialogs
def note(message, title='', level=C.XMLUI_DATA_LVL_INFO):
"""Sugar to easily create a Note Dialog
"""sugar to easily create a Note Dialog
@param message(unicode): body of the note
@param title(unicode): title of the note
@ -1254,8 +1254,14 @@ def note(message, title='', level=C.XMLUI_DATA_LVL_INFO):
return note_xmlui
def quickNote(host, client, message, title='', level=C.XMLUI_DATA_LVL_INFO):
"""more sugar to do the whole note process"""
note_ui = note(message, title, level)
host.actionNew({'xmlui': note_ui.toXml()}, profile=client.profile)
def deferredUI(host, xmlui, chained=False):
r"""Create a deferred linked to XMLUI
"""create a deferred linked to XMLUI
@param xmlui(XMLUI): instance of the XMLUI
Must be an XMLUI that you can submit, with submit_id set to ''