Remove some more test flags in the main code

This commit is contained in:
Veronica K. B. Olsen
2020-12-21 21:08:49 +01:00
parent 6ad132e12d
commit d008113eec
4 changed files with 32 additions and 34 deletions
+19 -21
View File
@@ -774,14 +774,13 @@ class GuiBuildNovel(QDialog):
if not os.path.isdir(saveDir):
saveDir = self.mainConf.homePath
if self.mainConf.showGUI:
dlgOpt = QFileDialog.Options()
dlgOpt |= QFileDialog.DontUseNativeDialog
savePath, _ = QFileDialog.getSaveFileName(
self, "Save Document As", savePath, options=dlgOpt
)
if not savePath:
return False
dlgOpt = QFileDialog.Options()
dlgOpt |= QFileDialog.DontUseNativeDialog
savePath, _ = QFileDialog.getSaveFileName(
self, "Save Document As", savePath, options=dlgOpt
)
if not savePath:
return False
self.mainConf.setLastPath(savePath)
@@ -887,19 +886,18 @@ class GuiBuildNovel(QDialog):
errMsg = "Unknown format"
# Report to user
if self.mainConf.showGUI:
if wSuccess:
self.theParent.makeAlert(
"%s file successfully written to:<br> %s" % (
textFmt, savePath
), nwAlert.INFO
)
else:
self.theParent.makeAlert(
"Failed to write %s file. %s" % (
textFmt, errMsg
), nwAlert.ERROR
)
if wSuccess:
self.theParent.makeAlert(
"%s file successfully written to:<br> %s" % (
textFmt, savePath
), nwAlert.INFO
)
else:
self.theParent.makeAlert(
"Failed to write %s file. %s" % (
textFmt, errMsg
), nwAlert.ERROR
)
return wSuccess
+10 -11
View File
@@ -971,17 +971,16 @@ class GuiMain(QMainWindow):
logger.error(msgLine)
# Popup
if self.mainConf.showGUI:
msgBox = QMessageBox()
if theLevel == nwAlert.INFO:
msgBox.information(self, "Information", popMsg)
elif theLevel == nwAlert.WARN:
msgBox.warning(self, "Warning", popMsg)
elif theLevel == nwAlert.ERROR:
msgBox.critical(self, "Error", popMsg)
elif theLevel == nwAlert.BUG:
popMsg += "<br>This is a bug!"
msgBox.critical(self, "Internal Error", popMsg)
msgBox = QMessageBox()
if theLevel == nwAlert.INFO:
msgBox.information(self, "Information", popMsg)
elif theLevel == nwAlert.WARN:
msgBox.warning(self, "Warning", popMsg)
elif theLevel == nwAlert.ERROR:
msgBox.critical(self, "Error", popMsg)
elif theLevel == nwAlert.BUG:
popMsg += "<br>This is a bug!"
msgBox.critical(self, "Internal Error", popMsg)
return