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 bb162d34a7
commit f14eaa217f
13 changed files with 94 additions and 47 deletions

View File

@@ -81,11 +81,15 @@ class _ViewProviderFemMeshRegion:
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):