# HG changeset patch # User Goffi # Date 1409095466 -7200 # Node ID 2f9f735334da93445caab7a5ca2de62c3dc28007 # Parent 7fcafc3206b111b0f740469fdfb017b3c5c56b5b core (XMLUI): sugar method "note" allow to easily create a XMLUI note dialog (more methods for other dialogs should follow) diff -r 7fcafc3206b1 -r 2f9f735334da src/tools/xml_tools.py --- a/src/tools/xml_tools.py Wed Aug 27 00:23:14 2014 +0200 +++ b/src/tools/xml_tools.py Wed Aug 27 01:24:26 2014 +0200 @@ -1026,6 +1026,23 @@ 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