Fixed path model double click

This commit is contained in:
markus
2018-10-02 19:34:36 -07:00
committed by wmayer
parent 868baa6dd2
commit 293ac55262
3 changed files with 11 additions and 3 deletions

View File

@@ -42,6 +42,7 @@ class ViewProvider(object):
def __init__(self, vobj, icon):
self.icon = icon
self.attach(vobj)
vobj.Proxy = self
def attach(self, vobj):
@@ -88,12 +89,12 @@ def Attach(vobj, name):
'''Attach(vobj, name) ... attach the appropriate view provider to the view object.
If no view provider was registered for the given name a default IconViewProvider is created.'''
PathLog.track(name)
PathLog.track(vobj.Object.Label, name)
global _factory
for key,value in PathUtil.keyValueIter(_factory):
if key == name:
return value(vobj, name)
PathLog.track(name, 'PathIconViewProvider')
PathLog.track(vobj.Object.Label, name, 'PathIconViewProvider')
return ViewProvider(vobj, name)
def RegisterViewProvider(name, provider):

View File

@@ -65,6 +65,13 @@ def _OpenCloseResourceEditor(obj, vobj, edit):
job.ViewObject.Proxy.editObject(obj)
else:
job.ViewObject.Proxy.uneditObject(obj)
else:
missing = 'Job'
if job:
missing = 'ViewObject'
if job.ViewObject:
missing = 'Proxy'
PathLog.warning("Cannot edit %s - no %s" % (obj.Label, missing))
@contextmanager
def selectionEx():

View File

@@ -467,7 +467,7 @@ def findParentJob(obj):
for i in obj.InList:
if hasattr(i, 'Proxy') and isinstance(i.Proxy, PathScripts.PathJob.ObjectJob):
return i
if i.TypeId == "Path::FeaturePython" or i.TypeId == "Path::FeatureCompoundPython":
if i.TypeId == "Path::FeaturePython" or i.TypeId == "Path::FeatureCompoundPython" or i.TypeId == "App::DocumentObjectGroup":
grandParent = findParentJob(i)
if grandParent is not None:
return grandParent