comparison src/browser/sat_browser/menu.py @ 616:1c0d5a87c554 frontends_multi_profiles

browser_side: add and use method displayWidget to harmonize widget's management in Libervia (not completely done, there are some issues)
author souliane <souliane@mailoo.org>
date Wed, 11 Feb 2015 11:18:13 +0100
parents 6016c74ee323
children 30180021f203
comparison
equal deleted inserted replaced
615:70872a83ef15 616:1c0d5a87c554
31 from pyjamas import Window 31 from pyjamas import Window
32 32
33 from constants import Const as C 33 from constants import Const as C
34 import file_tools 34 import file_tools
35 import xmlui 35 import xmlui
36 import chat
36 import panels 37 import panels
37 import dialog 38 import dialog
38 import contact_group 39 import contact_group
39 import base_menu 40 import base_menu
40 from base_menu import MenuCmd 41 from base_menu import MenuCmd
96 97
97 self.add(self.menu_bar) 98 self.add(self.menu_bar)
98 99
99 # General menu 100 # General menu
100 def onWebWidget(self): 101 def onWebWidget(self):
101 web_widget = self.host.widgets.getOrCreateWidget(panels.WebPanel, C.WEB_PANEL_DEFAULT_URL, profile=C.PROF_KEY_NONE, on_existing_widget=C.WIDGET_RECREATE) 102 web_widget = self.host.displayWidget(panels.WebPanel, C.WEB_PANEL_DEFAULT_URL)
102 self.host.setSelected(web_widget) 103 self.host.setSelected(web_widget)
103 104
104 def onDisconnect(self): 105 def onDisconnect(self):
105 def confirm_cb(answer): 106 def confirm_cb(answer):
106 if answer: 107 if answer:
154 if self.host.whoami: 155 if self.host.whoami:
155 nick = self.host.whoami.node 156 nick = self.host.whoami.node
156 if room_jid not in [room.bare for room in self.host.room_list]: 157 if room_jid not in [room.bare for room in self.host.room_list]:
157 self.host.bridge.call('joinMUC', lambda room_jid: invite(room_jid, contacts), room_jid, nick) 158 self.host.bridge.call('joinMUC', lambda room_jid: invite(room_jid, contacts), room_jid, nick)
158 else: 159 else:
159 self.host.getOrCreateLiberviaWidget(panels.ChatPanel, {'item': room_jid, 'type_': "group"}, True, jid.JID(room_jid).bare) 160 self.host.displayWidget(chat.Chat, room_jid, type_="group", new_tab=jid.JID(room_jid).bare)
160 invite(room_jid, contacts) 161 invite(room_jid, contacts)
161 162
162 dialog.RoomAndContactsChooser(self.host, join, ok_button="Join", visible=(True, False)) 163 dialog.RoomAndContactsChooser(self.host, join, ok_button="Join", visible=(True, False))
163 164
164 def onCollectiveRadio(self): 165 def onCollectiveRadio(self):