gui: improve backward compatibility

This commit is contained in:
Zheng, Lei 2020-04-25 18:30:07 +08:00
parent 06f8edd493
commit edac36d4df

View File

@ -103,7 +103,9 @@ class SelectionObserver:
hasSelection = FreeCADGui.Selection.hasSelection() hasSelection = FreeCADGui.Selection.hasSelection()
for cmd in self.cmds: for cmd in self.cmds:
cmd.onSelectionChange(hasSelection) cmd.onSelectionChange(hasSelection)
FreeCADGui.updateCommands() update = getattr(FreeCADGui, 'updateCommands', None)
if update:
update()
def addSelection(self,docname,objname,subname,_pos): def addSelection(self,docname,objname,subname,_pos):
self.onChange() self.onChange()