Remember new project folder last used path (#1930)

This commit is contained in:
Veronica Berglyd Olsen
2024-06-16 00:31:02 +02:00
parent 928a116666
commit ea247c5814
2 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -221,7 +221,6 @@ class GuiWelcome(NDialog):
def _browseForProject(self) -> None:
"""Browse for a project to open."""
if path := SHARED.getProjectPath(self, path=CONFIG.lastPath("project"), allowZip=False):
CONFIG.setLastPath("project", path)
self._openProjectPath(path)
return
@@ -550,7 +549,7 @@ class _NewProjectForm(QWidget):
def __init__(self, parent: QWidget) -> None:
super().__init__(parent=parent)
self._basePath = CONFIG.homePath()
self._basePath = CONFIG.lastPath("project")
self._fillMode = self.FILL_BLANK
self._copyPath = None
@@ -726,12 +725,13 @@ class _NewProjectForm(QWidget):
@pyqtSlot()
def _doBrowse(self) -> None:
"""Select a project folder."""
if projDir := QFileDialog.getExistingDirectory(
if path := QFileDialog.getExistingDirectory(
self, self.tr("Select Project Folder"),
str(self._basePath), options=QFileDialog.Option.ShowDirsOnly
):
self._basePath = Path(projDir)
self._basePath = Path(path)
self._updateProjPath()
CONFIG.setLastPath("project", path)
return
@pyqtSlot()