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:
@@ -54,12 +54,15 @@ class _ViewProviderFemConstraintSelfWeight:
|
||||
return False
|
||||
|
||||
def doubleClicked(self, vobj):
|
||||
doc = FreeCADGui.getDocument(vobj.Object.Document)
|
||||
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 doc.getInEdit():
|
||||
doc.setEdit(vobj.Object.Name)
|
||||
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):
|
||||
|
||||
@@ -82,11 +82,15 @@ class _ViewProviderFemElementFluid1D:
|
||||
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):
|
||||
|
||||
@@ -81,11 +81,15 @@ class _ViewProviderFemElementGeometry1D:
|
||||
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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -85,12 +85,15 @@ class _ViewProviderFemElementRotation1D:
|
||||
return False
|
||||
|
||||
def doubleClicked(self, vobj):
|
||||
doc = FreeCADGui.getDocument(vobj.Object.Document)
|
||||
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 doc.getInEdit():
|
||||
doc.setEdit(vobj.Object.Name)
|
||||
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):
|
||||
|
||||
@@ -77,13 +77,17 @@ class _ViewProviderFemMaterial:
|
||||
FreeCADGui.Control.closeDialog()
|
||||
return
|
||||
|
||||
# overwrite the doubleClicked to make sure no other Material taskd (and thus no selection observer) is still active
|
||||
# overwrite the doubleClicked of material object python to make sure no other Material taskd (and thus no selection observer) is still active
|
||||
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):
|
||||
|
||||
@@ -63,12 +63,15 @@ class _ViewProviderFemMaterialMechanicalNonlinear:
|
||||
return False
|
||||
|
||||
def doubleClicked(self, vobj):
|
||||
doc = FreeCADGui.getDocument(vobj.Object.Document)
|
||||
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 doc.getInEdit():
|
||||
doc.setEdit(vobj.Object.Name)
|
||||
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):
|
||||
|
||||
@@ -80,11 +80,15 @@ class _ViewProviderFemMeshBoundaryLayer:
|
||||
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):
|
||||
|
||||
@@ -135,7 +135,10 @@ class _ViewProviderFemMeshGmsh:
|
||||
print('No analysis in the active document.')
|
||||
gui_doc.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):
|
||||
|
||||
@@ -80,11 +80,15 @@ class _ViewProviderFemMeshGroup:
|
||||
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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -65,11 +65,15 @@ class _ViewProviderFemResultMechanical:
|
||||
def doubleClicked(self, vobj):
|
||||
if FreeCADGui.activeWorkbench().name() != 'FemWorkbench':
|
||||
FreeCADGui.activateWorkbench("FemWorkbench")
|
||||
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 setEdit(self, vobj, mode=0):
|
||||
|
||||
@@ -89,7 +89,10 @@ class _ViewProviderFemSolverCalculix:
|
||||
else:
|
||||
FreeCAD.Console.PrintError('No active Analysis found!\n')
|
||||
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):
|
||||
|
||||
Reference in New Issue
Block a user