diff --git a/lattice2Common.py b/lattice2Common.py index 3730c57..974a36a 100644 --- a/lattice2Common.py +++ b/lattice2Common.py @@ -22,6 +22,7 @@ #*************************************************************************** import FreeCAD, Part +from latticeExecuter import CancelError if FreeCAD.GuiUp: import FreeCADGui from PySide import QtCore, QtGui @@ -57,6 +58,8 @@ class SelectionError(FreeCAD.Base.FreeCADError): self.title = title def msgError(err): + #if type(err) is CancelError: return # doesn't work! Why! + if hasattr(err, "isCancelError") and err.isCancelError: return #workaround mb = QtGui.QMessageBox() mb.setIcon(mb.Icon.Warning) mb.setText(err.message) diff --git a/lattice2Executer.py b/lattice2Executer.py index 6e2e797..6319c5e 100644 --- a/lattice2Executer.py +++ b/lattice2Executer.py @@ -94,4 +94,5 @@ def _showMsg(obj, message, _type): class CancelError(Exception): def __init__(self): - self.message = "Canceled by user" \ No newline at end of file + self.message = "Canceled by user" + self.isCancelError = True \ No newline at end of file