From 6687ff2fd9569aaefc72a72f3b7b79a0a61caa49 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Tue, 4 Sep 2018 20:40:03 -0700 Subject: [PATCH] Select potential base if it is the only candidate for a base model --- src/Mod/Path/PathScripts/PathJobDlg.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathJobDlg.py b/src/Mod/Path/PathScripts/PathJobDlg.py index b5caba8f35..faa20df3ba 100644 --- a/src/Mod/Path/PathScripts/PathJobDlg.py +++ b/src/Mod/Path/PathScripts/PathJobDlg.py @@ -77,14 +77,18 @@ class JobCreate: expandTwoDs = False expandJobs = False index = 0 - for base in sorted(PathJob.ObjectJob.baseCandidates(), key=lambda o: o.Label): + candidates = sorted(PathJob.ObjectJob.baseCandidates(), key=lambda o: o.Label) + for base in candidates: PathLog.track(base.Label) if not base in xxx and not PathJob.isResourceClone(job, base, None) and not hasattr(base, 'StockType'): PathLog.track('base', base.Label) item = QtGui.QTreeWidgetItem([base.Label]) item.setData(0, self.DataObject, base) sel = base.Label in selected - item.setCheckState(0, QtCore.Qt.CheckState.Checked if sel else QtCore.Qt.CheckState.Unchecked) + if sel or (1 == len(candidates) and not selected): + item.setCheckState(0, QtCore.Qt.CheckState.Checked) + else: + item.setCheckState(0, QtCore.Qt.CheckState.Unchecked) if PathUtil.isSolid(base): self.itemsSolid.addChild(item) if sel: