- added a fix in the Gerber parser when adding the geometry in the self.apertures dict for the case that the current aperture is None (Allegro does that)
- finished support for internationalization by adding a set of .po/.mo files for the English language. Unfortunately the final action can be done only when Beta will be out of Beta (no more changes) or when I will decide to stop working on this app. - changed the tooltip for 'feedrate_rapids' parameter to point out that this parameter is useful only for the Marlin postprocessor
This commit is contained in:
@@ -10,16 +10,9 @@ import FlatCAMTranslation as fcTranslate
|
||||
fcTranslate.apply_language('ToolMove')
|
||||
|
||||
|
||||
def _tr(text):
|
||||
try:
|
||||
return _(text)
|
||||
except:
|
||||
return text
|
||||
|
||||
|
||||
class ToolMove(FlatCAMTool):
|
||||
|
||||
toolName = _tr("Move")
|
||||
toolName = _("Move")
|
||||
|
||||
def __init__(self, app):
|
||||
FlatCAMTool.__init__(self, app)
|
||||
@@ -74,14 +67,14 @@ class ToolMove(FlatCAMTool):
|
||||
self.app.command_active = "Move"
|
||||
|
||||
if self.app.collection.get_selected():
|
||||
self.app.inform.emit(_tr("MOVE: Click on the Start point ..."))
|
||||
self.app.inform.emit(_("MOVE: Click on the Start point ..."))
|
||||
# draw the selection box
|
||||
self.draw_sel_bbox()
|
||||
else:
|
||||
self.setVisible(False)
|
||||
# signal that there is no command active
|
||||
self.app.command_active = None
|
||||
self.app.inform.emit(_tr("[WARNING_NOTCL] MOVE action cancelled. No object(s) to move."))
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] MOVE action cancelled. No object(s) to move."))
|
||||
|
||||
def on_left_click(self, event):
|
||||
# mouse click will be accepted only if the left button is clicked
|
||||
@@ -103,7 +96,7 @@ class ToolMove(FlatCAMTool):
|
||||
else:
|
||||
self.point2 = copy(self.point1)
|
||||
self.point1 = pos
|
||||
self.app.inform.emit(_tr("MOVE: Click on the Destination point ..."))
|
||||
self.app.inform.emit(_("MOVE: Click on the Destination point ..."))
|
||||
|
||||
if self.clicked_move == 1:
|
||||
try:
|
||||
@@ -121,14 +114,14 @@ class ToolMove(FlatCAMTool):
|
||||
dx = pos[0] - self.point1[0]
|
||||
dy = pos[1] - self.point1[1]
|
||||
|
||||
proc = self.app.proc_container.new(_tr("Moving ..."))
|
||||
proc = self.app.proc_container.new(_("Moving ..."))
|
||||
|
||||
def job_move(app_obj):
|
||||
obj_list = self.app.collection.get_selected()
|
||||
|
||||
try:
|
||||
if not obj_list:
|
||||
self.app.inform.emit(_tr("[WARNING_NOTCL] No object(s) selected."))
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] No object(s) selected."))
|
||||
return "fail"
|
||||
else:
|
||||
for sel_obj in obj_list:
|
||||
@@ -151,13 +144,13 @@ class ToolMove(FlatCAMTool):
|
||||
# self.app.collection.set_active(sel_obj.options['name'])
|
||||
except Exception as e:
|
||||
proc.done()
|
||||
self.app.inform.emit(_tr('[ERROR_NOTCL] '
|
||||
self.app.inform.emit(_('[ERROR_NOTCL] '
|
||||
'ToolMove.on_left_click() --> %s') % str(e))
|
||||
return "fail"
|
||||
proc.done()
|
||||
# delete the selection bounding box
|
||||
self.delete_shape()
|
||||
self.app.inform.emit(_tr('[success]%s object was moved ...') %
|
||||
self.app.inform.emit(_('[success]%s object was moved ...') %
|
||||
str(sel_obj.kind).capitalize())
|
||||
|
||||
self.app.worker_task.emit({'fcn': job_move, 'params': [self]})
|
||||
@@ -167,7 +160,7 @@ class ToolMove(FlatCAMTool):
|
||||
return
|
||||
|
||||
except TypeError:
|
||||
self.app.inform.emit(_tr('[ERROR_NOTCL] '
|
||||
self.app.inform.emit(_('[ERROR_NOTCL] '
|
||||
'ToolMove.on_left_click() --> Error when mouse left click.'))
|
||||
return
|
||||
|
||||
@@ -195,7 +188,7 @@ class ToolMove(FlatCAMTool):
|
||||
def on_key_press(self, event):
|
||||
if event.key == 'escape':
|
||||
# abort the move action
|
||||
self.app.inform.emit(_tr("[WARNING_NOTCL]Move action cancelled."))
|
||||
self.app.inform.emit(_("[WARNING_NOTCL]Move action cancelled."))
|
||||
self.toggle()
|
||||
return
|
||||
|
||||
@@ -207,7 +200,7 @@ class ToolMove(FlatCAMTool):
|
||||
|
||||
obj_list = self.app.collection.get_selected()
|
||||
if not obj_list:
|
||||
self.app.inform.emit(_tr("[WARNING_NOTCL]Object(s) not selected"))
|
||||
self.app.inform.emit(_("[WARNING_NOTCL]Object(s) not selected"))
|
||||
self.toggle()
|
||||
else:
|
||||
# if we have an object selected then we can safely activate the mouse events
|
||||
|
||||
Reference in New Issue
Block a user