diff -r ca312be56929 -r e87a2daace80 svghmi/svghmi.py --- a/svghmi/svghmi.py Wed Jun 01 09:15:26 2022 +0200 +++ b/svghmi/svghmi.py Wed Jun 01 09:22:07 2022 +0200 @@ -282,6 +282,10 @@ CONFNODEEDITOR_TABS = [ (_("HMI Tree"), "CreateSVGHMI_UI")] + def __init__(self, parent, controler, window): + ConfTreeNodeEditor.__init__(self, parent, controler, window) + self.Controler = controler + def CreateSVGHMI_UI(self, parent): global hmi_tree_root @@ -292,25 +296,29 @@ hmitree_backup_file = open(hmitree_backup_path, 'rb') hmi_tree_root = HMITreeNode.from_etree(etree.parse(hmitree_backup_file).getroot()) - ret = SVGHMI_UI(parent, Register_SVGHMI_UI_for_HMI_tree_updates) + ret = SVGHMI_UI(parent, self.Controler, Register_SVGHMI_UI_for_HMI_tree_updates) on_hmitree_update(hmi_tree_root) return ret if wx.Platform == '__WXMSW__': - browser_launch_cmd="cmd.exe /c 'start msedge {url}'" + default_cmds={ + "launch":"cmd.exe /c 'start msedge {url}'", + "watchdog":"cmd.exe /k 'echo watchdog for {url} !'"} else: - browser_launch_cmd="chromium {url}" + default_cmds={ + "launch":"chromium {url}", + "watchdog":"echo Watchdog for {name} !"} class SVGHMI(object): XSD = """ - + - + @@ -342,7 +350,7 @@ - """%browser_launch_cmd + """%default_cmds EditorType = SVGHMIEditor @@ -399,9 +407,13 @@ if from_project_path is not None: shutil.copyfile(self._getSVGpath(from_project_path), self._getSVGpath()) - shutil.copyfile(self._getPOTpath(from_project_path), - self._getPOTpath()) - # XXX TODO copy .PO files + + potpath = self._getPOTpath(from_project_path) + if os.path.isfile(potpath): + shutil.copyfile(potpath, self._getPOTpath()) + # copy .PO files + for _name, pofile in GetPoFiles(from_project_path): + shutil.copy(pofile, self.CTNPath()) return True def GetSVGGeometry(self):