Merge branch 'main' into feature/status_shapes
This commit is contained in:
@@ -303,25 +303,21 @@ class GuiManuscript(QDialog):
|
||||
@pyqtSlot()
|
||||
def _editSelectedBuild(self) -> None:
|
||||
"""Edit the currently selected build settings entry."""
|
||||
build = self._getSelectedBuild()
|
||||
if build is not None:
|
||||
if build := self._getSelectedBuild():
|
||||
self._openSettingsDialog(build)
|
||||
return
|
||||
|
||||
@pyqtSlot("QListWidgetItem*", "QListWidgetItem*")
|
||||
def _updateBuildDetails(self, current: QListWidgetItem, previous: QListWidgetItem) -> None:
|
||||
"""Process change of build selection to update the details."""
|
||||
if isinstance(current, QListWidgetItem):
|
||||
build = self._builds.getBuild(current.data(self.D_KEY))
|
||||
if build is not None:
|
||||
self.buildDetails.updateInfo(build)
|
||||
if current and (build := self._builds.getBuild(current.data(self.D_KEY))):
|
||||
self.buildDetails.updateInfo(build)
|
||||
return
|
||||
|
||||
@pyqtSlot()
|
||||
def _deleteSelectedBuild(self) -> None:
|
||||
"""Delete the currently selected build settings entry."""
|
||||
build = self._getSelectedBuild()
|
||||
if build is not None:
|
||||
if build := self._getSelectedBuild():
|
||||
if SHARED.question(self.tr("Delete build '{0}'?".format(build.name))):
|
||||
self._builds.removeBuild(build.buildID)
|
||||
self._updateBuildsList()
|
||||
@@ -332,8 +328,7 @@ class GuiManuscript(QDialog):
|
||||
"""Process new build settings from the settings dialog."""
|
||||
self._builds.setBuild(build)
|
||||
self._updateBuildItem(build)
|
||||
current = self.buildList.currentItem()
|
||||
if isinstance(current, QListWidgetItem) and current.data(self.D_KEY) == build.buildID:
|
||||
if (current := self.buildList.currentItem()) and current.data(self.D_KEY) == build.buildID:
|
||||
self._updateBuildDetails(current, current)
|
||||
return
|
||||
|
||||
@@ -342,8 +337,7 @@ class GuiManuscript(QDialog):
|
||||
"""Run the document builder on the current build settings for
|
||||
the preview widget.
|
||||
"""
|
||||
build = self._getSelectedBuild()
|
||||
if build is None:
|
||||
if not (build := self._getSelectedBuild()):
|
||||
return
|
||||
|
||||
docBuild = NWBuildDocument(SHARED.project, build)
|
||||
@@ -383,8 +377,7 @@ class GuiManuscript(QDialog):
|
||||
@pyqtSlot()
|
||||
def _buildManuscript(self) -> None:
|
||||
"""Open the build dialog and build the manuscript."""
|
||||
build = self._getSelectedBuild()
|
||||
if isinstance(build, BuildSettings):
|
||||
if build := self._getSelectedBuild():
|
||||
dlgBuild = GuiManuscriptBuild(self, build)
|
||||
dlgBuild.exec()
|
||||
|
||||
|
||||
@@ -560,7 +560,7 @@ class _NewProjectForm(QWidget):
|
||||
def __init__(self, parent: QWidget) -> None:
|
||||
super().__init__(parent=parent)
|
||||
|
||||
self._basePath = CONFIG.lastPath()
|
||||
self._basePath = CONFIG.homePath()
|
||||
self._fillMode = self.FILL_BLANK
|
||||
self._copyPath = None
|
||||
|
||||
@@ -632,7 +632,7 @@ class _NewProjectForm(QWidget):
|
||||
|
||||
self.numChapters = NSpinBox(self)
|
||||
self.numChapters.setRange(0, 200)
|
||||
self.numChapters.setValue(5)
|
||||
self.numChapters.setValue(0)
|
||||
self.numChapters.setToolTip(self.tr("Set to 0 to only add scenes"))
|
||||
|
||||
self.chapterBox = NWrappedWidgetBox(
|
||||
@@ -642,7 +642,7 @@ class _NewProjectForm(QWidget):
|
||||
|
||||
self.numScenes = NSpinBox(self)
|
||||
self.numScenes.setRange(0, 200)
|
||||
self.numScenes.setValue(5)
|
||||
self.numScenes.setValue(0)
|
||||
|
||||
self.sceneBox = NWrappedWidgetBox(
|
||||
self.tr("Add {0} scene documents (to each chapter)"), self.numScenes
|
||||
@@ -742,7 +742,6 @@ class _NewProjectForm(QWidget):
|
||||
):
|
||||
self._basePath = Path(projDir)
|
||||
self._updateProjPath()
|
||||
CONFIG.setLastPath(self._basePath)
|
||||
return
|
||||
|
||||
@pyqtSlot()
|
||||
|
||||
Reference in New Issue
Block a user