core (XMLUI): sugar method "note" allow to easily create a XMLUI note dialog (more methods for other dialogs should follow)

This commit is contained in:
Goffi 2014-08-27 01:24:26 +02:00
commit 70dc0f26b0

View file

@ -1026,6 +1026,23 @@ class XMLUI(object):
return self.doc.toxml()
# Some sugar for XMLUI dialogs
def note(message, title='', level=C.XMLUI_DATA_LVL_INFO):
"""Sugar to easily create a Note Dialog
@param message: body of the note
@param title: title of the note
@param level: one of C.XMLUI_DATA_LVL_*
"""
note_xmlui = XMLUI(C.XMLUI_DIALOG, dialog_opt = {
C.XMLUI_DATA_TYPE: C.XMLUI_DIALOG_NOTE,
C.XMLUI_DATA_MESS: message,
C.XMLUI_DATA_LVL: level},
title=title
)
return note_xmlui
# Misc other funtions