From e2b62fc9f6d6f306ffdf991683783afe2bd12528 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Mon, 26 Apr 2021 18:22:16 +0200 Subject: [PATCH] Fix alternative save path in build, and also add in project wizard --- .gitignore | 1 + nw/tools/build.py | 4 ++-- nw/tools/projwizard.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 9260acd3..7873a701 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,4 @@ ToC.txt # Coverage /.coverage +/coverage.* diff --git a/nw/tools/build.py b/nw/tools/build.py index 58526af5..692498c8 100644 --- a/nw/tools/build.py +++ b/nw/tools/build.py @@ -853,10 +853,10 @@ class GuiBuildNovel(QDialog): cleanName = makeFileNameSafe(self.theProject.projName) fileName = "%s.%s" % (cleanName, fileExt) saveDir = self.mainConf.lastPath - savePath = os.path.join(saveDir, fileName) if not os.path.isdir(saveDir): - saveDir = self.mainConf.homePath + saveDir = os.path.expanduser("~") + savePath = os.path.join(saveDir, fileName) savePath, _ = QFileDialog.getSaveFileName( self, self.tr("Save Document As"), savePath ) diff --git a/nw/tools/projwizard.py b/nw/tools/projwizard.py index 81b885e8..a5bedcc6 100644 --- a/nw/tools/projwizard.py +++ b/nw/tools/projwizard.py @@ -210,7 +210,7 @@ class ProjWizardFolderPage(QWizardPage): """ lastPath = self.mainConf.lastPath if not os.path.isdir(lastPath): - lastPath = "" + lastPath = os.path.expanduser("~") projDir = QFileDialog.getExistingDirectory( self, self.tr("Select Project Folder"), lastPath, options=QFileDialog.ShowDirsOnly