novelWriter 2.7b1__py3-none-any.whl → 2.7rc1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- novelwriter/__init__.py +17 -4
- novelwriter/assets/i18n/project_en_GB.json +1 -0
- novelwriter/assets/icons/remix_filled.icons +1 -0
- novelwriter/assets/icons/remix_outline.icons +1 -0
- novelwriter/assets/images/splash.png +0 -0
- novelwriter/assets/manual.pdf +0 -0
- novelwriter/assets/manual_fr.pdf +0 -0
- novelwriter/assets/sample.zip +0 -0
- novelwriter/assets/syntax/snazzy.conf +3 -3
- novelwriter/assets/themes/snazzy.conf +48 -0
- novelwriter/common.py +10 -1
- novelwriter/config.py +96 -25
- novelwriter/constants.py +17 -0
- novelwriter/core/buildsettings.py +2 -0
- novelwriter/core/coretools.py +41 -34
- novelwriter/core/docbuild.py +1 -0
- novelwriter/core/index.py +25 -1
- novelwriter/core/indexdata.py +4 -1
- novelwriter/core/item.py +35 -24
- novelwriter/core/itemmodel.py +17 -13
- novelwriter/core/novelmodel.py +2 -0
- novelwriter/core/project.py +14 -14
- novelwriter/core/projectdata.py +42 -24
- novelwriter/core/projectxml.py +17 -7
- novelwriter/core/sessions.py +29 -13
- novelwriter/core/tree.py +9 -5
- novelwriter/dialogs/docmerge.py +2 -1
- novelwriter/dialogs/docsplit.py +6 -3
- novelwriter/dialogs/editlabel.py +11 -8
- novelwriter/dialogs/preferences.py +37 -26
- novelwriter/dialogs/projectsettings.py +3 -0
- novelwriter/extensions/configlayout.py +6 -2
- novelwriter/extensions/switch.py +16 -15
- novelwriter/extensions/switchbox.py +1 -0
- novelwriter/formats/tokenizer.py +2 -1
- novelwriter/gui/doceditor.py +98 -40
- novelwriter/gui/noveltree.py +11 -5
- novelwriter/gui/outline.py +9 -1
- novelwriter/gui/projtree.py +1 -0
- novelwriter/gui/search.py +1 -0
- novelwriter/gui/statusbar.py +14 -6
- novelwriter/gui/theme.py +25 -10
- novelwriter/guimain.py +29 -9
- novelwriter/splash.py +74 -0
- novelwriter/tools/lipsum.py +2 -1
- novelwriter/tools/manuscript.py +1 -1
- novelwriter/tools/manussettings.py +38 -13
- novelwriter/tools/noveldetails.py +9 -8
- novelwriter/tools/welcome.py +1 -0
- novelwriter/tools/writingstats.py +68 -45
- {novelwriter-2.7b1.dist-info → novelwriter-2.7rc1.dist-info}/METADATA +1 -1
- {novelwriter-2.7b1.dist-info → novelwriter-2.7rc1.dist-info}/RECORD +56 -53
- {novelwriter-2.7b1.dist-info → novelwriter-2.7rc1.dist-info}/WHEEL +1 -1
- {novelwriter-2.7b1.dist-info → novelwriter-2.7rc1.dist-info}/entry_points.txt +0 -0
- {novelwriter-2.7b1.dist-info → novelwriter-2.7rc1.dist-info}/licenses/LICENSE.md +0 -0
- {novelwriter-2.7b1.dist-info → novelwriter-2.7rc1.dist-info}/top_level.txt +0 -0
novelwriter/splash.py
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
"""
|
2
|
+
novelWriter – Splash Screen
|
3
|
+
===========================
|
4
|
+
|
5
|
+
File History:
|
6
|
+
Created: 2015-04-25 [2.7rc1]
|
7
|
+
|
8
|
+
This file is a part of novelWriter
|
9
|
+
Copyright (C) 2025 Veronica Berglyd Olsen and novelWriter contributors
|
10
|
+
|
11
|
+
This program is free software: you can redistribute it and/or modify
|
12
|
+
it under the terms of the GNU General Public License as published by
|
13
|
+
the Free Software Foundation, either version 3 of the License, or
|
14
|
+
(at your option) any later version.
|
15
|
+
|
16
|
+
This program is distributed in the hope that it will be useful, but
|
17
|
+
WITHOUT ANY WARRANTY; without even the implied warranty of
|
18
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
19
|
+
General Public License for more details.
|
20
|
+
|
21
|
+
You should have received a copy of the GNU General Public License
|
22
|
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
23
|
+
"""
|
24
|
+
from __future__ import annotations
|
25
|
+
|
26
|
+
import logging
|
27
|
+
|
28
|
+
from pathlib import Path
|
29
|
+
from time import sleep
|
30
|
+
|
31
|
+
from PyQt6.QtCore import QRect, Qt
|
32
|
+
from PyQt6.QtGui import QColor, QPainter, QPixmap
|
33
|
+
from PyQt6.QtWidgets import QSplashScreen
|
34
|
+
|
35
|
+
logger = logging.getLogger(__name__)
|
36
|
+
|
37
|
+
SPLASH_IMG = Path(__file__).parent / "assets" / "images" / "splash.png"
|
38
|
+
|
39
|
+
|
40
|
+
class NSplashScreen(QSplashScreen):
|
41
|
+
|
42
|
+
__slots__ = ("_color", "_rect", "_text")
|
43
|
+
|
44
|
+
def __init__(self) -> None:
|
45
|
+
super().__init__(pixmap=QPixmap(str(SPLASH_IMG)), flags=Qt.WindowType.WindowStaysOnTopHint)
|
46
|
+
|
47
|
+
logger.debug("Create: NSplashScreen")
|
48
|
+
|
49
|
+
font = self.font()
|
50
|
+
font.setPointSizeF(12.0)
|
51
|
+
self.setFont(font)
|
52
|
+
self._color = QColor(26, 52, 78)
|
53
|
+
self._rect = QRect(144, 110, 440, 30)
|
54
|
+
self._text = ""
|
55
|
+
return
|
56
|
+
|
57
|
+
def __del__(self) -> None: # pragma: no cover
|
58
|
+
logger.debug("Delete: NSplashScreen")
|
59
|
+
return
|
60
|
+
|
61
|
+
def drawContents(self, painter: QPainter) -> None:
|
62
|
+
"""Draw the text message."""
|
63
|
+
painter.setPen(self._color)
|
64
|
+
painter.drawText(self._rect, Qt.AlignmentFlag.AlignLeft, self._text)
|
65
|
+
return
|
66
|
+
|
67
|
+
def showStatus(self, message: str) -> None:
|
68
|
+
"""Update the status message."""
|
69
|
+
self._text = message
|
70
|
+
self.showMessage(message)
|
71
|
+
if message:
|
72
|
+
logger.info("[Splash] %s", message)
|
73
|
+
sleep(0.025)
|
74
|
+
return
|
novelwriter/tools/lipsum.py
CHANGED
@@ -75,8 +75,9 @@ class GuiLipsum(NDialog):
|
|
75
75
|
self.paraCount.setMaximum(100)
|
76
76
|
self.paraCount.setValue(5)
|
77
77
|
|
78
|
-
self.randLabel = QLabel(self.tr("Randomise order"), self)
|
79
78
|
self.randSwitch = NSwitch(self)
|
79
|
+
self.randLabel = QLabel(self.tr("Randomise order"), self)
|
80
|
+
self.randLabel.setBuddy(self.randSwitch)
|
80
81
|
|
81
82
|
self.formBox = QGridLayout()
|
82
83
|
self.formBox.addWidget(self.headLabel, 0, 0, 1, 2, QtAlignLeft)
|
novelwriter/tools/manuscript.py
CHANGED
@@ -630,7 +630,7 @@ class _DetailsWidget(QWidget):
|
|
630
630
|
self.listView.addTopLevelItem(item)
|
631
631
|
for key in [
|
632
632
|
"text.includeSynopsis", "text.includeComments", "text.includeStory",
|
633
|
-
"text.includeKeywords", "text.includeBodyText",
|
633
|
+
"text.includeNotes", "text.includeKeywords", "text.includeBodyText",
|
634
634
|
]:
|
635
635
|
sub = QTreeWidgetItem()
|
636
636
|
sub.setText(0, build.getLabel(key))
|
@@ -104,6 +104,7 @@ class GuiBuildSettings(NToolDialog):
|
|
104
104
|
# SideBar
|
105
105
|
self.sidebar = NPagedSideBar(self)
|
106
106
|
self.sidebar.setLabelColor(SHARED.theme.helpText)
|
107
|
+
self.sidebar.setAccessibleName(self.titleLabel.text())
|
107
108
|
|
108
109
|
self.sidebar.addLabel(self.tr("General"))
|
109
110
|
self.sidebar.addButton(self.tr("Selection"), self.OPT_FILTERS)
|
@@ -564,9 +565,10 @@ class _HeadingsTab(NScrollablePage):
|
|
564
565
|
self.fmtPart.setReadOnly(True)
|
565
566
|
self.btnPart = NIconToolButton(self, iSz, "edit", "green")
|
566
567
|
self.btnPart.clicked.connect(qtLambda(self._editHeading, self.EDIT_TITLE))
|
568
|
+
self.swtPart = NSwitch(self, height=iPx)
|
567
569
|
self.hdePart = QLabel(trHide, self)
|
568
570
|
self.hdePart.setIndent(6)
|
569
|
-
self.
|
571
|
+
self.hdePart.setBuddy(self.swtPart)
|
570
572
|
|
571
573
|
self.formatBox.addWidget(self.lblPart, 0, 0)
|
572
574
|
self.formatBox.addWidget(self.fmtPart, 0, 1)
|
@@ -580,9 +582,10 @@ class _HeadingsTab(NScrollablePage):
|
|
580
582
|
self.fmtChapter.setReadOnly(True)
|
581
583
|
self.btnChapter = NIconToolButton(self, iSz, "edit", "green")
|
582
584
|
self.btnChapter.clicked.connect(qtLambda(self._editHeading, self.EDIT_CHAPTER))
|
585
|
+
self.swtChapter = NSwitch(self, height=iPx)
|
583
586
|
self.hdeChapter = QLabel(trHide, self)
|
584
587
|
self.hdeChapter.setIndent(6)
|
585
|
-
self.
|
588
|
+
self.hdeChapter.setBuddy(self.swtChapter)
|
586
589
|
|
587
590
|
self.formatBox.addWidget(self.lblChapter, 1, 0)
|
588
591
|
self.formatBox.addWidget(self.fmtChapter, 1, 1)
|
@@ -596,9 +599,10 @@ class _HeadingsTab(NScrollablePage):
|
|
596
599
|
self.fmtUnnumbered.setReadOnly(True)
|
597
600
|
self.btnUnnumbered = NIconToolButton(self, iSz, "edit", "green")
|
598
601
|
self.btnUnnumbered.clicked.connect(qtLambda(self._editHeading, self.EDIT_UNNUM))
|
602
|
+
self.swtUnnumbered = NSwitch(self, height=iPx)
|
599
603
|
self.hdeUnnumbered = QLabel(trHide, self)
|
600
604
|
self.hdeUnnumbered.setIndent(6)
|
601
|
-
self.
|
605
|
+
self.hdeUnnumbered.setBuddy(self.swtUnnumbered)
|
602
606
|
|
603
607
|
self.formatBox.addWidget(self.lblUnnumbered, 2, 0)
|
604
608
|
self.formatBox.addWidget(self.fmtUnnumbered, 2, 1)
|
@@ -612,9 +616,10 @@ class _HeadingsTab(NScrollablePage):
|
|
612
616
|
self.fmtScene.setReadOnly(True)
|
613
617
|
self.btnScene = NIconToolButton(self, iSz, "edit", "green")
|
614
618
|
self.btnScene.clicked.connect(qtLambda(self._editHeading, self.EDIT_SCENE))
|
619
|
+
self.swtScene = NSwitch(self, height=iPx)
|
615
620
|
self.hdeScene = QLabel(trHide, self)
|
616
621
|
self.hdeScene.setIndent(6)
|
617
|
-
self.
|
622
|
+
self.hdeScene.setBuddy(self.swtScene)
|
618
623
|
|
619
624
|
self.formatBox.addWidget(self.lblScene, 3, 0)
|
620
625
|
self.formatBox.addWidget(self.fmtScene, 3, 1)
|
@@ -628,9 +633,10 @@ class _HeadingsTab(NScrollablePage):
|
|
628
633
|
self.fmtAScene.setReadOnly(True)
|
629
634
|
self.btnAScene = NIconToolButton(self, iSz, "edit", "green")
|
630
635
|
self.btnAScene.clicked.connect(qtLambda(self._editHeading, self.EDIT_HSCENE))
|
636
|
+
self.swtAScene = NSwitch(self, height=iPx)
|
631
637
|
self.hdeAScene = QLabel(trHide, self)
|
632
638
|
self.hdeAScene.setIndent(6)
|
633
|
-
self.
|
639
|
+
self.hdeAScene.setBuddy(self.swtAScene)
|
634
640
|
|
635
641
|
self.formatBox.addWidget(self.lblAScene, 4, 0)
|
636
642
|
self.formatBox.addWidget(self.fmtAScene, 4, 1)
|
@@ -644,9 +650,10 @@ class _HeadingsTab(NScrollablePage):
|
|
644
650
|
self.fmtSection.setReadOnly(True)
|
645
651
|
self.btnSection = NIconToolButton(self, iSz, "edit", "green")
|
646
652
|
self.btnSection.clicked.connect(qtLambda(self._editHeading, self.EDIT_SECTION))
|
653
|
+
self.swtSection = NSwitch(self, height=iPx)
|
647
654
|
self.hdeSection = QLabel(trHide, self)
|
648
655
|
self.hdeSection.setIndent(6)
|
649
|
-
self.
|
656
|
+
self.hdeSection.setBuddy(self.swtSection)
|
650
657
|
|
651
658
|
self.formatBox.addWidget(self.lblSection, 5, 0)
|
652
659
|
self.formatBox.addWidget(self.fmtSection, 5, 1)
|
@@ -704,44 +711,59 @@ class _HeadingsTab(NScrollablePage):
|
|
704
711
|
|
705
712
|
# Layout Matrix
|
706
713
|
# =============
|
714
|
+
trCentre = self.tr("Centre")
|
715
|
+
trBreak = self.tr("Page Break")
|
716
|
+
|
707
717
|
self.layoutMatrix = QGridLayout()
|
708
718
|
self.layoutMatrix.setVerticalSpacing(12)
|
709
719
|
self.layoutMatrix.setHorizontalSpacing(12)
|
710
720
|
|
711
|
-
self.layoutMatrix.addWidget(QLabel(
|
712
|
-
self.layoutMatrix.addWidget(QLabel(
|
721
|
+
self.layoutMatrix.addWidget(QLabel(trCentre, self), 0, 1)
|
722
|
+
self.layoutMatrix.addWidget(QLabel(trBreak, self), 0, 2)
|
713
723
|
|
714
724
|
# Title Layout
|
715
|
-
|
725
|
+
trLabel = self._build.getLabel("headings.styleTitle")
|
726
|
+
self.lblTitle = QLabel(trLabel, self)
|
716
727
|
self.centerTitle = NSwitch(self, height=iPx)
|
728
|
+
self.centerTitle.setAccessibleName(f"{trLabel}: {trCentre}")
|
717
729
|
self.breakTitle = NSwitch(self, height=iPx)
|
730
|
+
self.breakTitle.setAccessibleName(f"{trLabel}: {trBreak}")
|
718
731
|
|
719
732
|
self.layoutMatrix.addWidget(self.lblTitle, 1, 0)
|
720
733
|
self.layoutMatrix.addWidget(self.centerTitle, 1, 1, QtAlignCenter)
|
721
734
|
self.layoutMatrix.addWidget(self.breakTitle, 1, 2, QtAlignCenter)
|
722
735
|
|
723
736
|
# Partition Layout
|
724
|
-
|
737
|
+
trLabel = self._build.getLabel("headings.stylePart")
|
738
|
+
self.lblPart = QLabel(trLabel, self)
|
725
739
|
self.centerPart = NSwitch(self, height=iPx)
|
740
|
+
self.centerPart.setAccessibleName(f"{trLabel}: {trCentre}")
|
726
741
|
self.breakPart = NSwitch(self, height=iPx)
|
742
|
+
self.breakPart.setAccessibleName(f"{trLabel}: {trBreak}")
|
727
743
|
|
728
744
|
self.layoutMatrix.addWidget(self.lblPart, 2, 0)
|
729
745
|
self.layoutMatrix.addWidget(self.centerPart, 2, 1, QtAlignCenter)
|
730
746
|
self.layoutMatrix.addWidget(self.breakPart, 2, 2, QtAlignCenter)
|
731
747
|
|
732
748
|
# Chapter Layout
|
733
|
-
|
749
|
+
trLabel = self._build.getLabel("headings.styleChapter")
|
750
|
+
self.lblChapter = QLabel(trLabel, self)
|
734
751
|
self.centerChapter = NSwitch(self, height=iPx)
|
752
|
+
self.centerChapter.setAccessibleName(f"{trLabel}: {trCentre}")
|
735
753
|
self.breakChapter = NSwitch(self, height=iPx)
|
754
|
+
self.breakChapter.setAccessibleName(f"{trLabel}: {trBreak}")
|
736
755
|
|
737
756
|
self.layoutMatrix.addWidget(self.lblChapter, 3, 0)
|
738
757
|
self.layoutMatrix.addWidget(self.centerChapter, 3, 1, QtAlignCenter)
|
739
758
|
self.layoutMatrix.addWidget(self.breakChapter, 3, 2, QtAlignCenter)
|
740
759
|
|
741
760
|
# Scene Layout
|
742
|
-
|
761
|
+
trLabel = self._build.getLabel("headings.styleScene")
|
762
|
+
self.lblScene = QLabel(trLabel, self)
|
743
763
|
self.centerScene = NSwitch(self, height=iPx)
|
764
|
+
self.centerScene.setAccessibleName(f"{trLabel}: {trCentre}")
|
744
765
|
self.breakScene = NSwitch(self, height=iPx)
|
766
|
+
self.breakScene.setAccessibleName(f"{trLabel}: {trBreak}")
|
745
767
|
|
746
768
|
self.layoutMatrix.addWidget(self.lblScene, 4, 0)
|
747
769
|
self.layoutMatrix.addWidget(self.centerScene, 4, 1, QtAlignCenter)
|
@@ -952,12 +974,14 @@ class _FormattingTab(NScrollableForm):
|
|
952
974
|
self.incSynopsis = NSwitch(self, height=iPx)
|
953
975
|
self.incComments = NSwitch(self, height=iPx)
|
954
976
|
self.incStory = NSwitch(self, height=iPx)
|
977
|
+
self.incNotes = NSwitch(self, height=iPx)
|
955
978
|
self.incKeywords = NSwitch(self, height=iPx)
|
956
979
|
|
957
980
|
self.addRow(self._build.getLabel("text.includeBodyText"), self.incBodyText)
|
958
981
|
self.addRow(self._build.getLabel("text.includeSynopsis"), self.incSynopsis)
|
959
982
|
self.addRow(self._build.getLabel("text.includeComments"), self.incComments)
|
960
983
|
self.addRow(self._build.getLabel("text.includeStory"), self.incStory)
|
984
|
+
self.addRow(self._build.getLabel("text.includeNotes"), self.incNotes)
|
961
985
|
self.addRow(self._build.getLabel("text.includeKeywords"), self.incKeywords)
|
962
986
|
|
963
987
|
# Ignored Keywords
|
@@ -979,7 +1003,6 @@ class _FormattingTab(NScrollableForm):
|
|
979
1003
|
|
980
1004
|
# Note Headings
|
981
1005
|
self.addNoteHead = NSwitch(self, height=iPx)
|
982
|
-
|
983
1006
|
self.addRow(self._build.getLabel("text.addNoteHeadings"), self.addNoteHead)
|
984
1007
|
|
985
1008
|
# Text Format
|
@@ -1267,6 +1290,7 @@ class _FormattingTab(NScrollableForm):
|
|
1267
1290
|
self.incSynopsis.setChecked(self._build.getBool("text.includeSynopsis"))
|
1268
1291
|
self.incComments.setChecked(self._build.getBool("text.includeComments"))
|
1269
1292
|
self.incStory.setChecked(self._build.getBool("text.includeStory"))
|
1293
|
+
self.incNotes.setChecked(self._build.getBool("text.includeNotes"))
|
1270
1294
|
self.incKeywords.setChecked(self._build.getBool("text.includeKeywords"))
|
1271
1295
|
self.ignoredKeywords.setText(self._build.getStr("text.ignoredKeywords"))
|
1272
1296
|
self.addNoteHead.setChecked(self._build.getBool("text.addNoteHeadings"))
|
@@ -1366,6 +1390,7 @@ class _FormattingTab(NScrollableForm):
|
|
1366
1390
|
self._build.setValue("text.includeSynopsis", self.incSynopsis.isChecked())
|
1367
1391
|
self._build.setValue("text.includeComments", self.incComments.isChecked())
|
1368
1392
|
self._build.setValue("text.includeStory", self.incStory.isChecked())
|
1393
|
+
self._build.setValue("text.includeNotes", self.incNotes.isChecked())
|
1369
1394
|
self._build.setValue("text.includeKeywords", self.incKeywords.isChecked())
|
1370
1395
|
self._build.setValue("text.ignoredKeywords", self.ignoredKeywords.text())
|
1371
1396
|
self._build.setValue("text.addNoteHeadings", self.addNoteHead.isChecked())
|
@@ -86,6 +86,7 @@ class GuiNovelDetails(NNonBlockingDialog):
|
|
86
86
|
# SideBar
|
87
87
|
self.sidebar = NPagedSideBar(self)
|
88
88
|
self.sidebar.setLabelColor(SHARED.theme.helpText)
|
89
|
+
self.sidebar.setAccessibleName(self.titleLabel.text())
|
89
90
|
self.sidebar.addButton(self.tr("Overview"), self.PAGE_OVERVIEW)
|
90
91
|
self.sidebar.addButton(self.tr("Contents"), self.PAGE_CONTENTS)
|
91
92
|
self.sidebar.setSelected(self.PAGE_OVERVIEW)
|
@@ -256,8 +257,8 @@ class _OverviewPage(NScrollablePage):
|
|
256
257
|
def updateProjectData(self) -> None:
|
257
258
|
"""Load information about the project."""
|
258
259
|
project = SHARED.project
|
259
|
-
project.
|
260
|
-
wcNovel, wcNotes = project.data.currCounts
|
260
|
+
project.updateCounts()
|
261
|
+
wcNovel, wcNotes, _, _ = project.data.currCounts
|
261
262
|
|
262
263
|
self.projName.setText(project.data.name)
|
263
264
|
self.projRevisions.setText(f"{project.data.saveCount:n}")
|
@@ -356,16 +357,14 @@ class _ContentsPage(NFixedPage):
|
|
356
357
|
countFrom = options.getInt("GuiNovelDetails", "countFrom", 1)
|
357
358
|
clearDouble = options.getBool("GuiNovelDetails", "clearDouble", True)
|
358
359
|
|
359
|
-
self.wpLabel = QLabel(self.tr("Words per page"), self)
|
360
|
-
|
361
360
|
self.wpValue = QSpinBox(self)
|
362
361
|
self.wpValue.setMinimum(10)
|
363
362
|
self.wpValue.setMaximum(1000)
|
364
363
|
self.wpValue.setSingleStep(10)
|
365
364
|
self.wpValue.setValue(wordsPerPage)
|
366
365
|
self.wpValue.valueChanged.connect(self._populateTree)
|
367
|
-
|
368
|
-
self.
|
366
|
+
self.wpLabel = QLabel(self.tr("Words per page"), self)
|
367
|
+
self.wpLabel.setBuddy(self.wpValue)
|
369
368
|
|
370
369
|
self.poValue = QSpinBox(self)
|
371
370
|
self.poValue.setMinimum(1)
|
@@ -373,12 +372,14 @@ class _ContentsPage(NFixedPage):
|
|
373
372
|
self.poValue.setSingleStep(1)
|
374
373
|
self.poValue.setValue(countFrom)
|
375
374
|
self.poValue.valueChanged.connect(self._populateTree)
|
376
|
-
|
377
|
-
self.
|
375
|
+
self.poLabel = QLabel(self.tr("First page offset"), self)
|
376
|
+
self.poLabel.setBuddy(self.poValue)
|
378
377
|
|
379
378
|
self.dblValue = NSwitch(self, height=iPx)
|
380
379
|
self.dblValue.setChecked(clearDouble)
|
381
380
|
self.dblValue.clicked.connect(self._populateTree)
|
381
|
+
self.dblLabel = QLabel(self.tr("Chapters on odd pages"), self)
|
382
|
+
self.dblLabel.setBuddy(self.dblValue)
|
382
383
|
|
383
384
|
self.optionsBox = QGridLayout()
|
384
385
|
self.optionsBox.addWidget(self.wpLabel, 0, 0)
|
novelwriter/tools/welcome.py
CHANGED
@@ -565,6 +565,7 @@ class _NewProjectForm(QWidget):
|
|
565
565
|
self.projAuthor = QLineEdit(self)
|
566
566
|
self.projAuthor.setMaxLength(200)
|
567
567
|
self.projAuthor.setPlaceholderText(self.tr("Optional"))
|
568
|
+
self.projAuthor.setText(CONFIG.lastAuthor)
|
568
569
|
|
569
570
|
# Project Path
|
570
571
|
self.projPath = QLineEdit(self)
|
@@ -183,59 +183,82 @@ class GuiWritingStats(NToolDialog):
|
|
183
183
|
# Filter Options
|
184
184
|
iPx = SHARED.theme.baseIconHeight
|
185
185
|
|
186
|
-
self.filterBox = QGroupBox(self.tr("Filters"), self)
|
187
186
|
self.filterForm = QGridLayout(self)
|
187
|
+
self.filterForm.setRowStretch(6, 1)
|
188
|
+
self.filterBox = QGroupBox(self.tr("Filters"), self)
|
188
189
|
self.filterBox.setLayout(self.filterForm)
|
189
190
|
|
190
|
-
|
191
|
-
self.
|
191
|
+
# Include Novel Files
|
192
|
+
self.swtIncNovel = NSwitch(self, height=iPx)
|
193
|
+
self.swtIncNovel.setChecked(
|
192
194
|
pOptions.getBool("GuiWritingStats", "incNovel", True)
|
193
195
|
)
|
194
|
-
self.
|
196
|
+
self.swtIncNovel.clicked.connect(self._updateListBox)
|
197
|
+
self.lblIncNovel = QLabel(self.tr("Count novel files"), self)
|
198
|
+
self.lblIncNovel.setBuddy(self.swtIncNovel)
|
195
199
|
|
196
|
-
self.
|
197
|
-
self.
|
200
|
+
self.filterForm.addWidget(self.lblIncNovel, 0, 0)
|
201
|
+
self.filterForm.addWidget(self.swtIncNovel, 0, 1)
|
202
|
+
|
203
|
+
# Include Note Files
|
204
|
+
self.swtIncNotes = NSwitch(self, height=iPx)
|
205
|
+
self.swtIncNotes.setChecked(
|
198
206
|
pOptions.getBool("GuiWritingStats", "incNotes", True)
|
199
207
|
)
|
200
|
-
self.
|
208
|
+
self.swtIncNotes.clicked.connect(self._updateListBox)
|
209
|
+
self.lblIncNotes = QLabel(self.tr("Count note files"), self)
|
210
|
+
self.lblIncNotes.setBuddy(self.swtIncNotes)
|
211
|
+
|
212
|
+
self.filterForm.addWidget(self.lblIncNotes, 1, 0)
|
213
|
+
self.filterForm.addWidget(self.swtIncNotes, 1, 1)
|
201
214
|
|
202
|
-
|
203
|
-
self.
|
215
|
+
# Hide Zero Counts
|
216
|
+
self.swtHideZeros = NSwitch(self, height=iPx)
|
217
|
+
self.swtHideZeros.setChecked(
|
204
218
|
pOptions.getBool("GuiWritingStats", "hideZeros", True)
|
205
219
|
)
|
206
|
-
self.
|
220
|
+
self.swtHideZeros.clicked.connect(self._updateListBox)
|
221
|
+
self.lblHideZeros = QLabel(self.tr("Hide zero word count"), self)
|
222
|
+
self.lblHideZeros.setBuddy(self.swtHideZeros)
|
207
223
|
|
208
|
-
self.
|
209
|
-
self.
|
224
|
+
self.filterForm.addWidget(self.lblHideZeros, 2, 0)
|
225
|
+
self.filterForm.addWidget(self.swtHideZeros, 2, 1)
|
226
|
+
|
227
|
+
# Hide Negative Counts
|
228
|
+
self.swtHideNegative = NSwitch(self, height=iPx)
|
229
|
+
self.swtHideNegative.setChecked(
|
210
230
|
pOptions.getBool("GuiWritingStats", "hideNegative", False)
|
211
231
|
)
|
212
|
-
self.
|
232
|
+
self.swtHideNegative.clicked.connect(self._updateListBox)
|
233
|
+
self.lblHideNegative = QLabel(self.tr("Hide negative word count"), self)
|
234
|
+
self.lblHideNegative.setBuddy(self.swtHideNegative)
|
235
|
+
|
236
|
+
self.filterForm.addWidget(self.lblHideNegative, 3, 0)
|
237
|
+
self.filterForm.addWidget(self.swtHideNegative, 3, 1)
|
213
238
|
|
214
|
-
|
215
|
-
self.
|
239
|
+
# Group Entries
|
240
|
+
self.swtGroupByDay = NSwitch(self, height=iPx)
|
241
|
+
self.swtGroupByDay.setChecked(
|
216
242
|
pOptions.getBool("GuiWritingStats", "groupByDay", False)
|
217
243
|
)
|
218
|
-
self.
|
244
|
+
self.swtGroupByDay.clicked.connect(self._updateListBox)
|
245
|
+
self.lblGroupByDay = QLabel(self.tr("Group entries by day"), self)
|
246
|
+
self.lblGroupByDay.setBuddy(self.swtGroupByDay)
|
247
|
+
|
248
|
+
self.filterForm.addWidget(self.lblGroupByDay, 4, 0)
|
249
|
+
self.filterForm.addWidget(self.swtGroupByDay, 4, 1)
|
219
250
|
|
220
|
-
|
221
|
-
self.
|
251
|
+
# Show Idle
|
252
|
+
self.swtShowIdleTime = NSwitch(self, height=iPx)
|
253
|
+
self.swtShowIdleTime.setChecked(
|
222
254
|
pOptions.getBool("GuiWritingStats", "showIdleTime", False)
|
223
255
|
)
|
224
|
-
self.
|
225
|
-
|
226
|
-
self.
|
227
|
-
|
228
|
-
self.filterForm.addWidget(
|
229
|
-
self.filterForm.addWidget(
|
230
|
-
self.filterForm.addWidget(QLabel(self.tr("Group entries by day"), self), 4, 0)
|
231
|
-
self.filterForm.addWidget(QLabel(self.tr("Show idle time"), self), 5, 0)
|
232
|
-
self.filterForm.addWidget(self.incNovel, 0, 1)
|
233
|
-
self.filterForm.addWidget(self.incNotes, 1, 1)
|
234
|
-
self.filterForm.addWidget(self.hideZeros, 2, 1)
|
235
|
-
self.filterForm.addWidget(self.hideNegative, 3, 1)
|
236
|
-
self.filterForm.addWidget(self.groupByDay, 4, 1)
|
237
|
-
self.filterForm.addWidget(self.showIdleTime, 5, 1)
|
238
|
-
self.filterForm.setRowStretch(6, 1)
|
256
|
+
self.swtShowIdleTime.clicked.connect(self._updateListBox)
|
257
|
+
self.lblShowIdleTime = QLabel(self.tr("Show idle time"), self)
|
258
|
+
self.lblShowIdleTime.setBuddy(self.swtShowIdleTime)
|
259
|
+
|
260
|
+
self.filterForm.addWidget(self.lblShowIdleTime, 5, 0)
|
261
|
+
self.filterForm.addWidget(self.swtShowIdleTime, 5, 1)
|
239
262
|
|
240
263
|
# Settings
|
241
264
|
self.histMax = QSpinBox(self)
|
@@ -325,12 +348,12 @@ class GuiWritingStats(NToolDialog):
|
|
325
348
|
|
326
349
|
sortCol = self.listBox.sortColumn()
|
327
350
|
sortOrder = header.sortIndicatorOrder() if header else 0
|
328
|
-
incNovel = self.
|
329
|
-
incNotes = self.
|
330
|
-
hideZeros = self.
|
331
|
-
hideNegative = self.
|
332
|
-
groupByDay = self.
|
333
|
-
showIdleTime = self.
|
351
|
+
incNovel = self.swtIncNovel.isChecked()
|
352
|
+
incNotes = self.swtIncNotes.isChecked()
|
353
|
+
hideZeros = self.swtHideZeros.isChecked()
|
354
|
+
hideNegative = self.swtHideNegative.isChecked()
|
355
|
+
groupByDay = self.swtGroupByDay.isChecked()
|
356
|
+
showIdleTime = self.swtShowIdleTime.isChecked()
|
334
357
|
histMax = self.histMax.value()
|
335
358
|
|
336
359
|
logger.debug("Saving State: GuiWritingStats")
|
@@ -487,11 +510,11 @@ class GuiWritingStats(NToolDialog):
|
|
487
510
|
self.listBox.clear()
|
488
511
|
self.timeFilter = 0.0
|
489
512
|
|
490
|
-
incNovel = self.
|
491
|
-
incNotes = self.
|
492
|
-
hideZeros = self.
|
493
|
-
hideNegative = self.
|
494
|
-
groupByDay = self.
|
513
|
+
incNovel = self.swtIncNovel.isChecked()
|
514
|
+
incNotes = self.swtIncNotes.isChecked()
|
515
|
+
hideZeros = self.swtHideZeros.isChecked()
|
516
|
+
hideNegative = self.swtHideNegative.isChecked()
|
517
|
+
groupByDay = self.swtGroupByDay.isChecked()
|
495
518
|
histMax = self.histMax.value()
|
496
519
|
|
497
520
|
# Group the data
|
@@ -563,7 +586,7 @@ class GuiWritingStats(NToolDialog):
|
|
563
586
|
# Populate the list
|
564
587
|
mTrans = Qt.TransformationMode.FastTransformation
|
565
588
|
mAspect = Qt.AspectRatioMode.IgnoreAspectRatio
|
566
|
-
showIdleTime = self.
|
589
|
+
showIdleTime = self.swtShowIdleTime.isChecked()
|
567
590
|
for _, sStart, sDiff, nWords, _, _, sIdle in self.filterData:
|
568
591
|
|
569
592
|
if showIdleTime:
|