diff --git a/src/tools/xml_tools.py b/src/tools/xml_tools.py index e34d2ef6..116e606c 100644 --- a/src/tools/xml_tools.py +++ b/src/tools/xml_tools.py @@ -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