Do not try to export after dismissing the dialog

I happened to notice the UI briefly locking up when testing my previous
changes on some of the Pandoc exporters. While the bigger mess I found
along the way is more than a little fix can handle, this stopgap measure
will at least stop us from running pandoc when it isn't needed.
This commit is contained in:
Jan Wester 2019-08-09 00:47:56 +02:00 committed by Curtis Gedak
parent 9317dc97d8
commit f6fa3e8375

View file

@ -75,8 +75,8 @@ class plainText(basicFormat):
s[varName] = filename
settingsWidget.settings["Output"] = s
# Save settings
settingsWidget.writeSettings()
# Save settings
settingsWidget.writeSettings()
return filename
@ -84,14 +84,15 @@ class plainText(basicFormat):
settings = settingsWidget.getSettings()
filename = self.getExportFilename(settingsWidget)
settingsWidget.writeSettings()
content = self.output(settingsWidget)
if not content:
print("Error: No content. Nothing saved.")
return
if filename:
settingsWidget.writeSettings()
content = self.output(settingsWidget)
if not content:
print("Error: No content. Nothing saved.")
return
with open(filename, "w", encoding='utf8') as f:
f.write(content)