From 51078499095d48cc897ec7cdec6b81e1467009c1 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Thu, 7 Nov 2024 23:55:59 +0100 Subject: [PATCH] Add status column to outline --- novelwriter/constants.py | 1 + novelwriter/enum.py | 31 ++++++++++++++++--------------- novelwriter/gui/outline.py | 5 +++++ 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/novelwriter/constants.py b/novelwriter/constants.py index 954f21ed..25326f64 100644 --- a/novelwriter/constants.py +++ b/novelwriter/constants.py @@ -301,6 +301,7 @@ class nwLabels: nwOutline.LEVEL: QT_TRANSLATE_NOOP("Constant", "Level"), nwOutline.LABEL: QT_TRANSLATE_NOOP("Constant", "Document"), nwOutline.LINE: QT_TRANSLATE_NOOP("Constant", "Line"), + nwOutline.STATUS: QT_TRANSLATE_NOOP("Constant", "Status"), nwOutline.CCOUNT: QT_TRANSLATE_NOOP("Constant", "Chars"), nwOutline.WCOUNT: QT_TRANSLATE_NOOP("Constant", "Words"), nwOutline.PCOUNT: QT_TRANSLATE_NOOP("Constant", "Pars"), diff --git a/novelwriter/enum.py b/novelwriter/enum.py index b6135344..7441bc9b 100644 --- a/novelwriter/enum.py +++ b/novelwriter/enum.py @@ -162,21 +162,22 @@ class nwOutline(Enum): LEVEL = 1 LABEL = 2 LINE = 3 - CCOUNT = 4 - WCOUNT = 5 - PCOUNT = 6 - POV = 7 - FOCUS = 8 - CHAR = 9 - PLOT = 10 - TIME = 11 - WORLD = 12 - OBJECT = 13 - ENTITY = 14 - CUSTOM = 15 - STORY = 16 - MENTION = 17 - SYNOP = 18 + STATUS = 4 + CCOUNT = 5 + WCOUNT = 6 + PCOUNT = 7 + POV = 8 + FOCUS = 9 + CHAR = 10 + PLOT = 11 + TIME = 12 + WORLD = 13 + OBJECT = 14 + ENTITY = 15 + CUSTOM = 16 + STORY = 17 + MENTION = 18 + SYNOP = 19 class nwBuildFmt(Enum): diff --git a/novelwriter/gui/outline.py b/novelwriter/gui/outline.py index ee0e1c9f..f6f808c4 100644 --- a/novelwriter/gui/outline.py +++ b/novelwriter/gui/outline.py @@ -318,6 +318,7 @@ class GuiOutlineTree(QTreeWidget): nwOutline.LEVEL: 40, nwOutline.LABEL: 150, nwOutline.LINE: 40, + nwOutline.STATUS: 100, nwOutline.CCOUNT: 50, nwOutline.WCOUNT: 50, nwOutline.PCOUNT: 50, @@ -340,6 +341,7 @@ class GuiOutlineTree(QTreeWidget): nwOutline.LEVEL: True, nwOutline.LABEL: False, nwOutline.LINE: True, + nwOutline.STATUS: True, nwOutline.CCOUNT: True, nwOutline.WCOUNT: False, nwOutline.PCOUNT: False, @@ -691,6 +693,7 @@ class GuiOutlineTree(QTreeWidget): nwItem = SHARED.project.tree[tHandle] if iLevel == 0 or nwItem is None: continue + sLabel, sIcon = nwItem.getImportStatus() item = QTreeWidgetItem() hDec = SHARED.theme.getHeaderDecoration(iLevel) @@ -704,6 +707,8 @@ class GuiOutlineTree(QTreeWidget): item.setIcon(self._colIdx[nwOutline.LABEL], self._dIcon[nwItem.mainHeading]) item.setText(self._colIdx[nwOutline.LABEL], nwItem.itemName) item.setText(self._colIdx[nwOutline.LINE], f"{novIdx.line:n}") + item.setText(self._colIdx[nwOutline.STATUS], sLabel) + item.setIcon(self._colIdx[nwOutline.STATUS], sIcon) item.setText(self._colIdx[nwOutline.SYNOP], novIdx.synopsis) item.setText(self._colIdx[nwOutline.CCOUNT], f"{novIdx.charCount:n}") item.setText(self._colIdx[nwOutline.WCOUNT], f"{novIdx.wordCount:n}")