# HG changeset patch # User Goffi # Date 1257641348 -3600 # Node ID 633c5ed657011ba46dd417800ee8ec089dfeb132 # Parent fc8c202cda87236301294d85f891d763ed3bca1c parameters: new button type (not finished) diff -r fc8c202cda87 -r 633c5ed65701 frontends/wix/param.py --- a/frontends/wix/param.py Sun Nov 08 00:11:00 2009 +0100 +++ b/frontends/wix/param.py Sun Nov 08 01:49:08 2009 +0100 @@ -62,20 +62,28 @@ type = param.getAttribute("type") value = param.getAttribute("value") sizer = wx.BoxSizer(wx.HORIZONTAL) - label=wx.StaticText(panel, -1, name+" ") if type=="string": + label=wx.StaticText(panel, -1, name+" ") ctrl = wx.TextCtrl(panel, -1, value) + sizer.Add(label) elif type=="password": + label=wx.StaticText(panel, -1, name+" ") ctrl = wx.TextCtrl(panel, -1, value, style=wx.TE_PASSWORD) + sizer.Add(label) + elif type=="button": + ctrl = wx.Button(panel, -1, value) else: error("FIXME FIXME FIXME") #FIXME ! raise NotImplementedError ctrl.param_id=(name, category) - sizer.Add(label) sizer.Add(ctrl, 1, flag=wx.EXPAND) panel.sizer.Add(sizer, flag=wx.EXPAND) - panel.Bind(wx.EVT_TEXT, self.onTextChanged, ctrl) + if type=="string" or type=="password": + panel.Bind(wx.EVT_TEXT, self.onTextChanged, ctrl) + elif type=="button": + panel.Bind(wx.EVT_BUTTON, self.onButtonClicked, ctrl) + panel.SetSizer(panel.sizer) panel.SetAutoLayout(True) self.notebook.AddPage(panel, category) @@ -86,6 +94,11 @@ self.modified[event.GetEventObject().param_id]=event.GetString() event.Skip() + def onButtonClicked(self, event): + """Called when a paramated is modified""" + print "Button Clicked (%s/%s)" % event.GetEventObject().param_id#TODO: gof: appeler callback + #self.modified[event.GetEventObject().param_id]=event.GetString() + event.Skip() def onClose(self, event): """Close event: we have to save the params.""" diff -r fc8c202cda87 -r 633c5ed65701 plugins/plugin_xep_0065.py --- a/plugins/plugin_xep_0065.py Sun Nov 08 00:11:00 2009 +0100 +++ b/plugins/plugin_xep_0065.py Sun Nov 08 01:49:08 2009 +0100 @@ -468,8 +468,11 @@ self.server_factory = Socks5ServerFactory() self.server_factory.protocol.host = self.host #needed for progress CB self.client_factory = Socks5ClientFactory() + + #parameters host.memory.importParams(self, XEP_0065.params) host.memory.setDefault("IP", "File Transfert", self.getExternalIP) + port = int(self.host.memory.getParamV("Port", "File Transfert")) info("Launching Socks5 Stream server on port %d", port) reactor.listenTCP(port, self.server_factory) diff -r fc8c202cda87 -r 633c5ed65701 tools/memory.py --- a/tools/memory.py Sun Nov 08 00:11:00 2009 +0100 +++ b/tools/memory.py Sun Nov 08 01:49:08 2009 +0100 @@ -43,6 +43,7 @@ +