Improve build class test
This commit is contained in:
+18
-19
@@ -848,26 +848,21 @@ class GuiBuildNovel(QDialog):
|
||||
# Generate File Name
|
||||
# ==================
|
||||
|
||||
if fileExt:
|
||||
cleanName = makeFileNameSafe(self.theProject.projName)
|
||||
fileName = "%s.%s" % (cleanName, fileExt)
|
||||
saveDir = self.mainConf.lastPath
|
||||
if not os.path.isdir(saveDir):
|
||||
saveDir = os.path.expanduser("~")
|
||||
|
||||
cleanName = makeFileNameSafe(self.theProject.projName)
|
||||
fileName = "%s.%s" % (cleanName, fileExt)
|
||||
saveDir = self.mainConf.lastPath
|
||||
if not os.path.isdir(saveDir):
|
||||
saveDir = os.path.expanduser("~")
|
||||
|
||||
savePath = os.path.join(saveDir, fileName)
|
||||
savePath, _ = QFileDialog.getSaveFileName(
|
||||
self, self.tr("Save Document As"), savePath
|
||||
)
|
||||
if not savePath:
|
||||
return False
|
||||
|
||||
self.mainConf.setLastPath(savePath)
|
||||
|
||||
else:
|
||||
savePath = os.path.join(saveDir, fileName)
|
||||
savePath, _ = QFileDialog.getSaveFileName(
|
||||
self, self.tr("Save Document As"), savePath
|
||||
)
|
||||
if not savePath:
|
||||
return False
|
||||
|
||||
self.mainConf.setLastPath(savePath)
|
||||
|
||||
# Build and Write
|
||||
# ===============
|
||||
|
||||
@@ -995,9 +990,13 @@ class GuiBuildNovel(QDialog):
|
||||
errMsg - str(e)
|
||||
|
||||
else:
|
||||
errMsg = self.tr("Unknown format")
|
||||
# If the if statements above and here match, it should not
|
||||
# be possible to reach this else statement.
|
||||
return False # pragma: no cover
|
||||
|
||||
# Report to User
|
||||
# ==============
|
||||
|
||||
# Report to user
|
||||
if wSuccess:
|
||||
self.theParent.makeAlert(
|
||||
"%s<br>%s" % (
|
||||
|
||||
Reference in New Issue
Block a user