diff 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
line wrap: on
line diff
--- a/frontends/src/wix/main_window.py	Fri Jan 10 18:20:30 2014 +0100
+++ b/frontends/src/wix/main_window.py	Tue Feb 04 18:02:35 2014 +0100
@@ -24,7 +24,6 @@
 import wx
 from sat_frontends.wix.contact_list import ContactList
 from sat_frontends.wix.chat import Chat
-from sat_frontends.wix.param import Param
 from sat_frontends.wix.xmlui import XMLUI
 from sat_frontends.wix.gateways import GatewaysManager
 from sat_frontends.wix.profile import Profile
@@ -56,7 +55,7 @@
 
     def __init__(self):
         QuickApp.__init__(self)
-        wx.Frame.__init__(self,None, title="SàT Wix", size=(300,500))
+        wx.Frame.__init__(self,None, title="SàT Wix", size=(350,500))
 
         #sizer
         self.sizer = wx.BoxSizer(wx.VERTICAL)
@@ -407,7 +406,17 @@
 
     def onParam(self, e):
         debug(_("Param request"))
-        param = Param(self)
+        def success(params):
+            XMLUI(self, xml_data=params, title=_("Configuration"))
+
+        def failure(error):
+            dlg = wx.MessageDialog(self, unicode(error),
+                                   _('Error'),
+                                   wx.OK | wx.ICON_ERROR
+                                  )
+            dlg.ShowModal()
+            dlg.Destroy()
+        self.bridge.getParamsUI(app=Const.APP_NAME, profile_key=self.profile, callback=success, errback=failure)
 
     def onAbout(self, e):
         about = wx.AboutDialogInfo()