diff --git a/novelwriter/core/project.py b/novelwriter/core/project.py index 57f9432e..40828056 100644 --- a/novelwriter/core/project.py +++ b/novelwriter/core/project.py @@ -254,14 +254,6 @@ class NWProject(QObject): self.projContent = None self.projDict = None self.projFiles = [] - self._data.itemStatus.write(None, self.tr("New"), (100, 100, 100)) - self._data.itemStatus.write(None, self.tr("Note"), (200, 50, 0)) - self._data.itemStatus.write(None, self.tr("Draft"), (200, 150, 0)) - self._data.itemStatus.write(None, self.tr("Finished"), (50, 200, 0)) - self._data.itemImport.write(None, self.tr("New"), (100, 100, 100)) - self._data.itemImport.write(None, self.tr("Minor"), (200, 50, 0)) - self._data.itemImport.write(None, self.tr("Major"), (200, 150, 0)) - self._data.itemImport.write(None, self.tr("Main"), (50, 200, 0)) return @@ -294,6 +286,17 @@ class NWProject(QObject): return False self.clearProject() + + self._data.itemStatus.write(None, self.tr("New"), (100, 100, 100)) + self._data.itemStatus.write(None, self.tr("Note"), (200, 50, 0)) + self._data.itemStatus.write(None, self.tr("Draft"), (200, 150, 0)) + self._data.itemStatus.write(None, self.tr("Finished"), (50, 200, 0)) + + self._data.itemImport.write(None, self.tr("New"), (100, 100, 100)) + self._data.itemImport.write(None, self.tr("Minor"), (200, 50, 0)) + self._data.itemImport.write(None, self.tr("Major"), (200, 150, 0)) + self._data.itemImport.write(None, self.tr("Main"), (50, 200, 0)) + if not self.setProjectPath(projPath, newProject=True): return False @@ -859,15 +862,16 @@ class NWProject(QObject): """ return self._setStatusImport(newCols, delCols, self._data.itemImport) - def setProjectChanged(self, bValue): + def setProjectChanged(self, value): """Toggle the project changed flag, and propagate the information to the GUI statusbar. """ - self._projChanged = bValue - self.projectStatusChanged.emit(self._projChanged) - if bValue is True: - # If we've changed the project at all, this should be True - self._projAltered = True + 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 ## diff --git a/tests/reference/coreProject_NewCustomA_nwProject.nwx b/tests/reference/coreProject_NewCustomA_nwProject.nwx index 69987568..ca7b5891 100644 --- a/tests/reference/coreProject_NewCustomA_nwProject.nwx +++ b/tests/reference/coreProject_NewCustomA_nwProject.nwx @@ -1,5 +1,5 @@ - + Test Custom Test Novel @@ -32,106 +32,106 @@ - New - Note - Draft - Finished + New + Note + Draft + Finished - New - Minor - Major - Main + New + Minor + Major + Main - + - Novel + Novel - + - Title Page + Title Page - + - Chapter 1 + Chapter 1 - + - Scene 1.1 + Scene 1.1 - + - Scene 1.2 + Scene 1.2 - + - Scene 1.3 + Scene 1.3 - + - Chapter 2 + Chapter 2 - + - Scene 2.1 + Scene 2.1 - + - Scene 2.2 + Scene 2.2 - + - Scene 2.3 + Scene 2.3 - + - Chapter 3 + Chapter 3 - + - Scene 3.1 + Scene 3.1 - + - Scene 3.2 + Scene 3.2 - + - Scene 3.3 + Scene 3.3 - + - Plot + Plot - + - Main Plot + Main Plot - + - Characters + Characters - + - Protagonist + Protagonist - + - Locations + Locations - + - Main Location + Main Location - + - Archive + Archive - + - Trash + Trash diff --git a/tests/reference/coreProject_NewCustomB_nwProject.nwx b/tests/reference/coreProject_NewCustomB_nwProject.nwx index a4a5e280..404b0128 100644 --- a/tests/reference/coreProject_NewCustomB_nwProject.nwx +++ b/tests/reference/coreProject_NewCustomB_nwProject.nwx @@ -1,5 +1,5 @@ - + Test Custom Test Novel @@ -32,82 +32,82 @@ - New - Note - Draft - Finished + New + Note + Draft + Finished - New - Minor - Major - Main + New + Minor + Major + Main - + - Novel + Novel - + - Title Page + Title Page - + - Scene 1 + Scene 1 - + - Scene 2 + Scene 2 - + - Scene 3 + Scene 3 - + - Scene 4 + Scene 4 - + - Scene 5 + Scene 5 - + - Scene 6 + Scene 6 - + - Plot + Plot - + - Main Plot + Main Plot - + - Characters + Characters - + - Protagonist + Protagonist - + - Locations + Locations - + - Main Location + Main Location - + - Archive + Archive - + - Trash + Trash diff --git a/tests/reference/coreProject_NewFileFolder_nwProject.nwx b/tests/reference/coreProject_NewFileFolder_nwProject.nwx index e3d19827..646317f3 100644 --- a/tests/reference/coreProject_NewFileFolder_nwProject.nwx +++ b/tests/reference/coreProject_NewFileFolder_nwProject.nwx @@ -1,5 +1,5 @@ - + New Project New Novel @@ -76,15 +76,15 @@ New Scene - + Stuff - + Hello - + Jane diff --git a/tests/reference/coreProject_NewMinimal_nwProject.nwx b/tests/reference/coreProject_NewMinimal_nwProject.nwx index 7fcc9b61..15907d72 100644 --- a/tests/reference/coreProject_NewMinimal_nwProject.nwx +++ b/tests/reference/coreProject_NewMinimal_nwProject.nwx @@ -1,5 +1,5 @@ - + New Project None @@ -30,50 +30,50 @@ - New - Note - Draft - Finished + New + Note + Draft + Finished - New - Minor - Major - Main + New + Minor + Major + Main - + - Novel + Novel - + - Title Page + Title Page - + - New Chapter + New Chapter - + - New Scene + New Scene - + - Plot + Plot - + - Characters + Characters - + - Locations + Locations - + - Archive + Archive diff --git a/tests/reference/coreProject_NewRoot_nwProject.nwx b/tests/reference/coreProject_NewRoot_nwProject.nwx index d256a9a9..6aff4336 100644 --- a/tests/reference/coreProject_NewRoot_nwProject.nwx +++ b/tests/reference/coreProject_NewRoot_nwProject.nwx @@ -1,5 +1,5 @@ - + New Project New Novel @@ -76,35 +76,35 @@ New Scene - + Novel - + Plot - + Characters - + Locations - + Timeline - + Objects - + Custom - + Custom diff --git a/tests/reference/guiEditor_Main_Final_0000000000020.nwd b/tests/reference/guiEditor_Main_Final_0000000000010.nwd similarity index 71% rename from tests/reference/guiEditor_Main_Final_0000000000020.nwd rename to tests/reference/guiEditor_Main_Final_0000000000010.nwd index c0316819..bc255b88 100644 --- a/tests/reference/guiEditor_Main_Final_0000000000020.nwd +++ b/tests/reference/guiEditor_Main_Final_0000000000010.nwd @@ -1,5 +1,5 @@ %%~name: New Note -%%~path: 000000000000a/0000000000020 +%%~path: 000000000000a/0000000000010 %%~kind: CHARACTER/NOTE # Jane Doe diff --git a/tests/reference/guiEditor_Main_Final_0000000000021.nwd b/tests/reference/guiEditor_Main_Final_0000000000011.nwd similarity index 74% rename from tests/reference/guiEditor_Main_Final_0000000000021.nwd rename to tests/reference/guiEditor_Main_Final_0000000000011.nwd index 5dddd23b..99705061 100644 --- a/tests/reference/guiEditor_Main_Final_0000000000021.nwd +++ b/tests/reference/guiEditor_Main_Final_0000000000011.nwd @@ -1,5 +1,5 @@ %%~name: New Note -%%~path: 0000000000009/0000000000021 +%%~path: 0000000000009/0000000000011 %%~kind: PLOT/NOTE # Main Plot diff --git a/tests/reference/guiEditor_Main_Final_0000000000022.nwd b/tests/reference/guiEditor_Main_Final_0000000000012.nwd similarity index 74% rename from tests/reference/guiEditor_Main_Final_0000000000022.nwd rename to tests/reference/guiEditor_Main_Final_0000000000012.nwd index 092f832a..ea19dae5 100644 --- a/tests/reference/guiEditor_Main_Final_0000000000022.nwd +++ b/tests/reference/guiEditor_Main_Final_0000000000012.nwd @@ -1,5 +1,5 @@ %%~name: New Note -%%~path: 000000000000b/0000000000022 +%%~path: 000000000000b/0000000000012 %%~kind: WORLD/NOTE # Main Location diff --git a/tests/reference/guiEditor_Main_Final_nwProject.nwx b/tests/reference/guiEditor_Main_Final_nwProject.nwx index 69f7208c..e5c1a1ac 100644 --- a/tests/reference/guiEditor_Main_Final_nwProject.nwx +++ b/tests/reference/guiEditor_Main_Final_nwProject.nwx @@ -1,5 +1,5 @@ - + New Project New Novel @@ -68,7 +68,7 @@ Plot - + New Note @@ -76,7 +76,7 @@ Characters - + New Note @@ -84,11 +84,11 @@ World - + New Note - + Trash diff --git a/tests/test_core/test_core_item.py b/tests/test_core/test_core_item.py index df841aa2..02fe3f8f 100644 --- a/tests/test_core/test_core_item.py +++ b/tests/test_core/test_core_item.py @@ -25,7 +25,7 @@ from lxml import etree from PyQt5.QtGui import QIcon -from tools import C +from tools import C, buildTestProject from novelwriter.core.item import NWItem from novelwriter.core.project import NWProject @@ -33,10 +33,12 @@ from novelwriter.enum import nwItemClass, nwItemType, nwItemLayout @pytest.mark.core -def testCoreItem_Setters(mockGUI, mockRnd): +def testCoreItem_Setters(mockGUI, mockRnd, fncDir): """Test all the simple setters for the NWItem class. """ theProject = NWProject(mockGUI) + mockRnd.reset() + buildTestProject(theProject, fncDir) theItem = NWItem(theProject) statusKeys = ["s000000", "s000001", "s000002", "s000003"] @@ -192,11 +194,12 @@ def testCoreItem_Setters(mockGUI, mockRnd): @pytest.mark.core -def testCoreItem_Methods(mockGUI, mockRnd): +def testCoreItem_Methods(mockGUI, mockRnd, fncDir): """Test the simple methods of the NWItem class. """ - mockRnd.reset() theProject = NWProject(mockGUI) + mockRnd.reset() + buildTestProject(theProject, fncDir) theItem = NWItem(theProject) # Describe Me diff --git a/tests/test_core/test_core_project.py b/tests/test_core/test_core_project.py index 6075dbe9..66fa4082 100644 --- a/tests/test_core/test_core_project.py +++ b/tests/test_core/test_core_project.py @@ -263,14 +263,14 @@ def testCoreProject_NewRoot(fncDir, outDir, refDir, mockGUI, mockRnd): assert theProject.closeProject() is True assert theProject.openProject(projFile) is True - assert theProject.newRoot(nwItemClass.NOVEL) == "0000000000020" - assert theProject.newRoot(nwItemClass.PLOT) == "0000000000021" - assert theProject.newRoot(nwItemClass.CHARACTER) == "0000000000022" - assert theProject.newRoot(nwItemClass.WORLD) == "0000000000023" - assert theProject.newRoot(nwItemClass.TIMELINE) == "0000000000024" - assert theProject.newRoot(nwItemClass.OBJECT) == "0000000000025" - assert theProject.newRoot(nwItemClass.CUSTOM) == "0000000000026" - assert theProject.newRoot(nwItemClass.CUSTOM) == "0000000000027" + assert theProject.newRoot(nwItemClass.NOVEL) == "0000000000010" + assert theProject.newRoot(nwItemClass.PLOT) == "0000000000011" + assert theProject.newRoot(nwItemClass.CHARACTER) == "0000000000012" + assert theProject.newRoot(nwItemClass.WORLD) == "0000000000013" + assert theProject.newRoot(nwItemClass.TIMELINE) == "0000000000014" + assert theProject.newRoot(nwItemClass.OBJECT) == "0000000000015" + assert theProject.newRoot(nwItemClass.CUSTOM) == "0000000000016" + assert theProject.newRoot(nwItemClass.CUSTOM) == "0000000000017" assert theProject.projChanged is True assert theProject.saveProject() is True @@ -281,23 +281,23 @@ def testCoreProject_NewRoot(fncDir, outDir, refDir, mockGUI, mockRnd): assert theProject.projChanged is False # Delete the new items - assert theProject.removeItem("0000000000020") is True - assert theProject.removeItem("0000000000021") is True - assert theProject.removeItem("0000000000022") is True - assert theProject.removeItem("0000000000023") is True - assert theProject.removeItem("0000000000024") is True - assert theProject.removeItem("0000000000025") is True - assert theProject.removeItem("0000000000026") is True - assert theProject.removeItem("0000000000027") is True + assert theProject.removeItem("0000000000010") is True + assert theProject.removeItem("0000000000011") is True + assert theProject.removeItem("0000000000012") is True + assert theProject.removeItem("0000000000013") is True + assert theProject.removeItem("0000000000014") is True + assert theProject.removeItem("0000000000015") is True + assert theProject.removeItem("0000000000016") is True + assert theProject.removeItem("0000000000017") is True - assert "0000000000020" not in theProject.tree - assert "0000000000021" not in theProject.tree - assert "0000000000022" not in theProject.tree - assert "0000000000023" not in theProject.tree - assert "0000000000024" not in theProject.tree - assert "0000000000025" not in theProject.tree - assert "0000000000026" not in theProject.tree - assert "0000000000027" not in theProject.tree + assert "0000000000010" not in theProject.tree + assert "0000000000011" not in theProject.tree + assert "0000000000012" not in theProject.tree + assert "0000000000013" not in theProject.tree + assert "0000000000014" not in theProject.tree + assert "0000000000015" not in theProject.tree + assert "0000000000016" not in theProject.tree + assert "0000000000017" not in theProject.tree # END Test testCoreProject_NewRoot @@ -324,26 +324,26 @@ def testCoreProject_NewFileFolder(monkeypatch, fncDir, outDir, refDir, mockGUI, assert theProject.newFile("New File", "1234567890abc") is None # Add files properly - assert theProject.newFolder("Stuff", C.hNovelRoot) == "0000000000020" - assert theProject.newFile("Hello", "0000000000020") == "0000000000021" - assert theProject.newFile("Jane", C.hCharRoot) == "0000000000022" + assert theProject.newFolder("Stuff", C.hNovelRoot) == "0000000000010" + assert theProject.newFile("Hello", "0000000000010") == "0000000000011" + assert theProject.newFile("Jane", C.hCharRoot) == "0000000000012" - assert "0000000000020" in theProject.tree - assert "0000000000021" in theProject.tree - assert "0000000000022" in theProject.tree + assert "0000000000010" in theProject.tree + assert "0000000000011" in theProject.tree + assert "0000000000012" in theProject.tree # Write to file, failed assert theProject.writeNewFile("blabla", 1, True) is False # Not a handle - assert theProject.writeNewFile("0000000000020", 1, True) is False # Not a file + assert theProject.writeNewFile("0000000000010", 1, True) is False # Not a file assert theProject.writeNewFile(C.hTitlePage, 1, True) is False # Already has content # Write to file, success - assert theProject.writeNewFile("0000000000021", 2, True) is True - assert NWDoc(theProject, "0000000000021").readDocument() == "## Hello\n\n" + assert theProject.writeNewFile("0000000000011", 2, True) is True + assert NWDoc(theProject, "0000000000011").readDocument() == "## Hello\n\n" # Write to file with additional text, success - assert theProject.writeNewFile("0000000000022", 1, False, "Hi Jane\n\n") is True - assert NWDoc(theProject, "0000000000022").readDocument() == "# Jane\n\nHi Jane\n\n" + assert theProject.writeNewFile("0000000000012", 1, False, "Hi Jane\n\n") is True + assert NWDoc(theProject, "0000000000012").readDocument() == "# Jane\n\nHi Jane\n\n" # Save, close and check assert theProject.projChanged is True @@ -356,23 +356,23 @@ def testCoreProject_NewFileFolder(monkeypatch, fncDir, outDir, refDir, mockGUI, # Delete new file, but block access with monkeypatch.context() as mp: mp.setattr("os.unlink", causeOSError) - assert theProject.removeItem("0000000000021") is False - assert "0000000000021" in theProject.tree + assert theProject.removeItem("0000000000011") is False + assert "0000000000011" in theProject.tree # Delete new files and folders - assert os.path.isfile(os.path.join(fncDir, "content", "0000000000022.nwd")) - assert os.path.isfile(os.path.join(fncDir, "content", "0000000000021.nwd")) + assert os.path.isfile(os.path.join(fncDir, "content", "0000000000012.nwd")) + assert os.path.isfile(os.path.join(fncDir, "content", "0000000000011.nwd")) - assert theProject.removeItem("0000000000022") is True - assert theProject.removeItem("0000000000021") is True - assert theProject.removeItem("0000000000020") is True + assert theProject.removeItem("0000000000012") is True + assert theProject.removeItem("0000000000011") is True + assert theProject.removeItem("0000000000010") is True - assert not os.path.isfile(os.path.join(fncDir, "content", "0000000000022.nwd")) - assert not os.path.isfile(os.path.join(fncDir, "content", "0000000000021.nwd")) + assert not os.path.isfile(os.path.join(fncDir, "content", "0000000000012.nwd")) + assert not os.path.isfile(os.path.join(fncDir, "content", "0000000000011.nwd")) - assert "0000000000020" not in theProject.tree - assert "0000000000021" not in theProject.tree - assert "0000000000022" not in theProject.tree + assert "0000000000010" not in theProject.tree + assert "0000000000011" not in theProject.tree + assert "0000000000012" not in theProject.tree assert theProject.closeProject() is True @@ -933,7 +933,7 @@ def testCoreProject_Methods(monkeypatch, mockGUI, tmpDir, fncDir, mockRnd): # Trash folder # Should create on first call, and just returned on later calls - hTrash = "0000000000018" + hTrash = "0000000000010" assert theProject.tree[hTrash] is None assert theProject.trashFolder() == hTrash assert theProject.trashFolder() == hTrash @@ -987,14 +987,14 @@ def testCoreProject_Methods(monkeypatch, mockGUI, tmpDir, fncDir, mockRnd): # Change project tree order oldOrder = [ - "0000000000010", "0000000000011", "0000000000012", - "0000000000013", "0000000000014", "0000000000015", - "0000000000016", "0000000000017", "0000000000018", + "0000000000008", "0000000000009", "000000000000a", + "000000000000b", "000000000000c", "000000000000d", + "000000000000e", "000000000000f", "0000000000010", ] newOrder = [ - "0000000000013", "0000000000014", "0000000000015", - "0000000000010", "0000000000011", "0000000000012", - "0000000000016", "0000000000017", + "000000000000b", "000000000000c", "000000000000d", + "0000000000008", "0000000000009", "000000000000a", + "000000000000e", "000000000000f", ] assert theProject.tree.handles() == oldOrder assert theProject.setTreeOrder(newOrder) diff --git a/tests/test_core/test_core_tree.py b/tests/test_core/test_core_tree.py index cef9fa58..518122e7 100644 --- a/tests/test_core/test_core_tree.py +++ b/tests/test_core/test_core_tree.py @@ -23,8 +23,6 @@ import os import pytest import random -from lxml import etree - from tools import readFile from novelwriter.enum import nwItemClass, nwItemType, nwItemLayout @@ -198,7 +196,7 @@ def testCoreTree_BuildTree(mockGUI, mockItems): assert len(theTree) == len(mockItems) + 1 theList = theTree.handles() - nHandle = "0000000000010" + nHandle = "0000000000000" assert theList[-1] == nHandle # Try to add existing handle @@ -395,65 +393,6 @@ def testCoreTree_Reorder(mockGUI, mockItems): # END Test testCoreTree_Reorder -@pytest.mark.core -@pytest.mark.skip -def testCoreTree_XMLPackUnpack(mockGUI, mockItems): - """Test packing and unpacking the tree to and from XML. - """ - theProject = NWProject(mockGUI) - theTree = NWTree(theProject) - - for tHandle, pHandle, nwItem in mockItems: - theTree.append(tHandle, pHandle, nwItem) - theTree.updateItemData(tHandle) - - assert len(theTree) == len(mockItems) - - nwXML = etree.Element("novelWriterXML") - theTree.packXML(nwXML) - assert etree.tostring(nwXML, pretty_print=False, encoding="utf-8") == ( - b'' - b'' - b'Novel' - b'Act One' - b'Chapter One' - b'Scene One' - b'Outtakes' - b'Trash' - b'Characters' - b'Jane Doe' - b'' - b'' - ) - - theTree.clear() - assert len(theTree) == 0 - assert not theTree.unpackXML(nwXML) - assert theTree.unpackXML(nwXML[0]) - assert len(theTree) == len(mockItems) - -# END Test testCoreTree_XMLPackUnpack - - @pytest.mark.core def testCoreTree_ToCFile(monkeypatch, mockGUI, mockItems, tmpDir): """Test writing the ToC.txt file. diff --git a/tests/test_gui/test_gui_guimain.py b/tests/test_gui/test_gui_guimain.py index 28b5b729..28582695 100644 --- a/tests/test_gui/test_gui_guimain.py +++ b/tests/test_gui/test_gui_guimain.py @@ -489,11 +489,12 @@ def testGuiMain_Editing(qtbot, monkeypatch, nwGUI, fncProj, refDir, outDir, mock # Check a Quick Create and Delete assert nwGUI.projView.projTree.newTreeItem(nwItemType.FILE, None) newHandle = nwGUI.projView.getSelectedHandle() - assert nwGUI.theProject.tree["0000000000020"] is not None + assert newHandle == "0000000000013" + assert nwGUI.theProject.tree[newHandle] is not None assert nwGUI.projView.requestDeleteItem() assert nwGUI.projView.setSelectedHandle(newHandle) assert nwGUI.projView.requestDeleteItem() - assert nwGUI.theProject.tree["0000000000024"] is not None # Trash + assert nwGUI.theProject.tree["0000000000014"] is not None # Trash assert nwGUI.saveProject() # Check the files @@ -509,21 +510,21 @@ def testGuiMain_Editing(qtbot, monkeypatch, nwGUI, fncProj, refDir, outDir, mock copyfile(projFile, testFile) assert cmpFiles(testFile, compFile) - projFile = os.path.join(fncProj, "content", "0000000000020.nwd") - testFile = os.path.join(outDir, "guiEditor_Main_Final_0000000000020.nwd") - compFile = os.path.join(refDir, "guiEditor_Main_Final_0000000000020.nwd") + projFile = os.path.join(fncProj, "content", "0000000000010.nwd") + testFile = os.path.join(outDir, "guiEditor_Main_Final_0000000000010.nwd") + compFile = os.path.join(refDir, "guiEditor_Main_Final_0000000000010.nwd") copyfile(projFile, testFile) assert cmpFiles(testFile, compFile) - projFile = os.path.join(fncProj, "content", "0000000000021.nwd") - testFile = os.path.join(outDir, "guiEditor_Main_Final_0000000000021.nwd") - compFile = os.path.join(refDir, "guiEditor_Main_Final_0000000000021.nwd") + projFile = os.path.join(fncProj, "content", "0000000000011.nwd") + testFile = os.path.join(outDir, "guiEditor_Main_Final_0000000000011.nwd") + compFile = os.path.join(refDir, "guiEditor_Main_Final_0000000000011.nwd") copyfile(projFile, testFile) assert cmpFiles(testFile, compFile) - projFile = os.path.join(fncProj, "content", "0000000000022.nwd") - testFile = os.path.join(outDir, "guiEditor_Main_Final_0000000000022.nwd") - compFile = os.path.join(refDir, "guiEditor_Main_Final_0000000000022.nwd") + projFile = os.path.join(fncProj, "content", "0000000000012.nwd") + testFile = os.path.join(outDir, "guiEditor_Main_Final_0000000000012.nwd") + compFile = os.path.join(refDir, "guiEditor_Main_Final_0000000000012.nwd") copyfile(projFile, testFile) assert cmpFiles(testFile, compFile) diff --git a/tests/tools.py b/tests/tools.py index 1cbc0359..0da846cc 100644 --- a/tests/tools.py +++ b/tests/tools.py @@ -167,6 +167,16 @@ def buildTestProject(theObject, projPath): theProject.clearProject() theProject.setProjectPath(projPath, newProject=True) + + theProject.data.itemStatus.write(None, "New", (100, 100, 100)) + theProject.data.itemStatus.write(None, "Note", (200, 50, 0)) + theProject.data.itemStatus.write(None, "Draft", (200, 150, 0)) + theProject.data.itemStatus.write(None, "Finished", (50, 200, 0)) + theProject.data.itemImport.write(None, "New", (100, 100, 100)) + theProject.data.itemImport.write(None, "Minor", (200, 50, 0)) + theProject.data.itemImport.write(None, "Major", (200, 150, 0)) + theProject.data.itemImport.write(None, "Main", (50, 200, 0)) + theProject.data.setName("New Project") theProject.data.setTitle("New Novel") theProject.data.setAuthors("Jane Doe")