novelWriter 2.3rc1__py3-none-any.whl → 2.4b1__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-2.3rc1.dist-info → novelWriter-2.4b1.dist-info}/METADATA +1 -1
- {novelWriter-2.3rc1.dist-info → novelWriter-2.4b1.dist-info}/RECORD +99 -85
- {novelWriter-2.3rc1.dist-info → novelWriter-2.4b1.dist-info}/WHEEL +1 -1
- novelWriter-2.4b1.dist-info/entry_points.txt +2 -0
- novelwriter/__init__.py +5 -5
- novelwriter/assets/i18n/nw_de_DE.qm +0 -0
- novelwriter/assets/i18n/nw_en_US.qm +0 -0
- novelwriter/assets/i18n/nw_es_419.qm +0 -0
- novelwriter/assets/i18n/nw_fr_FR.qm +0 -0
- novelwriter/assets/i18n/nw_it_IT.qm +0 -0
- novelwriter/assets/i18n/nw_ja_JP.qm +0 -0
- novelwriter/assets/i18n/nw_nb_NO.qm +0 -0
- novelwriter/assets/i18n/nw_nl_NL.qm +0 -0
- novelwriter/assets/i18n/project_nl_NL.json +11 -0
- novelwriter/assets/i18n/project_pt_BR.json +11 -0
- novelwriter/assets/icons/typicons_dark/icons.conf +4 -0
- novelwriter/assets/icons/typicons_dark/nw_tb-mark.svg +7 -0
- novelwriter/assets/icons/typicons_dark/typ_arrow-down.svg +4 -0
- novelwriter/assets/icons/typicons_dark/typ_arrow-right.svg +4 -0
- novelwriter/assets/icons/typicons_dark/typ_refresh-flipped.svg +1 -1
- novelwriter/assets/icons/typicons_dark/typ_refresh.svg +1 -1
- novelwriter/assets/icons/typicons_dark/typ_search-grey.svg +4 -0
- novelwriter/assets/icons/typicons_dark/typ_times.svg +1 -1
- novelwriter/assets/icons/typicons_light/icons.conf +4 -0
- novelwriter/assets/icons/typicons_light/nw_tb-mark.svg +7 -0
- novelwriter/assets/icons/typicons_light/typ_arrow-down.svg +4 -0
- novelwriter/assets/icons/typicons_light/typ_arrow-right.svg +4 -0
- novelwriter/assets/icons/typicons_light/typ_refresh-flipped.svg +1 -1
- novelwriter/assets/icons/typicons_light/typ_refresh.svg +1 -1
- novelwriter/assets/icons/typicons_light/typ_search-grey.svg +4 -0
- novelwriter/assets/icons/typicons_light/typ_times.svg +1 -1
- novelwriter/assets/manual.pdf +0 -0
- novelwriter/assets/sample.zip +0 -0
- novelwriter/assets/syntax/cyberpunk_night.conf +26 -0
- novelwriter/assets/syntax/default_dark.conf +1 -0
- novelwriter/assets/syntax/default_light.conf +1 -0
- novelwriter/assets/syntax/grey_dark.conf +1 -0
- novelwriter/assets/syntax/grey_light.conf +1 -0
- novelwriter/assets/syntax/light_owl.conf +1 -0
- novelwriter/assets/syntax/night_owl.conf +1 -0
- novelwriter/assets/syntax/solarized_dark.conf +1 -0
- novelwriter/assets/syntax/solarized_light.conf +1 -0
- novelwriter/assets/syntax/tango.conf +23 -0
- novelwriter/assets/syntax/tomorrow.conf +1 -0
- novelwriter/assets/syntax/tomorrow_night.conf +1 -0
- novelwriter/assets/syntax/tomorrow_night_blue.conf +1 -0
- novelwriter/assets/syntax/tomorrow_night_bright.conf +1 -0
- novelwriter/assets/syntax/tomorrow_night_eighties.conf +1 -0
- novelwriter/assets/text/credits_en.htm +25 -23
- novelwriter/assets/themes/cyberpunk_night.conf +29 -0
- novelwriter/common.py +1 -1
- novelwriter/config.py +35 -12
- novelwriter/constants.py +5 -6
- novelwriter/core/buildsettings.py +60 -40
- novelwriter/core/coretools.py +98 -13
- novelwriter/core/docbuild.py +74 -7
- novelwriter/core/document.py +24 -3
- novelwriter/core/index.py +31 -112
- novelwriter/core/project.py +11 -15
- novelwriter/core/projectxml.py +2 -1
- novelwriter/core/sessions.py +2 -2
- novelwriter/core/status.py +4 -4
- novelwriter/core/storage.py +16 -6
- novelwriter/core/tohtml.py +22 -25
- novelwriter/core/tokenizer.py +416 -236
- novelwriter/core/tomd.py +17 -8
- novelwriter/core/toodt.py +65 -7
- novelwriter/core/tree.py +8 -8
- novelwriter/dialogs/about.py +2 -2
- novelwriter/dialogs/docsplit.py +7 -8
- novelwriter/dialogs/preferences.py +3 -6
- novelwriter/dialogs/wordlist.py +1 -1
- novelwriter/enum.py +17 -14
- novelwriter/extensions/configlayout.py +22 -0
- novelwriter/extensions/modified.py +20 -2
- novelwriter/extensions/versioninfo.py +1 -1
- novelwriter/gui/doceditor.py +257 -279
- novelwriter/gui/dochighlight.py +29 -25
- novelwriter/gui/docviewer.py +139 -148
- novelwriter/gui/docviewerpanel.py +4 -24
- novelwriter/gui/editordocument.py +12 -1
- novelwriter/gui/itemdetails.py +6 -6
- novelwriter/gui/mainmenu.py +37 -17
- novelwriter/gui/noveltree.py +11 -19
- novelwriter/gui/outline.py +43 -20
- novelwriter/gui/projtree.py +88 -88
- novelwriter/gui/search.py +316 -0
- novelwriter/gui/sidebar.py +25 -30
- novelwriter/gui/theme.py +68 -8
- novelwriter/guimain.py +183 -178
- novelwriter/shared.py +26 -1
- novelwriter/text/__init__.py +3 -0
- novelwriter/text/counting.py +137 -0
- novelwriter/tools/manuscript.py +344 -55
- novelwriter/tools/manussettings.py +214 -71
- novelwriter/tools/noveldetails.py +1 -1
- novelwriter/tools/welcome.py +8 -9
- novelWriter-2.3rc1.dist-info/entry_points.txt +0 -5
- {novelWriter-2.3rc1.dist-info → novelWriter-2.4b1.dist-info}/LICENSE.md +0 -0
- {novelWriter-2.3rc1.dist-info → novelWriter-2.4b1.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<svg width="24" height="24" version="1.2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
3
|
-
<path d="m10.
|
3
|
+
<path d="m10.692 12.288h-7.692v-7.689c0.012-1.7022 1.0065-2.1116 2.2095-0.90734l1.731 1.7367c1.5225-1.1923 3.3855-1.8447 5.349-1.8447 2.325 0 4.5135 0.90583 6.156 2.5511 1.6485 1.6377 2.5545 3.8288 2.5545 6.1533 0 2.3291-0.906 4.5172-2.5515 6.1594-1.6455 1.6452-3.8325 2.5525-6.159 2.5525-2.325 0-4.5135-0.90734-6.159-2.554-0.444-0.44542-0.837-0.93132-1.17-1.4472-0.5205-0.81135-0.285-1.8897 0.525-2.4071 0.8085-0.51891 1.887-0.28344 2.406 0.5249 0.1995 0.31044 0.438 0.59988 0.702 0.86984 0.9885 0.98682 2.301 1.5297 3.696 1.5297 1.395 0 2.7075-0.5414 3.696-1.5297 0.9855-0.98682 1.53-2.2991 1.53-3.6969 0-1.3948-0.543-2.707-1.53-3.6908-0.9885-0.98682-2.301-1.5312-3.696-1.5312-1.032 0-2.019 0.30144-2.8635 0.85784l2.172 2.1761c1.2045 1.2027 0.795 2.1866-0.906 2.1866z" fill="#718c00" stroke-width="1.4998"/>
|
4
4
|
</svg>
|
@@ -1,4 +1,4 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<svg width="24" height="24" version="1.2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
3
|
-
<path d="m13.
|
3
|
+
<path d="m13.308 12.288h7.692v-7.689c-0.012001-1.7022-1.0065-2.1116-2.2095-0.90734l-1.731 1.7367c-1.5225-1.1923-3.3855-1.8447-5.349-1.8447-2.325 0-4.5135 0.90583-6.156 2.5511-1.6485 1.6377-2.5545 3.8288-2.5545 6.1533 0 2.3291 0.906 4.5172 2.5515 6.1594 1.6455 1.6452 3.8325 2.5525 6.159 2.5525 2.325 0 4.5135-0.90734 6.159-2.554 0.444-0.44542 0.837-0.93132 1.17-1.4472 0.5205-0.81135 0.285-1.8897-0.525-2.4071-0.8085-0.51891-1.887-0.28344-2.406 0.5249-0.1995 0.31044-0.438 0.59988-0.702 0.86984-0.9885 0.98682-2.301 1.5297-3.696 1.5297-1.395 0-2.7075-0.5414-3.696-1.5297-0.9855-0.98682-1.53-2.2991-1.53-3.6969 0-1.3948 0.543-2.707 1.53-3.6908 0.9885-0.98682 2.301-1.5312 3.696-1.5312 1.032 0 2.019 0.30144 2.8635 0.85784l-2.172 2.1761c-1.2045 1.2027-0.795 2.1866 0.906 2.1866z" fill="#718c00" stroke-width="1.4998"/>
|
4
4
|
</svg>
|
@@ -0,0 +1,4 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<svg width="24" height="24" version="1.2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
3
|
+
<path d="m20.547 14.707-0.7017-0.703-0.98054-0.98185c0.29717-0.90068 0.46343-1.859 0.46343-2.8578 0-5.0519-4.112-9.1639-9.1639-9.1639s-9.1639 4.112-9.1639 9.1639c0 5.0519 4.112 9.1639 9.1639 9.1639 0.99887 0 1.9585-0.16626 2.8591-0.46343l0.98185 0.98054 1.9794 1.9768 0.07986 0.07986 0.08378 0.072c0.78679 0.66242 1.7647 1.0264 2.7544 1.0264 2.2596 0 4.0976-1.838 4.0976-4.0989 0-1.0997-0.4294-2.1313-1.2096-2.9037zm-16.93-4.5427c0-3.6093 2.9364-6.5457 6.5457-6.5457s6.5457 2.9364 6.5457 6.5457-2.9364 6.5457-6.5457 6.5457-6.5457-2.9364-6.5457-6.5457z" fill-opacity=".78039" stroke-width="1.3091"/>
|
4
|
+
</svg>
|
@@ -1,4 +1,4 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<svg width="24" height="24" version="1.2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
3
|
-
<path d="
|
3
|
+
<path d="m20.121 3.8786c-1.17-1.1715-3.072-1.1715-4.2421 0l-3.879 3.8791-3.879-3.8791c-1.17-1.1715-3.072-1.1715-4.2421 0-1.1715 1.1715-1.1715 3.0705 0 4.2421l3.8776 3.879-3.8776 3.879c-1.1715 1.1715-1.1715 3.0705 0 4.2421 0.58502 0.58652 1.353 0.87902 2.1211 0.87902 0.76801 0 1.5361-0.29251 2.1211-0.87902l3.879-3.879 3.879 3.879c0.58502 0.58652 1.353 0.87902 2.1211 0.87902 0.76801 0 1.5361-0.29251 2.1211-0.87902 1.1715-1.1715 1.1715-3.0705 0-4.2421l-3.8776-3.879 3.8776-3.879c1.1715-1.1715 1.1715-3.0705 0-4.2421z" fill="#c82829" stroke-width="1.5001"/>
|
4
4
|
</svg>
|
novelwriter/assets/manual.pdf
CHANGED
Binary file
|
novelwriter/assets/sample.zip
CHANGED
Binary file
|
@@ -0,0 +1,26 @@
|
|
1
|
+
[Main]
|
2
|
+
name = Cyberpunk Night
|
3
|
+
author = Anders Lemvigh
|
4
|
+
url = https://github.com/alemvigh
|
5
|
+
license = CC BY-SA 4.0
|
6
|
+
licenseurl = https://creativecommons.org/licenses/by-sa/4.0/
|
7
|
+
|
8
|
+
[Syntax]
|
9
|
+
background = 0, 0, 0
|
10
|
+
text = 150, 150, 150
|
11
|
+
link = 77, 077, 255
|
12
|
+
headertext = 255, 255, 255
|
13
|
+
headertag = 50, 0, 180
|
14
|
+
emphasis = 0, 255, 255
|
15
|
+
straightquotes = 7, 27, 219
|
16
|
+
doublequotes = 0, 255, 0
|
17
|
+
singlequotes = 0, 140, 255
|
18
|
+
hidden = 77, 77, 100
|
19
|
+
shortcode = 255, 255, 0
|
20
|
+
keyword = 255, 100, 255
|
21
|
+
value = 255, 150, 10
|
22
|
+
spellcheckline = 242, 72, 23
|
23
|
+
errorline = 186, 218, 4
|
24
|
+
replacetag = 0, 0, 180
|
25
|
+
modifier = 144, 142, 176
|
26
|
+
optional = 180, 180, 180
|
@@ -0,0 +1,23 @@
|
|
1
|
+
[Main]
|
2
|
+
name = Tango
|
3
|
+
author = Veronica Berglyd Olsen (adaptation)
|
4
|
+
|
5
|
+
[Syntax]
|
6
|
+
background = 48, 48, 47
|
7
|
+
text = 238, 238, 236
|
8
|
+
link = 115, 159, 207
|
9
|
+
headertext = 115, 159, 207
|
10
|
+
headertag = 52, 101, 164
|
11
|
+
emphasis = 196, 160, 0
|
12
|
+
straightquotes = 239, 41, 41
|
13
|
+
doublequotes = 138, 226, 52
|
14
|
+
singlequotes = 252, 233, 79
|
15
|
+
hidden = 143, 143, 141
|
16
|
+
shortcode = 115, 159, 207
|
17
|
+
keyword = 239, 41, 41
|
18
|
+
value = 173, 127, 168
|
19
|
+
optional = 115, 159, 207
|
20
|
+
spellcheckline = 239, 41, 41
|
21
|
+
errorline = 138, 226, 52
|
22
|
+
replacetag = 51, 226, 226
|
23
|
+
modifier = 196, 160, 0
|
@@ -8,9 +8,9 @@
|
|
8
8
|
<h3>Contributors</h3>
|
9
9
|
|
10
10
|
<p>
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
• <b>Concept:</b> Marian Lückhof (<a href="https://github.com/Number042">@Number042</a>)<br>
|
12
|
+
• <b>Internationalisation:</b> Bruno Meneguello (<a href="https://github.com/bkmeneguello">@bkmeneguello</a>)<br>
|
13
|
+
• <b>Setup and Packaging:</b> Rachel Powers (<a href="https://github.com/Ryex">@Ryex</a>)
|
14
14
|
</p>
|
15
15
|
<p>For other contributions, see the project's
|
16
16
|
<a href="https://github.com/vkbo/novelWriter/graphs/contributors">Contributors</a> page.</p>
|
@@ -24,20 +24,20 @@
|
|
24
24
|
<p>The default language is English (UK) with English (US) as an option. These are the original
|
25
25
|
translators for the languages currently available:</p>
|
26
26
|
<p>
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
27
|
+
• <b>Dutch:</b> Martijn van der Kleijn (<a href="https://github.com/mvdkleijn">@mvdkleijn</a>)<br>
|
28
|
+
• <b>French:</b> Jan Lüdke (<a href="https://github.com/jyhelle">@jyhelle</a>)<br>
|
29
|
+
• <b>German:</b> Myian (<a href="https://github.com/heymyian">@heymyian</a>)<br>
|
30
|
+
• <b>Italian:</b> Riccardo Mangili<br>
|
31
|
+
• <b>Japanese:</b> hebekeg (<a href="https://github.com/hebekeg">@hebekeg</a>)<br>
|
32
|
+
• <b>Latin American Spanish:</b> Tommy Marplatt (<a href="https://github.com/tmarplatt">@tmarplatt</a>)<br>
|
33
|
+
• <b>Norwegian:</b> Veronica Berglyd Olsen (<a href="https://github.com/vkbo">@vkbo</a>)<br>
|
34
|
+
• <b>Portuguese:</b> Bruno Meneguello (<a href="https://github.com/bkmeneguello">@bkmeneguello</a>)<br>
|
35
|
+
• <b>Simplified Chinese:</b> Qianzhi Long (<a href="https://github.com/longqzh">@longqzh</a>)
|
36
36
|
</p>
|
37
37
|
|
38
38
|
<p>Additional larger translation contributions:</p>
|
39
39
|
<p>
|
40
|
-
|
40
|
+
• <b>French:</b> Albert Aribaud (<a href="https://github.com/aaribaud">@aaribaud</a>)
|
41
41
|
</p>
|
42
42
|
|
43
43
|
<p>Translations are managed on <a href="https://crowdin.com/project/novelwriter">Crowdin</a>, and
|
@@ -47,27 +47,29 @@ more contributions are listed on the project's <a href="https://crowdin.com/proj
|
|
47
47
|
|
48
48
|
<p>The following libraries are dependencies of novelWriter:</p>
|
49
49
|
<p>
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
50
|
+
• <a href="https://www.qt.io">Qt5</a> by Qt Company<br>
|
51
|
+
• <a href="https://www.riverbankcomputing.com/software/pyqt">PyQt5</a> by Riverbank Computing<br>
|
52
|
+
• <a href="https://abiword.github.io/enchant">Enchant</a> by Dom Lachowicz<br>
|
53
|
+
• <a href="https://pyenchant.github.io/pyenchant">PyEnchant</a> by Dimitri Merejkowsky
|
54
54
|
</p>
|
55
55
|
|
56
56
|
<h3>Assets</h3>
|
57
57
|
|
58
58
|
<p>Some of the assets bundled with novelWriter were adapted from the following sources:</p>
|
59
59
|
<p>
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
60
|
+
• <a href="https://github.com/stephenhutchings/typicons.font">Typicons</a> icons by Stephen Hutchings (CC BY-SA 4.0)<br>
|
61
|
+
• <a href="https://github.com/chriskempson/base16">Tomorrow</a> syntax themes by Chris Kempson (MIT License)<br>
|
62
|
+
• <a href="https://github.com/sdras/night-owl-vscode-theme">Owl</a> syntax themes by Sarah Drasner (MIT License)<br>
|
63
|
+
• <a href="https://github.com/altercation/solarized">Solarized</a> themes by Ethan Schoonover (MIT License)
|
64
64
|
</p>
|
65
65
|
|
66
66
|
<h3>Fonts</h3>
|
67
67
|
|
68
|
-
<p>The font used for the main novelWriter logo, mimetype and text banners is
|
68
|
+
<p>The font used for the main novelWriter logo, mimetype and text banners is Pridi. Other fonts are
|
69
|
+
used on buttons and icons.</p>
|
69
70
|
<p>
|
70
|
-
|
71
|
+
• Pridi by Cadson Demak (Open Font License, Version 1.1)<br>
|
72
|
+
• Source Sans Pro by Paul D. Hunt (SIL Open Font License)
|
71
73
|
</p>
|
72
74
|
|
73
75
|
<h3>Special Mentions</h3>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
[Main]
|
2
|
+
name = Cyberpunk Night
|
3
|
+
description = A taste of the future 80s
|
4
|
+
author = Anders Lemvigh
|
5
|
+
url = https://github.com/alemvigh
|
6
|
+
license = CC BY-SA 4.0
|
7
|
+
licenseurl = https://creativecommons.org/licenses/by-sa/4.0/
|
8
|
+
icontheme = typicons_dark
|
9
|
+
|
10
|
+
[Palette]
|
11
|
+
window = 0, 0, 0
|
12
|
+
windowtext = 150, 150, 150
|
13
|
+
base = 0, 0, 0
|
14
|
+
alternatebase = 30, 20, 45
|
15
|
+
text = 150, 150, 150
|
16
|
+
tooltipbase = 40, 20, 70
|
17
|
+
tooltiptext = 255, 255, 255
|
18
|
+
button = 5, 0, 10
|
19
|
+
buttontext = 150, 150, 150
|
20
|
+
brighttext = 255, 255, 255
|
21
|
+
highlight = 50, 30, 80
|
22
|
+
highlightedtext = 255, 255, 255
|
23
|
+
link = 77, 77, 255
|
24
|
+
linkvisited = 50, 0, 80
|
25
|
+
|
26
|
+
[GUI]
|
27
|
+
statusnone = 50, 50, 50
|
28
|
+
statussaved = 77, 255, 77
|
29
|
+
statusunsaved = 255, 77, 77
|
novelwriter/common.py
CHANGED
@@ -255,7 +255,7 @@ def formatFileFilter(extensions: list[str | tuple[str, str]]) -> str:
|
|
255
255
|
result = []
|
256
256
|
for ext in extensions:
|
257
257
|
if isinstance(ext, str):
|
258
|
-
result.append(f"{trConst(nwLabels.FILE_FILTERS.get(ext))} ({ext})")
|
258
|
+
result.append(f"{trConst(nwLabels.FILE_FILTERS.get(ext, 'ERR'))} ({ext})")
|
259
259
|
elif isinstance(ext, tuple) and len(ext) == 2:
|
260
260
|
result.append(f"{ext[0]} ({ext[1]})")
|
261
261
|
return ";;".join(result)
|
novelwriter/config.py
CHANGED
@@ -30,6 +30,7 @@ import logging
|
|
30
30
|
|
31
31
|
from time import time
|
32
32
|
from pathlib import Path
|
33
|
+
from datetime import datetime
|
33
34
|
|
34
35
|
from PyQt5.QtGui import QFontDatabase
|
35
36
|
from PyQt5.QtCore import (
|
@@ -84,8 +85,11 @@ class Config:
|
|
84
85
|
self._nwLangPath = self._appPath / "assets" / "i18n"
|
85
86
|
self._qtLangPath = QLibraryInfo.location(QLibraryInfo.TranslationsPath)
|
86
87
|
|
87
|
-
|
88
|
-
self._qLocale = QLocale.system() if
|
88
|
+
hasLocale = (self._nwLangPath / f"nw_{QLocale.system().name()}.qm").exists()
|
89
|
+
self._qLocale = QLocale.system() if hasLocale else QLocale("en_GB")
|
90
|
+
self._dLocale = QLocale.system()
|
91
|
+
self._dShortDate = self._dLocale.dateFormat(QLocale.FormatType.ShortFormat)
|
92
|
+
self._dShortDateTime = self._dLocale.dateTimeFormat(QLocale.FormatType.ShortFormat)
|
89
93
|
self._qtTrans = {}
|
90
94
|
|
91
95
|
# PDF Manual
|
@@ -179,17 +183,19 @@ class Config:
|
|
179
183
|
# State
|
180
184
|
self.showViewerPanel = True # The panel for the viewer is visible
|
181
185
|
self.showEditToolBar = False # The document editor toolbar visibility
|
182
|
-
self.useShortcodes = False # Use shortcodes for basic formatting
|
183
186
|
self.viewComments = True # Comments are shown in the viewer
|
184
187
|
self.viewSynopsis = True # Synopsis is shown in the viewer
|
185
188
|
|
186
|
-
# Search
|
187
|
-
self.searchCase
|
188
|
-
self.searchWord
|
189
|
-
self.searchRegEx
|
190
|
-
self.searchLoop
|
191
|
-
self.searchNextFile
|
192
|
-
self.searchMatchCap
|
189
|
+
# Search Box States
|
190
|
+
self.searchCase = False
|
191
|
+
self.searchWord = False
|
192
|
+
self.searchRegEx = False
|
193
|
+
self.searchLoop = False
|
194
|
+
self.searchNextFile = False
|
195
|
+
self.searchMatchCap = False
|
196
|
+
self.searchProjCase = False
|
197
|
+
self.searchProjWord = False
|
198
|
+
self.searchProjRegEx = False
|
193
199
|
|
194
200
|
# System and App Information
|
195
201
|
# ==========================
|
@@ -414,6 +420,14 @@ class Config:
|
|
414
420
|
self._errData = []
|
415
421
|
return message
|
416
422
|
|
423
|
+
def localDate(self, value: datetime) -> str:
|
424
|
+
"""Return a localised date format."""
|
425
|
+
return self._dLocale.toString(value, self._dShortDate)
|
426
|
+
|
427
|
+
def localDateTime(self, value: datetime) -> str:
|
428
|
+
"""Return a localised datetime format."""
|
429
|
+
return self._dLocale.toString(value, self._dShortDateTime)
|
430
|
+
|
417
431
|
def listLanguages(self, lngSet: int) -> list[tuple[str, str]]:
|
418
432
|
"""List localisation files in the i18n folder. The default GUI
|
419
433
|
language is British English (en_GB).
|
@@ -496,6 +510,11 @@ class Config:
|
|
496
510
|
QLocale.setDefault(self._qLocale)
|
497
511
|
self._qtTrans = {}
|
498
512
|
|
513
|
+
hasLocale = (self._nwLangPath / f"nw_{self._qLocale.name()}.qm").exists()
|
514
|
+
self._dLocale = self._qLocale if hasLocale else QLocale.system()
|
515
|
+
self._dShortDate = self._dLocale.dateFormat(QLocale.FormatType.ShortFormat)
|
516
|
+
self._dShortDateTime = self._dLocale.dateTimeFormat(QLocale.FormatType.ShortFormat)
|
517
|
+
|
499
518
|
langList = [
|
500
519
|
(self._qtLangPath, "qtbase"), # Qt 5.x
|
501
520
|
(str(self._nwLangPath), "nw"), # novelWriter
|
@@ -602,7 +621,6 @@ class Config:
|
|
602
621
|
sec = "State"
|
603
622
|
self.showViewerPanel = conf.rdBool(sec, "showviewerpanel", self.showViewerPanel)
|
604
623
|
self.showEditToolBar = conf.rdBool(sec, "showedittoolbar", self.showEditToolBar)
|
605
|
-
self.useShortcodes = conf.rdBool(sec, "useshortcodes", self.useShortcodes)
|
606
624
|
self.viewComments = conf.rdBool(sec, "viewcomments", self.viewComments)
|
607
625
|
self.viewSynopsis = conf.rdBool(sec, "viewsynopsis", self.viewSynopsis)
|
608
626
|
self.searchCase = conf.rdBool(sec, "searchcase", self.searchCase)
|
@@ -611,6 +629,9 @@ class Config:
|
|
611
629
|
self.searchLoop = conf.rdBool(sec, "searchloop", self.searchLoop)
|
612
630
|
self.searchNextFile = conf.rdBool(sec, "searchnextfile", self.searchNextFile)
|
613
631
|
self.searchMatchCap = conf.rdBool(sec, "searchmatchcap", self.searchMatchCap)
|
632
|
+
self.searchProjCase = conf.rdBool(sec, "searchprojcase", self.searchProjCase)
|
633
|
+
self.searchProjWord = conf.rdBool(sec, "searchprojword", self.searchProjWord)
|
634
|
+
self.searchProjRegEx = conf.rdBool(sec, "searchprojregex", self.searchProjRegEx)
|
614
635
|
|
615
636
|
# Check Values
|
616
637
|
# ============
|
@@ -708,7 +729,6 @@ class Config:
|
|
708
729
|
conf["State"] = {
|
709
730
|
"showviewerpanel": str(self.showViewerPanel),
|
710
731
|
"showedittoolbar": str(self.showEditToolBar),
|
711
|
-
"useshortcodes": str(self.useShortcodes),
|
712
732
|
"viewcomments": str(self.viewComments),
|
713
733
|
"viewsynopsis": str(self.viewSynopsis),
|
714
734
|
"searchcase": str(self.searchCase),
|
@@ -717,6 +737,9 @@ class Config:
|
|
717
737
|
"searchloop": str(self.searchLoop),
|
718
738
|
"searchnextfile": str(self.searchNextFile),
|
719
739
|
"searchmatchcap": str(self.searchMatchCap),
|
740
|
+
"searchprojcase": str(self.searchProjCase),
|
741
|
+
"searchprojword": str(self.searchProjWord),
|
742
|
+
"searchprojregex": str(self.searchProjRegEx),
|
720
743
|
}
|
721
744
|
|
722
745
|
# Write config file
|
novelwriter/constants.py
CHANGED
@@ -23,8 +23,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
23
23
|
"""
|
24
24
|
from __future__ import annotations
|
25
25
|
|
26
|
-
import re
|
27
|
-
|
28
26
|
from PyQt5.QtCore import QCoreApplication, QT_TRANSLATE_NOOP
|
29
27
|
|
30
28
|
from novelwriter.enum import nwBuildFmt, nwItemClass, nwItemLayout, nwOutline
|
@@ -55,6 +53,7 @@ class nwConst:
|
|
55
53
|
|
56
54
|
# Gui Settings
|
57
55
|
STATUS_MSG_TIMEOUT = 15000 # milliseconds
|
56
|
+
MAX_SEARCH_RESULT = 1000
|
58
57
|
|
59
58
|
# Dialogs
|
60
59
|
DLG_FINISHED = 2
|
@@ -67,12 +66,9 @@ class nwRegEx:
|
|
67
66
|
FMT_EI = r"(?<![\w\\])(_)(?![\s_])(.+?)(?<![\s\\])(\1)(?!\w)"
|
68
67
|
FMT_EB = r"(?<![\w\\])([\*]{2})(?![\s\*])(.+?)(?<![\s\\])(\1)(?!\w)"
|
69
68
|
FMT_ST = r"(?<![\w\\])([~]{2})(?![\s~])(.+?)(?<![\s\\])(\1)(?!\w)"
|
70
|
-
FMT_SC = r"(?i)(?<!\\)(\[[\/\!]?(?:i|b|s|u|sup|sub)\])"
|
69
|
+
FMT_SC = r"(?i)(?<!\\)(\[[\/\!]?(?:i|b|s|u|m|sup|sub)\])"
|
71
70
|
FMT_SV = r"(?<!\\)(\[(?i)(?:fn|footnote):)(.+?)(?<!\\)(\])"
|
72
71
|
|
73
|
-
# Pre-Compiled RegEx
|
74
|
-
RX_SC = re.compile(FMT_SC)
|
75
|
-
|
76
72
|
# END Class nwRegEx
|
77
73
|
|
78
74
|
|
@@ -86,6 +82,8 @@ class nwShortcode:
|
|
86
82
|
STRIKE_C = "[/s]"
|
87
83
|
ULINE_O = "[u]"
|
88
84
|
ULINE_C = "[/u]"
|
85
|
+
MARK_O = "[m]"
|
86
|
+
MARK_C = "[/m]"
|
89
87
|
SUP_O = "[sup]"
|
90
88
|
SUP_C = "[/sup]"
|
91
89
|
SUB_O = "[sub]"
|
@@ -408,6 +406,7 @@ class nwUnicode:
|
|
408
406
|
U_THNBSP = "\u202f" # Thin non-breaking space
|
409
407
|
U_ENSP = "\u2002" # Short (en) space
|
410
408
|
U_EMSP = "\u2003" # Long (em) space
|
409
|
+
U_MMSP = "\u205f" # Medium mathematical space
|
411
410
|
U_LSEP = "\u2028" # Line separator
|
412
411
|
U_PSEP = "\u2029" # Paragraph separator
|
413
412
|
|
@@ -49,39 +49,54 @@ logger = logging.getLogger(__name__)
|
|
49
49
|
# (type, default, [min value, max value])
|
50
50
|
|
51
51
|
SETTINGS_TEMPLATE = {
|
52
|
-
"filter.includeNovel":
|
53
|
-
"filter.includeNotes":
|
54
|
-
"filter.includeInactive":
|
55
|
-
"headings.fmtTitle":
|
56
|
-
"headings.fmtChapter":
|
57
|
-
"headings.fmtUnnumbered":
|
58
|
-
"headings.fmtScene":
|
59
|
-
"headings.
|
60
|
-
"headings.
|
61
|
-
"headings.
|
62
|
-
"
|
63
|
-
"
|
64
|
-
"
|
65
|
-
"
|
66
|
-
"
|
67
|
-
"
|
68
|
-
"
|
69
|
-
"
|
70
|
-
"
|
71
|
-
"
|
72
|
-
"
|
73
|
-
"
|
74
|
-
"
|
75
|
-
"
|
76
|
-
"
|
77
|
-
"
|
78
|
-
"
|
79
|
-
"format.
|
80
|
-
"format.
|
81
|
-
"
|
82
|
-
"
|
83
|
-
"
|
84
|
-
"
|
52
|
+
"filter.includeNovel": (bool, True),
|
53
|
+
"filter.includeNotes": (bool, False),
|
54
|
+
"filter.includeInactive": (bool, False),
|
55
|
+
"headings.fmtTitle": (str, nwHeadFmt.TITLE),
|
56
|
+
"headings.fmtChapter": (str, nwHeadFmt.TITLE),
|
57
|
+
"headings.fmtUnnumbered": (str, nwHeadFmt.TITLE),
|
58
|
+
"headings.fmtScene": (str, "* * *"),
|
59
|
+
"headings.fmtHardScene": (str, ""),
|
60
|
+
"headings.fmtSection": (str, ""),
|
61
|
+
"headings.hideTitle": (bool, False),
|
62
|
+
"headings.hideChapter": (bool, False),
|
63
|
+
"headings.hideUnnumbered": (bool, False),
|
64
|
+
"headings.hideScene": (bool, False),
|
65
|
+
"headings.hideHardScene": (bool, False),
|
66
|
+
"headings.hideSection": (bool, True),
|
67
|
+
"headings.centerTitle": (bool, True),
|
68
|
+
"headings.centerChapter": (bool, False),
|
69
|
+
"headings.centerScene": (bool, False),
|
70
|
+
"headings.breakTitle": (bool, True),
|
71
|
+
"headings.breakChapter": (bool, True),
|
72
|
+
"headings.breakScene": (bool, False),
|
73
|
+
"text.includeSynopsis": (bool, False),
|
74
|
+
"text.includeComments": (bool, False),
|
75
|
+
"text.includeKeywords": (bool, False),
|
76
|
+
"text.includeBodyText": (bool, True),
|
77
|
+
"text.ignoredKeywords": (str, ""),
|
78
|
+
"text.addNoteHeadings": (bool, True),
|
79
|
+
"format.textFont": (str, CONFIG.textFont),
|
80
|
+
"format.textSize": (int, 12),
|
81
|
+
"format.lineHeight": (float, 1.15, 0.75, 3.0),
|
82
|
+
"format.justifyText": (bool, False),
|
83
|
+
"format.stripUnicode": (bool, False),
|
84
|
+
"format.replaceTabs": (bool, False),
|
85
|
+
"format.pageUnit": (str, "cm"),
|
86
|
+
"format.pageSize": (str, "A4"),
|
87
|
+
"format.pageWidth": (float, 21.0),
|
88
|
+
"format.pageHeight": (float, 29.7),
|
89
|
+
"format.topMargin": (float, 2.0),
|
90
|
+
"format.bottomMargin": (float, 2.0),
|
91
|
+
"format.leftMargin": (float, 2.0),
|
92
|
+
"format.rightMargin": (float, 2.0),
|
93
|
+
"odt.addColours": (bool, True),
|
94
|
+
"odt.pageHeader": (str, nwHeadFmt.ODT_AUTO),
|
95
|
+
"odt.pageCountOffset": (int, 0),
|
96
|
+
"odt.firstLineIndent": (bool, False),
|
97
|
+
"md.preserveBreaks": (bool, True),
|
98
|
+
"html.addStyles": (bool, True),
|
99
|
+
"html.preserveTabs": (bool, False),
|
85
100
|
}
|
86
101
|
|
87
102
|
SETTINGS_LABELS = {
|
@@ -91,19 +106,19 @@ SETTINGS_LABELS = {
|
|
91
106
|
"filter.includeInactive": QT_TRANSLATE_NOOP("Builds", "Inactive Documents"),
|
92
107
|
|
93
108
|
"headings": QT_TRANSLATE_NOOP("Builds", "Headings"),
|
94
|
-
"headings.fmtTitle": QT_TRANSLATE_NOOP("Builds", "
|
95
|
-
"headings.fmtChapter": QT_TRANSLATE_NOOP("Builds", "Chapter
|
96
|
-
"headings.fmtUnnumbered": QT_TRANSLATE_NOOP("Builds", "Unnumbered
|
97
|
-
"headings.fmtScene": QT_TRANSLATE_NOOP("Builds", "Scene
|
98
|
-
"headings.
|
99
|
-
"headings.
|
100
|
-
"headings.hideSection": QT_TRANSLATE_NOOP("Builds", "Hide Section Headings"),
|
109
|
+
"headings.fmtTitle": QT_TRANSLATE_NOOP("Builds", "Partition Format"),
|
110
|
+
"headings.fmtChapter": QT_TRANSLATE_NOOP("Builds", "Chapter Format"),
|
111
|
+
"headings.fmtUnnumbered": QT_TRANSLATE_NOOP("Builds", "Unnumbered Format"),
|
112
|
+
"headings.fmtScene": QT_TRANSLATE_NOOP("Builds", "Scene Format"),
|
113
|
+
"headings.fmtHardScene": QT_TRANSLATE_NOOP("Builds", "Hard Scene Format"),
|
114
|
+
"headings.fmtSection": QT_TRANSLATE_NOOP("Builds", "Section Format"),
|
101
115
|
|
102
116
|
"text.grpContent": QT_TRANSLATE_NOOP("Builds", "Text Content"),
|
103
117
|
"text.includeSynopsis": QT_TRANSLATE_NOOP("Builds", "Include Synopsis"),
|
104
118
|
"text.includeComments": QT_TRANSLATE_NOOP("Builds", "Include Comments"),
|
105
119
|
"text.includeKeywords": QT_TRANSLATE_NOOP("Builds", "Include Keywords"),
|
106
120
|
"text.includeBodyText": QT_TRANSLATE_NOOP("Builds", "Include Body Text"),
|
121
|
+
"text.ignoredKeywords": QT_TRANSLATE_NOOP("Builds", "Ignore These Keywords"),
|
107
122
|
"text.grpInsert": QT_TRANSLATE_NOOP("Builds", "Insert Content"),
|
108
123
|
"text.addNoteHeadings": QT_TRANSLATE_NOOP("Builds", "Add Titles for Notes"),
|
109
124
|
|
@@ -129,9 +144,14 @@ SETTINGS_LABELS = {
|
|
129
144
|
"odt.addColours": QT_TRANSLATE_NOOP("Builds", "Add Highlight Colours"),
|
130
145
|
"odt.pageHeader": QT_TRANSLATE_NOOP("Builds", "Page Header"),
|
131
146
|
"odt.pageCountOffset": QT_TRANSLATE_NOOP("Builds", "Page Counter Offset"),
|
147
|
+
"odt.firstLineIndent": QT_TRANSLATE_NOOP("Builds", "First Line Indent"),
|
148
|
+
|
149
|
+
"md": QT_TRANSLATE_NOOP("Builds", "Markdown (.md)"),
|
150
|
+
"md.preserveBreaks": QT_TRANSLATE_NOOP("Builds", "Preserve Hard Line Breaks"),
|
132
151
|
|
133
152
|
"html": QT_TRANSLATE_NOOP("Builds", "HTML (.html)"),
|
134
153
|
"html.addStyles": QT_TRANSLATE_NOOP("Builds", "Add CSS Styles"),
|
154
|
+
"html.preserveTabs": QT_TRANSLATE_NOOP("Builds", "Preserve Tab Characters"),
|
135
155
|
}
|
136
156
|
|
137
157
|
|