diff frontends/src/primitivus/chat.py @ 1093:11e2bb20e896

core, frontends (menus): MENU_ROOM and MENU_SINGLE are now managed
author Goffi <goffi@goffi.org>
date Thu, 26 Jun 2014 00:05:20 +0200
parents 6ec513ad92c2
children e2e1e27a3680
line wrap: on
line diff
--- a/frontends/src/primitivus/chat.py	Wed Jun 25 20:54:15 2014 +0200
+++ b/frontends/src/primitivus/chat.py	Thu Jun 26 00:05:20 2014 +0200
@@ -132,11 +132,11 @@
         """Return Menu bar"""
         menu = sat_widgets.Menu(self.host.loop)
         if self.type == 'group':
+            self.host.addMenus(menu, C.MENU_ROOM, {'room_jid': self.target.bare})
             game = _("Game")
-            muc = _("MUC")
             menu.addMenu(game, "Tarot", self.onTarotRequest)
-            menu.addMenu(muc, _("Configure room"), self.onConfigureRoom)
         elif self.type == 'one2one':
+            self.host.addMenus(menu, C.MENU_SINGLE, {'jid': self.target})
             menu.addMenu(_("Action"), _("Send file"), self.onSendFileRequest)
         return menu
 
@@ -345,6 +345,7 @@
 
     #MENU EVENTS#
     def onTarotRequest(self, menu):
+        # TODO: move this to plugin_misc_tarot with dynamic menu
         if len(self.occupants) != 4:
             self.host.showPopUp(sat_widgets.Alert(_("Can't start game"), _("You need to be exactly 4 peoples in the room to start a Tarot game"), ok_cb=self.host.removePopUp))
         else:
@@ -358,6 +359,7 @@
         self.host.bridge.configureRoom(self.id, self.host.profile, callback=gotUI, errback=configureError)
 
     def onSendFileRequest(self, menu):
+        # TODO: move this to core with dynamic menus
         dialog = FileDialog(ok_cb=self.onFileSelected, cancel_cb=self.host.removePopUp)
         self.host.showPopUp(dialog, 80, 80)