controls/ProjectPropertiesPanel.py
changeset 1973 cc7a46953471
parent 1886 e4a656e73aec
parent 1972 38e912c8bd31
child 2228 12cb48823b8c
--- a/controls/ProjectPropertiesPanel.py	Thu Mar 01 14:28:55 2018 +0100
+++ b/controls/ProjectPropertiesPanel.py	Fri Mar 02 17:01:25 2018 +0100
@@ -27,6 +27,8 @@
 import wx
 from wx.lib.scrolledpanel import ScrolledPanel
 
+from xmlclass.xmlclass import URI_model
+
 # -------------------------------------------------------------------------------
 #                                 Helpers
 # -------------------------------------------------------------------------------
@@ -294,8 +296,16 @@
             if self.Controller is not None and self.Values is not None:
                 old_value = self.Values.get(name)
                 new_value = textctrl.GetValue()
-                if name not in REQUIRED_PARAMS and new_value == "":
+                if name in REQUIRED_PARAMS and new_value == "":
                     new_value = None
+                if name == 'companyURL':
+                    if not URI_model.match(new_value):
+                        new_value = None
+                        dialog = wx.MessageDialog(self, _('Invalid URL!\n'
+                                                          'Please enter correct URL address.'),
+                                                  _("Error"), wx.OK | wx.ICON_ERROR)
+                        dialog.ShowModal()
+                        dialog.Destroy()
                 if old_value != new_value:
                     self.Controller.SetProjectProperties(properties={name: new_value})
                     self.ParentWindow._Refresh(TITLE, FILEMENU, EDITMENU,