Merge branch 'main' into outline_view

This commit is contained in:
Veronica Berglyd Olsen
2022-05-22 16:19:53 +02:00
47 changed files with 2613 additions and 2381 deletions
+3 -3
View File
@@ -60,9 +60,9 @@ __license__ = "GPLv3"
__author__ = "Veronica Berglyd Olsen"
__maintainer__ = "Veronica Berglyd Olsen"
__email__ = "code@vkbo.net"
__version__ = "1.7-alpha0"
__hexversion__ = "0x010700a0"
__date__ = "2022-02-20"
__version__ = "1.7-beta1"
__hexversion__ = "0x010700b1"
__date__ = "2022-05-17"
__status__ = "Stable"
__domain__ = "novelwriter.io"
__url__ = "https://novelwriter.io"
+100 -100
View File
@@ -2,104 +2,104 @@
"Synopsis": "Synopsis",
"Comment": "Opmerking",
"Notes": "Notities",
"0": "Nul",
"1": "Één",
"2": "Twee",
"3": "Drie",
"4": "Vier",
"5": "Vijf",
"6": "Zes",
"7": "Zeven",
"8": "Acht",
"9": "Negen",
"10": "Tien",
"11": "Elf",
"12": "Twaalf",
"13": "Dertien",
"14": "Veertien",
"15": "Vijftien",
"16": "Zestien",
"17": "Zeventien",
"18": "Achttien",
"19": "Negentien",
"20": "Twintig",
"21": "Eenentwintig",
"22": "Tweeentwintig",
"23": "Drieentwintig",
"24": "Vierentwintig",
"25": "Vijfentwintig",
"26": "Zesentwintig",
"27": "Zevenentwintig",
"28": "Achtentwintig",
"29": "Negenentwintig",
"30": "Dertig",
"31": "Eenendertig",
"32": "Tweeendertig",
"33": "Drieendertig",
"34": "Vierendertig",
"35": "Vijfendertig",
"36": "Zesendertig",
"37": "Zevenendertig",
"38": "Achtendertig",
"39": "Negenendertig",
"40": "Veertig",
"41": "Eenenveertig",
"42": "Tweeënveertig",
"43": "Drieenveertig",
"44": "Vierenveertig",
"45": "Vijfenveertig",
"46": "Zesenveertig",
"47": "Zevenenveertig",
"48": "Achtenveertig",
"49": "Negenenveertig",
"50": "Vijftig",
"51": "Eenenvijftig",
"52": "Tweeenvijftig",
"53": "Drieenvijftig",
"54": "Vierenvijftig",
"55": "Vijfenvijftig",
"56": "Zesenvijftig",
"57": "Zevenenvijftig",
"58": "Achtenvijftig",
"59": "Negenenvijftig",
"60": "Zestig",
"61": "Eenenzestig",
"62": "Tweeenzestig",
"63": "Drieenzestig",
"64": "Vierenzestig",
"65": "Vijfenzestig",
"66": "Zesenzestig",
"67": "Zevenenzestig",
"68": "Achtenzestig",
"69": "Negenenzestig",
"70": "Zeventig",
"71": "Eenenzeventig",
"72": "Tweeenzeventig",
"73": "Drieenzeventig",
"74": "Vierenzeventig",
"75": "Vijfenzeventig",
"76": "Zesenzeventig",
"77": "Zevenenzeventig",
"78": "Achtenzeventig",
"79": "Negenenzeventig",
"80": "Tachtig",
"81": "Eenentachtig",
"82": "Tweeentachtig",
"83": "Drieentachtig",
"84": "Vierentachtig",
"85": "Vijfentachtig",
"86": "Zesentachtig",
"87": "Zevenentachtig",
"88": "Achtentachtig",
"89": "Negenentachtig",
"90": "Negentig",
"91": "Eenennegentig",
"92": "Tweeennegentig",
"93": "Drieennegentig",
"94": "Vierennegentig",
"95": "Vijfennegentig",
"96": "Zesennegentig",
"97": "Zevenennegentig",
"98": "Achtennegentig",
"99": "Negenennegentig"
"0": "nul",
"1": "één",
"2": "twee",
"3": "drie",
"4": "vier",
"5": "vijf",
"6": "zes",
"7": "zeven",
"8": "acht",
"9": "negen",
"10": "tien",
"11": "elf",
"12": "twaalf",
"13": "dertien",
"14": "veertien",
"15": "vijftien",
"16": "zestien",
"17": "zeventien",
"18": "achttien",
"19": "negentien",
"20": "twintig",
"21": "eenentwintig",
"22": "tweeëntwintig",
"23": "drieëntwintig",
"24": "vierentwintig",
"25": "vijfentwintig",
"26": "zesentwintig",
"27": "zevenentwintig",
"28": "achtentwintig",
"29": "negenentwintig",
"30": "dertig",
"31": "eenendertig",
"32": "tweeëndertig",
"33": "drieëndertig",
"34": "vierendertig",
"35": "vijfendertig",
"36": "zesendertig",
"37": "zevenendertig",
"38": "achtendertig",
"39": "negenendertig",
"40": "veertig",
"41": "eenenveertig",
"42": "tweeënveertig",
"43": "drieënveertig",
"44": "vierenveertig",
"45": "vijfenveertig",
"46": "zesenveertig",
"47": "zevenenveertig",
"48": "achtenveertig",
"49": "negenenveertig",
"50": "vijftig",
"51": "eenenvijftig",
"52": "tweeënvijftig",
"53": "drieënvijftig",
"54": "vierenvijftig",
"55": "vijfenvijftig",
"56": "zesenvijftig",
"57": "zevenenvijftig",
"58": "achtenvijftig",
"59": "negenenvijftig",
"60": "zestig",
"61": "eenenzestig",
"62": "tweeënzestig",
"63": "drieënzestig",
"64": "vierenzestig",
"65": "vijfenzestig",
"66": "zesenzestig",
"67": "zevenenzestig",
"68": "achtenzestig",
"69": "negenenzestig",
"70": "zeventig",
"71": "eenenzeventig",
"72": "tweeënzeventig",
"73": "drieënzeventig",
"74": "vierenzeventig",
"75": "vijfenzeventig",
"76": "zesenzeventig",
"77": "zevenenzeventig",
"78": "achtenzeventig",
"79": "negenenzeventig",
"80": "tachtig",
"81": "eenentachtig",
"82": "tweeëntachtig",
"83": "drieëntachtig",
"84": "vierentachtig",
"85": "vijfentachtig",
"86": "zesentachtig",
"87": "zevenentachtig",
"88": "achtentachtig",
"89": "negenentachtig",
"90": "negentig",
"91": "eenennegentig",
"92": "tweeënnegentig",
"93": "drieënnegentig",
"94": "vierennegentig",
"95": "vijfennegentig",
"96": "zesennegentig",
"97": "zevenennegentig",
"98": "achtennegentig",
"99": "negenennegentig"
}
+7 -47
View File
@@ -2,56 +2,16 @@
<html>
<body>
<h2>Release Notes for 1.6</h2>
<p><i>Released on 20 February 2022</i></p>
<h2>Release Notes for 1.7 Beta 1</h2>
<p><i>Released on 17 May 2022</i></p>
<p>This release does not introduce any major new features, but is instead a collection of minor
improvements and tweaks based on user requests. There are also a number of changes under the hood
to improve the structure and performance of novelWriter.</p>
<p><u>Some key improvements to the user interface are:</u></p>
<p>&#10003; The max text width setting in Preferences now also applies to the document viewer, and
the setting itself on the Preference dialog has been simplified a bit.</p>
<p>&#10003; When text is selected in the document editor, the number of words selected is displayed
in the editor's footer area.</p>
<p>&#10003; The search tool in the document editor now shows the number of results in the
document.</p>
<p>&#10003; The Enter and Ctrl+O keyboard shortcuts should now work the same way in all tree
views.</p>
<p>&#10003; It is now possible to set a blank section title format on the Build Novel Project tool
and get empty paragraphs in the output. Previously, a blank format would just remove the section
break entirely. This change allows the user to define hard and soft scene breaks using level three
and four headings. The scene and section titles can be hidden completely with two new switches
added to the user interface.</p>
<p><u>Other feature changes include:</u></p>
<p>&#10003; The project index is now automatically rebuilt in the event it is empty or incomplete
when the project is opened.</p>
<p>&#10003; The user can now add their own syntax and GUI theme files in the app folder in their
user area on the host operating system. Where the custom files must be added is described in the
documentation.</p>
<p>&#10003; A Windows installer is yet again provided for novelWriter. If you have novelWriter
installed using another method, make sure you uninstall it properly first as the two methods are
not compatible.</p>
<p>&#10003; Release versions for Ubuntu 21.04 have been dropped, and added for the upcoming Ubuntu
22.04.</p>
<p>&#10003; Most translations have been updated. A Dutch translation is in the works.</p>
<p>This is a beta release of the next release version, and is intended for testing purposes. Please
be careful when using this version on live writing projects, and make sure you take frequent
backups.</p>
<p>Please check the changelog for an overview of changes. The full release notes will be added to
the final release.</p>
<p><i>See also the <a href="https://github.com/vkbo/novelWriter/releases">Releases</a> page.</i></p>
<h2>Patch Notes</h2>
<h3>Patch 1.6.1 &ndash; 16 March 2022</h3>
<p>This is a bugfix and patch release that fixes two recursion/loop issues. One would potentially
cause a crash if the window was resized rapidly, and one would cause a hang with certain search
parameters in the editor's search box. The Latin American Spanish translation has also been
updated.</p>
<h3>Patch 1.6.2 &ndash; 20 March 2022</h3>
<p>This is a bugfix release that fixes a couple of minor issues. Projects containing one or more
empty documents would trigger a rebuild of the index each time the project was opened. This has now
been fixed. Another fix resolves an error message being written to the console logging output when
a new document was created. Both errors were harmless.</p>
</body>
</html>
+58 -52
View File
@@ -120,32 +120,34 @@ class NWProject():
# Item Methods
##
def newRoot(self, rootName, rootClass):
"""Add a new root item.
def newRoot(self, itemClass, label=None):
"""Add a new root item. If label is None, use the class label.
"""
if label is None:
label = trConst(nwLabels.CLASS_NAME[itemClass])
newItem = NWItem(self)
newItem.setName(rootName)
newItem.setName(label)
newItem.setType(nwItemType.ROOT)
newItem.setClass(rootClass)
newItem.setClass(itemClass)
self.projTree.append(None, None, newItem)
self.projTree.updateItemData(newItem.itemHandle)
return newItem.itemHandle
def newFolder(self, folderName, pHandle):
"""Add a new folder with a given name and parent item.
def newFolder(self, label, pHandle):
"""Add a new folder with a given label and parent item.
"""
newItem = NWItem(self)
newItem.setName(folderName)
newItem.setName(label)
newItem.setType(nwItemType.FOLDER)
self.projTree.append(None, pHandle, newItem)
self.projTree.updateItemData(newItem.itemHandle)
return newItem.itemHandle
def newFile(self, fileName, pHandle):
"""Add a new file with a given name and parent item.
def newFile(self, label, pHandle):
"""Add a new file with a given label and parent item.
"""
newItem = NWItem(self)
newItem.setName(fileName)
newItem.setName(label)
newItem.setType(nwItemType.FILE)
self.projTree.append(None, pHandle, newItem)
self.projTree.updateItemData(newItem.itemHandle)
@@ -264,84 +266,88 @@ class NWProject():
self.setBookTitle(projTitle)
self.setBookAuthors(projAuthors)
hNovelRoot = self.newRoot(nwItemClass.NOVEL)
hTitlePage = self.newFile(self.tr("Title Page"), hNovelRoot)
titlePage = "#! %s\n\n" % (self.bookTitle if self.bookTitle else self.projName)
if self.bookAuthors:
titlePage = "%s>> %s %s <<\n" % (titlePage, self.tr("By"), self.getAuthors())
aDoc = NWDoc(self, hTitlePage)
aDoc.writeDocument(titlePage)
if popMinimal:
# Creating a minimal project with a few root folders and a
# single chapter folder with a single file.
xHandle = {}
xHandle[1] = self.newRoot(self.tr("Novel"), nwItemClass.NOVEL)
xHandle[2] = self.newRoot(self.tr("Plot"), nwItemClass.PLOT)
xHandle[3] = self.newRoot(self.tr("Characters"), nwItemClass.CHARACTER)
xHandle[4] = self.newRoot(self.tr("World"), nwItemClass.WORLD)
xHandle[5] = self.newFile(self.tr("Title Page"), xHandle[1])
xHandle[6] = self.newFolder(self.tr("New Chapter"), xHandle[1])
xHandle[7] = self.newFile(self.tr("New Chapter"), xHandle[6])
xHandle[8] = self.newFile(self.tr("New Scene"), xHandle[6])
aDoc = NWDoc(self, xHandle[5])
aDoc.writeDocument(titlePage)
aDoc = NWDoc(self, xHandle[7])
# single chapter with a single scene.
hChapter = self.newFile(self.tr("New Chapter"), hNovelRoot)
aDoc = NWDoc(self, hChapter)
aDoc.writeDocument("## %s\n\n" % self.tr("New Chapter"))
aDoc = NWDoc(self, xHandle[8])
hScene = self.newFile(self.tr("New Scene"), hChapter)
aDoc = NWDoc(self, hScene)
aDoc.writeDocument("### %s\n\n" % self.tr("New Scene"))
self.newRoot(nwItemClass.PLOT)
self.newRoot(nwItemClass.CHARACTER)
self.newRoot(nwItemClass.WORLD)
self.newRoot(nwItemClass.ARCHIVE)
elif popCustom:
# Create a project structure based on selected root folders
# and a number of chapters and scenes selected in the
# wizard's custom page.
# Create root folders
nHandle = self.newRoot(self.tr("Novel"), nwItemClass.NOVEL)
for newRoot in projData.get("addRoots", []):
if newRoot in nwItemClass:
self.newRoot(trConst(nwLabels.CLASS_NAME[newRoot]), newRoot)
# Create a title page
tHandle = self.newFile(self.tr("Title Page"), nHandle)
aDoc = NWDoc(self, tHandle)
aDoc.writeDocument(titlePage)
# Create chapters and scenes
numChapters = projData.get("numChapters", 0)
numScenes = projData.get("numScenes", 0)
chFolders = projData.get("chFolders", False)
chSynop = self.tr("Summary of the chapter.")
scSynop = self.tr("Summary of the scene.")
# Create chapters
if numChapters > 0:
for ch in range(numChapters):
chTitle = self.tr("Chapter {0}").format(f"{ch+1:d}")
pHandle = nHandle
if chFolders:
pHandle = self.newFolder(chTitle, nHandle)
cHandle = self.newFile(chTitle, pHandle)
cHandle = self.newFile(chTitle, hNovelRoot)
aDoc = NWDoc(self, cHandle)
aDoc.writeDocument("## %s\n\n" % chTitle)
aDoc.writeDocument(f"## {chTitle}\n\n% Synopsis: {chSynop}\n\n")
# Create chapter scenes
if numScenes > 0:
for sc in range(numScenes):
scTitle = self.tr("Scene {0}").format(f"{ch+1:d}.{sc+1:d}")
sHandle = self.newFile(scTitle, pHandle)
sHandle = self.newFile(scTitle, cHandle)
aDoc = NWDoc(self, sHandle)
aDoc.writeDocument("### %s\n\n" % scTitle)
aDoc.writeDocument(f"### {scTitle}\n\n% Synopsis: {scSynop}\n\n")
# Create scenes (no chapters)
elif numScenes > 0:
for sc in range(numScenes):
scTitle = self.tr("Scene {0}").format(f"{sc+1:d}")
sHandle = self.newFile(scTitle, nHandle)
sHandle = self.newFile(scTitle, hNovelRoot)
aDoc = NWDoc(self, sHandle)
aDoc.writeDocument("### %s\n\n" % scTitle)
aDoc.writeDocument(f"### {scTitle}\n\n% Synopsis: {scSynop}\n\n")
# Create notes folders
noteTitles = {
nwItemClass.PLOT: self.tr("Main Plot"),
nwItemClass.CHARACTER: self.tr("Protagonist"),
nwItemClass.WORLD: self.tr("Main Location"),
}
addNotes = projData.get("addNotes", False)
for newRoot in projData.get("addRoots", []):
if newRoot in nwItemClass:
rHandle = self.newRoot(newRoot)
if addNotes:
aHandle = self.newFile(noteTitles[newRoot], rHandle)
ntTag = simplified(noteTitles[newRoot]).replace(" ", "")
aDoc = NWDoc(self, aHandle)
aDoc.writeDocument(f"# {noteTitles[newRoot]}\n\n@tag: {ntTag}\n\n")
# Also add the archive and trash folders
self.newRoot(nwItemClass.ARCHIVE)
self.trashFolder()
# Finalise
if popCustom or popMinimal:
+2 -2
View File
@@ -182,12 +182,12 @@ class GuiAbout(QDialog):
self.tr("Translations"),
self._wrapTable([
("English", "Veronica Berglyd Olsen"),
("Español Latinoamericano", "Tommy Marplatt"),
("Français", "Jan Lüdke (jyhelle)"),
("Nederlands", "Martijn van der Kleijn"),
("Norsk Bokmål", "Veronica Berglyd Olsen"),
("Português", "Bruno Meneguello"),
("简体中文", "Qianzhi Long"),
("Español Latinoamericano", "Tommy Marplatt"),
("Nederlands", "Martijn van der Kleijn"),
])
)
+1 -4
View File
@@ -37,7 +37,6 @@ from PyQt5.QtWidgets import (
from novelwriter.core import NWDoc
from novelwriter.enum import nwItemType, nwItemClass, nwItemLayout, nwAlert
from novelwriter.constants import trConst, nwLabels
logger = logging.getLogger(__name__)
@@ -176,9 +175,7 @@ class GuiProjectTree(QTreeWidget):
if itemType == nwItemType.ROOT and isinstance(itemClass, nwItemClass):
tHandle = self.theProject.newRoot(
trConst(nwLabels.CLASS_NAME[itemClass]), itemClass
)
tHandle = self.theProject.newRoot(itemClass)
elif itemType in (nwItemType.FILE, nwItemType.FOLDER):
+2
View File
@@ -49,6 +49,7 @@ class GuiViewsBar(QToolBar):
# Style
iPx = self.mainConf.pxInt(22)
mPx = self.mainConf.pxInt(58)
lblFont = self.theTheme.guiFont
lblFont.setPointSizeF(0.65*self.theTheme.fontPointSize)
@@ -57,6 +58,7 @@ class GuiViewsBar(QToolBar):
self.setMovable(False)
self.setToolButtonStyle(Qt.ToolButtonTextUnderIcon)
self.setIconSize(QSize(iPx, iPx))
self.setMaximumWidth(mPx)
self.setContentsMargins(0, 0, 0, 0)
stretch = QWidget(self)
+2 -8
View File
@@ -1432,9 +1432,9 @@ class GuiMain(QMainWindow):
"popMinimal": newProj.field("popMinimal"),
"popCustom": newProj.field("popCustom"),
"addRoots": [],
"addNotes": False,
"numChapters": 0,
"numScenes": 0,
"chFolders": False,
}
if newProj.field("popCustom"):
addRoots = []
@@ -1444,16 +1444,10 @@ class GuiMain(QMainWindow):
addRoots.append(nwItemClass.CHARACTER)
if newProj.field("addWorld"):
addRoots.append(nwItemClass.WORLD)
if newProj.field("addTime"):
addRoots.append(nwItemClass.TIMELINE)
if newProj.field("addObject"):
addRoots.append(nwItemClass.OBJECT)
if newProj.field("addEntity"):
addRoots.append(nwItemClass.ENTITY)
projData["addRoots"] = addRoots
projData["addNotes"] = newProj.field("addNotes")
projData["numChapters"] = newProj.field("numChapters")
projData["numScenes"] = newProj.field("numScenes")
projData["chFolders"] = newProj.field("chFolders")
return projData
+1 -1
View File
@@ -72,7 +72,7 @@ class GuiLipsum(QDialog):
# Form
self.headLabel = QLabel("<b>{0}</b>".format(self.tr("Insert Lorem Ipsum Text")))
self.paraLabel = QLabel(self.tr("Number of pragraphs"))
self.paraLabel = QLabel(self.tr("Number of paragraphs"))
self.paraCount = QSpinBox()
self.paraCount.setMinimum(1)
self.paraCount.setMaximum(100)
+91 -90
View File
@@ -31,12 +31,10 @@ from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (
QWizard, QWizardPage, QLabel, QVBoxLayout, QLineEdit, QPlainTextEdit,
QPushButton, QFileDialog, QHBoxLayout, QRadioButton, QFormLayout,
QGroupBox, QGridLayout, QSpinBox
QGridLayout, QSpinBox
)
from novelwriter.enum import nwItemClass
from novelwriter.common import makeFileNameSafe
from novelwriter.constants import trConst, nwLabels
from novelwriter.gui.custom import QSwitch
logger = logging.getLogger(__name__)
@@ -98,10 +96,10 @@ class ProjWizardIntroPage(QWizardPage):
self.setTitle(self.tr("Create New Project"))
self.theText = QLabel(self.tr(
"Provide at least a working title. The working title should not "
"be change beyond this point as it is used by the application for "
"generating file names for for instance backups. The other fields "
"are optional and can be changed at any time in Project Settings."
"Provide at least a project name. The project name should not "
"be changed beyond this point as it is used for generating file "
"names for for instance backups. The other fields are optional "
"and can be changed at any time in Project Settings."
))
self.theText.setWordWrap(True)
@@ -134,7 +132,7 @@ class ProjWizardIntroPage(QWizardPage):
self.projAuthors.setPlaceholderText(self.tr("Optional. One name per line."))
self.mainForm = QFormLayout()
self.mainForm.addRow(self.tr("Working Title"), self.projName)
self.mainForm.addRow(self.tr("Project Name"), self.projName)
self.mainForm.addRow(self.tr("Novel Title"), self.projTitle)
self.mainForm.addRow(self.tr("Author(s)"), self.projAuthors)
self.mainForm.setVerticalSpacing(fS)
@@ -324,68 +322,28 @@ class ProjWizardCustomPage(QWizardPage):
self.setTitle(self.tr("Custom Project Options"))
self.theText = QLabel(self.tr(
"Select which additional root folders to make, and how to populate "
"the Novel folder. If you don't want to add chapters or scenes, set "
"the values to 0. You can add scenes without chapters."
"Select which additional elements to populate the project with. "
"You can skip making chapters and add only scenes by setting the "
"number of chapters to 0."
))
self.theText.setWordWrap(True)
vS = self.mainConf.pxInt(12)
cM = self.mainConf.pxInt(12)
mH = self.mainConf.pxInt(26)
fS = self.mainConf.pxInt(4)
# Root Folders
self.rootGroup = QGroupBox(self.tr("Additional Root Folders"))
self.rootForm = QGridLayout()
self.rootGroup.setLayout(self.rootForm)
self.lblPlot = QLabel(self.tr("{0} folder").format(
trConst(nwLabels.CLASS_NAME[nwItemClass.PLOT]))
)
self.lblChar = QLabel(self.tr("{0} folder").format(
trConst(nwLabels.CLASS_NAME[nwItemClass.CHARACTER]))
)
self.lblWorld = QLabel(self.tr("{0} folder").format(
trConst(nwLabels.CLASS_NAME[nwItemClass.WORLD]))
)
self.lblTime = QLabel(self.tr("{0} folder").format(
trConst(nwLabels.CLASS_NAME[nwItemClass.TIMELINE]))
)
self.lblObject = QLabel(self.tr("{0} folder").format(
trConst(nwLabels.CLASS_NAME[nwItemClass.OBJECT]))
)
self.lblEntity = QLabel(self.tr("{0} folder").format(
trConst(nwLabels.CLASS_NAME[nwItemClass.ENTITY]))
)
self.addPlot = QSwitch()
self.addChar = QSwitch()
self.addWorld = QSwitch()
self.addTime = QSwitch()
self.addObject = QSwitch()
self.addEntity = QSwitch()
self.addPlot = QSwitch()
self.addChar = QSwitch()
self.addWorld = QSwitch()
self.addNotes = QSwitch()
self.addPlot.setChecked(True)
self.addChar.setChecked(True)
self.addWorld.setChecked(True)
self.rootForm.addWidget(self.lblPlot, 0, 0)
self.rootForm.addWidget(self.lblChar, 1, 0)
self.rootForm.addWidget(self.lblWorld, 2, 0)
self.rootForm.addWidget(self.lblTime, 3, 0)
self.rootForm.addWidget(self.lblObject, 4, 0)
self.rootForm.addWidget(self.lblEntity, 5, 0)
self.rootForm.addWidget(self.addPlot, 0, 1, 1, 1, Qt.AlignRight)
self.rootForm.addWidget(self.addChar, 1, 1, 1, 1, Qt.AlignRight)
self.rootForm.addWidget(self.addWorld, 2, 1, 1, 1, Qt.AlignRight)
self.rootForm.addWidget(self.addTime, 3, 1, 1, 1, Qt.AlignRight)
self.rootForm.addWidget(self.addObject, 4, 1, 1, 1, Qt.AlignRight)
self.rootForm.addWidget(self.addEntity, 5, 1, 1, 1, Qt.AlignRight)
self.rootForm.setRowStretch(6, 1)
# Novel Options
self.novelGroup = QGroupBox(self.tr("Populate Novel Folder"))
self.novelForm = QGridLayout()
self.novelGroup.setLayout(self.novelForm)
self.addWorld.setChecked(False)
self.addNotes.setChecked(False)
# Generate Content
self.numChapters = QSpinBox()
self.numChapters.setRange(0, 100)
self.numChapters.setValue(5)
@@ -394,37 +352,40 @@ class ProjWizardCustomPage(QWizardPage):
self.numScenes.setRange(0, 200)
self.numScenes.setValue(5)
self.chFolders = QSwitch()
self.chFolders.setChecked(True)
self.novelForm.addWidget(QLabel(self.tr("Add chapters")), 0, 0)
self.novelForm.addWidget(QLabel(self.tr("Scenes (per chapter)")), 1, 0)
self.novelForm.addWidget(QLabel(self.tr("Add chapter folders")), 2, 0)
self.novelForm.addWidget(self.numChapters, 0, 1, 1, 1, Qt.AlignRight)
self.novelForm.addWidget(self.numScenes, 1, 1, 1, 1, Qt.AlignRight)
self.novelForm.addWidget(self.chFolders, 2, 1, 1, 1, Qt.AlignRight)
self.novelForm.setRowStretch(3, 1)
# Grid Form
self.addBox = QGridLayout()
self.addBox.addWidget(QLabel(self.tr("Add a folder for plot notes")), 0, 0)
self.addBox.addWidget(QLabel(self.tr("Add a folder for character notes")), 1, 0)
self.addBox.addWidget(QLabel(self.tr("Add a folder for location notes")), 2, 0)
self.addBox.addWidget(QLabel(self.tr("Add example notes to the above")), 3, 0)
self.addBox.addWidget(QLabel(self.tr("Add chapters to the novel folder")), 4, 0)
self.addBox.addWidget(QLabel(self.tr("Add scenes to each chapter")), 5, 0)
self.addBox.addWidget(self.addPlot, 0, 1, 1, 1, Qt.AlignRight)
self.addBox.addWidget(self.addChar, 1, 1, 1, 1, Qt.AlignRight)
self.addBox.addWidget(self.addWorld, 2, 1, 1, 1, Qt.AlignRight)
self.addBox.addWidget(self.addNotes, 3, 1, 1, 1, Qt.AlignRight)
self.addBox.addWidget(self.numChapters, 4, 1, 1, 1, Qt.AlignRight)
self.addBox.addWidget(self.numScenes, 5, 1, 1, 1, Qt.AlignRight)
self.addBox.setVerticalSpacing(fS)
self.addBox.setHorizontalSpacing(cM)
self.addBox.setContentsMargins(cM, 0, cM, 0)
self.addBox.setColumnStretch(2, 1)
for i in range(6):
self.addBox.setRowMinimumHeight(i, mH)
# Wizard Fields
self.registerField("addPlot", self.addPlot)
self.registerField("addChar", self.addChar)
self.registerField("addWorld", self.addWorld)
self.registerField("addTime", self.addTime)
self.registerField("addObject", self.addObject)
self.registerField("addEntity", self.addEntity)
self.registerField("addNotes", self.addNotes)
self.registerField("numChapters", self.numChapters)
self.registerField("numScenes", self.numScenes)
self.registerField("chFolders", self.chFolders)
# Assemble
self.innerBox = QHBoxLayout()
self.innerBox.addWidget(self.rootGroup)
self.innerBox.addWidget(self.novelGroup)
self.outerBox = QVBoxLayout()
self.outerBox.setSpacing(vS)
self.outerBox.setSpacing(cM)
self.outerBox.addWidget(self.theText)
self.outerBox.addLayout(self.innerBox)
self.outerBox.addLayout(self.addBox)
self.outerBox.addStretch(1)
self.setLayout(self.outerBox)
@@ -441,15 +402,8 @@ class ProjWizardFinalPage(QWizardPage):
self.mainConf = novelwriter.CONFIG
self.theWizard = theWizard
self.setTitle(self.tr("Finished"))
self.theText = QLabel(
"<p>%s</p><p>%s</p>" % (
self.tr("All done."),
self.tr("Press '{0}' to create the new project.").format(
self.tr("Done") if self.mainConf.osDarwin else self.tr("Finish")
)
)
)
self.setTitle(self.tr("Summary"))
self.theText = QLabel("")
self.theText.setWordWrap(True)
# Assemble
@@ -461,4 +415,51 @@ class ProjWizardFinalPage(QWizardPage):
return
def initializePage(self):
"""Update the summary information on the final page.
"""
QWizardPage.initializePage(self)
sumList = []
sumList.append(self.tr("Project Name: {0}").format(self.field("projName")))
sumList.append(self.tr("Project Path: {0}").format(self.field("projPath")))
if self.field("popMinimal"):
sumList.append(self.tr("Fill the project with a minimal set of items"))
elif self.field("popSample"):
sumList.append(self.tr("Fill the project with example files"))
elif self.field("popCustom"):
if self.field("addPlot"):
sumList.append(self.tr("Add a folder for plot notes"))
if self.field("addChar"):
sumList.append(self.tr("Add a folder for character notes"))
if self.field("addWorld"):
sumList.append(self.tr("Add a folder for location notes"))
if self.field("addNotes"):
sumList.append(self.tr("Add example notes to the above"))
if self.field("numChapters") > 0:
sumList.append(self.tr("Add {0} chapters to the novel folder").format(
self.field("numChapters")
))
if self.field("numScenes") > 0:
sumList.append(self.tr("Add {0} scenes to each chapter").format(
self.field("numScenes")
))
else:
if self.field("numScenes") > 0:
sumList.append(self.tr("Add {0} scenes").format(
self.field("numScenes")
))
self.theText.setText(
"<p>%s</p><p>&nbsp;&bull;&nbsp;%s</p><p>%s</p>" % (
self.tr("You have selected the following:"),
"<br>&nbsp;&bull;&nbsp;".join(sumList),
self.tr("Press '{0}' to create the new project.").format(
self.tr("Done") if self.mainConf.osDarwin else self.tr("Finish")
)
)
)
return
# END Class ProjWizardFinalPage