assembly: disable auto solve when workbench is not active
This commit is contained in:
parent
b1ff90e093
commit
4feccb6fab
|
@ -2788,7 +2788,8 @@ class Assembly(AsmGroup):
|
||||||
@classmethod
|
@classmethod
|
||||||
def canAutoSolve(cls):
|
def canAutoSolve(cls):
|
||||||
from . import solver
|
from . import solver
|
||||||
return gui.AsmCmdManager.AutoRecompute and \
|
return gui.AsmCmdManager.WorkbenchActivated and \
|
||||||
|
gui.AsmCmdManager.AutoRecompute and \
|
||||||
FreeCADGui.ActiveDocument and \
|
FreeCADGui.ActiveDocument and \
|
||||||
not FreeCADGui.ActiveDocument.Transacting and \
|
not FreeCADGui.ActiveDocument.Transacting and \
|
||||||
not FreeCAD.isRestoring() and \
|
not FreeCAD.isRestoring() and \
|
||||||
|
|
1
gui.py
1
gui.py
|
@ -138,6 +138,7 @@ class AsmCmdManager(ProxyType):
|
||||||
Toolbars = OrderedDict()
|
Toolbars = OrderedDict()
|
||||||
Menus = OrderedDict()
|
Menus = OrderedDict()
|
||||||
_defaultMenuGroupName = '&Assembly3'
|
_defaultMenuGroupName = '&Assembly3'
|
||||||
|
WorkbenchActivated = False
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def getToolbarParams():
|
def getToolbarParams():
|
||||||
|
|
|
@ -29,11 +29,13 @@ class Assembly3Workbench(FreeCADGui.Workbench):
|
||||||
|
|
||||||
def Activated(self):
|
def Activated(self):
|
||||||
from .gui import AsmCmdManager
|
from .gui import AsmCmdManager
|
||||||
|
AsmCmdManager.WorkbenchActivated = True
|
||||||
for cmd in AsmCmdManager.getInfo().Types:
|
for cmd in AsmCmdManager.getInfo().Types:
|
||||||
cmd.workbenchActivated()
|
cmd.workbenchActivated()
|
||||||
|
|
||||||
def Deactivated(self):
|
def Deactivated(self):
|
||||||
from .gui import AsmCmdManager
|
from .gui import AsmCmdManager
|
||||||
|
AsmCmdManager.WorkbenchActivated = False
|
||||||
for cmd in AsmCmdManager.getInfo().Types:
|
for cmd in AsmCmdManager.getInfo().Types:
|
||||||
cmd.workbenchDeactivated()
|
cmd.workbenchDeactivated()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user