plugins/python/modules/svgui/svgui.py
changeset 415 339fa2542481
parent 410 092e33606e51
child 421 c9ec111ad275
equal deleted inserted replaced
414:6f54c173aa19 415:339fa2542481
    10 
    10 
    11 class RootClass:
    11 class RootClass:
    12 
    12 
    13     PluginMethods = [
    13     PluginMethods = [
    14         {"bitmap" : os.path.join("images","ImportSVG"),
    14         {"bitmap" : os.path.join("images","ImportSVG"),
    15          "name" : "Import SVG",
    15          "name" : _("Import SVG"),
    16          "tooltip" : "Import SVG",
    16          "tooltip" : _("Import SVG"),
    17          "method" : "_ImportSVG"},
    17          "method" : "_ImportSVG"},
    18         {"bitmap" : os.path.join("images","ImportSVG"),
    18         {"bitmap" : os.path.join("images","ImportSVG"),
    19          "name" : "Inkscape",
    19          "name" : _("Inkscape"),
    20          "tooltip" : "Create HMI",
    20          "tooltip" : _("Create HMI"),
    21          "method" : "_StartInkscape"},
    21          "method" : "_StartInkscape"},
    22     ]
    22     ]
    23 
    23 
    24     def PluginPath(self):
    24     def PluginPath(self):
    25         return os.path.join(self.PlugParent.PluginPath(), "modules", self.PlugType)
    25         return os.path.join(self.PlugParent.PluginPath(), "modules", self.PlugType)
    85         res += (("runtime_%s.py"%location_str, file(runtimefile_path,"rb")),)
    85         res += (("runtime_%s.py"%location_str, file(runtimefile_path,"rb")),)
    86         
    86         
    87         return res
    87         return res
    88 
    88 
    89     def _ImportSVG(self):
    89     def _ImportSVG(self):
    90         dialog = wx.FileDialog(self.GetPlugRoot().AppFrame, "Choose a SVG file", os.getcwd(), "",  "SVG files (*.svg)|*.svg|All files|*.*", wx.OPEN)
    90         dialog = wx.FileDialog(self.GetPlugRoot().AppFrame, _("Choose a SVG file"), os.getcwd(), "",  _("SVG files (*.svg)|*.svg|All files|*.*"), wx.OPEN)
    91         if dialog.ShowModal() == wx.ID_OK:
    91         if dialog.ShowModal() == wx.ID_OK:
    92             svgpath = dialog.GetPath()
    92             svgpath = dialog.GetPath()
    93             if os.path.isfile(svgpath):
    93             if os.path.isfile(svgpath):
    94                 shutil.copy(svgpath, self._getSVGpath())
    94                 shutil.copy(svgpath, self._getSVGpath())
    95             else:
    95             else:
    96                 self.logger.write_error("No such SVG file: %s\n"%svgpath)
    96                 self.logger.write_error(_("No such SVG file: %s\n")%svgpath)
    97         dialog.Destroy()  
    97         dialog.Destroy()  
    98 
    98 
    99     def _StartInkscape(self):
    99     def _StartInkscape(self):
   100         svgfile = self._getSVGpath()
   100         svgfile = self._getSVGpath()
   101         if not os.path.isfile(svgfile):
   101         if not os.path.isfile(svgfile):