From 293ac5526291201b2ab65138503d06d38fdb6d91 Mon Sep 17 00:00:00 2001 From: markus Date: Tue, 2 Oct 2018 19:34:36 -0700 Subject: [PATCH] Fixed path model double click --- src/Mod/Path/PathScripts/PathIconViewProvider.py | 5 +++-- src/Mod/Path/PathScripts/PathJobGui.py | 7 +++++++ src/Mod/Path/PathScripts/PathUtils.py | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathIconViewProvider.py b/src/Mod/Path/PathScripts/PathIconViewProvider.py index 15ce108e73..5c52f494d6 100644 --- a/src/Mod/Path/PathScripts/PathIconViewProvider.py +++ b/src/Mod/Path/PathScripts/PathIconViewProvider.py @@ -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): diff --git a/src/Mod/Path/PathScripts/PathJobGui.py b/src/Mod/Path/PathScripts/PathJobGui.py index 4ce7d67871..6d09bfaaba 100644 --- a/src/Mod/Path/PathScripts/PathJobGui.py +++ b/src/Mod/Path/PathScripts/PathJobGui.py @@ -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(): diff --git a/src/Mod/Path/PathScripts/PathUtils.py b/src/Mod/Path/PathScripts/PathUtils.py index c9ebf0f960..33946a77c3 100644 --- a/src/Mod/Path/PathScripts/PathUtils.py +++ b/src/Mod/Path/PathScripts/PathUtils.py @@ -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