Fix for Path output file naming issues.

Use the fullPath name when opening dialog, handle cancel cleanly.

These changes fixes the output file file naming for me. Without it,
I just get the unprocessed substitution strings in the current working directory.
This commit is contained in:
Jon Escombe
2022-09-02 09:11:23 +01:00
parent 310880516a
commit 815c2f8fcf

View File

@@ -238,19 +238,21 @@ def resolveFileName(job, subpartname, sequencenumber):
if openDialog:
foo = QtGui.QFileDialog.getSaveFileName(
QtGui.QApplication.activeWindow(), "Output File", filename
QtGui.QApplication.activeWindow(), "Output File", fullPath
)
if foo[0]:
fullPath = foo[0]
else:
fullPath = None
# remove any unused substitution strings:
for s in validPathSubstitutions + validFilenameSubstitutions:
fullPath = fullPath.replace(f"%{s}", "")
if fullPath:
# remove any unused substitution strings:
for s in validPathSubstitutions + validFilenameSubstitutions:
fullPath = fullPath.replace(f"%{s}", "")
fullPath = os.path.normpath(fullPath)
PathLog.track(fullPath)
fullPath = os.path.normpath(fullPath)
PathLog.track(fullPath)
return fullPath
@@ -591,7 +593,7 @@ class CommandPathPost:
filenames.append(name)
PathLog.track(result, gcode, name)
if result is None:
if name is None:
success = False
else:
finalgcode += gcode