Update home path and fix wrong setting fix for scene and chapter count on welcome dialog
This commit is contained in:
@@ -178,7 +178,7 @@ class BuildSettings:
|
||||
def __init__(self) -> None:
|
||||
self._name = ""
|
||||
self._uuid = str(uuid.uuid4())
|
||||
self._path = Path.home()
|
||||
self._path = CONFIG.homePath()
|
||||
self._build = ""
|
||||
self._order = 0
|
||||
self._format = nwBuildFmt.ODT
|
||||
@@ -220,7 +220,7 @@ class BuildSettings:
|
||||
"""The last used build path."""
|
||||
if self._path.is_dir():
|
||||
return self._path
|
||||
return Path.home()
|
||||
return CONFIG.homePath()
|
||||
|
||||
@property
|
||||
def lastBuildName(self) -> str:
|
||||
@@ -297,7 +297,7 @@ class BuildSettings:
|
||||
if isinstance(path, Path) and path.is_dir():
|
||||
self._path = path
|
||||
else:
|
||||
self._path = Path.home()
|
||||
self._path = CONFIG.homePath()
|
||||
self._changed = True
|
||||
return
|
||||
|
||||
|
||||
@@ -190,7 +190,7 @@ class GuiWordList(QDialog):
|
||||
))
|
||||
ffilter = formatFileFilter(["*.txt", "*"])
|
||||
path, _ = QFileDialog.getOpenFileName(
|
||||
self, self.tr("Import File"), str(Path.home()), filter=ffilter
|
||||
self, self.tr("Import File"), str(CONFIG.homePath()), filter=ffilter
|
||||
)
|
||||
if path:
|
||||
try:
|
||||
@@ -207,7 +207,7 @@ class GuiWordList(QDialog):
|
||||
def _exportWords(self) -> None:
|
||||
"""Export words to file."""
|
||||
path, _ = QFileDialog.getSaveFileName(
|
||||
self, self.tr("Export File"), str(Path.home())
|
||||
self, self.tr("Export File"), str(CONFIG.homePath())
|
||||
)
|
||||
if path:
|
||||
try:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -638,11 +638,11 @@ class _NewProjectForm(QWidget):
|
||||
self.chapterBox = NWrappedWidgetBox(
|
||||
self.tr("Add {0} chapter documents"), self.numChapters
|
||||
)
|
||||
self.chapterBox.addStretch(0)
|
||||
self.chapterBox.addStretch(1)
|
||||
|
||||
self.numScenes = NSpinBox(self)
|
||||
self.numScenes.setRange(0, 200)
|
||||
self.numScenes.setValue(3)
|
||||
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