svghmi/ui.py
changeset 3818 e528b11a60cc
parent 3750 f62625418bff
child 3880 89549813a6c1
equal deleted inserted replaced
3817:3deeda82636a 3818:e528b11a60cc
   333 
   333 
   334         self.main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=3, vgap=0)
   334         self.main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=3, vgap=0)
   335         self.main_sizer.AddGrowableCol(0)
   335         self.main_sizer.AddGrowableCol(0)
   336         self.main_sizer.AddGrowableRow(2)
   336         self.main_sizer.AddGrowableRow(2)
   337 
   337 
   338         self.staticmsg = wx.StaticText(self, label = _("Drag selected Widget from here to Inkscape"))
   338         self.staticmsg = wx.StaticText(self.main_panel, label = _("Drag selected Widget from here to Inkscape"))
   339         self.preview = wx.Panel(self.main_panel, size=(-1, _preview_height + _preview_margin*2))
   339         self.preview = wx.Panel(self.main_panel, size=(-1, _preview_height + _preview_margin*2))
   340         self.signature_sizer = wx.BoxSizer(wx.VERTICAL)
   340         self.signature_sizer = wx.BoxSizer(wx.VERTICAL)
   341         self.args_box = wx.StaticBox(self.main_panel, -1,
   341         self.args_box = wx.StaticBox(self.main_panel, -1,
   342                                      _("Widget's arguments"),
   342                                      _("Widget's arguments"),
   343                                      style = wx.ALIGN_CENTRE_HORIZONTAL)
   343                                      style = wx.ALIGN_CENTRE_HORIZONTAL)
   434 
   434 
   435         if self.bmp:
   435         if self.bmp:
   436             # Get Preview panel size
   436             # Get Preview panel size
   437             sz = self.preview.GetClientSize()
   437             sz = self.preview.GetClientSize()
   438             w = self.bmp.GetWidth()
   438             w = self.bmp.GetWidth()
   439             dc.DrawBitmap(self.bmp, (sz.width - w)/2, _preview_margin)
   439             dc.DrawBitmap(self.bmp, (sz.width - w)//2, _preview_margin)
   440 
   440 
   441 
   441 
   442 
   442 
   443     def OnSelectLibDir(self, event):
   443     def OnSelectLibDir(self, event):
   444         defaultpath = self.RecallLibDir()
   444         defaultpath = self.RecallLibDir()
   473 
   473 
   474         # TODO: spawn a thread, to decouple thumbnail gen
   474         # TODO: spawn a thread, to decouple thumbnail gen
   475         status, result, _err_result = ProcessLogger(
   475         status, result, _err_result = ProcessLogger(
   476             #self.Controler.GetCTRoot().logger,
   476             #self.Controler.GetCTRoot().logger,
   477             None,
   477             None,
   478             '"' + inkpath + '" "' + svgpath + '" ' +
   478             [ inkpath, svgpath, export_opt, thumbpath, "-D", "-h", str(_preview_height)]).spin()
   479             export_opt + ' "' + thumbpath +
       
   480             '" -D -h ' + str(_preview_height)).spin()
       
   481         if status != 0:
   479         if status != 0:
   482             self.msg = _("Inkscape couldn't generate thumbnail.")
   480             self.msg = _("Inkscape couldn't generate thumbnail.")
   483             return False
   481             return False
   484         return True
   482         return True
   485 
   483