diff --git a/nw/gui/projecteditor.py b/nw/gui/projecteditor.py index 88da6ca6..5ba2e558 100644 --- a/nw/gui/projecteditor.py +++ b/nw/gui/projecteditor.py @@ -336,6 +336,9 @@ class GuiProjectEditReplace(QWidget): newItem = QTreeWidgetItem(["<%s>" % aKey, aVal]) self.listBox.addTopLevelItem(newItem) + self.listBox.sortByColumn(0, Qt.AscendingOrder) + self.listBox.setSortingEnabled(True) + self.editKey = QLineEdit() self.editValue = QLineEdit() self.saveButton = QPushButton(QIcon.fromTheme("document-save"),"") diff --git a/nw/project/item.py b/nw/project/item.py index 367167c8..55d532a1 100644 --- a/nw/project/item.py +++ b/nw/project/item.py @@ -55,8 +55,8 @@ class NWItem(): def packXML(self, xParent): xPack = etree.SubElement(xParent,"item",attrib={ "handle" : str(self.itemHandle), - "parent" : str(self.parHandle), "order" : str(self.itemOrder), + "parent" : str(self.parHandle), }) xSub = self._subPack(xPack,"name", text=str(self.itemName)) xSub = self._subPack(xPack,"type", text=str(self.itemType.name)) diff --git a/nw/project/project.py b/nw/project/project.py index bdc1b8b3..c41d4115 100644 --- a/nw/project/project.py +++ b/nw/project/project.py @@ -288,8 +288,8 @@ class NWProject(): # Root element and project details logger.debug("Writing project meta") nwXML = etree.Element("novelWriterXML",attrib={ - "fileVersion" : "1.0", "appVersion" : str(nw.__version__), + "fileVersion" : "1.0", "timeStamp" : datetime.now().strftime("%Y-%m-%d %H:%M:%S"), }) diff --git a/nw/project/status.py b/nw/project/status.py index 1d19bf34..ea1a045a 100644 --- a/nw/project/status.py +++ b/nw/project/status.py @@ -89,9 +89,9 @@ class NWStatus(): def packEntries(self, xParent): for n in range(self.theLength): xSub = etree.SubElement(xParent,"entry",attrib={ - "red" : str(self.theColours[n][0]), - "green" : str(self.theColours[n][1]), "blue" : str(self.theColours[n][2]), + "green" : str(self.theColours[n][1]), + "red" : str(self.theColours[n][0]), }) xSub.text = self.theLabels[n] return True diff --git a/sample/sampleNovel/nwProject.nwx b/sample/sampleNovel/nwProject.nwx index 5f27329d..e0347637 100644 --- a/sample/sampleNovel/nwProject.nwx +++ b/sample/sampleNovel/nwProject.nwx @@ -1,5 +1,5 @@ - + Sample Project Sample Project @@ -14,6 +14,7 @@ 581 B + E D diff --git a/tests/test_gui.py b/tests/test_gui.py index f7840805..9c5ad51c 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -327,7 +327,7 @@ def testProjectEditor(qtbot, nwTempGUI, nwRef): projEdit.tabReplace.listBox.clearSelection() qtbot.mouseClick(projEdit.tabReplace.addButton, Qt.LeftButton) - projEdit.tabReplace.listBox.topLevelItem(1).setSelected(True) + projEdit.tabReplace.listBox.topLevelItem(0).setSelected(True) for c in "Delete": qtbot.keyClick(projEdit.tabReplace.editKey, c, delay=keyDelay) for c in "This Stuff": @@ -335,7 +335,7 @@ def testProjectEditor(qtbot, nwTempGUI, nwRef): qtbot.mouseClick(projEdit.tabReplace.saveButton, Qt.LeftButton) projEdit.tabReplace.listBox.clearSelection() - projEdit.tabReplace.listBox.topLevelItem(1).setSelected(True) + projEdit.tabReplace.listBox.topLevelItem(0).setSelected(True) qtbot.mouseClick(projEdit.tabReplace.delButton, Qt.LeftButton) projEdit._doSave()