mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-06-28 19:20:40 +12:00
9317dc97d8
According to issue #608 we were silently overwriting files when there was a suffix being generated for a chosen export filename when one was missing to begin with. Unfortunately, this helpful feature avoids all the conveniences offered by QFileDialog in regards to alerting the user to overwriting an existing file. Worse still, this feature already exists in QFileDialog and the native APIs it can rely on. This patch reimplements QFileDialog.getSaveFileName to allow the use of the default suffix feature as functions.getSaveFileNameWithSuffix and removes most of the magic involved with the old solution.
25 lines
683 B
Python
25 lines
683 B
Python
#!/usr/bin/env python
|
|
# --!-- coding: utf8 --!--
|
|
from manuskript.exporter.pandoc.abstractPlainText import abstractPlainText
|
|
|
|
|
|
class abstractOutput(abstractPlainText):
|
|
name = "SUBCLASSME"
|
|
description = "SUBCLASSME"
|
|
exportVarName = "SUBCLASSME"
|
|
toFormat = "SUBCLASSME"
|
|
icon = "SUBCLASSME"
|
|
exportFilter = "SUBCLASSME"
|
|
exportDefaultSuffix = ".SUBCLASSME"
|
|
requires = {
|
|
"Settings": True,
|
|
"Preview": False,
|
|
}
|
|
|
|
def export(self, settingsWidget):
|
|
filename = self.getExportFilename(settingsWidget)
|
|
settingsWidget.writeSettings()
|
|
if filename:
|
|
content = self.output(settingsWidget, outputfile=filename)
|
|
|