326 |
326 |
327 def OnTaskBarChangeInterface(self, evt): |
327 def OnTaskBarChangeInterface(self, evt): |
328 ip_addr = self.pyroserver.ip_addr |
328 ip_addr = self.pyroserver.ip_addr |
329 ip_addr = '' if ip_addr is None else ip_addr |
329 ip_addr = '' if ip_addr is None else ip_addr |
330 dlg = ParamsEntryDialog(None, _("Enter the IP of the interface to bind"), defaultValue=ip_addr) |
330 dlg = ParamsEntryDialog(None, _("Enter the IP of the interface to bind"), defaultValue=ip_addr) |
331 dlg.SetTests([(re.compile('\d{1,3}(?:\.\d{1,3}){3}$').match, _("IP is not valid!")), |
331 dlg.SetTests([(re.compile(r'\d{1,3}(?:\.\d{1,3}){3}$').match, _("IP is not valid!")), |
332 (lambda x:len([x for x in x.split(".") if 0 <= int(x) <= 255]) == 4, |
332 (lambda x:len([x for x in x.split(".") if 0 <= int(x) <= 255]) == 4, |
333 _("IP is not valid!"))]) |
333 _("IP is not valid!"))]) |
334 if dlg.ShowModal() == wx.ID_OK: |
334 if dlg.ShowModal() == wx.ID_OK: |
335 self.pyroserver.ip_addr = dlg.GetValue() |
335 self.pyroserver.ip_addr = dlg.GetValue() |
336 self.pyroserver.Restart() |
336 self.pyroserver.Restart() |