FEM: Python object VP, add a pop up if a task panel is open while another one will be opened

This commit is contained in:
Bernd Hahnebach
2018-05-21 14:32:39 +02:00
committed by wmayer
parent ae4a97d3d2
commit c997755ad1
13 changed files with 94 additions and 47 deletions

View File

@@ -80,11 +80,15 @@ class _ViewProviderFemElementGeometry2D:
return
def doubleClicked(self, vobj):
doc = FreeCADGui.getDocument(vobj.Object.Document)
if not doc.getInEdit():
doc.setEdit(vobj.Object.Name)
guidoc = FreeCADGui.getDocument(vobj.Object.Document)
# check if another VP is in edit mode, https://forum.freecadweb.org/viewtopic.php?t=13077#p104702
if not guidoc.getInEdit():
guidoc.setEdit(vobj.Object.Name)
else:
FreeCAD.Console.PrintError('Active Task Dialog found! Please close this one first!\n')
from PySide.QtGui import QMessageBox
message = 'Active Task Dialog found! Please close this one before open a new one!'
QMessageBox.critical(None, "Error in tree view", message)
FreeCAD.Console.PrintError(message + '\n')
return True
def __getstate__(self):