Release 2.0 RC 2 (#1231)
This commit is contained in:
@@ -74,6 +74,8 @@ opened, a request to update the file format will show up.
|
||||
reader class is capable of reading all file formats that have been used thus far. The various
|
||||
data classes have been improved, and a new XML file formart version 1.5 added. Issue #1189.
|
||||
PRs #1221 and #1232.
|
||||
* The index is now automatically rebuilt when the project file format is updated. Issue #1235.
|
||||
PR #1236.
|
||||
* The project folder on disk is now wrapped in a storage class that the project accesses files
|
||||
through. It also handles lock files and archiving used for backup. The change is in preparation
|
||||
for adding a potential single file format. Issue #1222. PR #1225.
|
||||
@@ -83,6 +85,8 @@ opened, a request to update the file format will show up.
|
||||
Issue #1152. PR #1225.
|
||||
* The Config class has been refactored extensively and now also uses pathlib for all paths. Tests
|
||||
are also switched to using pathlib. Issue #1224. PRs #1228 and #1229.
|
||||
* The updating of tree order method of the project tree class has been updated for better
|
||||
performance. PR #1236.
|
||||
|
||||
----
|
||||
|
||||
|
||||
@@ -74,7 +74,6 @@ class NWProject(QObject):
|
||||
# Project Status
|
||||
self._projOpened = 0 # The time stamp of when the project file was opened
|
||||
self._projChanged = False # The project has unsaved changes
|
||||
self._projAltered = False # The project has been altered this session
|
||||
self._lockedBy = None # Data on which computer has the project open
|
||||
self._projFiles = [] # A list of all files in the content folder on load
|
||||
|
||||
@@ -118,10 +117,6 @@ class NWProject(QObject):
|
||||
def projChanged(self):
|
||||
return self._projChanged
|
||||
|
||||
@property
|
||||
def projAltered(self):
|
||||
return self._projAltered
|
||||
|
||||
@property
|
||||
def projFiles(self):
|
||||
return self._projFiles
|
||||
@@ -236,7 +231,6 @@ class NWProject(QObject):
|
||||
# Project Status
|
||||
self._projOpened = 0
|
||||
self._projChanged = False
|
||||
self._projAltered = False
|
||||
|
||||
# Project Tree
|
||||
self._storage.clear()
|
||||
@@ -375,7 +369,6 @@ class NWProject(QObject):
|
||||
|
||||
self.updateWordCounts()
|
||||
self._projOpened = time()
|
||||
self._projAltered = False
|
||||
|
||||
self._storage.writeLockFile()
|
||||
self.setProjectChanged(False)
|
||||
@@ -559,9 +552,6 @@ class NWProject(QObject):
|
||||
if isinstance(value, bool):
|
||||
self._projChanged = value
|
||||
self.projectStatusChanged.emit(self._projChanged)
|
||||
if value:
|
||||
# If we've changed the project at all, this should be True
|
||||
self._projAltered = True
|
||||
return self._projChanged
|
||||
|
||||
##
|
||||
|
||||
+14
-16
@@ -404,22 +404,20 @@ class GuiMain(QMainWindow):
|
||||
if self.docEditor.docChanged():
|
||||
self.saveDocument()
|
||||
|
||||
if self.theProject.projAltered:
|
||||
saveOK = self.saveProject()
|
||||
doBackup = False
|
||||
if self.theProject.data.doBackup and self.mainConf.backupOnClose:
|
||||
doBackup = True
|
||||
if self.mainConf.askBeforeBackup:
|
||||
msgYes = self.askQuestion(
|
||||
self.tr("Backup Project"),
|
||||
self.tr("Backup the current project?")
|
||||
)
|
||||
if not msgYes:
|
||||
doBackup = False
|
||||
if doBackup:
|
||||
self.theProject.backupProject(False)
|
||||
else:
|
||||
saveOK = True
|
||||
saveOK = self.saveProject()
|
||||
doBackup = False
|
||||
if self.theProject.data.doBackup and self.mainConf.backupOnClose:
|
||||
doBackup = True
|
||||
if self.mainConf.askBeforeBackup:
|
||||
msgYes = self.askQuestion(
|
||||
self.tr("Backup Project"),
|
||||
self.tr("Backup the current project?")
|
||||
)
|
||||
if not msgYes:
|
||||
doBackup = False
|
||||
|
||||
if doBackup:
|
||||
self.theProject.backupProject(False)
|
||||
|
||||
if saveOK:
|
||||
self.closeDocument()
|
||||
|
||||
@@ -516,11 +516,9 @@ def testCoreProject_Methods(monkeypatch, mockGUI, fncPath, mockRnd):
|
||||
|
||||
# Spell check
|
||||
theProject.setProjectChanged(False)
|
||||
theProject._projAltered = False
|
||||
theProject.data.setSpellCheck(True)
|
||||
theProject.data.setSpellCheck(False)
|
||||
assert theProject.projChanged is True
|
||||
assert theProject.projAltered is True
|
||||
assert theProject.projOpened > 0
|
||||
|
||||
# Spell language
|
||||
|
||||
Reference in New Issue
Block a user