gui: fix tree item move command

This commit is contained in:
Zheng, Lei 2017-12-09 13:26:00 +08:00
parent f72e048295
commit 9e98a55b07

8
gui.py
View File

@ -277,15 +277,17 @@ class AsmCmdUp(AsmCmdBase):
logger.debug('move {}:{} -> {}:{}'.format(
i,objName(obj),j,objName(children[j])))
parent.Document.openTransaction(cls._menuText)
readonly = 'Immutable' in parent.getPropertyStatus('Group')
if readonly:
parent.setPropertyStatus('Group','-Immutable')
parent.Group = {i:children[j],j:obj}
if readonly:
parent.setPropertyStatus('Group','Immutable')
parent.Document.commitTransaction()
# The tree view may deselect the item because of claimChildren changes,
# so we restore the selection here
FreeCADGui.Selection.addSelection(topParent,subname)
if AsmCmdManager.AutoRecompute:
parent.Proxy.solve()
@classmethod
def onClearSelection(cls):
cls._active = False