- 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

@@ -49,7 +49,7 @@ class FCDrillAdd(FCShapeTool):
try:
QtGui.QGuiApplication.restoreOverrideCursor()
except:
except Exception as e:
pass
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_drill.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
@@ -91,7 +91,7 @@ class FCDrillAdd(FCShapeTool):
try:
QtGui.QGuiApplication.restoreOverrideCursor()
except:
except Exception as e:
pass
# add the point to drills if the diameter is a key in the dict, if not, create it add the drill location
@@ -152,8 +152,9 @@ class FCDrillArray(FCShapeTool):
try:
QtGui.QGuiApplication.restoreOverrideCursor()
except:
except Exception as e:
pass
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_drill_array.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
@@ -274,7 +275,7 @@ class FCDrillArray(FCShapeTool):
try:
QtGui.QGuiApplication.restoreOverrideCursor()
except:
except Exception as e:
pass
# add the point to drills if the diameter is a key in the dict, if not, create it add the drill location
@@ -599,7 +600,7 @@ class FCDrillSelect(DrawTool):
try:
QtGui.QGuiApplication.restoreOverrideCursor()
except:
except Exception as e:
pass
self.exc_editor_app = exc_editor_app
@@ -668,7 +669,7 @@ class FCDrillSelect(DrawTool):
# select the diameter of the selected shape in the tool table
try:
self.draw_app.tools_table_exc.cellPressed.disconnect()
except:
except TypeError:
pass
sel_tools = set()
@@ -1257,12 +1258,12 @@ class FlatCAMExcEditor(QtCore.QObject):
try:
# if connected, disconnect the signal from the slot on item_changed as it creates issues
self.tools_table_exc.itemChanged.disconnect()
except:
except TypeError:
pass
try:
self.tools_table_exc.cellPressed.disconnect()
except:
except TypeError:
pass
# updated units
@@ -1704,7 +1705,7 @@ class FlatCAMExcEditor(QtCore.QObject):
def deactivate(self):
try:
QtGui.QGuiApplication.restoreOverrideCursor()
except:
except Exception as e:
pass
# adjust the status of the menu entries related to the editor
@@ -2311,7 +2312,7 @@ class FlatCAMExcEditor(QtCore.QObject):
if self.app.ui.popMenu.mouse_is_panning is False:
try:
QtGui.QGuiApplication.restoreOverrideCursor()
except:
except Exception as e:
pass
if self.active_tool.complete is False and not isinstance(self.active_tool, FCDrillSelect):
self.active_tool.complete = True
@@ -2380,7 +2381,7 @@ class FlatCAMExcEditor(QtCore.QObject):
try:
self.tools_table_exc.cellPressed.disconnect()
except:
except Exception as e:
pass
# select the diameter of the selected shape in the tool table
self.tools_table_exc.setSelectionMode(QtWidgets.QAbstractItemView.MultiSelection)

View File

@@ -1921,7 +1921,7 @@ class FCCircle(FCShapeTool):
try:
QtGui.QGuiApplication.restoreOverrideCursor()
except:
except Exception as e:
pass
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_circle_geo.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
@@ -1954,7 +1954,7 @@ class FCCircle(FCShapeTool):
def make(self):
try:
QtGui.QGuiApplication.restoreOverrideCursor()
except:
except Exception as e:
pass
p1 = self.points[0]
@@ -1972,7 +1972,7 @@ class FCArc(FCShapeTool):
try:
QtGui.QGuiApplication.restoreOverrideCursor()
except:
except Exception as e:
pass
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_arc.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
@@ -2190,7 +2190,7 @@ class FCRectangle(FCShapeTool):
try:
QtGui.QGuiApplication.restoreOverrideCursor()
except:
except Exception as e:
pass
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
@@ -2221,7 +2221,7 @@ class FCRectangle(FCShapeTool):
def make(self):
try:
QtGui.QGuiApplication.restoreOverrideCursor()
except:
except Exception as e:
pass
p1 = self.points[0]
@@ -2243,7 +2243,7 @@ class FCPolygon(FCShapeTool):
try:
QtGui.QGuiApplication.restoreOverrideCursor()
except:
except Exception as e:
pass
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
@@ -2276,7 +2276,7 @@ class FCPolygon(FCShapeTool):
def make(self):
try:
QtGui.QGuiApplication.restoreOverrideCursor()
except:
except Exception as e:
pass
# self.geometry = LinearRing(self.points)
@@ -2305,7 +2305,7 @@ class FCPath(FCPolygon):
try:
QtGui.QGuiApplication.restoreOverrideCursor()
except:
except Exception as e:
pass
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_path5.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
@@ -2316,7 +2316,7 @@ class FCPath(FCPolygon):
try:
QtGui.QGuiApplication.restoreOverrideCursor()
except:
except Exception as e:
pass
self.draw_app.in_action = False
@@ -2349,7 +2349,7 @@ class FCSelect(DrawTool):
try:
QtGui.QGuiApplication.restoreOverrideCursor()
except:
except Exception as e:
pass
self.storage = self.draw_app.storage
@@ -2433,7 +2433,7 @@ class FCMove(FCShapeTool):
try:
QtGui.QGuiApplication.restoreOverrideCursor()
except:
except Exception as e:
pass
self.storage = self.draw_app.storage
@@ -2613,7 +2613,7 @@ class FCText(FCShapeTool):
try:
QtGui.QGuiApplication.restoreOverrideCursor()
except:
except Exception as e:
pass
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_text.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
@@ -3173,7 +3173,7 @@ class FlatCAMGeoEditor(QtCore.QObject):
def deactivate(self):
try:
QtGui.QGuiApplication.restoreOverrideCursor()
except:
except Exception as e:
pass
# adjust the status of the menu entries related to the editor
@@ -3638,7 +3638,7 @@ class FlatCAMGeoEditor(QtCore.QObject):
if self.in_action is False:
try:
QtGui.QGuiApplication.restoreOverrideCursor()
except:
except Exception as e:
pass
if self.active_tool.complete is False and not isinstance(self.active_tool, FCSelect):

View File

@@ -188,7 +188,7 @@ class FCPad(FCShapeTool):
try:
QtGui.QGuiApplication.restoreOverrideCursor()
except:
except Exception as e:
pass
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_circle.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
@@ -403,7 +403,7 @@ class FCPadArray(FCShapeTool):
try:
QtGui.QGuiApplication.restoreOverrideCursor()
except:
except Exception as e:
pass
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_array.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
@@ -1341,7 +1341,7 @@ class FCDisc(FCShapeTool):
try:
QtGui.QGuiApplication.restoreOverrideCursor()
except:
except Exception as e:
pass
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_disc.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
@@ -2934,12 +2934,12 @@ class FlatCAMGrbEditor(QtCore.QObject):
try:
# if connected, disconnect the signal from the slot on item_changed as it creates issues
self.apertures_table.itemChanged.disconnect()
except Exception as e:
except TypeError:
pass
try:
self.apertures_table.cellPressed.disconnect()
except Exception as e:
except TypeError:
pass
# updated units