gui: fix tree item move command
This commit is contained in:
parent
f72e048295
commit
9e98a55b07
8
gui.py
8
gui.py
|
@ -277,15 +277,17 @@ class AsmCmdUp(AsmCmdBase):
|
||||||
logger.debug('move {}:{} -> {}:{}'.format(
|
logger.debug('move {}:{} -> {}:{}'.format(
|
||||||
i,objName(obj),j,objName(children[j])))
|
i,objName(obj),j,objName(children[j])))
|
||||||
parent.Document.openTransaction(cls._menuText)
|
parent.Document.openTransaction(cls._menuText)
|
||||||
|
readonly = 'Immutable' in parent.getPropertyStatus('Group')
|
||||||
|
if readonly:
|
||||||
|
parent.setPropertyStatus('Group','-Immutable')
|
||||||
parent.Group = {i:children[j],j:obj}
|
parent.Group = {i:children[j],j:obj}
|
||||||
|
if readonly:
|
||||||
|
parent.setPropertyStatus('Group','Immutable')
|
||||||
parent.Document.commitTransaction()
|
parent.Document.commitTransaction()
|
||||||
# The tree view may deselect the item because of claimChildren changes,
|
# The tree view may deselect the item because of claimChildren changes,
|
||||||
# so we restore the selection here
|
# so we restore the selection here
|
||||||
FreeCADGui.Selection.addSelection(topParent,subname)
|
FreeCADGui.Selection.addSelection(topParent,subname)
|
||||||
|
|
||||||
if AsmCmdManager.AutoRecompute:
|
|
||||||
parent.Proxy.solve()
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def onClearSelection(cls):
|
def onClearSelection(cls):
|
||||||
cls._active = False
|
cls._active = False
|
||||||
|
|
Loading…
Reference in New Issue
Block a user