Fix "Canceled by user" messagebox (wasn't intended to pop up)
This commit is contained in:
parent
a792d92442
commit
037d3028ea
|
@ -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)
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue
Block a user