Added a couple of flags to allow the build tool to be run without user interaction
This commit is contained in:
+23
-21
@@ -552,15 +552,16 @@ class GuiBuildNovel(QDialog):
|
|||||||
if not path.isdir(saveDir):
|
if not path.isdir(saveDir):
|
||||||
saveDir = self.mainConf.homePath
|
saveDir = self.mainConf.homePath
|
||||||
|
|
||||||
dlgOpt = QFileDialog.Options()
|
if self.mainConf.showGUI:
|
||||||
dlgOpt |= QFileDialog.DontUseNativeDialog
|
dlgOpt = QFileDialog.Options()
|
||||||
saveTo = QFileDialog.getSaveFileName(
|
dlgOpt |= QFileDialog.DontUseNativeDialog
|
||||||
self, "Save Document As", savePath, options=dlgOpt
|
saveTo = QFileDialog.getSaveFileName(
|
||||||
)
|
self, "Save Document As", savePath, options=dlgOpt
|
||||||
if saveTo[0]:
|
)
|
||||||
savePath = saveTo[0]
|
if saveTo[0]:
|
||||||
else:
|
savePath = saveTo[0]
|
||||||
return False
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
self.mainConf.setLastPath(savePath)
|
self.mainConf.setLastPath(savePath)
|
||||||
|
|
||||||
@@ -635,18 +636,19 @@ class GuiBuildNovel(QDialog):
|
|||||||
errMsg = "Unknown format"
|
errMsg = "Unknown format"
|
||||||
|
|
||||||
# Report to user
|
# Report to user
|
||||||
if wSuccess:
|
if self.mainConf.showGUI:
|
||||||
self.theParent.makeAlert(
|
if wSuccess:
|
||||||
"%s file successfully written to:<br> %s" % (
|
self.theParent.makeAlert(
|
||||||
textFmt, savePath
|
"%s file successfully written to:<br> %s" % (
|
||||||
), nwAlert.INFO
|
textFmt, savePath
|
||||||
)
|
), nwAlert.INFO
|
||||||
else:
|
)
|
||||||
self.theParent.makeAlert(
|
else:
|
||||||
"Failed to write %s file. %s" % (
|
self.theParent.makeAlert(
|
||||||
textFmt, errMsg
|
"Failed to write %s file. %s" % (
|
||||||
), nwAlert.ERROR
|
textFmt, errMsg
|
||||||
)
|
), nwAlert.ERROR
|
||||||
|
)
|
||||||
|
|
||||||
return wSuccess
|
return wSuccess
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user