Fix duplicate tool dialogs issue

This commit is contained in:
Veronica Berglyd Olsen
2024-06-11 00:53:50 +02:00
parent cc61c5321e
commit 69cd443999
+4 -2
View File
@@ -797,7 +797,8 @@ class GuiMain(QMainWindow):
def showBuildManuscriptDialog(self) -> None:
"""Open the build manuscript dialog."""
if SHARED.hasProject:
dialog = GuiManuscript(self)
if not (dialog := SHARED.findTopLevelWidget(GuiManuscript)):
dialog = GuiManuscript(self)
dialog.activateDialog()
dialog.loadContent()
return
@@ -815,7 +816,8 @@ class GuiMain(QMainWindow):
def showWritingStatsDialog(self) -> None:
"""Open the session stats dialog."""
if SHARED.hasProject:
dialog = GuiWritingStats(self)
if not (dialog := SHARED.findTopLevelWidget(GuiWritingStats)):
dialog = GuiWritingStats(self)
dialog.activateDialog()
dialog.populateGUI()
return