Commit b03443cc authored by Cyril Laguilhon-Debat's avatar Cyril Laguilhon-Debat

Translations + some minors gui improvements

- french translations
- added some translated strings in pronterface.py
- resized macro window and control's positions
- reordered main menu
parent 603dcf01
This diff is collapsed.
This diff is collapsed.
No preview for this file type
This diff is collapsed.
...@@ -272,24 +272,26 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -272,24 +272,26 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
def popmenu(self): def popmenu(self):
self.menustrip = wx.MenuBar() self.menustrip = wx.MenuBar()
m = wx.Menu() # File menu
m = wx.Menu()
self.Bind(wx.EVT_MENU, self.loadfile, m.Append(-1,_("&Open..."),_(" Opens file"))) self.Bind(wx.EVT_MENU, self.loadfile, m.Append(-1,_("&Open..."),_(" Opens file")))
self.Bind(wx.EVT_MENU, self.do_editgcode, m.Append(-1,_("&Edit..."),_(" Edit open file"))) self.Bind(wx.EVT_MENU, self.do_editgcode, m.Append(-1,_("&Edit..."),_(" Edit open file")))
if sys.platform != 'darwin': self.Bind(wx.EVT_MENU, self.OnExit, m.Append(wx.ID_EXIT,_("E&xit"),_(" Closes the Window")))
self.menustrip.Append(m,_("&File"))
# Settings menu
m = wx.Menu()
self.macros_menu = wx.Menu()
m.AppendSubMenu(self.macros_menu, _("&Macros"))
self.Bind(wx.EVT_MENU, self.new_macro, self.macros_menu.Append(-1, _("<&New...>")))
self.Bind(wx.EVT_MENU, lambda *e:options(self), m.Append(-1,_("&Options"),_(" Options dialog")))
if sys.platform != 'darwin':
self.Bind(wx.EVT_MENU, lambda x:threading.Thread(target=lambda :self.do_skein("set")).start(), m.Append(-1,_("SFACT Settings"),_(" Adjust SFACT settings"))) self.Bind(wx.EVT_MENU, lambda x:threading.Thread(target=lambda :self.do_skein("set")).start(), m.Append(-1,_("SFACT Settings"),_(" Adjust SFACT settings")))
try: try:
from SkeinforgeQuickEditDialog import SkeinforgeQuickEditDialog from SkeinforgeQuickEditDialog import SkeinforgeQuickEditDialog
self.Bind(wx.EVT_MENU, lambda *e:SkeinforgeQuickEditDialog(self), m.Append(-1,_("SFACT Quick Settings"),_(" Quickly adjust SFACT settings for active profile"))) self.Bind(wx.EVT_MENU, lambda *e:SkeinforgeQuickEditDialog(self), m.Append(-1,_("SFACT Quick Settings"),_(" Quickly adjust SFACT settings for active profile")))
except: except:
pass pass
self.Bind(wx.EVT_MENU, self.OnExit, m.Append(wx.ID_EXIT,_("E&xit"),_(" Closes the Window")))
self.menustrip.Append(m,_("&Print"))
m = wx.Menu()
self.macros_menu = wx.Menu()
m.AppendSubMenu(self.macros_menu, _("&Macros"))
self.Bind(wx.EVT_MENU, self.new_macro, self.macros_menu.Append(-1, _("<&New...>")))
self.Bind(wx.EVT_MENU, lambda *e:options(self), m.Append(-1,_("&Options"),_(" Options dialog")))
self.menustrip.Append(m,_("&Settings")) self.menustrip.Append(m,_("&Settings"))
self.update_macros_menu() self.update_macros_menu()
self.SetMenuBar(self.menustrip) self.SetMenuBar(self.menustrip)
...@@ -306,17 +308,17 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -306,17 +308,17 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
macroed(self.filename,self.f,self.doneediting,1) macroed(self.filename,self.f,self.doneediting,1)
def new_macro(self,e=None): def new_macro(self,e=None):
dialog = wx.Dialog(self,-1,_("Enter macro name"),size=(200,100)) dialog = wx.Dialog(self,-1,_("Enter macro name"),size=(260,85))
panel = wx.Panel(dialog,-1) panel = wx.Panel(dialog,-1)
vbox = wx.BoxSizer(wx.VERTICAL) vbox = wx.BoxSizer(wx.VERTICAL)
wx.StaticText(panel,-1,_("Macro name:"),(8,14)) wx.StaticText(panel,-1,_("Macro name:"),(8,14))
dialog.namectrl = wx.TextCtrl(panel,-1,'',(80,8),size=(100,24),style=wx.TE_PROCESS_ENTER) dialog.namectrl = wx.TextCtrl(panel,-1,'',(110,8),size=(130,24),style=wx.TE_PROCESS_ENTER)
hbox = wx.BoxSizer(wx.HORIZONTAL) hbox = wx.BoxSizer(wx.HORIZONTAL)
okb = wx.Button(dialog,wx.ID_OK,_("Ok"),size=(50,24)) okb = wx.Button(dialog,wx.ID_OK,_("Ok"),size=(60,24))
dialog.Bind(wx.EVT_TEXT_ENTER,lambda e:dialog.EndModal(wx.ID_OK),dialog.namectrl) dialog.Bind(wx.EVT_TEXT_ENTER,lambda e:dialog.EndModal(wx.ID_OK),dialog.namectrl)
#dialog.Bind(wx.EVT_BUTTON,lambda e:self.new_macro_named(dialog,e),okb) #dialog.Bind(wx.EVT_BUTTON,lambda e:self.new_macro_named(dialog,e),okb)
hbox.Add(okb) hbox.Add(okb)
hbox.Add(wx.Button(dialog,wx.ID_CANCEL,_("Cancel"),size=(50,24))) hbox.Add(wx.Button(dialog,wx.ID_CANCEL,_("Cancel"),size=(60,24)))
vbox.Add(panel) vbox.Add(panel)
vbox.Add(hbox,1,wx.ALIGN_CENTER|wx.TOP|wx.BOTTOM,10) vbox.Add(hbox,1,wx.ALIGN_CENTER|wx.TOP|wx.BOTTOM,10)
dialog.SetSizer(vbox) dialog.SetSizer(vbox)
...@@ -337,7 +339,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -337,7 +339,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
print _("Name '")+macro+_("' is being used by built-in command") print _("Name '")+macro+_("' is being used by built-in command")
return return
elif len([c for c in macro if not c.isalnum() and c != "_"]): elif len([c for c in macro if not c.isalnum() and c != "_"]):
print "Macro name may contain only alphanumeric symbols and underscores" print _("Macro name may contain only alphanumeric symbols and underscores")
return return
else: else:
old_def = "" old_def = ""
...@@ -1188,11 +1190,11 @@ class macroed(wx.Dialog): ...@@ -1188,11 +1190,11 @@ class macroed(wx.Dialog):
title = wx.StaticText(self.panel,-1,title%macro_name) title = wx.StaticText(self.panel,-1,title%macro_name)
#title.SetFont(wx.Font(11,wx.NORMAL,wx.NORMAL,wx.BOLD)) #title.SetFont(wx.Font(11,wx.NORMAL,wx.NORMAL,wx.BOLD))
titlesizer.Add(title,1) titlesizer.Add(title,1)
self.okb = wx.Button(self.panel, -1, ("Save")) self.okb = wx.Button(self.panel, -1, _("Save"))
self.okb.Bind(wx.EVT_BUTTON, self.save) self.okb.Bind(wx.EVT_BUTTON, self.save)
self.Bind(wx.EVT_CLOSE, self.close) self.Bind(wx.EVT_CLOSE, self.close)
titlesizer.Add(self.okb) titlesizer.Add(self.okb)
self.cancelb = wx.Button(self.panel, -1, ("Cancel")) self.cancelb = wx.Button(self.panel, -1, _("Cancel"))
self.cancelb.Bind(wx.EVT_BUTTON, self.close) self.cancelb.Bind(wx.EVT_BUTTON, self.close)
titlesizer.Add(self.cancelb) titlesizer.Add(self.cancelb)
topsizer=wx.BoxSizer(wx.VERTICAL) topsizer=wx.BoxSizer(wx.VERTICAL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment