From 7f3e9c0f314db1b7bf568a3cdcbdda2670ef56e0 Mon Sep 17 00:00:00 2001
From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com>
Date: Thu, 21 May 2020 20:13:10 +0200
Subject: [PATCH 1/4] Updated changelog
---
CHANGELOG.md | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4d962671..daf37221 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,8 +4,11 @@
**User Interface**
-* The Export Tool has been removed and replaced by a new tool called "Build Novel Project". The new tool has the same filtering options as the Export Tool, but with more formatting options for titles. It also has a preview window to display the generated document. A Save As button provides exports to HTML, novelWriter Markdown. plain text, PDF and Open Document format. LaTeX export has not been ported over, and interfacing with Pandoc is no longer supported either. Although. as before, the HTML export can be converted with Pandoc still. The new tool also supports printing. PR #204
-* The Project Settings, Preferences, Item Editor, Merge Documents, and Split Documents dialogs have been redesigned. The ones with tabs, now have vertical tabs on the left with horizontal labels. The dialog design should be more compact, and have room for more tabs for future settings. PR #212
+* The Export Tool has been removed and replaced by a new tool called "Build Novel Project". The new tool has the same filtering options as the Export Tool, but with more formatting options for titles. It also has a preview window to display the generated document. A Save As button provides exports to HTML, novelWriter Markdown. plain text, PDF and Open Document format. LaTeX export has not been ported over, and interfacing with Pandoc is no longer supported either. Although, as before, the HTML export can be converted with Pandoc to other formats outside of novelWriter. The new tool also supports printing. PR #204
+* The Project Settings, Preferences, Item Editor, Merge Documents, and Split Documents dialogs have been redesigned. The ones with tabs now have vertical tabs on the left with horizontal labels. The dialog design should be more compact, and have room for more tabs for future settings. PR #212
+* A new icon, as well as a mimetype icon for the project files, have been designed and added to the app. PRs #213 and #214
+* The About dialog has been completely redesigned to allow more information. PR #217
+* The Open Project dialog has been cleaned up and made more readable. The project paths have been moved out of the list, and are now displayed when an item is selected instead. Icons have been added, and the New project dialog can also be triggered from this dialog. PR #218
## Version 0.5.2 [2020-05-21]
From 8aacad8ce0a3a30316872c82c68791f4dd06caa7 Mon Sep 17 00:00:00 2001
From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com>
Date: Thu, 21 May 2020 20:13:50 +0200
Subject: [PATCH 2/4] Made the item editor dialog less cluttered
---
nw/gui/dialogs/itemeditor.py | 18 +++---------------
1 file changed, 3 insertions(+), 15 deletions(-)
diff --git a/nw/gui/dialogs/itemeditor.py b/nw/gui/dialogs/itemeditor.py
index 51583195..ce1fac67 100644
--- a/nw/gui/dialogs/itemeditor.py
+++ b/nw/gui/dialogs/itemeditor.py
@@ -34,7 +34,7 @@ from PyQt5.QtWidgets import (
QDialogButtonBox
)
-from nw.gui.additions import QSwitch, QHelpLabel
+from nw.gui.additions import QSwitch
from nw.constants import nwLabels, nwItemLayout, nwItemClass, nwItemType
logger = logging.getLogger(__name__)
@@ -59,13 +59,6 @@ class GuiItemEditor(QDialog):
self.setWindowTitle("Item Settings")
self.setLayout(self.outerBox)
- # Labels
- self.headLabel = QLabel("Edit Item Settings")
- self.helpLabel = QHelpLabel(
- "Item layout and status options depend on the root folder.",
- self.theParent.theTheme.helpText
- )
-
# Item Label
self.editName = QLineEdit()
self.editName.setMinimumWidth(220)
@@ -132,6 +125,7 @@ class GuiItemEditor(QDialog):
# Assemble
self.mainForm = QGridLayout()
self.mainForm.setVerticalSpacing(4)
+ self.mainForm.setHorizontalSpacing(16)
self.mainForm.addWidget(QLabel("Label"), 0, 0, 1, 1)
self.mainForm.addWidget(self.editName, 0, 1, 1, 2)
self.mainForm.addWidget(QLabel("Status"), 1, 0, 1, 1)
@@ -141,19 +135,13 @@ class GuiItemEditor(QDialog):
self.mainForm.addWidget(self.textExport, 3, 0, 1, 2)
self.mainForm.addWidget(self.editExport, 3, 2, 1, 1)
- self.outerBox.setSpacing(0)
- self.outerBox.addWidget(self.headLabel)
- self.outerBox.addWidget(self.helpLabel)
- self.outerBox.addSpacing(8)
+ self.outerBox.setSpacing(16)
self.outerBox.addLayout(self.mainForm)
- self.outerBox.addSpacing(12)
self.outerBox.addStretch(1)
self.outerBox.addWidget(self.buttonBox)
self.setLayout(self.outerBox)
self.rejected.connect(self._doClose)
- self.show()
-
self.editName.selectAll()
logger.debug("GuiItemEditor initialisation complete")
From 2a9bdd1985875f8151a317f0d882dc3011f9ffa2 Mon Sep 17 00:00:00 2001
From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com>
Date: Thu, 21 May 2020 20:29:40 +0200
Subject: [PATCH 3/4] Moved document stats to the details panel below the tree
---
nw/gui/elements/docdetails.py | 120 ++++++++++++++++++++++++----------
nw/gui/elements/doctree.py | 2 +-
nw/gui/statusbar.py | 19 +-----
3 files changed, 88 insertions(+), 53 deletions(-)
diff --git a/nw/gui/elements/docdetails.py b/nw/gui/elements/docdetails.py
index 8c231fa6..12eb6030 100644
--- a/nw/gui/elements/docdetails.py
+++ b/nw/gui/elements/docdetails.py
@@ -51,83 +51,119 @@ class GuiDocDetails(QFrame):
self.mainBox.setHorizontalSpacing(6)
self.setLayout(self.mainBox)
- self.fntOne = QFont()
- self.fntOne.setPointSize(10)
- self.fntOne.setBold(True)
+ self.fntLabel = QFont()
+ self.fntLabel.setPointSize(10)
+ self.fntLabel.setBold(True)
- self.fntTwo = QFont()
- self.fntTwo.setFamily("Monospace")
- self.fntTwo.setPointSize(10)
+ self.fntFixed = QFont()
+ self.fntFixed.setFamily("Monospace")
+ self.fntFixed.setPointSize(10)
- self.fntThree = QFont()
- self.fntThree.setPointSize(10)
+ self.fntValue = QFont()
+ self.fntValue.setPointSize(10)
# Label
self.labelName = QLabel("Label ")
- self.labelName.setFont(self.fntOne)
+ self.labelName.setFont(self.fntLabel)
self.labelName.setAlignment(Qt.AlignLeft | Qt.AlignBaseline)
self.labelFlag = QLabel("")
- self.labelFlag.setFont(self.fntTwo)
+ self.labelFlag.setFont(self.fntFixed)
self.labelFlag.setAlignment(Qt.AlignRight | Qt.AlignBaseline)
self.labelData = QLabel("")
- self.labelData.setFont(self.fntThree)
+ self.labelData.setFont(self.fntValue)
self.labelData.setAlignment(Qt.AlignLeft | Qt.AlignBaseline)
self.labelData.setWordWrap(True)
# Status
self.statusName = QLabel("Status ")
- self.statusName.setFont(self.fntOne)
+ self.statusName.setFont(self.fntLabel)
self.statusName.setAlignment(Qt.AlignLeft)
self.statusFlag = QLabel("")
- self.statusFlag.setFont(self.fntTwo)
+ self.statusFlag.setFont(self.fntFixed)
self.statusFlag.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
self.statusData = QLabel("")
- self.statusData.setFont(self.fntThree)
+ self.statusData.setFont(self.fntValue)
self.statusData.setAlignment(Qt.AlignLeft)
# Class
self.className = QLabel("Class ")
- self.className.setFont(self.fntOne)
+ self.className.setFont(self.fntLabel)
self.className.setAlignment(Qt.AlignLeft)
self.classFlag = QLabel("")
- self.classFlag.setFont(self.fntTwo)
+ self.classFlag.setFont(self.fntFixed)
self.classFlag.setAlignment(Qt.AlignRight)
self.classData = QLabel("")
- self.classData.setFont(self.fntThree)
+ self.classData.setFont(self.fntValue)
self.classData.setAlignment(Qt.AlignLeft)
# Layout
self.layoutName = QLabel("Layout ")
- self.layoutName.setFont(self.fntOne)
+ self.layoutName.setFont(self.fntLabel)
self.layoutName.setAlignment(Qt.AlignLeft)
self.layoutFlag = QLabel("")
- self.layoutFlag.setFont(self.fntTwo)
+ self.layoutFlag.setFont(self.fntFixed)
self.layoutFlag.setAlignment(Qt.AlignRight)
self.layoutData = QLabel("")
- self.layoutData.setFont(self.fntThree)
+ self.layoutData.setFont(self.fntValue)
self.layoutData.setAlignment(Qt.AlignLeft)
+ # Character Count
+ self.cCountName = QLabel(" Characters")
+ self.cCountName.setFont(self.fntLabel)
+ self.cCountName.setAlignment(Qt.AlignRight)
+
+ self.cCountData = QLabel("")
+ self.cCountData.setFont(self.fntValue)
+ self.cCountData.setAlignment(Qt.AlignRight)
+
+ # Word Count
+ self.wCountName = QLabel(" Words")
+ self.wCountName.setFont(self.fntLabel)
+ self.wCountName.setAlignment(Qt.AlignRight)
+
+ self.wCountData = QLabel("")
+ self.wCountData.setFont(self.fntValue)
+ self.wCountData.setAlignment(Qt.AlignRight)
+
+ # Paragraph Count
+ self.pCountName = QLabel(" Paragraphs")
+ self.pCountName.setFont(self.fntLabel)
+ self.pCountName.setAlignment(Qt.AlignRight)
+
+ self.pCountData = QLabel("")
+ self.pCountData.setFont(self.fntValue)
+ self.pCountData.setAlignment(Qt.AlignRight)
+
# Assemble
- self.mainBox.addWidget(self.labelName, 0, 0)
- self.mainBox.addWidget(self.statusName, 1, 0)
- self.mainBox.addWidget(self.className, 2, 0)
- self.mainBox.addWidget(self.layoutName, 3, 0)
- self.mainBox.addWidget(self.labelFlag, 0, 1)
- self.mainBox.addWidget(self.statusFlag, 1, 1)
- self.mainBox.addWidget(self.classFlag, 2, 1)
- self.mainBox.addWidget(self.layoutFlag, 3, 1)
- self.mainBox.addWidget(self.labelData, 0, 2)
- self.mainBox.addWidget(self.statusData, 1, 2)
- self.mainBox.addWidget(self.classData, 2, 2)
- self.mainBox.addWidget(self.layoutData, 3, 2)
+ self.mainBox.addWidget(self.labelName, 0, 0, 1, 1)
+ self.mainBox.addWidget(self.labelFlag, 0, 1, 1, 1)
+ self.mainBox.addWidget(self.labelData, 0, 2, 1, 3)
+
+ self.mainBox.addWidget(self.statusName, 1, 0, 1, 1)
+ self.mainBox.addWidget(self.statusFlag, 1, 1, 1, 1)
+ self.mainBox.addWidget(self.statusData, 1, 2, 1, 1)
+ self.mainBox.addWidget(self.cCountName, 1, 3, 1, 1)
+ self.mainBox.addWidget(self.cCountData, 1, 4, 1, 1)
+
+ self.mainBox.addWidget(self.className, 2, 0, 1, 1)
+ self.mainBox.addWidget(self.classFlag, 2, 1, 1, 1)
+ self.mainBox.addWidget(self.classData, 2, 2, 1, 1)
+ self.mainBox.addWidget(self.wCountName, 2, 3, 1, 1)
+ self.mainBox.addWidget(self.wCountData, 2, 4, 1, 1)
+
+ self.mainBox.addWidget(self.layoutName, 3, 0, 1, 1)
+ self.mainBox.addWidget(self.layoutFlag, 3, 1, 1, 1)
+ self.mainBox.addWidget(self.layoutData, 3, 2, 1, 1)
+ self.mainBox.addWidget(self.pCountName, 3, 3, 1, 1)
+ self.mainBox.addWidget(self.pCountData, 3, 4, 1, 1)
self.mainBox.setColumnStretch(0,0)
self.mainBox.setColumnStretch(1,0)
@@ -149,13 +185,16 @@ class GuiDocDetails(QFrame):
if nwItem is None:
self.labelFlag.setText("")
- self.statusFlag.setText("")
- self.classFlag.setText("")
- self.layoutFlag.setText("")
self.labelData.setText("")
+ self.statusFlag.setText("")
self.statusData.setText("")
+ self.classFlag.setText("")
self.classData.setText("")
+ self.layoutFlag.setText("")
self.layoutData.setText("")
+ self.cCountData.setText("–")
+ self.wCountData.setText("–")
+ self.pCountData.setText("–")
else:
theLabel = nwItem.itemName
@@ -176,7 +215,7 @@ class GuiDocDetails(QFrame):
else:
exportFlag = " "
else:
- exportFlag = "+"
+ exportFlag = "-"
self.labelFlag.setText(exportFlag)
self.statusFlag.setPixmap(flagIcon.pixmap(10, 10))
@@ -188,6 +227,15 @@ class GuiDocDetails(QFrame):
self.classData.setText(nwLabels.CLASS_NAME[nwItem.itemClass])
self.layoutData.setText(nwLabels.LAYOUT_NAME[nwItem.itemLayout])
+ if nwItem.itemType == nwItemType.FILE:
+ self.cCountData.setText("{:n}".format(nwItem.charCount))
+ self.wCountData.setText("{:n}".format(nwItem.wordCount))
+ self.pCountData.setText("{:n}".format(nwItem.paraCount))
+ else:
+ self.cCountData.setText("–")
+ self.wCountData.setText("–")
+ self.pCountData.setText("–")
+
return
# END Class GuiDocDetails
diff --git a/nw/gui/elements/doctree.py b/nw/gui/elements/doctree.py
index bb06b9d2..89ef9d8c 100644
--- a/nw/gui/elements/doctree.py
+++ b/nw/gui/elements/doctree.py
@@ -421,7 +421,7 @@ class GuiDocTree(QTreeWidget):
if nwItem.isExported:
stExport = nwUnicode.U_CHECK
else:
- stExport = "+"
+ stExport = "-"
tStatus = stExport+" "+stClass+stLayout
diff --git a/nw/gui/statusbar.py b/nw/gui/statusbar.py
index 0d2643c6..c7ee28df 100644
--- a/nw/gui/statusbar.py
+++ b/nw/gui/statusbar.py
@@ -195,22 +195,9 @@ class GuiMainStatus(QStatusBar):
def _updateStats(self):
"""Update statistics.
"""
- self.statsText.setToolTip((
- "Document Stats
"
- "Characters: {cC:n}
"
- "Words: {wC:n}
"
- "Paragraphs: {pC:n}
"
- "
"
- "Project Stats
"
- "Words Total: {pWC:n}
"
- "This Session: {sWC:n}"
- ).format(
- cC = self.charCount,
- wC = self.wordCount,
- pC = self.paraCount,
- pWC = self.projWords,
- sWC = self.sessWords,
- ))
+ self.statsText.setToolTip(
+ "D: Document word count
P: Project word count"
+ )
self.statsText.setText((
"D:{wC:n} P:{pWC:n} ({sWC:+n})"
).format(
From 2f1bc456c03f102ea665ee26490565593d22dec8 Mon Sep 17 00:00:00 2001
From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com>
Date: Thu, 21 May 2020 20:39:21 +0200
Subject: [PATCH 4/4] Changed some help text a bit
---
nw/gui/dialogs/docsplit.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/nw/gui/dialogs/docsplit.py b/nw/gui/dialogs/docsplit.py
index 137138c3..25cc2f1d 100644
--- a/nw/gui/dialogs/docsplit.py
+++ b/nw/gui/dialogs/docsplit.py
@@ -57,7 +57,7 @@ class GuiDocSplit(QDialog):
self.headLabel = QLabel("Document Headers")
self.helpLabel = QHelpLabel(
- "Select the maximum level to split into files at.", self.theParent.theTheme.helpText
+ "Select the maximum level to split into files.", self.theParent.theTheme.helpText
)
self.listBox = QListWidget()