- modified Toggle Workspace function to work in the new Preferences UI configuration

- cleaned the app from progress signal usage since it is not used anymore
This commit is contained in:
Marius Stanciu
2020-01-03 01:41:03 +02:00
committed by Marius
parent e0825bfce3
commit e090b96c7c
13 changed files with 43 additions and 145 deletions

View File

@@ -3305,7 +3305,6 @@ class FlatCAMExcEditor(QtCore.QObject):
# How the object should be initialized
def obj_init(excellon_obj, app_obj):
# self.progress.emit(20)
excellon_obj.drills = deepcopy(new_drills)
excellon_obj.tools = deepcopy(new_tools)
excellon_obj.slots = deepcopy(new_slots)
@@ -3335,12 +3334,9 @@ class FlatCAMExcEditor(QtCore.QObject):
use_thread=False)
except Exception as e:
log.error("Error on Edited object creation: %s" % str(e))
self.app.progress.emit(100)
return
self.app.inform.emit('[success] %s' %
_("Excellon editing finished."))
# self.progress.emit(100)
self.app.inform.emit('[success] %s' % _("Excellon editing finished."))
def on_tool_select(self, tool):
"""

View File

@@ -1272,8 +1272,6 @@ class TransformEditorTool(FlatCAMTool):
xmaximal = max(xmaxlist)
ymaximal = max(ymaxlist)
self.app.progress.emit(20)
for sel_sha in shape_list:
px = 0.5 * (xminimal + xmaximal)
py = 0.5 * (yminimal + ymaximal)
@@ -1284,11 +1282,7 @@ class TransformEditorTool(FlatCAMTool):
# self.draw_app.transform_complete.emit()
self.app.inform.emit('[success] %s' %
_("Done. Rotate completed."))
self.app.progress.emit(100)
self.app.inform.emit('[success] %s' % _("Done. Rotate completed."))
except Exception as e:
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Rotation action was not executed"), str(e)))
return
@@ -1329,8 +1323,6 @@ class TransformEditorTool(FlatCAMTool):
px = 0.5 * (xminimal + xmaximal)
py = 0.5 * (yminimal + ymaximal)
self.app.progress.emit(20)
# execute mirroring
for sha in shape_list:
if axis is 'X':
@@ -1347,8 +1339,6 @@ class TransformEditorTool(FlatCAMTool):
#
# self.draw_app.transform_complete.emit()
self.app.progress.emit(100)
except Exception as e:
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Flip action was not executed"), str(e)))
return
@@ -1375,8 +1365,6 @@ class TransformEditorTool(FlatCAMTool):
xminimal = min(xminlist)
yminimal = min(yminlist)
self.app.progress.emit(20)
for sha in shape_list:
if axis is 'X':
sha.skew(num, 0, point=(xminimal, yminimal))
@@ -1388,12 +1376,9 @@ class TransformEditorTool(FlatCAMTool):
#
# self.draw_app.transform_complete.emit()
if axis == 'X':
self.app.inform.emit('[success] %s...' %
_('Skew on the X axis done'))
self.app.inform.emit('[success] %s...' % _('Skew on the X axis done'))
else:
self.app.inform.emit('[success] %s...' %
_('Skew on the Y axis done'))
self.app.progress.emit(100)
self.app.inform.emit('[success] %s...' % _('Skew on the Y axis done'))
except Exception as e:
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Skew action was not executed"), str(e)))
@@ -1407,8 +1392,7 @@ class TransformEditorTool(FlatCAMTool):
ymaxlist = []
if not shape_list:
self.app.inform.emit('[WARNING_NOTCL] %s' %
_("No shape selected. Please Select a shape to scale!"))
self.app.inform.emit('[WARNING_NOTCL] %s' % _("No shape selected. Please Select a shape to scale!"))
return
else:
with self.app.proc_container.new(_("Applying Scale")):
@@ -1427,8 +1411,6 @@ class TransformEditorTool(FlatCAMTool):
xmaximal = max(xmaxlist)
ymaximal = max(ymaxlist)
self.app.progress.emit(20)
if point is None:
px = 0.5 * (xminimal + xmaximal)
py = 0.5 * (yminimal + ymaximal)
@@ -1445,12 +1427,9 @@ class TransformEditorTool(FlatCAMTool):
# self.draw_app.transform_complete.emit()
if str(axis) == 'X':
self.app.inform.emit('[success] %s...' %
_('Scale on the X axis done'))
self.app.inform.emit('[success] %s...' % _('Scale on the X axis done'))
else:
self.app.inform.emit('[success] %s...' %
_('Scale on the Y axis done'))
self.app.progress.emit(100)
self.app.inform.emit('[success] %s...' % _('Scale on the Y axis done'))
except Exception as e:
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Scale action was not executed"), str(e)))
return
@@ -1467,8 +1446,6 @@ class TransformEditorTool(FlatCAMTool):
else:
with self.app.proc_container.new(_("Applying Offset")):
try:
self.app.progress.emit(20)
for sha in shape_list:
if axis is 'X':
sha.offset((num, 0))
@@ -1477,12 +1454,9 @@ class TransformEditorTool(FlatCAMTool):
self.draw_app.replot()
if axis == 'X':
self.app.inform.emit('[success] %s...' %
_('Offset on the X axis done'))
self.app.inform.emit('[success] %s...' % _('Offset on the X axis done'))
else:
self.app.inform.emit('[success] %s...' %
_('Offset on the Y axis done'))
self.app.progress.emit(100)
self.app.inform.emit('[success] %s...' % _('Offset on the Y axis done'))
except Exception as e:
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Offset action was not executed"), str(e)))

View File

@@ -5761,7 +5761,6 @@ class TransformEditorTool(FlatCAMTool):
xmaximal = max(xmaxlist)
ymaximal = max(ymaxlist)
self.app.progress.emit(20)
px = 0.5 * (xminimal + xmaximal)
py = 0.5 * (yminimal + ymaximal)
@@ -5775,12 +5774,9 @@ class TransformEditorTool(FlatCAMTool):
sel_el['clear'] = affinity.rotate(sel_el['clear'], angle=-num, origin=(px, py))
self.draw_app.plot_all()
self.app.inform.emit('[success] %s' %
_("Done. Rotate completed."))
self.app.progress.emit(100)
self.app.inform.emit('[success] %s' % _("Done. Rotate completed."))
except Exception as e:
self.app.inform.emit('[ERROR_NOTCL] %s: %s' %
(_("Rotation action was not executed."), str(e)))
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Rotation action was not executed."), str(e)))
return
def on_flip(self, axis):
@@ -5827,8 +5823,6 @@ class TransformEditorTool(FlatCAMTool):
px = 0.5 * (xminimal + xmaximal)
py = 0.5 * (yminimal + ymaximal)
self.app.progress.emit(20)
# execute mirroring
for sel_el_shape in elem_list:
sel_el = sel_el_shape.geo
@@ -5851,8 +5845,6 @@ class TransformEditorTool(FlatCAMTool):
self.app.inform.emit('[success] %s...' %
_('Flip on the X axis done'))
self.draw_app.plot_all()
self.app.progress.emit(100)
except Exception as e:
self.app.inform.emit('[ERROR_NOTCL] %s: %s' %
(_("Flip action was not executed."), str(e)))
@@ -5889,8 +5881,6 @@ class TransformEditorTool(FlatCAMTool):
xminimal = min(xminlist)
yminimal = min(yminlist)
self.app.progress.emit(20)
for sel_el_shape in elem_list:
sel_el = sel_el_shape.geo
if axis is 'X':
@@ -5913,8 +5903,6 @@ class TransformEditorTool(FlatCAMTool):
self.app.inform.emit('[success] %s...' % _('Skew on the X axis done'))
else:
self.app.inform.emit('[success] %s...' % _('Skew on the Y axis done'))
self.app.progress.emit(100)
except Exception as e:
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Skew action was not executed."), str(e)))
return
@@ -5958,8 +5946,6 @@ class TransformEditorTool(FlatCAMTool):
xmaximal = max(xmaxlist)
ymaximal = max(ymaxlist)
self.app.progress.emit(20)
if point is None:
px = 0.5 * (xminimal + xmaximal)
py = 0.5 * (yminimal + ymaximal)