comparison frontends/wix/main_window.py @ 66:8147b4f40809

SàT: multi-profile: DBus signals and frontend adaptation (first draft) - Quick App: new single_profile parameter in __init__ (default: yes), used to tell if the application use only one profile at the time or not - Quick App: new __check_profile method, tell if the profile is used by the current frontend - Quick App: new methods plug_profile, unplug_profile and clear_profile, must be called by the frontend to tell which profiles to use - DBus Bridge: new methods getProfileName, getProfilesList and createProfile
author Goffi <goffi@goffi.org>
date Wed, 03 Feb 2010 23:35:57 +1100
parents d46f849664aa
children 0e50dd3a234a
comparison
equal deleted inserted replaced
65:d35c5edab53f 66:8147b4f40809
221 def __init__(self): 221 def __init__(self):
222 wx.Frame.__init__(self,None, title="SAT Wix", size=(300,500)) 222 wx.Frame.__init__(self,None, title="SAT Wix", size=(300,500))
223 self.CM = QuickContactManagement() #FIXME: not the best place 223 self.CM = QuickContactManagement() #FIXME: not the best place
224 224
225 225
226
226 #Frame elements 227 #Frame elements
227 self.contactList = ContactList(self, self.CM) 228 self.contactList = ContactList(self, self.CM)
228 self.contactList.registerActivatedCB(self.onContactActivated) 229 self.contactList.registerActivatedCB(self.onContactActivated)
229 self.chat_wins=ChatList(self) 230 self.chat_wins=ChatList(self)
230 self.CreateStatusBar() 231 self.CreateStatusBar()
251 252
252 #events 253 #events
253 self.Bind(wx.EVT_CLOSE, self.onClose, self) 254 self.Bind(wx.EVT_CLOSE, self.onClose, self)
254 255
255 QuickApp.__init__(self) 256 QuickApp.__init__(self)
257 self.plug_profile()
256 258
257 self.Show() 259 self.Show()
258 260
259 def createMenus(self): 261 def createMenus(self):
260 info("Creating menus") 262 info("Creating menus")
326 self.tools.Enable() 328 self.tools.Enable()
327 else: 329 else:
328 self.SetStatusText(msgOFFLINE) 330 self.SetStatusText(msgOFFLINE)
329 self.tools.Disable() 331 self.tools.Disable()
330 return 332 return
331
332
333 def presenceUpdate(self, jabber_id, show, priority, statuses):
334 QuickApp.presenceUpdate(self, jabber_id, show, priority, statuses)
335 333
336 def askConfirmation(self, type, id, data): 334 def askConfirmation(self, type, id, data):
337 #TODO: refactor this in QuickApp 335 #TODO: refactor this in QuickApp
338 debug ("Confirmation asked") 336 debug ("Confirmation asked")
339 answer_data={} 337 answer_data={}
531 profile=Profile(self, data) 529 profile=Profile(self, data)
532 530
533 531
534 def onFindGateways(self, e): 532 def onFindGateways(self, e):
535 debug("Find Gateways request") 533 debug("Find Gateways request")
536 id = self.bridge.findGateways(self.whoami.domain) 534 id = self.bridge.findGateways(self.profiles[self.profile]['whoami'].domain)
537 self.current_action_ids.add(id) 535 self.current_action_ids.add(id)
538 self.current_action_ids_cb[id] = self.onGatewaysFound 536 self.current_action_ids_cb[id] = self.onGatewaysFound
539 537
540 def onGatewaysFound(self, data): 538 def onGatewaysFound(self, data):
541 """Called when SàT has found the server gateways""" 539 """Called when SàT has found the server gateways"""