Prevent multiple non-modal dialogs of the same kind from being opened
This commit is contained in:
@@ -899,7 +899,8 @@ class GuiMain(QMainWindow):
|
||||
def showBuildManuscriptDialog(self) -> None:
|
||||
"""Open the build manuscript dialog."""
|
||||
if SHARED.hasProject:
|
||||
dialog = GuiManuscript(self)
|
||||
if (dialog := SHARED.findTopLevelWidget(GuiManuscript)) is None:
|
||||
dialog = GuiManuscript(self)
|
||||
dialog.setModal(False)
|
||||
dialog.show()
|
||||
dialog.raise_()
|
||||
@@ -920,7 +921,8 @@ class GuiMain(QMainWindow):
|
||||
def showWritingStatsDialog(self) -> None:
|
||||
"""Open the session stats dialog."""
|
||||
if SHARED.hasProject:
|
||||
dialog = GuiWritingStats(self)
|
||||
if (dialog := SHARED.findTopLevelWidget(GuiWritingStats)) is None:
|
||||
dialog = GuiWritingStats(self)
|
||||
dialog.setModal(False)
|
||||
dialog.show()
|
||||
dialog.raise_()
|
||||
|
||||
Reference in New Issue
Block a user