- fixed bug in FlatCAMObj.FlatCAMGeometry.ui_disconnect(); the widgets signals were not disconnected from handlers when required therefore the signals were connected in an exponential way

- some changes in the widgets used in the Selected tab for Geometry object
- some PEP8 cleanup in FlatCAMObj.py
This commit is contained in:
Marius Stanciu
2019-07-19 21:46:11 +03:00
parent 86287ea10f
commit 2797a58165
17 changed files with 300 additions and 270 deletions

View File

@@ -461,7 +461,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
try:
# if connected, disconnect the signal from the slot on item_changed as it creates issues
self.tools_table.itemChanged.disconnect(self.on_tool_edit)
except:
except TypeError:
pass
def on_tool_add(self, dia=None, muted=None):
@@ -861,7 +861,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
for poly in cleared_by_last_tool:
try:
area = area.difference(poly)
except:
except Exception as e:
pass
cleared_by_last_tool[:] = []

View File

@@ -360,13 +360,13 @@ class ToolPDF(FlatCAMTool):
try:
self.check_thread.stop()
except Exception as e:
except TypeError:
pass
self.check_thread.setInterval(check_period)
try:
self.check_thread.timeout.disconnect(self.periodic_check_handler)
except:
except TypeError:
pass
self.check_thread.timeout.connect(self.periodic_check_handler)

View File

@@ -437,7 +437,7 @@ class ToolPaint(FlatCAMTool, Gerber):
try:
# if connected, disconnect the signal from the slot on item_changed as it creates issues
self.tools_table.itemChanged.disconnect()
except:
except TypeError:
pass
# updated units

View File

@@ -642,22 +642,26 @@ class SolderPaste(FlatCAMTool):
def ui_disconnect(self):
# if connected, disconnect the signal from the slot on item_changed as it creates issues
try:
for i in range(self.gcode_form_layout.count()):
if isinstance(self.gcode_form_layout.itemAt(i).widget(), FCComboBox):
for i in range(self.gcode_form_layout.count()):
if isinstance(self.gcode_form_layout.itemAt(i).widget(), FCComboBox):
try:
self.gcode_form_layout.itemAt(i).widget().currentIndexChanged.disconnect()
if isinstance(self.gcode_form_layout.itemAt(i).widget(), FCEntry):
except TypeError:
pass
if isinstance(self.gcode_form_layout.itemAt(i).widget(), FCEntry):
try:
self.gcode_form_layout.itemAt(i).widget().editingFinished.disconnect()
except:
pass
except TypeError:
pass
try:
self.tools_table.itemChanged.disconnect(self.on_tool_edit)
except:
except TypeError:
pass
try:
self.tools_table.currentItemChanged.disconnect(self.on_row_selection_change)
except:
except TypeError:
pass
def update_comboboxes(self, obj, status):

View File

@@ -569,14 +569,14 @@ class ToolSub(FlatCAMTool):
try:
self.check_thread.stop()
except Exception as e:
except TypeError:
pass
if reset:
self.check_thread.setInterval(check_period)
try:
self.check_thread.timeout.disconnect(self.periodic_check_handler)
except Exception as e:
except TypeError:
pass
self.check_thread.timeout.connect(self.periodic_check_handler)