Improved coverage of dialogs tools, and import document feature

This commit is contained in:
Veronica K. B. Olsen
2020-09-28 20:29:52 +02:00
parent fc096ddb0b
commit 678a31855f
5 changed files with 77 additions and 53 deletions
+12 -17
View File
@@ -594,15 +594,12 @@ class GuiMain(QMainWindow):
return False
if not self.docEditor.isEmpty():
if self.mainConf.showGUI:
msgBox = QMessageBox()
msgRes = msgBox.question(self, "Import Document", (
"Importing the file will overwrite the current content of the document. "
"Do you want to proceed?"
))
if msgRes != QMessageBox.Yes:
return False
else:
msgBox = QMessageBox()
msgRes = msgBox.question(self, "Import Document", (
"Importing the file will overwrite the current content of the document. "
"Do you want to proceed?"
))
if msgRes != QMessageBox.Yes:
return False
self.docEditor.replaceText(theText)
@@ -612,18 +609,16 @@ class GuiMain(QMainWindow):
def mergeDocuments(self):
"""Merge multiple documents to one single new document.
"""
if self.mainConf.showGUI:
dlgMerge = GuiDocMerge(self, self.theProject)
dlgMerge.exec_()
return True
dlgMerge = GuiDocMerge(self, self.theProject)
dlgMerge.exec_()
return
def splitDocument(self):
"""Split a single document into multiple documents.
"""
if self.mainConf.showGUI:
dlgSplit = GuiDocSplit(self, self.theProject)
dlgSplit.exec_()
return True
dlgSplit = GuiDocSplit(self, self.theProject)
dlgSplit.exec_()
return
def passDocumentAction(self, theAction):
"""Pass on document action theAction to the document viewer if