Performance improvements to Build and Writing Stats, and making sure only one of each can be opened

This commit is contained in:
Veronica K. B. Olsen
2020-10-06 20:28:00 +02:00
parent 23d5e33864
commit 8d66875ebc
4 changed files with 56 additions and 17 deletions
+15 -2
View File
@@ -48,6 +48,7 @@ from nw.gui import (
)
from nw.core import NWProject, NWDoc, NWIndex
from nw.constants import nwItemType, nwItemClass, nwAlert
from nw.common import getGuiItem
logger = logging.getLogger(__name__)
@@ -816,9 +817,15 @@ class GuiMain(QMainWindow):
logger.error("No project open")
return
dlgBuild = GuiBuildNovel(self, self.theProject)
dlgBuild = getGuiItem("GuiBuildNovel")
if dlgBuild is None:
dlgBuild = GuiBuildNovel(self, self.theProject)
dlgBuild.setModal(False)
dlgBuild.show()
qApp.processEvents()
dlgBuild.viewCachedDoc()
return
def showWritingStatsDialog(self):
@@ -828,9 +835,15 @@ class GuiMain(QMainWindow):
logger.error("No project open")
return
dlgStats = GuiWritingStats(self, self.theProject)
dlgStats = getGuiItem("GuiWritingStats")
if dlgStats is None:
dlgStats = GuiWritingStats(self, self.theProject)
dlgStats.setModal(False)
dlgStats.show()
qApp.processEvents()
dlgStats.populateGUI()
return
def showAboutNWDialog(self):