Project manager dialog now lists recent projects and lets the user open one of these, or browse for a folder

This commit is contained in:
Veronica K. B. Olsen
2020-02-26 17:44:11 +01:00
parent 6867f38637
commit c688c66d5b
7 changed files with 205 additions and 21 deletions
+8 -1
View File
@@ -319,6 +319,7 @@ class NWProject():
return False
self.projMeta = path.join(self.projPath,"meta")
saveTime = time()
if not self._checkFolder(self.projPath): return
if not self._checkFolder(self.projMeta): return
@@ -330,7 +331,7 @@ class NWProject():
nwXML = etree.Element("novelWriterXML",attrib={
"appVersion" : str(nw.__version__),
"fileVersion" : "1.0",
"timeStamp" : datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
"timeStamp" : datetime.fromtimestamp(saveTime).strftime("%Y-%m-%d %H:%M:%S"),
})
# Save Project Meta
@@ -386,8 +387,14 @@ class NWProject():
rename(saveFile, backFile)
rename(tempFile, saveFile)
# Save project GUI options
self.optState.saveSettings()
# Update recent projects
self.mainConf.setRecent(self.projPath)
self.mainConf.updateRecentCache(self.projPath, self.projName, self.currWCount, saveTime)
self.mainConf.saveRecentCache()
self.theParent.setStatus("Saved Project: %s" % self.projName)
self.setProjectChanged(False)