Mercurial > libervia-backend
comparison frontends/src/wix/main_window.py @ 796:46aa5ada61bf
core, frontends: XMLUI refactoring:
- now there is a base XMLUI class. Frontends inherits from this class, and add their specific widgets/containers/behaviour
- wix: param.py has been removed, as the same behaviour has been reimplemented through XMLUI
- removed "misc" argument in XMLUI.__init__
- severals things are broken (gateway, directory search), following patches will fix them
- core: elements names in xml_tools.dataForm2XMLUI now use a construction with category_name/param_name to avoid name conflicts (could happen with 2 parameters of the same name in differents categories).
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 04 Feb 2014 18:02:35 +0100 |
parents | 5642939d254e |
children | 9007bb133009 |
comparison
equal
deleted
inserted
replaced
795:6625558371db | 796:46aa5ada61bf |
---|---|
22 from sat_frontends.quick_frontend.quick_chat_list import QuickChatList | 22 from sat_frontends.quick_frontend.quick_chat_list import QuickChatList |
23 from sat_frontends.quick_frontend.quick_app import QuickApp | 23 from sat_frontends.quick_frontend.quick_app import QuickApp |
24 import wx | 24 import wx |
25 from sat_frontends.wix.contact_list import ContactList | 25 from sat_frontends.wix.contact_list import ContactList |
26 from sat_frontends.wix.chat import Chat | 26 from sat_frontends.wix.chat import Chat |
27 from sat_frontends.wix.param import Param | |
28 from sat_frontends.wix.xmlui import XMLUI | 27 from sat_frontends.wix.xmlui import XMLUI |
29 from sat_frontends.wix.gateways import GatewaysManager | 28 from sat_frontends.wix.gateways import GatewaysManager |
30 from sat_frontends.wix.profile import Profile | 29 from sat_frontends.wix.profile import Profile |
31 from sat_frontends.wix.profile_manager import ProfileManager | 30 from sat_frontends.wix.profile_manager import ProfileManager |
32 import os.path | 31 import os.path |
54 class MainWindow(wx.Frame, QuickApp): | 53 class MainWindow(wx.Frame, QuickApp): |
55 """main app window""" | 54 """main app window""" |
56 | 55 |
57 def __init__(self): | 56 def __init__(self): |
58 QuickApp.__init__(self) | 57 QuickApp.__init__(self) |
59 wx.Frame.__init__(self,None, title="SàT Wix", size=(300,500)) | 58 wx.Frame.__init__(self,None, title="SàT Wix", size=(350,500)) |
60 | 59 |
61 #sizer | 60 #sizer |
62 self.sizer = wx.BoxSizer(wx.VERTICAL) | 61 self.sizer = wx.BoxSizer(wx.VERTICAL) |
63 self.SetSizer(self.sizer) | 62 self.SetSizer(self.sizer) |
64 | 63 |
405 debug(_("Status change request")) | 404 debug(_("Status change request")) |
406 self.__updateStatus() | 405 self.__updateStatus() |
407 | 406 |
408 def onParam(self, e): | 407 def onParam(self, e): |
409 debug(_("Param request")) | 408 debug(_("Param request")) |
410 param = Param(self) | 409 def success(params): |
410 XMLUI(self, xml_data=params, title=_("Configuration")) | |
411 | |
412 def failure(error): | |
413 dlg = wx.MessageDialog(self, unicode(error), | |
414 _('Error'), | |
415 wx.OK | wx.ICON_ERROR | |
416 ) | |
417 dlg.ShowModal() | |
418 dlg.Destroy() | |
419 self.bridge.getParamsUI(app=Const.APP_NAME, profile_key=self.profile, callback=success, errback=failure) | |
411 | 420 |
412 def onAbout(self, e): | 421 def onAbout(self, e): |
413 about = wx.AboutDialogInfo() | 422 about = wx.AboutDialogInfo() |
414 about.SetName(Const.APP_NAME) | 423 about.SetName(Const.APP_NAME) |
415 about.SetVersion (unicode(self.bridge.getVersion())) | 424 about.SetVersion (unicode(self.bridge.getVersion())) |