6 # See COPYING file for copyrights details. |
6 # See COPYING file for copyrights details. |
7 |
7 |
8 |
8 |
9 from __future__ import absolute_import |
9 from __future__ import absolute_import |
10 from __future__ import print_function |
10 from __future__ import print_function |
|
11 |
11 import wx |
12 import wx |
|
13 from zope.interface import implementer |
|
14 |
12 from controls.UriLocationEditor import IConnectorPanel |
15 from controls.UriLocationEditor import IConnectorPanel |
13 from zope.interface import implementer |
|
14 |
16 |
15 URITypes = ["WAMP", "WAMPS"] |
17 URITypes = ["WAMP", "WAMPS"] |
16 |
18 |
17 |
19 |
18 def WAMP_connector_dialog(confnodesroot): |
20 def WAMP_connector_dialog(confnodesroot): |
19 [ID_IPTEXT, ID_PORTTEXT, ID_REALMTEXT, ID_WAMPIDTEXT, ID_SECURECHECKBOX] = [wx.NewId() for _init_ctrls in range(5)] |
21 [ID_IPTEXT, ID_PORTTEXT, ID_REALMTEXT, ID_WAMPIDTEXT, ID_SECURECHECKBOX] = [wx.NewId() for _init_ctrls in range(5)] |
20 |
|
21 |
22 |
22 @implementer(IConnectorPanel) |
23 @implementer(IConnectorPanel) |
23 class WAMPConnectorPanel(wx.Panel): |
24 class WAMPConnectorPanel(wx.Panel): |
24 def __init__(self, typeConnector, parrent, *args, **kwargs): |
25 def __init__(self, typeConnector, parrent, *args, **kwargs): |
25 self.type = typeConnector |
26 self.type = typeConnector |
28 self._init_ctrls() |
29 self._init_ctrls() |
29 self._init_sizers() |
30 self._init_sizers() |
30 self.uri = None |
31 self.uri = None |
31 |
32 |
32 def _init_ctrls(self): |
33 def _init_ctrls(self): |
33 self.IpText = wx.TextCtrl(parent=self, id=ID_IPTEXT, size = wx.Size(200, -1)) |
34 self.IpText = wx.TextCtrl(parent=self, id=ID_IPTEXT, size=wx.Size(200, -1)) |
34 self.PortText = wx.TextCtrl(parent=self, id=ID_PORTTEXT, size = wx.Size(200, -1)) |
35 self.PortText = wx.TextCtrl(parent=self, id=ID_PORTTEXT, size=wx.Size(200, -1)) |
35 self.RealmText = wx.TextCtrl(parent=self, id=ID_REALMTEXT, size = wx.Size(200, -1)) |
36 self.RealmText = wx.TextCtrl(parent=self, id=ID_REALMTEXT, size=wx.Size(200, -1)) |
36 self.WAMPIDText = wx.TextCtrl(parent=self, id=ID_WAMPIDTEXT, size = wx.Size(200, -1)) |
37 self.WAMPIDText = wx.TextCtrl(parent=self, id=ID_WAMPIDTEXT, size=wx.Size(200, -1)) |
37 self.SecureCheckbox = wx.CheckBox(self, ID_SECURECHECKBOX, _("Is connection secure?")) |
38 self.SecureCheckbox = wx.CheckBox(self, ID_SECURECHECKBOX, _("Is connection secure?")) |
38 |
39 |
39 def _init_sizers(self): |
40 def _init_sizers(self): |
40 self.mainSizer = wx.FlexGridSizer(cols=2, hgap=10, rows=5, vgap=10) |
41 self.mainSizer = wx.FlexGridSizer(cols=2, hgap=10, rows=5, vgap=10) |
41 self.mainSizer.AddWindow(wx.StaticText(self, label=_("URI host:")), |
42 self.mainSizer.AddWindow(wx.StaticText(self, label=_("URI host:")), |