Fix "Canceled by user" messagebox (wasn't intended to pop up)

This commit is contained in:
DeepSOIC 2015-12-16 03:15:40 +03:00
parent a792d92442
commit 037d3028ea
2 changed files with 5 additions and 1 deletions

View File

@ -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)

View File

@ -94,4 +94,5 @@ def _showMsg(obj, message, _type):
class CancelError(Exception):
def __init__(self):
self.message = "Canceled by user"
self.message = "Canceled by user"
self.isCancelError = True