svghmi/svghmi.py
branchwxPython4
changeset 3312 2c0511479b18
parent 3290 f0c97422b34a
child 3344 4a08728a2ea4
--- a/svghmi/svghmi.py	Fri Sep 10 14:42:46 2021 +0200
+++ b/svghmi/svghmi.py	Fri Sep 10 14:44:20 2021 +0200
@@ -292,14 +292,19 @@
 
         return ret
 
+if wx.Platform == '__WXMSW__':
+    browser_launch_cmd="cmd.exe /c 'start msedge {url}'"
+else:
+    browser_launch_cmd="chromium {url}"
+
 class SVGHMI(object):
     XSD = """<?xml version="1.0" encoding="utf-8" ?>
     <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
       <xsd:element name="SVGHMI">
         <xsd:complexType>
-          <xsd:attribute name="OnStart" type="xsd:string" use="optional" default="chromium {url}"/>
-          <xsd:attribute name="OnStop" type="xsd:string" use="optional" default="echo 'please close chromium window at {url}'"/>
-          <xsd:attribute name="OnWatchdog" type="xsd:string" use="optional" default="echo 'Watchdog for {name} !'"/>
+          <xsd:attribute name="OnStart" type="xsd:string" use="optional" default="%s"/>
+          <xsd:attribute name="OnStop" type="xsd:string" use="optional" default=""/>
+          <xsd:attribute name="OnWatchdog" type="xsd:string" use="optional" default=""/>
           <xsd:attribute name="EnableWatchdog" type="xsd:boolean" use="optional" default="false"/>
           <xsd:attribute name="WatchdogInitial" use="optional" default="30">
             <xsd:simpleType>
@@ -331,7 +336,7 @@
         </xsd:complexType>
       </xsd:element>
     </xsd:schema>
-    """
+    """%browser_launch_cmd
 
     EditorType = SVGHMIEditor