diff sat_bridge/DBus.py @ 182:556c2bd7c344

Primitivus now implement showDialog + new "newAlert" bridge method to show a dialog from core
author Goffi <goffi@goffi.org>
date Wed, 18 Aug 2010 12:45:48 +0800
parents 7452ac3818e7
children 96186f36d8cb
line wrap: on
line diff
--- a/sat_bridge/DBus.py	Mon Aug 16 21:59:52 2010 +0800
+++ b/sat_bridge/DBus.py	Wed Aug 18 12:45:48 2010 +0800
@@ -64,6 +64,11 @@
         debug("new message signal (from:%s msg:%s type:%s to:%s) sended", from_jid, msg, type, to)
      
     @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX,
+                         signature='ssss')
+    def newAlert(self, msg, title, type, profile):
+        debug("new alert signal (title:%s type:%s msg:%s profile:%s) sended", type, title, msg, profile)
+     
+    @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX,
                          signature='ssia{ss}s')
     def presenceUpdate(self, entity, show, priority, statuses, profile):
         debug("presence update signal (from:%s show:%s priority:%d statuses:%s profile:%s) sended" , entity, show, priority, statuses, profile)
@@ -288,7 +293,7 @@
 
             if in_sign[i] == 'a':
                 i+=1
-                if in_sign[i]!='{' and in_sign[i]!='(': #FIXME: gof: must manage tuples out of arrays
+                if in_sign[i]!='{' and in_sign[i]!='(': #FIXME: must manage tuples out of arrays
                     i+=1
                     continue #we have a simple type for the array
                 while (True): #we have a dict or a list of tuples
@@ -346,6 +351,9 @@
         debug("sending message...")
         self.dbus_bridge.newMessage(from_jid, msg, type, to, profile)
 
+    def newAlert(self, msg, title="", type="INFO", profile='@NONE@'):
+        self.dbus_bridge.newAlert(type, title, msg, profile)
+    
     def presenceUpdate(self, entity, show, priority, statuses, profile):
         debug("updating presence for %s",entity)
         self.dbus_bridge.presenceUpdate(entity, show, priority, statuses, profile)