Update current usage of last path

This commit is contained in:
Veronica Berglyd Olsen
2024-06-16 00:22:38 +02:00
parent 2a99cafbf2
commit 928a116666
5 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -652,7 +652,7 @@ class GuiMain(QMainWindow):
logger.error("No project open")
return False
lastPath = CONFIG.lastPath()
lastPath = CONFIG.lastPath("import")
ffilter = formatFileFilter(["*.txt", "*.md", "*.nwd", "*"])
loadFile, _ = QFileDialog.getOpenFileName(
self, self.tr("Import File"), str(lastPath), filter=ffilter
@@ -667,7 +667,7 @@ class GuiMain(QMainWindow):
try:
with open(loadFile, mode="rt", encoding="utf-8") as inFile:
text = inFile.read()
CONFIG.setLastPath(loadFile)
CONFIG.setLastPath("import", loadFile)
except Exception as exc:
SHARED.error(self.tr(
"Could not read file. The file must be an existing text file."