changeset 2044:4de202bdde05

core (xmlui): added a quickNote method to easily send notes
author Goffi <goffi@goffi.org>
date Sun, 28 Aug 2016 18:16:03 +0200
parents f3940f6a3222
children 48536a22b599
files src/tools/xml_tools.py
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/tools/xml_tools.py	Mon Aug 22 20:56:51 2016 +0200
+++ b/src/tools/xml_tools.py	Sun Aug 28 18:16:03 2016 +0200
@@ -1238,7 +1238,7 @@
 # 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 @@
     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 ''