Make sure deleted documents are closed if open

This commit is contained in:
Veronica Berglyd Olsen
2024-11-21 22:24:34 +01:00
parent 7ed619cf2e
commit e0b27317f3
3 changed files with 8 additions and 2 deletions
+3 -1
View File
@@ -175,10 +175,12 @@ class SharedData(QObject):
logger.debug("Thread Pool Max Count: %d", QThreadPool.globalInstance().maxThreadCount())
return
def closeEditor(self, tHandle: str | None = None) -> None:
def closeDocument(self, tHandle: str | None = None) -> None:
"""Close the document editor, optionally a specific document."""
if tHandle is None or tHandle == self.mainGui.docEditor.docHandle:
self.mainGui.closeDocument()
if tHandle is None or tHandle == self.mainGui.docViewer.docHandle:
self.mainGui.closeViewerPanel()
return
def saveEditor(self, tHandle: str | None = None) -> None: