fixes 6114

replaces DlgJobChooser with QInputDialog.
This commit is contained in:
sliptonic
2022-03-07 17:46:02 -06:00
parent bda12907de
commit 51b9d40010
4 changed files with 26 additions and 84 deletions

View File

@@ -44,6 +44,8 @@ LOG_MODULE = PathLog.thisModule()
PathLog.setLevel(PathLog.Level.INFO, LOG_MODULE)
translate = FreeCAD.Qt.translate
class _TempObject:
Path = None
Name = "Fixture"
@@ -241,6 +243,7 @@ class CommandPathPost:
job = None
else:
job = None
if job is None:
targetlist = []
for o in FreeCAD.ActiveDocument.Objects:
@@ -249,13 +252,12 @@ class CommandPathPost:
targetlist.append(o.Label)
PathLog.debug("Possible post objects: {}".format(targetlist))
if len(targetlist) > 1:
form = FreeCADGui.PySideUic.loadUi(":/panels/DlgJobChooser.ui")
form.cboProject.addItems(targetlist)
r = form.exec_()
if r is False:
jobname, result = QtGui.QInputDialog.getItem(
None, translate("Path", "Choose a Path Job"), None, targetlist
)
if result is False:
return
else:
jobname = form.cboProject.currentText()
else:
jobname = targetlist[0]
job = FreeCAD.ActiveDocument.getObject(jobname)