12 |
12 |
13 |
13 |
14 model = [('host',_("Host:")), |
14 model = [('host',_("Host:")), |
15 ('port',_("Port:"))] |
15 ('port',_("Port:"))] |
16 |
16 |
17 secure_model = model + [('ID',_("ID:"))] |
17 # (scheme, model, secure) |
18 |
18 models = [("LOCAL", [], False), ("PYRO", model, False), ("PYROS", model, True)] |
19 models = [("LOCAL", []), ("PYRO",model), ("PYROS",secure_model)] |
|
20 |
19 |
21 Schemes = list(zip(*models)[0]) |
20 Schemes = list(zip(*models)[0]) |
22 |
21 |
23 ModelsDict = dict(models) |
22 _PerSchemeConf = {sch : (mod,sec) for sch,mod,sec in models} |
24 |
23 |
25 class PYRO_dialog(SchemeEditor): |
24 class PYRO_dialog(SchemeEditor): |
26 def __init__(self, scheme, *args, **kwargs): |
25 def __init__(self, scheme, *args, **kwargs): |
27 self.model = ModelsDict[scheme] |
26 |
|
27 # ID selector is enabled only on PYROS (secure) |
|
28 self.model, self.EnableIDSelector = _PerSchemeConf[scheme] |
|
29 |
28 SchemeEditor.__init__(self, scheme, *args, **kwargs) |
30 SchemeEditor.__init__(self, scheme, *args, **kwargs) |
29 |
31 |
30 def SetLoc(self, loc): |
32 def SetLoc(self, loc): |
31 hostport, ID = list(islice(chain(loc.split("#"), repeat("")),2)) |
33 hostport, ID = list(islice(chain(loc.split("#"), repeat("")),2)) |
32 host, port = list(islice(chain(hostport.split(":"), repeat("")),2)) |
34 host, port = list(islice(chain(hostport.split(":"), repeat("")),2)) |