diff src/tools/xml_tools.py @ 1142:2f9f735334da

core (XMLUI): sugar method "note" allow to easily create a XMLUI note dialog (more methods for other dialogs should follow)
author Goffi <goffi@goffi.org>
date Wed, 27 Aug 2014 01:24:26 +0200
parents 7fcafc3206b1
children 96fb74a4714d
line wrap: on
line diff
--- 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