Finished heading formats and file name in export

This commit is contained in:
Veronica K. B. Olsen
2019-10-19 13:01:35 +02:00
parent 16f1b03781
commit 722a00bae3
3 changed files with 125 additions and 53 deletions
+24 -8
View File
@@ -73,21 +73,37 @@ class TextFile():
self.theConv.setWordWrap(0)
return
def setTitleFormat(self, fmtTitle):
self.theConv.setTitleFormat(fmtTitle)
return
def setChapterFormat(self, fmtChapter):
self.theConv.setChapterFormat(fmtChapter)
return
def setUnNumberedFormat(self, fmtUnNum):
self.theConv.setUnNumberedFormat(fmtUnNum)
return
def setSceneFormat(self, fmtScene):
self.theConv.setSceneFormat(fmtScene)
return
def setSectionFormat(self, fmtSection):
self.theConv.setSectionFormat(fmtSection)
return
##
# Core Methods
##
def openFile(self, saveTo, baseName):
def openFile(self, filePath):
fileName = "%s.%s" % (baseName.strip(),self.fileExt)
filePath = path.join(saveTo,fileName)
self.fileName = fileName
if path.isfile(filePath)and self.mainConf.showGUI:
self.fileName = path.basename(filePath)
if path.isfile(filePath) and self.mainConf.showGUI:
msgBox = QMessageBox()
msgRes = msgBox.question(
self.theParent, "Overwrite", ("File '%s' already exists.<br>Do you want to overwrite it?" % fileName)
self.theParent, "Overwrite", ("File '%s' already exists.<br>Do you want to overwrite it?" % self.fileName)
)
if msgRes != QMessageBox.Yes:
return False