Cleaning up startEditing/finishEditing/isEditing
This commit is contained in:
@@ -121,7 +121,7 @@ class _CommandArchMaterial:
|
||||
for obj in sel:
|
||||
if hasattr(obj,"Material"):
|
||||
FreeCADGui.doCommand("FreeCAD.ActiveDocument.getObject(\""+obj.Name+"\").Material = mat")
|
||||
FreeCADGui.doCommandGui("mat.ViewObject.startEditing()")
|
||||
FreeCADGui.doCommandGui("mat.ViewObject.Document.setEdit(mat.ViewObject, 0)")
|
||||
FreeCAD.ActiveDocument.commitTransaction()
|
||||
FreeCAD.ActiveDocument.recompute()
|
||||
|
||||
@@ -156,7 +156,7 @@ class _CommandArchMultiMaterial:
|
||||
if hasattr(obj,"Material"):
|
||||
if not obj.isDerivedFrom("App::MaterialObject"):
|
||||
FreeCADGui.doCommand("FreeCAD.ActiveDocument."+obj.Name+".Material = mat")
|
||||
FreeCADGui.doCommandGui("mat.ViewObject.startEditing()")
|
||||
FreeCADGui.doCommandGui("mat.ViewObject.Document.setEdit(mat.ViewObject, 0)")
|
||||
FreeCAD.ActiveDocument.commitTransaction()
|
||||
FreeCAD.ActiveDocument.recompute()
|
||||
|
||||
|
||||
@@ -383,7 +383,7 @@ class ArchReferenceCommand:
|
||||
FreeCADGui.doCommand("obj = Arch.makeReference()")
|
||||
FreeCADGui.doCommand("Draft.autogroup(obj)")
|
||||
FreeCAD.ActiveDocument.commitTransaction()
|
||||
FreeCADGui.doCommand("obj.ViewObject.startEditing()")
|
||||
FreeCADGui.doCommand("obj.ViewObject.Document.setEdit(obj.ViewObject, 0)")
|
||||
|
||||
if FreeCAD.GuiUp:
|
||||
FreeCADGui.addCommand('Arch_Reference', ArchReferenceCommand())
|
||||
|
||||
@@ -652,7 +652,7 @@ class _CommandFemResultShow(CommandManager):
|
||||
self.is_active = 'with_selresult'
|
||||
|
||||
def Activated(self):
|
||||
self.selobj.ViewObject.startEditing()
|
||||
self.selobj.ViewObject.Document.setEdit(self.selobj.ViewObject, 0)
|
||||
|
||||
|
||||
class _CommandFemResultsPurge(CommandManager):
|
||||
|
||||
@@ -84,7 +84,6 @@ class _TaskPanel(object):
|
||||
self._part.ViewObject.show()
|
||||
|
||||
def reject(self):
|
||||
# self._obj.ViewObject.finishEditing()
|
||||
FreeCADGui.ActiveDocument.resetEdit()
|
||||
self._restoreVisibility()
|
||||
return True
|
||||
@@ -94,7 +93,6 @@ class _TaskPanel(object):
|
||||
self._obj.References = self._refWidget.references()
|
||||
self._applyWidgetChanges()
|
||||
self._obj.Document.recompute()
|
||||
# self._obj.ViewObject.finishEditing()
|
||||
FreeCADGui.ActiveDocument.resetEdit()
|
||||
self._restoreVisibility()
|
||||
return True
|
||||
|
||||
@@ -194,15 +194,6 @@ class ViewProvider(object):
|
||||
def toString(self):
|
||||
"returns a string representation of the coin node of this object"
|
||||
return self.__vobject__.toString()
|
||||
def startEditing(self,mode=0):
|
||||
"sets this object in edit mode"
|
||||
return self.__vobject__.startEditing(mode)
|
||||
def finishEditing(self):
|
||||
"leaves edit mode for this object"
|
||||
self.__vobject__.finishEditing()
|
||||
def isEditing(self):
|
||||
"shows whether this object is in edit mode"
|
||||
self.__vobject__.isEditing()
|
||||
def setTransformation(self,trsf):
|
||||
"defines a transformation for this object"
|
||||
return self.__vobject__.setTransformation(trsf)
|
||||
|
||||
Reference in New Issue
Block a user