GUI and code tweaks and fixes (#852)

* Improve format menu header descriptions
* Ensure that item status is parsed after item class from XML
* Fix column alignment in ToC.txt file
* Rename test variable and fix outdated docstring
* Fix ToC.txt underline
* Rename the Layout label on the item details panel
* Add option to emphasise H1 and H2 labels in the project tree
* Rename the main column of the novel tree to match project tree
* Use the same document icons in the outline as the project tree
* Move project tree settings to Project section of config file
This commit is contained in:
Veronica Berglyd Olsen
2021-08-17 21:45:18 +02:00
committed by GitHub
parent f7c768bb91
commit a9368904e5
16 changed files with 120 additions and 81 deletions
+5 -1
View File
@@ -107,6 +107,7 @@ class NWItem():
if "order" in xItem.attrib:
self.setOrder(xItem.attrib["order"])
tmpStatus = ""
for xValue in xItem:
if xValue.tag == "name":
self.setName(xValue.text)
@@ -117,7 +118,7 @@ class NWItem():
elif xValue.tag == "layout":
self.setLayout(xValue.text)
elif xValue.tag == "status":
self.setStatus(xValue.text)
tmpStatus = xValue.text
elif xValue.tag == "expanded":
self.setExpanded(xValue.text)
elif xValue.tag == "exported":
@@ -136,6 +137,9 @@ class NWItem():
# version of novelWriter that doesn't know the tag.
logger.error("Unknown tag '%s'", xValue.tag)
# Guarantees that <status> is parsed after <class>
self.setStatus(tmpStatus)
return True
@staticmethod
+3 -3
View File
@@ -158,7 +158,7 @@ class NWTree():
continue
tFile = tHandle+".nwd"
if os.path.isfile(os.path.join(self.theProject.projContent, tFile)):
tocLine = "%-25s %-9s %-10s %s" % (
tocLine = "%-25s %-9s %-8s %s" % (
os.path.join("content", tFile),
tItem.itemClass.name,
tItem.itemLayout.name,
@@ -175,10 +175,10 @@ class NWTree():
outFile.write("Table of Contents\n")
outFile.write("=================\n")
outFile.write("\n")
outFile.write("%-25s %-9s %-10s %s\n" % (
outFile.write("%-25s %-9s %-8s %s\n" % (
"File Name", "Class", "Layout", "Document Label"
))
outFile.write("-"*tocLen + "\n")
outFile.write("-"*max(tocLen, 62) + "\n")
outFile.write("\n".join(tocList))
outFile.write("\n")