comparison browser_side/menu.py @ 148:8635bc9db9bf

added parameter management to test XMLUI, but it's currently deactivated for security reasons (need some configuration options) + separated mainTabPanel CSS from LiberviaTabPanel
author Goffi <goffi@goffi.org>
date Sun, 09 Dec 2012 23:42:08 +0100
parents 60ea800b7237
children 7e87c87b7952
comparison
equal deleted inserted replaced
147:60ea800b7237 148:8635bc9db9bf
33 from pyjamas.ui.HTML import HTML 33 from pyjamas.ui.HTML import HTML
34 from pyjamas.ui.Frame import Frame 34 from pyjamas.ui.Frame import Frame
35 from pyjamas import Window 35 from pyjamas import Window
36 from jid import JID 36 from jid import JID
37 from tools import html_sanitize 37 from tools import html_sanitize
38 from xmlui import XMLUI
38 import dialog 39 import dialog
39 import re 40 import re
40 41
41 class MenuCmd: 42 class MenuCmd:
42 43
91 menu_help = MenuBar(vertical=True) 92 menu_help = MenuBar(vertical=True)
92 menu_help.addItem("Social contract", MenuCmd(self, "onSocialContract")) 93 menu_help.addItem("Social contract", MenuCmd(self, "onSocialContract"))
93 menu_help.addItem("About", MenuCmd(self, "onAbout")) 94 menu_help.addItem("About", MenuCmd(self, "onAbout"))
94 95
95 menu_settings = MenuBar(vertical=True) 96 menu_settings = MenuBar(vertical=True)
97 #menu_settings.addItem("Parameters", MenuCmd(self, "onParameters"))
96 98
97 menubar = LiberviaMenuBar() 99 menubar = LiberviaMenuBar()
98 100
99 for _name, _icon, _menu in [('General', 'home', menu_general), 101 for _name, _icon, _menu in [('General', 'home', menu_general),
100 ('Contacts', 'social', menu_contacts), 102 ('Contacts', 'social', menu_contacts),
246 self.host.bridge.call('launchTarotGame', None, other_players) 248 self.host.bridge.call('launchTarotGame', None, other_players)
247 dialog.ContactsChooser(self.host, onPlayersSelected, 3, text="Please select 3 other players").getContacts() 249 dialog.ContactsChooser(self.host, onPlayersSelected, 3, text="Please select 3 other players").getContacts()
248 250
249 def onXiangqiGame(self): 251 def onXiangqiGame(self):
250 Window.alert("A Xiangqi game is planed, but not available yet") 252 Window.alert("A Xiangqi game is planed, but not available yet")
253
254 #Settings menu
255
256 def onParameters(self):
257 def gotParams(xmlui):
258 body = XMLUI(self.host, xmlui)
259 _dialog = dialog.GenericDialog("Parameters", body, options=['NO_CLOSE'])
260 body.setCloseCb(_dialog.close)
261 _dialog.setSize('80%', '80%')
262 _dialog.show()
263
264 self.host.bridge.call('getParamsUI', gotParams)
265