- some message strings cleanup

This commit is contained in:
Marius Stanciu 2020-04-24 07:23:14 +03:00 committed by Marius
parent 26dd29e7dd
commit 7df7e17569
19 changed files with 102 additions and 127 deletions

View File

@ -13,6 +13,7 @@ CHANGELOG for FlatCAM beta
- added a placeholder text to 2Sided Tool - added a placeholder text to 2Sided Tool
- added a new menu entry in the context menu of the Tcl Shell: 'Save Log' which will save the content of the Tcl Shell browser window to a file - added a new menu entry in the context menu of the Tcl Shell: 'Save Log' which will save the content of the Tcl Shell browser window to a file
- the status bar messages that are echoed in the Tcl Shell will no longer have all text colored but only the identifier - the status bar messages that are echoed in the Tcl Shell will no longer have all text colored but only the identifier
- some message strings cleanup
23.04.2020 23.04.2020

View File

@ -2961,7 +2961,7 @@ class App(QtCore.QObject):
if project_name == "": if project_name == "":
if silent is False: if silent is False:
self.inform.emit(_("Open cancelled.")) self.inform.emit(_("Cancelled."))
else: else:
# self.open_project(project_name) # self.open_project(project_name)
run_from_arg = True run_from_arg = True
@ -3881,7 +3881,7 @@ class App(QtCore.QObject):
filename = self.data_path + '/factory_defaults.FlatConfig' filename = self.data_path + '/factory_defaults.FlatConfig'
if filename == "": if filename == "":
self.inform.emit('[WARNING_NOTCL] %s' % _("Preferences default restore was cancelled.")) self.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
else: else:
try: try:
f = open(filename) f = open(filename)
@ -3930,7 +3930,7 @@ class App(QtCore.QObject):
filename = str(filename) filename = str(filename)
if filename == "": if filename == "":
self.inform.emit('[WARNING_NOTCL] %s' % _("FlatCAM preferences import cancelled.")) self.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
else: else:
try: try:
f = open(filename) f = open(filename)
@ -3985,7 +3985,7 @@ class App(QtCore.QObject):
defaults_from_file = {} defaults_from_file = {}
if filename == "": if filename == "":
self.inform.emit('[WARNING_NOTCL] %s' % _("FlatCAM preferences export cancelled.")) self.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
return return
else: else:
try: try:
@ -4060,7 +4060,7 @@ class App(QtCore.QObject):
filename = str(filename) filename = str(filename)
if filename == "": if filename == "":
self.inform.emit('[WARNING_NOTCL] %s' % _("Saving to file cancelled.")) self.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
return return
else: else:
try: try:
@ -6104,7 +6104,7 @@ class App(QtCore.QObject):
val_x = float(self.defaults['global_gridx']) val_x = float(self.defaults['global_gridx'])
val_y = float(self.defaults['global_gridy']) val_y = float(self.defaults['global_gridy'])
self.inform.emit('[WARNING_NOTCL]%s' % _("Units conversion cancelled.")) self.inform.emit('[WARNING_NOTCL]%s' % _("Cancelled."))
self.defaults_read_form() self.defaults_read_form()
@ -7368,7 +7368,7 @@ class App(QtCore.QObject):
self.report_usage("on_locate()") self.report_usage("on_locate()")
if obj is None: if obj is None:
self.inform.emit('[WARNING_NOTCL] %s' % _("There is no object selected...")) self.inform.emit('[WARNING_NOTCL] %s' % _("No object selected."))
return 'fail' return 'fail'
class DialogBoxChoice(QtWidgets.QDialog): class DialogBoxChoice(QtWidgets.QDialog):
@ -9470,7 +9470,7 @@ class App(QtCore.QObject):
color=QtGui.QColor("gray")) color=QtGui.QColor("gray"))
if len(filenames) == 0: if len(filenames) == 0:
self.inform.emit('[WARNING_NOTCL] %s' % _("Open Gerber cancelled.")) self.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
else: else:
for filename in filenames: for filename in filenames:
if filename != '': if filename != '':
@ -9507,8 +9507,7 @@ class App(QtCore.QObject):
color=QtGui.QColor("gray")) color=QtGui.QColor("gray"))
if len(filenames) == 0: if len(filenames) == 0:
self.inform.emit('[WARNING_NOTCL]%s' % self.inform.emit('[WARNING_NOTCL]%s' % _("Cancelled."))
_(" Open Excellon cancelled."))
else: else:
for filename in filenames: for filename in filenames:
if filename != '': if filename != '':
@ -9550,8 +9549,7 @@ class App(QtCore.QObject):
color=QtGui.QColor("gray")) color=QtGui.QColor("gray"))
if len(filenames) == 0: if len(filenames) == 0:
self.inform.emit('[WARNING_NOTCL] %s' % self.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
_("Open G-Code cancelled."))
else: else:
for filename in filenames: for filename in filenames:
if filename != '': if filename != '':
@ -9580,8 +9578,7 @@ class App(QtCore.QObject):
filename = str(filename) filename = str(filename)
if filename == "": if filename == "":
self.inform.emit('[WARNING_NOTCL] %s' % self.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
_("Open Project cancelled."))
else: else:
# self.worker_task.emit({'fcn': self.open_project, # self.worker_task.emit({'fcn': self.open_project,
# 'params': [filename]}) # 'params': [filename]})
@ -9621,7 +9618,7 @@ class App(QtCore.QObject):
color=QtGui.QColor("gray")) color=QtGui.QColor("gray"))
if len(filenames) == 0: if len(filenames) == 0:
self.inform.emit('[WARNING_NOTCL] %s' % _("Open HPGL2 file cancelled.")) self.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
else: else:
for filename in filenames: for filename in filenames:
if filename != '': if filename != '':
@ -9646,8 +9643,7 @@ class App(QtCore.QObject):
filter=_filter_) filter=_filter_)
if filename == "": if filename == "":
self.inform.emit('[WARNING_NOTCL] %s' % self.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
_("Open Config cancelled."))
else: else:
self.open_config_file(filename) self.open_config_file(filename)
@ -9662,8 +9658,7 @@ class App(QtCore.QObject):
obj = self.collection.get_active() obj = self.collection.get_active()
if obj is None: if obj is None:
self.inform.emit('[WARNING_NOTCL] %s' % self.inform.emit('[WARNING_NOTCL] %s' % _("No object selected."))
_("No object selected."))
msg = _("Please Select a Geometry object to export") msg = _("Please Select a Geometry object to export")
msgbox = QtWidgets.QMessageBox() msgbox = QtWidgets.QMessageBox()
msgbox.setInformativeText(msg) msgbox.setInformativeText(msg)
@ -9700,8 +9695,7 @@ class App(QtCore.QObject):
filename = str(filename) filename = str(filename)
if filename == "": if filename == "":
self.inform.emit('[WARNING_NOTCL]%s' % self.inform.emit('[WARNING_NOTCL]%s' % _("Cancelled."))
_(" Export SVG cancelled."))
return return
else: else:
self.export_svg(name, filename) self.export_svg(name, filename)
@ -9737,7 +9731,7 @@ class App(QtCore.QObject):
filename = str(filename) filename = str(filename)
if filename == "": if filename == "":
self.inform.emit(_("Export PNG cancelled.")) self.inform.emit(_("Cancelled."))
return return
else: else:
if self.is_legacy is False: if self.is_legacy is False:
@ -9760,8 +9754,7 @@ class App(QtCore.QObject):
obj = self.collection.get_active() obj = self.collection.get_active()
if obj is None: if obj is None:
self.inform.emit('[WARNING_NOTCL] %s' % self.inform.emit('[WARNING_NOTCL] %s' % _("No object selected."))
_("No object selected. Please select an Gerber object to export."))
return return
# Check for more compatible types and add as required # Check for more compatible types and add as required
@ -9784,8 +9777,7 @@ class App(QtCore.QObject):
filename = str(filename) filename = str(filename)
if filename == "": if filename == "":
self.inform.emit('[WARNING_NOTCL] %s' % self.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
_("Save Gerber source file cancelled."))
return return
else: else:
self.save_source_file(name, filename) self.save_source_file(name, filename)
@ -9804,14 +9796,12 @@ class App(QtCore.QObject):
obj = self.collection.get_active() obj = self.collection.get_active()
if obj is None: if obj is None:
self.inform.emit('[WARNING_NOTCL] %s' % self.inform.emit('[WARNING_NOTCL] %s' % _("No object selected."))
_("No object selected. Please select an Script object to export."))
return return
# Check for more compatible types and add as required # Check for more compatible types and add as required
if not isinstance(obj, FlatCAMScript): if not isinstance(obj, FlatCAMScript):
self.inform.emit('[ERROR_NOTCL] %s' % self.inform.emit('[ERROR_NOTCL] %s' % _("Failed. Only Script objects can be saved as TCL Script files..."))
_("Failed. Only Script objects can be saved as TCL Script files..."))
return return
name = self.collection.get_active().options["name"] name = self.collection.get_active().options["name"]
@ -9828,8 +9818,7 @@ class App(QtCore.QObject):
filename = str(filename) filename = str(filename)
if filename == "": if filename == "":
self.inform.emit('[WARNING_NOTCL] %s' % self.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
_("Save Script source file cancelled."))
return return
else: else:
self.save_source_file(name, filename) self.save_source_file(name, filename)
@ -9848,14 +9837,12 @@ class App(QtCore.QObject):
obj = self.collection.get_active() obj = self.collection.get_active()
if obj is None: if obj is None:
self.inform.emit('[WARNING_NOTCL] %s' % self.inform.emit('[WARNING_NOTCL] %s' % _("No object selected."))
_("No object selected. Please select an Document object to export."))
return return
# Check for more compatible types and add as required # Check for more compatible types and add as required
if not isinstance(obj, FlatCAMScript): if not isinstance(obj, FlatCAMScript):
self.inform.emit('[ERROR_NOTCL] %s' % self.inform.emit('[ERROR_NOTCL] %s' % _("Failed. Only Document objects can be saved as Document files..."))
_("Failed. Only Document objects can be saved as Document files..."))
return return
name = self.collection.get_active().options["name"] name = self.collection.get_active().options["name"]
@ -9872,8 +9859,7 @@ class App(QtCore.QObject):
filename = str(filename) filename = str(filename)
if filename == "": if filename == "":
self.inform.emit('[WARNING_NOTCL] %s' % self.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
_("Save Document source file cancelled."))
return return
else: else:
self.save_source_file(name, filename) self.save_source_file(name, filename)
@ -9892,14 +9878,12 @@ class App(QtCore.QObject):
obj = self.collection.get_active() obj = self.collection.get_active()
if obj is None: if obj is None:
self.inform.emit('[WARNING_NOTCL] %s' % self.inform.emit('[WARNING_NOTCL] %s' % _("No object selected."))
_("No object selected. Please select an Excellon object to export."))
return return
# Check for more compatible types and add as required # Check for more compatible types and add as required
if not isinstance(obj, FlatCAMExcellon): if not isinstance(obj, FlatCAMExcellon):
self.inform.emit('[ERROR_NOTCL] %s' % self.inform.emit('[ERROR_NOTCL] %s' % _("Failed. Only Excellon objects can be saved as Excellon files..."))
_("Failed. Only Excellon objects can be saved as Excellon files..."))
return return
name = self.collection.get_active().options["name"] name = self.collection.get_active().options["name"]
@ -9916,8 +9900,7 @@ class App(QtCore.QObject):
filename = str(filename) filename = str(filename)
if filename == "": if filename == "":
self.inform.emit('[WARNING_NOTCL] %s' % self.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
_("Saving Excellon source file cancelled."))
return return
else: else:
self.save_source_file(name, filename) self.save_source_file(name, filename)
@ -9936,8 +9919,7 @@ class App(QtCore.QObject):
obj = self.collection.get_active() obj = self.collection.get_active()
if obj is None: if obj is None:
self.inform.emit('[WARNING_NOTCL] %s' % self.inform.emit('[WARNING_NOTCL] %s' % _("No object selected."))
_("No object selected. Please Select an Excellon object to export."))
return return
# Check for more compatible types and add as required # Check for more compatible types and add as required
@ -9959,7 +9941,7 @@ class App(QtCore.QObject):
filename = str(filename) filename = str(filename)
if filename == "": if filename == "":
self.inform.emit('[WARNING_NOTCL] %s' % _("Export Excellon cancelled.")) self.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
return return
else: else:
used_extension = filename.rpartition('.')[2] used_extension = filename.rpartition('.')[2]
@ -9981,14 +9963,12 @@ class App(QtCore.QObject):
obj = self.collection.get_active() obj = self.collection.get_active()
if obj is None: if obj is None:
self.inform.emit('[WARNING_NOTCL] %s' % self.inform.emit('[WARNING_NOTCL] %s' % _("No object selected."))
_("No object selected. Please Select an Gerber object to export."))
return return
# Check for more compatible types and add as required # Check for more compatible types and add as required
if not isinstance(obj, FlatCAMGerber): if not isinstance(obj, FlatCAMGerber):
self.inform.emit('[ERROR_NOTCL] %s' % self.inform.emit('[ERROR_NOTCL] %s' % _("Failed. Only Gerber objects can be saved as Gerber files..."))
_("Failed. Only Gerber objects can be saved as Gerber files..."))
return return
name = self.collection.get_active().options["name"] name = self.collection.get_active().options["name"]
@ -10005,7 +9985,7 @@ class App(QtCore.QObject):
filename = str(filename) filename = str(filename)
if filename == "": if filename == "":
self.inform.emit('[WARNING_NOTCL] %s' % _("Export Gerber cancelled.")) self.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
return return
else: else:
used_extension = filename.rpartition('.')[2] used_extension = filename.rpartition('.')[2]
@ -10061,7 +10041,7 @@ class App(QtCore.QObject):
filename = str(filename) filename = str(filename)
if filename == "": if filename == "":
self.inform.emit('[WARNING_NOTCL] %s' % _("Export DXF cancelled.")) self.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
return return
else: else:
self.export_dxf(name, filename) self.export_dxf(name, filename)
@ -10093,7 +10073,7 @@ class App(QtCore.QObject):
filenames = [str(filename) for filename in filenames] filenames = [str(filename) for filename in filenames]
if len(filenames) == 0: if len(filenames) == 0:
self.inform.emit('[WARNING_NOTCL] %s' % _("Open SVG cancelled.")) self.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
else: else:
for filename in filenames: for filename in filenames:
if filename != '': if filename != '':
@ -10125,7 +10105,7 @@ class App(QtCore.QObject):
filenames = [str(filename) for filename in filenames] filenames = [str(filename) for filename in filenames]
if len(filenames) == 0: if len(filenames) == 0:
self.inform.emit('[WARNING_NOTCL] %s' % _("Open DXF cancelled.")) self.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
else: else:
for filename in filenames: for filename in filenames:
if filename != '': if filename != '':
@ -10362,7 +10342,7 @@ class App(QtCore.QObject):
if len(filenames) == 0: if len(filenames) == 0:
if silent is False: if silent is False:
self.inform.emit('[WARNING_NOTCL] %s' % _("Open TCL script cancelled.")) self.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
else: else:
for filename in filenames: for filename in filenames:
if filename != '': if filename != '':
@ -10406,7 +10386,7 @@ class App(QtCore.QObject):
if filename == "": if filename == "":
if silent is False: if silent is False:
self.inform.emit('[WARNING_NOTCL] %s' % _("Run TCL script cancelled.")) self.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
else: else:
if self.cmd_line_headless != 1: if self.cmd_line_headless != 1:
if self.ui.shell_dock.isHidden(): if self.ui.shell_dock.isHidden():
@ -10483,7 +10463,7 @@ class App(QtCore.QObject):
filename = str(filename) filename = str(filename)
if filename == '': if filename == '':
self.inform.emit('[WARNING_NOTCL] %s' % _("Save Project cancelled.")) self.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
return return
if use_thread is True: if use_thread is True:
@ -10538,7 +10518,7 @@ class App(QtCore.QObject):
filename = str(filename) filename = str(filename)
if filename == '': if filename == '':
self.inform.emit('[WARNING_NOTCL] %s' % _("Save Object PDF cancelled.")) self.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
return return
if use_thread is True: if use_thread is True:

View File

@ -368,7 +368,7 @@ class BookmarkManager(QtWidgets.QWidget):
filename = str(filename) filename = str(filename)
if filename == "": if filename == "":
self.app.inform.emit('[WARNING_NOTCL] %s' % _("FlatCAM bookmarks export cancelled.")) self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
return return
else: else:
try: try:
@ -410,7 +410,7 @@ class BookmarkManager(QtWidgets.QWidget):
filename = str(filename) filename = str(filename)
if filename == "": if filename == "":
self.app.inform.emit('[WARNING_NOTCL] %s' % _("FlatCAM bookmarks import cancelled.")) self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
else: else:
try: try:
with open(filename) as f: with open(filename) as f:
@ -1104,7 +1104,7 @@ class ToolsDB(QtWidgets.QWidget):
filename = str(filename) filename = str(filename)
if filename == "": if filename == "":
self.app.inform.emit('[WARNING_NOTCL] %s' % _("FlatCAM Tools DB export cancelled.")) self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
return return
else: else:
try: try:
@ -1150,7 +1150,7 @@ class ToolsDB(QtWidgets.QWidget):
filename, _f = QtWidgets.QFileDialog.getOpenFileName(caption=_("Import FlatCAM Tools DB"), filter=filter__) filename, _f = QtWidgets.QFileDialog.getOpenFileName(caption=_("Import FlatCAM Tools DB"), filter=filter__)
if filename == "": if filename == "":
self.app.inform.emit('[WARNING_NOTCL] %s' % _("FlatCAM Tools DB import cancelled.")) self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
else: else:
try: try:
with open(filename) as f: with open(filename) as f:
@ -2534,7 +2534,7 @@ class ToolsDB2(QtWidgets.QWidget):
filename = str(filename) filename = str(filename)
if filename == "": if filename == "":
self.app.inform.emit('[WARNING_NOTCL] %s' % _("FlatCAM Tools DB export cancelled.")) self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
return return
else: else:
try: try:
@ -2580,7 +2580,7 @@ class ToolsDB2(QtWidgets.QWidget):
filename, _f = QtWidgets.QFileDialog.getOpenFileName(caption=_("Import FlatCAM Tools DB"), filter=filter__) filename, _f = QtWidgets.QFileDialog.getOpenFileName(caption=_("Import FlatCAM Tools DB"), filter=filter__)
if filename == "": if filename == "":
self.app.inform.emit('[WARNING_NOTCL] %s' % _("FlatCAM Tools DB import cancelled.")) self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
else: else:
try: try:
with open(filename) as f: with open(filename) as f:

View File

@ -119,7 +119,7 @@ class KeySensitiveListView(QtWidgets.QTreeView):
# file drop from outside application # file drop from outside application
if drop_indicator == QtWidgets.QAbstractItemView.OnItem: if drop_indicator == QtWidgets.QAbstractItemView.OnItem:
if self.filename == "": if self.filename == "":
self.app.inform.emit(_("Open cancelled.")) self.app.inform.emit(_("Cancelled."))
else: else:
if self.filename.lower().rpartition('.')[-1] in self.app.grb_list: if self.filename.lower().rpartition('.')[-1] in self.app.grb_list:
self.app.worker_task.emit({'fcn': self.app.open_gerber, self.app.worker_task.emit({'fcn': self.app.open_gerber,

View File

@ -1021,8 +1021,7 @@ class FCDrillResize(FCShapeTool):
self.geometry.append(DrawToolShape(new_poly)) self.geometry.append(DrawToolShape(new_poly))
else: else:
# unexpected geometry so we cancel # unexpected geometry so we cancel
self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' % self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' % _("Cancelled."))
_("Cancelled."))
return return
# remove the geometry with the old size # remove the geometry with the old size
@ -1090,8 +1089,7 @@ class FCDrillResize(FCShapeTool):
except KeyError: except KeyError:
# if the exception happen here then we are not dealing with slots neither # if the exception happen here then we are not dealing with slots neither
# therefore something else is not OK so we return # therefore something else is not OK so we return
self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' % self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' % _("Cancelled."))
_("Cancelled."))
return return
# this simple hack is used so we can delete form self.draw_app.selected but # this simple hack is used so we can delete form self.draw_app.selected but

View File

@ -581,7 +581,7 @@ class PaintOptionsTool(FlatCAMTool):
def on_paint(self): def on_paint(self):
if not self.fcdraw.selected: if not self.fcdraw.selected:
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Paint cancelled. No shape selected.")) self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled. No shape selected."))
return return
tooldia = self.painttooldia_entry.get_value() tooldia = self.painttooldia_entry.get_value()
@ -1053,7 +1053,7 @@ class TransformEditorTool(FlatCAMTool):
def template(self): def template(self):
if not self.draw_app.selected: if not self.draw_app.selected:
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Transformation cancelled. No shape selected.")) self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled. No shape selected."))
return return
self.draw_app.select_tool("select") self.draw_app.select_tool("select")
@ -3022,7 +3022,7 @@ class FCBuffer(FCShapeTool):
def on_buffer(self): def on_buffer(self):
if not self.draw_app.selected: if not self.draw_app.selected:
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Buffer cancelled. No shape selected.")) self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled. No shape selected."))
return return
try: try:
@ -3050,7 +3050,7 @@ class FCBuffer(FCShapeTool):
def on_buffer_int(self): def on_buffer_int(self):
if not self.draw_app.selected: if not self.draw_app.selected:
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Buffer cancelled. No shape selected.")) self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled. No shape selected."))
return return
try: try:
@ -3078,7 +3078,7 @@ class FCBuffer(FCShapeTool):
def on_buffer_ext(self): def on_buffer_ext(self):
if not self.draw_app.selected: if not self.draw_app.selected:
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Buffer cancelled. No shape selected.")) self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled. No shape selected."))
return return
try: try:
@ -4499,8 +4499,7 @@ class FlatCAMGeoEditor(QtCore.QObject):
def on_copy_click(self): def on_copy_click(self):
if not self.selected: if not self.selected:
self.app.inform.emit('[WARNING_NOTCL] %s' % self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled. No shape selected."))
_("Copy cancelled. No shape selected."))
return return
self.app.ui.geo_copy_btn.setChecked(True) self.app.ui.geo_copy_btn.setChecked(True)

View File

@ -4262,8 +4262,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
# self.draw_app.select_tool('select') # self.draw_app.select_tool('select')
self.complete = True self.complete = True
current_tool = 'select' current_tool = 'select'
self.app.inform.emit('[WARNING_NOTCL] %s' % self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled. No aperture is selected"))
_("Cancelled. No aperture is selected"))
# This is to make the group behave as radio group # This is to make the group behave as radio group
if current_tool in self.tools_gerber: if current_tool in self.tools_gerber:
@ -5599,8 +5598,7 @@ class TransformEditorTool(FlatCAMTool):
def template(self): def template(self):
if not self.fcdraw.selected: if not self.fcdraw.selected:
self.app.inform.emit('[WARNING_NOTCL] %s' % self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled. No shape selected."))
_("Transformation cancelled. No shape selected."))
return return
self.draw_app.select_tool("select") self.draw_app.select_tool("select")

View File

@ -220,7 +220,7 @@ class TextEditor(QtWidgets.QWidget):
filename = str(FCFileSaveDialog.get_saved_filename(caption=_("Export Code ..."), filter=_filter_)[0]) filename = str(FCFileSaveDialog.get_saved_filename(caption=_("Export Code ..."), filter=_filter_)[0])
if filename == "": if filename == "":
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Export Code cancelled.")) self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
return return
else: else:
try: try:

View File

@ -3614,8 +3614,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.app.grb_editor.delete_selected() self.app.grb_editor.delete_selected()
self.app.grb_editor.plot_all() self.app.grb_editor.plot_all()
else: else:
self.app.inform.emit('[WARNING_NOTCL] %s' % self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled. Nothing selected to delete."))
_("Cancelled. Nothing selected to delete."))
return return
# Delete aperture in apertures table if delete key event comes from the Selected Tab # Delete aperture in apertures table if delete key event comes from the Selected Tab
@ -3699,8 +3698,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.app.grb_editor.active_tool.set_origin( self.app.grb_editor.active_tool.set_origin(
(self.app.grb_editor.snap_x, self.app.grb_editor.snap_y)) (self.app.grb_editor.snap_x, self.app.grb_editor.snap_y))
else: else:
self.app.inform.emit('[WARNING_NOTCL] %s' % self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled. Nothing selected to copy."))
_("Cancelled. Nothing selected to copy."))
return return
# Add Disc Tool # Add Disc Tool
@ -3746,8 +3744,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.app.grb_editor.active_tool.set_origin( self.app.grb_editor.active_tool.set_origin(
(self.app.grb_editor.snap_x, self.app.grb_editor.snap_y)) (self.app.grb_editor.snap_x, self.app.grb_editor.snap_y))
else: else:
self.app.inform.emit('[WARNING_NOTCL] %s' % self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled. Nothing selected to move."))
_("Cancelled. Nothing selected to move."))
return return
# Add Region Tool # Add Region Tool
@ -3828,8 +3825,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.app.exc_editor.delete_selected() self.app.exc_editor.delete_selected()
self.app.exc_editor.replot() self.app.exc_editor.replot()
else: else:
self.app.inform.emit('[WARNING_NOTCL] %s' % self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled. Nothing selected to delete."))
_("Cancelled. Nothing selected to delete."))
return return
# Delete tools in tools table if delete key event comes from the Selected Tab # Delete tools in tools table if delete key event comes from the Selected Tab
@ -3945,8 +3941,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.app.exc_editor.active_tool.set_origin( self.app.exc_editor.active_tool.set_origin(
(self.app.exc_editor.snap_x, self.app.exc_editor.snap_y)) (self.app.exc_editor.snap_x, self.app.exc_editor.snap_y))
else: else:
self.app.inform.emit('[WARNING_NOTCL] %s' % self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled. Nothing selected to copy."))
_("Cancelled. Nothing selected to copy."))
return return
# Add Drill Hole Tool # Add Drill Hole Tool
@ -3975,8 +3970,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.app.exc_editor.active_tool.set_origin( self.app.exc_editor.active_tool.set_origin(
(self.app.exc_editor.snap_x, self.app.exc_editor.snap_y)) (self.app.exc_editor.snap_x, self.app.exc_editor.snap_y))
else: else:
self.app.inform.emit('[WARNING_NOTCL] %s' % self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled. Nothing selected to move."))
_("Cancelled. Nothing selected to move."))
return return
# Add Array of Slots Hole Tool # Add Array of Slots Hole Tool
@ -4131,7 +4125,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.filename = str(url.toLocalFile()) self.filename = str(url.toLocalFile())
if self.filename == "": if self.filename == "":
self.app.inform.emit("Open cancelled.") self.app.inform.emit("Cancelled.")
else: else:
extension = self.filename.lower().rpartition('.')[-1] extension = self.filename.lower().rpartition('.')[-1]

View File

@ -751,7 +751,7 @@ class Film(FlatCAMTool):
filename = str(filename) filename = str(filename)
if str(filename) == "": if str(filename) == "":
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Export positive film cancelled.")) self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
return return
else: else:
pagesize = self.pagesize_combo.get_value() pagesize = self.pagesize_combo.get_value()
@ -897,7 +897,7 @@ class Film(FlatCAMTool):
filename = str(filename) filename = str(filename)
if str(filename) == "": if str(filename) == "":
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Export negative film cancelled.")) self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
return return
else: else:
self.export_negative(name, boxname, filename, border, self.export_negative(name, boxname, filename, border,

View File

@ -244,7 +244,7 @@ class ToolImage(FlatCAMTool):
self.mask_b_entry.get_value()] self.mask_b_entry.get_value()]
if filename == "": if filename == "":
self.app.inform.emit(_("Open cancelled.")) self.app.inform.emit(_("Cancelled."))
else: else:
self.app.worker_task.emit({'fcn': self.import_image, self.app.worker_task.emit({'fcn': self.import_image,
'params': [filename, type_obj, dpi, mode, mask]}) 'params': [filename, type_obj, dpi, mode, mask]})

View File

@ -111,7 +111,7 @@ class ToolMove(FlatCAMTool):
self.draw_sel_bbox() self.draw_sel_bbox()
else: else:
self.toggle() self.toggle()
self.app.inform.emit('[WARNING_NOTCL] %s' % _("MOVE action cancelled. No object(s) to move.")) self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled. No object(s) to move."))
def on_left_click(self, event): def on_left_click(self, event):
# mouse click will be accepted only if the left button is clicked # mouse click will be accepted only if the left button is clicked
@ -267,7 +267,7 @@ class ToolMove(FlatCAMTool):
def on_key_press(self, event): def on_key_press(self, event):
if event.key == 'escape': if event.key == 'escape':
# abort the move action # abort the move action
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Move action cancelled.")) self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))
self.toggle() self.toggle()
return return

View File

@ -1457,7 +1457,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
if float('%.*f' % (self.decimals, tool_dia)) in tool_dias: if float('%.*f' % (self.decimals, tool_dia)) in tool_dias:
if muted is None: if muted is None:
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Adding tool cancelled. Tool already in Tool Table.")) self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled. Tool already in Tool Table."))
# self.tools_table.itemChanged.connect(self.on_tool_edit) # self.tools_table.itemChanged.connect(self.on_tool_edit)
self.blockSignals(False) self.blockSignals(False)
@ -1520,7 +1520,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
break break
restore_dia_item = self.tools_table.item(row, 1) restore_dia_item = self.tools_table.item(row, 1)
restore_dia_item.setText(str(old_tool_dia)) restore_dia_item.setText(str(old_tool_dia))
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Edit cancelled. " self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled. "
"New diameter value is already in the Tool Table.")) "New diameter value is already in the Tool Table."))
self.blockSignals(False) self.blockSignals(False)
self.build_ui() self.build_ui()
@ -4010,7 +4010,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
tool_dias.append(float('%.*f' % (self.decimals, (v[tool_v])))) tool_dias.append(float('%.*f' % (self.decimals, (v[tool_v]))))
if float('%.*f' % (self.decimals, tooldia)) in tool_dias: if float('%.*f' % (self.decimals, tooldia)) in tool_dias:
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Adding tool cancelled. Tool already in Tool Table.")) self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled. Tool already in Tool Table."))
self.ui_connect() self.ui_connect()
return 'fail' return 'fail'

View File

@ -1193,7 +1193,7 @@ class ToolPaint(FlatCAMTool, Gerber):
if float('%.*f' % (self.decimals, tool_dia)) in tool_dias: if float('%.*f' % (self.decimals, tool_dia)) in tool_dias:
if muted is None: if muted is None:
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Adding tool cancelled. Tool already in Tool Table.")) self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled. Tool already in Tool Table."))
self.tools_table.itemChanged.connect(self.on_tool_edit) self.tools_table.itemChanged.connect(self.on_tool_edit)
return return
else: else:
@ -1254,7 +1254,7 @@ class ToolPaint(FlatCAMTool, Gerber):
restore_dia_item = self.tools_table.item(row, 1) restore_dia_item = self.tools_table.item(row, 1)
restore_dia_item.setText(str(old_tool_dia)) restore_dia_item.setText(str(old_tool_dia))
self.app.inform.emit('[WARNING_NOTCL] %s' % self.app.inform.emit('[WARNING_NOTCL] %s' %
_("Edit cancelled. New diameter value is already in the Tool Table.")) _("Cancelled. New diameter value is already in the Tool Table."))
self.blockSignals(False) self.blockSignals(False)
self.build_ui() self.build_ui()
@ -4074,7 +4074,7 @@ class ToolPaint(FlatCAMTool, Gerber):
tool_dias.append(float('%.*f' % (self.decimals, (v[tool_v])))) tool_dias.append(float('%.*f' % (self.decimals, (v[tool_v]))))
if float('%.*f' % (self.decimals, tooldia)) in tool_dias: if float('%.*f' % (self.decimals, tooldia)) in tool_dias:
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Adding tool cancelled. Tool already in Tool Table.")) self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled. Tool already in Tool Table."))
self.ui_connect() self.ui_connect()
return 'fail' return 'fail'

View File

@ -298,7 +298,7 @@ class PcbWizard(FlatCAMTool):
filename = str(filename) filename = str(filename)
if filename == "": if filename == "":
self.app.inform.emit(_("Open cancelled.")) self.app.inform.emit(_("Cancelled."))
else: else:
self.app.worker_task.emit({'fcn': self.load_excellon, 'params': [filename]}) self.app.worker_task.emit({'fcn': self.load_excellon, 'params': [filename]})
@ -321,7 +321,7 @@ class PcbWizard(FlatCAMTool):
filename = str(filename) filename = str(filename)
if filename == "": if filename == "":
self.app.inform.emit(_("Open cancelled.")) self.app.inform.emit(_("Cancelled."))
else: else:
self.app.worker_task.emit({'fcn': self.load_inf, 'params': [filename]}) self.app.worker_task.emit({'fcn': self.load_inf, 'params': [filename]})

View File

@ -113,7 +113,7 @@ class Properties(FlatCAMTool):
def properties(self): def properties(self):
obj_list = self.app.collection.get_selected() obj_list = self.app.collection.get_selected()
if not obj_list: if not obj_list:
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Properties Tool was not displayed. No object selected.")) self.app.inform.emit('[ERROR_NOTCL] %s' % _("No object selected."))
self.app.ui.notebook.setTabText(2, _("Tools")) self.app.ui.notebook.setTabText(2, _("Tools"))
self.properties_frame.hide() self.properties_frame.hide()
self.app.ui.notebook.setCurrentWidget(self.app.ui.project_tab) self.app.ui.notebook.setCurrentWidget(self.app.ui.project_tab)

View File

@ -788,7 +788,7 @@ class QRCode(FlatCAMTool):
filename = str(filename) filename = str(filename)
if filename == "": if filename == "":
self.app.inform.emit('[WARNING_NOTCL]%s' % _(" Export PNG cancelled.")) self.app.inform.emit('[WARNING_NOTCL]%s' % _("Cancelled."))
return return
else: else:
self.app.worker_task.emit({'fcn': job_thread_qr_png, 'params': [self.app, filename]}) self.app.worker_task.emit({'fcn': job_thread_qr_png, 'params': [self.app, filename]})
@ -835,7 +835,7 @@ class QRCode(FlatCAMTool):
filename = str(filename) filename = str(filename)
if filename == "": if filename == "":
self.app.inform.emit('[WARNING_NOTCL]%s' % _(" Export SVG cancelled.")) self.app.inform.emit('[WARNING_NOTCL]%s' % _("Cancelled."))
return return
else: else:
self.app.worker_task.emit({'fcn': job_thread_qr_svg, 'params': [self.app, filename]}) self.app.worker_task.emit({'fcn': job_thread_qr_svg, 'params': [self.app, filename]})

View File

@ -914,14 +914,12 @@ class SolderPaste(FlatCAMTool):
if float('%.*f' % (self.decimals, tool_dia)) in tool_dias: if float('%.*f' % (self.decimals, tool_dia)) in tool_dias:
if muted is None: if muted is None:
self.app.inform.emit('[WARNING_NOTCL] %s' % self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled. Tool already in Tool Table."))
_("Adding Nozzle tool cancelled. Tool already in Tool Table."))
self.tools_table.itemChanged.connect(self.on_tool_edit) self.tools_table.itemChanged.connect(self.on_tool_edit)
return return
else: else:
if muted is None: if muted is None:
self.app.inform.emit('[success] %s' % self.app.inform.emit('[success] %s' % _("New Nozzle tool added to Tool Table."))
_("New Nozzle tool added to Tool Table."))
self.tooltable_tools.update({ self.tooltable_tools.update({
int(self.tooluid): { int(self.tooluid): {
'tooldia': float('%.*f' % (self.decimals, tool_dia)), 'tooldia': float('%.*f' % (self.decimals, tool_dia)),
@ -976,7 +974,7 @@ class SolderPaste(FlatCAMTool):
restore_dia_item = self.tools_table.item(row, 1) restore_dia_item = self.tools_table.item(row, 1)
restore_dia_item.setText(str(old_tool_dia)) restore_dia_item.setText(str(old_tool_dia))
self.app.inform.emit('[WARNING_NOTCL] %s' % self.app.inform.emit('[WARNING_NOTCL] %s' %
_("Edit cancelled. New diameter value is already in the Tool Table.")) _("Cancelled. New diameter value is already in the Tool Table."))
self.build_ui() self.build_ui()
def on_tool_delete(self, rows_to_delete=None, all=None): def on_tool_delete(self, rows_to_delete=None, all=None):
@ -1241,12 +1239,10 @@ class SolderPaste(FlatCAMTool):
if not geo_obj.tools[tooluid_key]['solid_geometry']: if not geo_obj.tools[tooluid_key]['solid_geometry']:
a += 1 a += 1
if a == len(geo_obj.tools): if a == len(geo_obj.tools):
self.app.inform.emit('[ERROR_NOTCL] %s' % self.app.inform.emit('[ERROR_NOTCL] %s' % _('Cancelled. Empty file, it has no geometry...'))
_('Cancelled. Empty file, it has no geometry...'))
return 'fail' return 'fail'
app_obj.inform.emit('[success] %s...' % app_obj.inform.emit('[success] %s...' % _("Solder Paste geometry generated successfully"))
_("Solder Paste geometry generated successfully"))
return return
# if we still have geometry not processed at the end of the tools then we failed # if we still have geometry not processed at the end of the tools then we failed

View File

@ -7,8 +7,16 @@ from copy import deepcopy
from shapely.ops import cascaded_union from shapely.ops import cascaded_union
from shapely.geometry import Polygon, LineString, LinearRing from shapely.geometry import Polygon, LineString, LinearRing
import gettext
import FlatCAMTranslation as fcTranslate
import builtins
log = logging.getLogger('base') log = logging.getLogger('base')
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
class TclCommandGeoCutout(TclCommandSignaled): class TclCommandGeoCutout(TclCommandSignaled):
""" """
@ -137,7 +145,7 @@ class TclCommandGeoCutout(TclCommandSignaled):
name = args['name'] name = args['name']
else: else:
self.app.inform.emit( self.app.inform.emit(
"[WARNING]The name of the object for which cutout is done is missing. Add it and retry.") "[WARNING] %s" % _("The name of the object for which cutout is done is missing. Add it and retry."))
return return
if 'margin' in args: if 'margin' in args:
@ -173,12 +181,13 @@ class TclCommandGeoCutout(TclCommandSignaled):
return "Could not retrieve object: %s" % name return "Could not retrieve object: %s" % name
if 0 in {dia}: if 0 in {dia}:
self.app.inform.emit("[WARNING]Tool Diameter is zero value. Change it to a positive real number.") self.app.inform.emit(
"[WARNING] %s" % _("Tool Diameter is zero value. Change it to a positive real number."))
return "Tool Diameter is zero value. Change it to a positive real number." return "Tool Diameter is zero value. Change it to a positive real number."
if gaps not in ['lr', 'tb', '2lr', '2tb', '4', '8']: if gaps not in ['lr', 'tb', '2lr', '2tb', '4', '8']:
self.app.inform.emit("[WARNING]Gaps value can be only one of: 'lr', 'tb', '2lr', '2tb', 4 or 8. " self.app.inform.emit(
"Fill in a correct value and retry. ") "[WARNING] %s" % _("Gaps value can be only one of: 'lr', 'tb', '2lr', '2tb', 4 or 8."))
return return
# Get min and max data for each object as we just cut rectangles across X or Y # Get min and max data for each object as we just cut rectangles across X or Y
@ -290,7 +299,7 @@ class TclCommandGeoCutout(TclCommandSignaled):
app_obj.disable_plots(objects=[cutout_obj]) app_obj.disable_plots(objects=[cutout_obj])
app_obj.inform.emit("[success] Any-form Cutout operation finished.") app_obj.inform.emit("[success] %s" % _("Any-form Cutout operation finished."))
self.app.new_object('geometry', outname, geo_init, plot=False) self.app.new_object('geometry', outname, geo_init, plot=False)
@ -348,11 +357,11 @@ class TclCommandGeoCutout(TclCommandSignaled):
geo_obj.options['ymin'] = cutout_obj.options['ymin'] geo_obj.options['ymin'] = cutout_obj.options['ymin']
geo_obj.options['xmax'] = cutout_obj.options['xmax'] geo_obj.options['xmax'] = cutout_obj.options['xmax']
geo_obj.options['ymax'] = cutout_obj.options['ymax'] geo_obj.options['ymax'] = cutout_obj.options['ymax']
app_obj.inform.emit("[success] Any-form Cutout operation finished.") app_obj.inform.emit("[success] %s" % _("Any-form Cutout operation finished."))
self.app.new_object('geometry', outname, geo_init, plot=False) self.app.new_object('geometry', outname, geo_init, plot=False)
cutout_obj = self.app.collection.get_by_name(outname) cutout_obj = self.app.collection.get_by_name(outname)
else: else:
self.app.inform.emit("[ERROR]Cancelled. Object type is not supported.") self.app.inform.emit("[ERROR] %s" % _("Cancelled. Object type is not supported."))
return return