Fix a potential segfault issue in main gui and add auto-build on open manuscript tool
This commit is contained in:
@@ -800,8 +800,7 @@ class GuiMain(QMainWindow):
|
||||
def showBuildManuscriptDialog(self) -> None:
|
||||
"""Open the build manuscript dialog."""
|
||||
if SHARED.hasProject:
|
||||
if (dialog := SHARED.findTopLevelWidget(GuiManuscript)) is None:
|
||||
dialog = GuiManuscript(self)
|
||||
dialog = GuiManuscript(self)
|
||||
dialog.activateDialog()
|
||||
dialog.loadContent()
|
||||
return
|
||||
@@ -819,8 +818,7 @@ class GuiMain(QMainWindow):
|
||||
def showWritingStatsDialog(self) -> None:
|
||||
"""Open the session stats dialog."""
|
||||
if SHARED.hasProject:
|
||||
if (dialog := SHARED.findTopLevelWidget(GuiWritingStats)) is None:
|
||||
dialog = GuiWritingStats(self)
|
||||
dialog = GuiWritingStats(self)
|
||||
dialog.activateDialog()
|
||||
dialog.populateGUI()
|
||||
return
|
||||
|
||||
@@ -246,6 +246,7 @@ class GuiManuscript(NToolDialog):
|
||||
self._updateBuildsList()
|
||||
if selected in self._buildMap:
|
||||
self.buildList.setCurrentItem(self._buildMap[selected])
|
||||
QTimer.singleShot(200, self._generatePreview)
|
||||
|
||||
return
|
||||
|
||||
@@ -363,8 +364,8 @@ class GuiManuscript(NToolDialog):
|
||||
def _buildManuscript(self) -> None:
|
||||
"""Open the build dialog and build the manuscript."""
|
||||
if build := self._getSelectedBuild():
|
||||
dlgBuild = GuiManuscriptBuild(self, build)
|
||||
dlgBuild.exec()
|
||||
dialog = GuiManuscriptBuild(self, build)
|
||||
dialog.exec()
|
||||
|
||||
# After the build is done, save build settings changes
|
||||
if build.changed:
|
||||
|
||||
Reference in New Issue
Block a user