changeset 43:12fdc7d1feb1

core: newWidget implementation, it only display a not when a MUC room has been joined
author Goffi <goffi@goffi.org>
date Sun, 28 Aug 2016 16:50:56 +0200
parents 286865bc013a
children 7819e9efa250
files src/cagou/core/cagou_main.py
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/cagou/core/cagou_main.py	Sun Aug 28 16:49:28 2016 +0200
+++ b/src/cagou/core/cagou_main.py	Sun Aug 28 16:50:56 2016 +0200
@@ -27,6 +27,7 @@
 from sat.core import exceptions
 from sat_frontends.quick_frontend.quick_app import QuickApp
 from sat_frontends.quick_frontend import quick_widgets
+from sat_frontends.quick_frontend import quick_chat
 from sat_frontends.bridge.DBus import DBusBridgeFrontend
 import kivy
 kivy.require('1.9.1')
@@ -331,6 +332,12 @@
 
     ## widgets handling
 
+
+    def newWidget(self, widget):
+        log.debug(u"new widget created: {}".format(widget))
+        if isinstance(widget, quick_chat.QuickChat) and widget.type == C.CHAT_GROUP:
+            self.addNote(u"", _(u"room {} has been joined").format(widget.target))
+
     def getParentHandler(self, widget):
         """Return handler holding this widget
 
@@ -406,7 +413,7 @@
     def setPresenceStatus(self, show='', status=None, profile=C.PROF_KEY_NONE):
         log.info(u"Profile presence status set to {show}/{status}".format(show=show, status=status))
 
-    def addNote(self, title, message, level):
+    def addNote(self, title, message, level=C.XMLUI_DATA_LVL_INFO):
         """add a note (message which disappear) to root widget's header"""
         self.app.root.addNote(title, message, level)