Changed view providers to use Gui.Document.setEdit to start the editor for a new object.

This commit is contained in:
Markus Lampert
2018-10-04 20:52:25 -07:00
committed by wmayer
parent dfdc05f5c5
commit a68bc0612d
3 changed files with 4 additions and 2 deletions

View File

@@ -146,3 +146,5 @@ endif(BUILD_ADDONMGR)
if(BUILD_TUX)
add_subdirectory(Tux)
endif(BUILD_TUX)
add_subdirectory(LineFollowing)

View File

@@ -495,7 +495,7 @@ def Create(baseObject, name='DressupTag'):
obj = PathDressupTag.Create(baseObject, name)
vp = PathDressupTagViewProvider(obj.ViewObject)
FreeCAD.ActiveDocument.commitTransaction()
obj.ViewObject.startEditing()
obj.ViewObject.Document.setEdit(obj.ViewObject, 0)
return obj

View File

@@ -965,7 +965,7 @@ def Create(res):
vobj = ViewProvider(obj.ViewObject, res)
FreeCAD.ActiveDocument.commitTransaction()
obj.ViewObject.startEditing()
obj.ViewObject.Document.setEdit(obj.ViewObject, 0)
return obj
FreeCAD.ActiveDocument.abortTransaction()
return None