Update tests other than tree-related
This commit is contained in:
+5
-13
@@ -20,6 +20,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
from PyQt5.QtGui import QFont, QIcon, QPixmap
|
||||
from PyQt5.QtWidgets import QWidget
|
||||
|
||||
@@ -28,7 +30,9 @@ class MockGuiMain(QWidget):
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.mainStatus = MockStatusBar()
|
||||
self.mainStatus = MagicMock()
|
||||
self.docEditor = MagicMock()
|
||||
self.docViewer = MagicMock()
|
||||
self.projPath = ""
|
||||
return
|
||||
|
||||
@@ -52,18 +56,6 @@ class MockGuiMain(QWidget):
|
||||
return "close"
|
||||
|
||||
|
||||
class MockStatusBar:
|
||||
|
||||
def __init__(self):
|
||||
return
|
||||
|
||||
def setStatus(self, text):
|
||||
return
|
||||
|
||||
def updateProjectStatus(self, status):
|
||||
return
|
||||
|
||||
|
||||
class MockTheme:
|
||||
|
||||
def __init__(self):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<novelWriterXML appVersion="2.4rc1" hexVersion="0x020400c1" fileVersion="1.5" fileRevision="4" timeStamp="2024-04-09 22:34:16">
|
||||
<novelWriterXML appVersion="2.6b1" hexVersion="0x020600b1" fileVersion="1.5" fileRevision="4" timeStamp="2024-11-23 18:40:02">
|
||||
<project id="d0f3fe10-c6e6-4310-8bfd-181eb4224eed" saveCount="1" autoCount="1" editTime="0">
|
||||
<name>New Project</name>
|
||||
<author>Jane Doe</author>
|
||||
@@ -37,7 +37,7 @@
|
||||
<meta expanded="no" heading="H1" charCount="20" wordCount="5" paraCount="1" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Title Page</name>
|
||||
</item>
|
||||
<item handle="000000000000d" parent="0000000000008" root="0000000000008" order="0" type="FOLDER" class="NOVEL">
|
||||
<item handle="000000000000d" parent="0000000000008" root="0000000000008" order="1" type="FOLDER" class="NOVEL">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">New Chapter</name>
|
||||
</item>
|
||||
@@ -45,11 +45,11 @@
|
||||
<meta expanded="no" heading="H2" charCount="11" wordCount="2" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">New Chapter</name>
|
||||
</item>
|
||||
<item handle="000000000000f" parent="000000000000d" root="0000000000008" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<item handle="000000000000f" parent="000000000000d" root="0000000000008" order="1" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H3" charCount="9" wordCount="2" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">New Scene</name>
|
||||
</item>
|
||||
<item handle="0000000000010" parent="0000000000008" root="0000000000008" order="0" type="FOLDER" class="NOVEL">
|
||||
<item handle="0000000000010" parent="0000000000008" root="0000000000008" order="2" type="FOLDER" class="NOVEL">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Stuff</name>
|
||||
</item>
|
||||
@@ -57,11 +57,11 @@
|
||||
<meta expanded="no" heading="H2" charCount="5" wordCount="1" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Hello</name>
|
||||
</item>
|
||||
<item handle="0000000000009" parent="None" root="0000000000009" order="0" type="ROOT" class="PLOT">
|
||||
<item handle="0000000000009" parent="None" root="0000000000009" order="1" type="ROOT" class="PLOT">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Plot</name>
|
||||
</item>
|
||||
<item handle="000000000000a" parent="None" root="000000000000a" order="0" type="ROOT" class="CHARACTER">
|
||||
<item handle="000000000000a" parent="None" root="000000000000a" order="2" type="ROOT" class="CHARACTER">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Characters</name>
|
||||
</item>
|
||||
@@ -69,11 +69,11 @@
|
||||
<meta expanded="no" heading="H1" charCount="11" wordCount="3" paraCount="1" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Jane</name>
|
||||
</item>
|
||||
<item handle="0000000000013" parent="000000000000a" root="000000000000a" order="0" type="FILE" class="CHARACTER" layout="NOTE">
|
||||
<item handle="0000000000013" parent="000000000000a" root="000000000000a" order="1" type="FILE" class="CHARACTER" layout="NOTE">
|
||||
<meta expanded="no" heading="H1" charCount="11" wordCount="3" paraCount="1" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">John</name>
|
||||
</item>
|
||||
<item handle="000000000000b" parent="None" root="000000000000b" order="0" type="ROOT" class="WORLD">
|
||||
<item handle="000000000000b" parent="None" root="000000000000b" order="3" type="ROOT" class="WORLD">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Locations</name>
|
||||
</item>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<novelWriterXML appVersion="2.4rc1" hexVersion="0x020400c1" fileVersion="1.5" fileRevision="4" timeStamp="2024-04-09 22:34:16">
|
||||
<novelWriterXML appVersion="2.6b1" hexVersion="0x020600b1" fileVersion="1.5" fileRevision="4" timeStamp="2024-11-23 18:44:06">
|
||||
<project id="d0f3fe10-c6e6-4310-8bfd-181eb4224eed" saveCount="1" autoCount="1" editTime="0">
|
||||
<name>New Project</name>
|
||||
<author>Jane Doe</author>
|
||||
@@ -37,7 +37,7 @@
|
||||
<meta expanded="no" heading="H1" charCount="20" wordCount="5" paraCount="1" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Title Page</name>
|
||||
</item>
|
||||
<item handle="000000000000d" parent="0000000000008" root="0000000000008" order="0" type="FOLDER" class="NOVEL">
|
||||
<item handle="000000000000d" parent="0000000000008" root="0000000000008" order="1" type="FOLDER" class="NOVEL">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">New Chapter</name>
|
||||
</item>
|
||||
@@ -45,51 +45,51 @@
|
||||
<meta expanded="no" heading="H2" charCount="11" wordCount="2" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">New Chapter</name>
|
||||
</item>
|
||||
<item handle="000000000000f" parent="000000000000d" root="0000000000008" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<item handle="000000000000f" parent="000000000000d" root="0000000000008" order="1" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H3" charCount="9" wordCount="2" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">New Scene</name>
|
||||
</item>
|
||||
<item handle="0000000000009" parent="None" root="0000000000009" order="0" type="ROOT" class="PLOT">
|
||||
<item handle="0000000000009" parent="None" root="0000000000009" order="1" type="ROOT" class="PLOT">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Plot</name>
|
||||
</item>
|
||||
<item handle="000000000000a" parent="None" root="000000000000a" order="0" type="ROOT" class="CHARACTER">
|
||||
<item handle="000000000000a" parent="None" root="000000000000a" order="2" type="ROOT" class="CHARACTER">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Characters</name>
|
||||
</item>
|
||||
<item handle="000000000000b" parent="None" root="000000000000b" order="0" type="ROOT" class="WORLD">
|
||||
<item handle="000000000000b" parent="None" root="000000000000b" order="3" type="ROOT" class="WORLD">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Locations</name>
|
||||
</item>
|
||||
<item handle="0000000000010" parent="None" root="0000000000010" order="0" type="ROOT" class="NOVEL">
|
||||
<item handle="0000000000010" parent="None" root="0000000000010" order="4" type="ROOT" class="NOVEL">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Novel</name>
|
||||
</item>
|
||||
<item handle="0000000000011" parent="None" root="0000000000011" order="0" type="ROOT" class="PLOT">
|
||||
<item handle="0000000000011" parent="None" root="0000000000011" order="5" type="ROOT" class="PLOT">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Plot</name>
|
||||
</item>
|
||||
<item handle="0000000000012" parent="None" root="0000000000012" order="0" type="ROOT" class="CHARACTER">
|
||||
<item handle="0000000000012" parent="None" root="0000000000012" order="6" type="ROOT" class="CHARACTER">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Characters</name>
|
||||
</item>
|
||||
<item handle="0000000000013" parent="None" root="0000000000013" order="0" type="ROOT" class="WORLD">
|
||||
<item handle="0000000000013" parent="None" root="0000000000013" order="7" type="ROOT" class="WORLD">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Locations</name>
|
||||
</item>
|
||||
<item handle="0000000000014" parent="None" root="0000000000014" order="0" type="ROOT" class="TIMELINE">
|
||||
<item handle="0000000000014" parent="None" root="0000000000014" order="8" type="ROOT" class="TIMELINE">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Timeline</name>
|
||||
</item>
|
||||
<item handle="0000000000015" parent="None" root="0000000000015" order="0" type="ROOT" class="OBJECT">
|
||||
<item handle="0000000000015" parent="None" root="0000000000015" order="9" type="ROOT" class="OBJECT">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Objects</name>
|
||||
</item>
|
||||
<item handle="0000000000016" parent="None" root="0000000000016" order="0" type="ROOT" class="CUSTOM">
|
||||
<item handle="0000000000016" parent="None" root="0000000000016" order="10" type="ROOT" class="CUSTOM">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Custom</name>
|
||||
</item>
|
||||
<item handle="0000000000017" parent="None" root="0000000000017" order="0" type="ROOT" class="CUSTOM">
|
||||
<item handle="0000000000017" parent="None" root="0000000000017" order="11" type="ROOT" class="CUSTOM">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Custom</name>
|
||||
</item>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<novelWriterXML appVersion="2.6b1" hexVersion="0x020600b1" fileVersion="1.5" fileRevision="4" timeStamp="2024-11-20 18:44:37">
|
||||
<novelWriterXML appVersion="2.6b1" hexVersion="0x020600b1" fileVersion="1.5" fileRevision="4" timeStamp="2024-11-23 19:08:29">
|
||||
<project id="d0f3fe10-c6e6-4310-8bfd-181eb4224eed" saveCount="1" autoCount="1" editTime="0">
|
||||
<name>New Project</name>
|
||||
<author>Jane Doe</author>
|
||||
@@ -37,7 +37,7 @@
|
||||
<meta expanded="no" heading="H1" charCount="20" wordCount="5" paraCount="1" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Title Page</name>
|
||||
</item>
|
||||
<item handle="000000000000d" parent="0000000000008" root="0000000000008" order="0" type="FOLDER" class="NOVEL">
|
||||
<item handle="000000000000d" parent="0000000000008" root="0000000000008" order="1" type="FOLDER" class="NOVEL">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">New Chapter</name>
|
||||
</item>
|
||||
@@ -45,23 +45,23 @@
|
||||
<meta expanded="no" heading="H2" charCount="11" wordCount="2" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">New Chapter</name>
|
||||
</item>
|
||||
<item handle="0000000000019" parent="000000000000d" root="0000000000008" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<item handle="0000000000019" parent="000000000000d" root="0000000000008" order="1" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H2" charCount="11" wordCount="2" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">New Chapter</name>
|
||||
</item>
|
||||
<item handle="000000000000f" parent="000000000000d" root="0000000000008" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<item handle="000000000000f" parent="000000000000d" root="0000000000008" order="2" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H3" charCount="9" wordCount="2" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">New Scene</name>
|
||||
</item>
|
||||
<item handle="0000000000010" parent="000000000000d" root="0000000000008" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<item handle="0000000000010" parent="000000000000d" root="0000000000008" order="3" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H3" charCount="9" wordCount="2" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">New Scene</name>
|
||||
</item>
|
||||
<item handle="000000000001a" parent="000000000000d" root="0000000000008" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<item handle="000000000001a" parent="000000000000d" root="0000000000008" order="4" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H3" charCount="9" wordCount="2" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">New Scene</name>
|
||||
</item>
|
||||
<item handle="0000000000011" parent="0000000000008" root="0000000000008" order="0" type="FOLDER" class="NOVEL">
|
||||
<item handle="0000000000011" parent="0000000000008" root="0000000000008" order="2" type="FOLDER" class="NOVEL">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">New Chapter</name>
|
||||
</item>
|
||||
@@ -69,11 +69,11 @@
|
||||
<meta expanded="no" heading="H2" charCount="11" wordCount="2" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">New Chapter</name>
|
||||
</item>
|
||||
<item handle="0000000000013" parent="0000000000011" root="0000000000008" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<item handle="0000000000013" parent="0000000000011" root="0000000000008" order="1" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H3" charCount="9" wordCount="2" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">New Scene</name>
|
||||
</item>
|
||||
<item handle="0000000000014" parent="None" root="0000000000014" order="0" type="ROOT" class="NOVEL">
|
||||
<item handle="0000000000014" parent="None" root="0000000000014" order="1" type="ROOT" class="NOVEL">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Novel</name>
|
||||
</item>
|
||||
@@ -81,7 +81,7 @@
|
||||
<meta expanded="no" heading="H1" charCount="20" wordCount="5" paraCount="1" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Title Page</name>
|
||||
</item>
|
||||
<item handle="0000000000016" parent="0000000000014" root="0000000000014" order="0" type="FOLDER" class="NOVEL">
|
||||
<item handle="0000000000016" parent="0000000000014" root="0000000000014" order="1" type="FOLDER" class="NOVEL">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">New Chapter</name>
|
||||
</item>
|
||||
@@ -89,19 +89,19 @@
|
||||
<meta expanded="no" heading="H2" charCount="11" wordCount="2" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">New Chapter</name>
|
||||
</item>
|
||||
<item handle="0000000000018" parent="0000000000016" root="0000000000014" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<item handle="0000000000018" parent="0000000000016" root="0000000000014" order="1" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H3" charCount="9" wordCount="2" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">New Scene</name>
|
||||
</item>
|
||||
<item handle="0000000000009" parent="None" root="0000000000009" order="0" type="ROOT" class="PLOT">
|
||||
<item handle="0000000000009" parent="None" root="0000000000009" order="2" type="ROOT" class="PLOT">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Plot</name>
|
||||
</item>
|
||||
<item handle="000000000000a" parent="None" root="000000000000a" order="0" type="ROOT" class="CHARACTER">
|
||||
<item handle="000000000000a" parent="None" root="000000000000a" order="3" type="ROOT" class="CHARACTER">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Characters</name>
|
||||
</item>
|
||||
<item handle="000000000000b" parent="None" root="000000000000b" order="0" type="ROOT" class="WORLD">
|
||||
<item handle="000000000000b" parent="None" root="000000000000b" order="4" type="ROOT" class="WORLD">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Locations</name>
|
||||
</item>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<novelWriterXML appVersion="2.4rc1" hexVersion="0x020400c1" fileVersion="1.5" fileRevision="4" timeStamp="2024-04-09 22:34:16">
|
||||
<novelWriterXML appVersion="2.6b1" hexVersion="0x020600b1" fileVersion="1.5" fileRevision="4" timeStamp="2024-11-23 19:07:52">
|
||||
<project id="d0f3fe10-c6e6-4310-8bfd-181eb4224eed" saveCount="1" autoCount="0" editTime="0">
|
||||
<name>Test Project A</name>
|
||||
<author>Jane Doe</author>
|
||||
@@ -37,7 +37,7 @@
|
||||
<meta expanded="no" heading="H0" charCount="0" wordCount="0" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Title Page</name>
|
||||
</item>
|
||||
<item handle="000000000000a" parent="0000000000008" root="0000000000008" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<item handle="000000000000a" parent="0000000000008" root="0000000000008" order="1" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H0" charCount="0" wordCount="0" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Chapter 1</name>
|
||||
</item>
|
||||
@@ -45,15 +45,15 @@
|
||||
<meta expanded="no" heading="H0" charCount="0" wordCount="0" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Scene 1.1</name>
|
||||
</item>
|
||||
<item handle="000000000000c" parent="000000000000a" root="0000000000008" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<item handle="000000000000c" parent="000000000000a" root="0000000000008" order="1" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H0" charCount="0" wordCount="0" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Scene 1.2</name>
|
||||
</item>
|
||||
<item handle="000000000000d" parent="000000000000a" root="0000000000008" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<item handle="000000000000d" parent="000000000000a" root="0000000000008" order="2" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H0" charCount="0" wordCount="0" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Scene 1.3</name>
|
||||
</item>
|
||||
<item handle="000000000000e" parent="0000000000008" root="0000000000008" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<item handle="000000000000e" parent="0000000000008" root="0000000000008" order="2" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H0" charCount="0" wordCount="0" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Chapter 2</name>
|
||||
</item>
|
||||
@@ -61,15 +61,15 @@
|
||||
<meta expanded="no" heading="H0" charCount="0" wordCount="0" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Scene 2.1</name>
|
||||
</item>
|
||||
<item handle="0000000000010" parent="000000000000e" root="0000000000008" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<item handle="0000000000010" parent="000000000000e" root="0000000000008" order="1" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H0" charCount="0" wordCount="0" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Scene 2.2</name>
|
||||
</item>
|
||||
<item handle="0000000000011" parent="000000000000e" root="0000000000008" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<item handle="0000000000011" parent="000000000000e" root="0000000000008" order="2" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H0" charCount="0" wordCount="0" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Scene 2.3</name>
|
||||
</item>
|
||||
<item handle="0000000000012" parent="0000000000008" root="0000000000008" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<item handle="0000000000012" parent="0000000000008" root="0000000000008" order="3" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H0" charCount="0" wordCount="0" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Chapter 3</name>
|
||||
</item>
|
||||
@@ -77,15 +77,15 @@
|
||||
<meta expanded="no" heading="H0" charCount="0" wordCount="0" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Scene 3.1</name>
|
||||
</item>
|
||||
<item handle="0000000000014" parent="0000000000012" root="0000000000008" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<item handle="0000000000014" parent="0000000000012" root="0000000000008" order="1" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H0" charCount="0" wordCount="0" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Scene 3.2</name>
|
||||
</item>
|
||||
<item handle="0000000000015" parent="0000000000012" root="0000000000008" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<item handle="0000000000015" parent="0000000000012" root="0000000000008" order="2" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H0" charCount="0" wordCount="0" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Scene 3.3</name>
|
||||
</item>
|
||||
<item handle="0000000000016" parent="None" root="0000000000016" order="0" type="ROOT" class="PLOT">
|
||||
<item handle="0000000000016" parent="None" root="0000000000016" order="1" type="ROOT" class="PLOT">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Plot</name>
|
||||
</item>
|
||||
@@ -93,7 +93,7 @@
|
||||
<meta expanded="no" heading="H0" charCount="0" wordCount="0" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Main Plot</name>
|
||||
</item>
|
||||
<item handle="0000000000018" parent="None" root="0000000000018" order="0" type="ROOT" class="CHARACTER">
|
||||
<item handle="0000000000018" parent="None" root="0000000000018" order="2" type="ROOT" class="CHARACTER">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Characters</name>
|
||||
</item>
|
||||
@@ -101,7 +101,7 @@
|
||||
<meta expanded="no" heading="H0" charCount="0" wordCount="0" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Protagonist</name>
|
||||
</item>
|
||||
<item handle="000000000001a" parent="None" root="000000000001a" order="0" type="ROOT" class="WORLD">
|
||||
<item handle="000000000001a" parent="None" root="000000000001a" order="3" type="ROOT" class="WORLD">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Locations</name>
|
||||
</item>
|
||||
@@ -109,11 +109,11 @@
|
||||
<meta expanded="no" heading="H0" charCount="0" wordCount="0" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Main Location</name>
|
||||
</item>
|
||||
<item handle="000000000001c" parent="None" root="000000000001c" order="0" type="ROOT" class="ARCHIVE">
|
||||
<item handle="000000000001c" parent="None" root="000000000001c" order="4" type="ROOT" class="ARCHIVE">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Archive</name>
|
||||
</item>
|
||||
<item handle="000000000001d" parent="None" root="000000000001d" order="0" type="ROOT" class="TRASH">
|
||||
<item handle="000000000001d" parent="None" root="000000000001d" order="5" type="ROOT" class="TRASH">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Trash</name>
|
||||
</item>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<novelWriterXML appVersion="2.4rc1" hexVersion="0x020400c1" fileVersion="1.5" fileRevision="4" timeStamp="2024-04-09 22:34:16">
|
||||
<novelWriterXML appVersion="2.6b1" hexVersion="0x020600b1" fileVersion="1.5" fileRevision="4" timeStamp="2024-11-23 19:07:13">
|
||||
<project id="d0f3fe10-c6e6-4310-8bfd-181eb4224eed" saveCount="1" autoCount="0" editTime="0">
|
||||
<name>Test Project B</name>
|
||||
<author>Jane Doe</author>
|
||||
@@ -37,31 +37,31 @@
|
||||
<meta expanded="no" heading="H0" charCount="0" wordCount="0" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Title Page</name>
|
||||
</item>
|
||||
<item handle="000000000000a" parent="0000000000008" root="0000000000008" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<item handle="000000000000a" parent="0000000000008" root="0000000000008" order="1" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H0" charCount="0" wordCount="0" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Scene 1</name>
|
||||
</item>
|
||||
<item handle="000000000000b" parent="0000000000008" root="0000000000008" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<item handle="000000000000b" parent="0000000000008" root="0000000000008" order="2" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H0" charCount="0" wordCount="0" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Scene 2</name>
|
||||
</item>
|
||||
<item handle="000000000000c" parent="0000000000008" root="0000000000008" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<item handle="000000000000c" parent="0000000000008" root="0000000000008" order="3" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H0" charCount="0" wordCount="0" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Scene 3</name>
|
||||
</item>
|
||||
<item handle="000000000000d" parent="0000000000008" root="0000000000008" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<item handle="000000000000d" parent="0000000000008" root="0000000000008" order="4" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H0" charCount="0" wordCount="0" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Scene 4</name>
|
||||
</item>
|
||||
<item handle="000000000000e" parent="0000000000008" root="0000000000008" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<item handle="000000000000e" parent="0000000000008" root="0000000000008" order="5" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H0" charCount="0" wordCount="0" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Scene 5</name>
|
||||
</item>
|
||||
<item handle="000000000000f" parent="0000000000008" root="0000000000008" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<item handle="000000000000f" parent="0000000000008" root="0000000000008" order="6" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H0" charCount="0" wordCount="0" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Scene 6</name>
|
||||
</item>
|
||||
<item handle="0000000000010" parent="None" root="0000000000010" order="0" type="ROOT" class="PLOT">
|
||||
<item handle="0000000000010" parent="None" root="0000000000010" order="1" type="ROOT" class="PLOT">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Plot</name>
|
||||
</item>
|
||||
@@ -69,7 +69,7 @@
|
||||
<meta expanded="no" heading="H0" charCount="0" wordCount="0" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Main Plot</name>
|
||||
</item>
|
||||
<item handle="0000000000012" parent="None" root="0000000000012" order="0" type="ROOT" class="CHARACTER">
|
||||
<item handle="0000000000012" parent="None" root="0000000000012" order="2" type="ROOT" class="CHARACTER">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Characters</name>
|
||||
</item>
|
||||
@@ -77,7 +77,7 @@
|
||||
<meta expanded="no" heading="H0" charCount="0" wordCount="0" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Protagonist</name>
|
||||
</item>
|
||||
<item handle="0000000000014" parent="None" root="0000000000014" order="0" type="ROOT" class="WORLD">
|
||||
<item handle="0000000000014" parent="None" root="0000000000014" order="3" type="ROOT" class="WORLD">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Locations</name>
|
||||
</item>
|
||||
@@ -85,11 +85,11 @@
|
||||
<meta expanded="no" heading="H0" charCount="0" wordCount="0" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Main Location</name>
|
||||
</item>
|
||||
<item handle="0000000000016" parent="None" root="0000000000016" order="0" type="ROOT" class="ARCHIVE">
|
||||
<item handle="0000000000016" parent="None" root="0000000000016" order="4" type="ROOT" class="ARCHIVE">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Archive</name>
|
||||
</item>
|
||||
<item handle="0000000000017" parent="None" root="0000000000017" order="0" type="ROOT" class="TRASH">
|
||||
<item handle="0000000000017" parent="None" root="0000000000017" order="5" type="ROOT" class="TRASH">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">Trash</name>
|
||||
</item>
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
%%~name: New Note
|
||||
%%~path: 000000000000a/0000000000010
|
||||
%%~kind: CHARACTER/NOTE
|
||||
%%~hash: 9fae6dfdd3d1c0822d3a3cf90c0142e65ad8e557
|
||||
%%~date: 2023-08-25 18:14:24/2023-08-25 18:14:24
|
||||
# Jane Doe
|
||||
|
||||
@tag: Jane
|
||||
|
||||
This is a file about Jane.
|
||||
@@ -1,10 +1,10 @@
|
||||
%%~name: New Note
|
||||
%%~path: 0000000000009/0000000000011
|
||||
%%~kind: PLOT/NOTE
|
||||
%%~hash: 3d3697638a70fc86cc023df6d42202a262d93905
|
||||
%%~date: 2024-04-14 23:46:49/2024-04-14 23:46:49
|
||||
# Main Plot
|
||||
%%~path: 000000000000a/0000000000011
|
||||
%%~kind: CHARACTER/NOTE
|
||||
%%~hash: 9fae6dfdd3d1c0822d3a3cf90c0142e65ad8e557
|
||||
%%~date: 2024-11-23 18:26:00/2024-11-23 18:26:00
|
||||
# Jane Doe
|
||||
|
||||
@tag: MainPlot
|
||||
@tag: Jane
|
||||
|
||||
This is a file [i]detailing[/i] the main plot.
|
||||
This is a file about Jane.
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
%%~name: New Note
|
||||
%%~path: 000000000000b/0000000000012
|
||||
%%~kind: WORLD/NOTE
|
||||
%%~hash: 3f5c3c6c3ba1c27c30b8ac9e59c222fb9a1bd775
|
||||
%%~date: 2023-08-25 18:17:45/2023-08-25 18:17:45
|
||||
# Main Location
|
||||
%%~path: 0000000000009/0000000000012
|
||||
%%~kind: PLOT/NOTE
|
||||
%%~hash: 3d3697638a70fc86cc023df6d42202a262d93905
|
||||
%%~date: 2024-11-23 18:26:31/2024-11-23 18:26:31
|
||||
# Main Plot
|
||||
|
||||
@tag: Home
|
||||
@tag: MainPlot
|
||||
|
||||
This is a file describing Jane’s home.
|
||||
This is a file [i]detailing[/i] the main plot.
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
%%~name: New Note
|
||||
%%~path: 000000000000b/0000000000013
|
||||
%%~kind: WORLD/NOTE
|
||||
%%~hash: 3f5c3c6c3ba1c27c30b8ac9e59c222fb9a1bd775
|
||||
%%~date: 2024-11-23 18:28:00/2024-11-23 18:28:00
|
||||
# Main Location
|
||||
|
||||
@tag: Home
|
||||
|
||||
This is a file describing Jane’s home.
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<novelWriterXML appVersion="2.6a3" hexVersion="0x020600a3" fileVersion="1.5" fileRevision="4" timeStamp="2024-11-01 21:15:11">
|
||||
<novelWriterXML appVersion="2.6b1" hexVersion="0x020600b1" fileVersion="1.5" fileRevision="4" timeStamp="2024-11-23 18:27:11">
|
||||
<project id="d0f3fe10-c6e6-4310-8bfd-181eb4224eed" saveCount="3" autoCount="2" editTime="5">
|
||||
<name>New Project</name>
|
||||
<author>Jane Doe</author>
|
||||
@@ -22,19 +22,19 @@
|
||||
<entry key="s000003" count="0" red="50" green="200" blue="0" shape="SQUARE">Finished</entry>
|
||||
</status>
|
||||
<importance>
|
||||
<entry key="i000004" count="6" red="100" green="100" blue="100" shape="SQUARE">New</entry>
|
||||
<entry key="i000004" count="7" red="100" green="100" blue="100" shape="SQUARE">New</entry>
|
||||
<entry key="i000005" count="0" red="200" green="50" blue="0" shape="SQUARE">Minor</entry>
|
||||
<entry key="i000006" count="0" red="200" green="150" blue="0" shape="SQUARE">Major</entry>
|
||||
<entry key="i000007" count="0" red="50" green="200" blue="0" shape="SQUARE">Main</entry>
|
||||
</importance>
|
||||
</settings>
|
||||
<content items="11" novelWords="179" notesWords="27">
|
||||
<content items="12" novelWords="179" notesWords="27">
|
||||
<item handle="0000000000008" parent="None" root="0000000000008" order="0" type="ROOT" class="NOVEL">
|
||||
<meta expanded="yes" />
|
||||
<name status="s000000" import="i000004">Novel</name>
|
||||
</item>
|
||||
<item handle="000000000000c" parent="0000000000008" root="0000000000008" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H1" charCount="20" wordCount="5" paraCount="1" cursorPos="0" />
|
||||
<meta expanded="yes" heading="H1" charCount="20" wordCount="5" paraCount="1" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">Title Page</name>
|
||||
</item>
|
||||
<item handle="000000000000d" parent="0000000000008" root="0000000000008" order="1" type="FOLDER" class="NOVEL">
|
||||
@@ -42,36 +42,40 @@
|
||||
<name status="s000000" import="i000004">New Chapter</name>
|
||||
</item>
|
||||
<item handle="000000000000e" parent="000000000000d" root="0000000000008" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H2" charCount="11" wordCount="2" paraCount="0" cursorPos="0" />
|
||||
<meta expanded="yes" heading="H2" charCount="11" wordCount="2" paraCount="0" cursorPos="0" />
|
||||
<name status="s000000" import="i000004" active="yes">New Chapter</name>
|
||||
</item>
|
||||
<item handle="000000000000f" parent="000000000000d" root="0000000000008" order="1" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H1" charCount="1003" wordCount="172" paraCount="17" cursorPos="1259" />
|
||||
<meta expanded="yes" heading="H1" charCount="1003" wordCount="172" paraCount="17" cursorPos="1259" />
|
||||
<name status="s000000" import="i000004" active="yes">New Scene</name>
|
||||
</item>
|
||||
<item handle="0000000000009" parent="None" root="0000000000009" order="1" type="ROOT" class="PLOT">
|
||||
<meta expanded="yes" />
|
||||
<name status="s000000" import="i000004">Plot</name>
|
||||
</item>
|
||||
<item handle="0000000000011" parent="0000000000009" root="0000000000009" order="0" type="FILE" class="PLOT" layout="NOTE">
|
||||
<meta expanded="no" heading="H1" charCount="48" wordCount="10" paraCount="1" cursorPos="76" />
|
||||
<item handle="0000000000012" parent="0000000000009" root="0000000000009" order="0" type="FILE" class="PLOT" layout="NOTE">
|
||||
<meta expanded="yes" heading="H1" charCount="48" wordCount="10" paraCount="1" cursorPos="76" />
|
||||
<name status="s000000" import="i000004" active="yes">New Note</name>
|
||||
</item>
|
||||
<item handle="000000000000a" parent="None" root="000000000000a" order="2" type="ROOT" class="CHARACTER">
|
||||
<meta expanded="yes" />
|
||||
<name status="s000000" import="i000004">Characters</name>
|
||||
</item>
|
||||
<item handle="0000000000010" parent="000000000000a" root="000000000000a" order="0" type="FILE" class="CHARACTER" layout="NOTE">
|
||||
<meta expanded="no" heading="H1" charCount="34" wordCount="8" paraCount="1" cursorPos="51" />
|
||||
<item handle="0000000000011" parent="000000000000a" root="000000000000a" order="0" type="FILE" class="CHARACTER" layout="NOTE">
|
||||
<meta expanded="yes" heading="H1" charCount="34" wordCount="8" paraCount="1" cursorPos="51" />
|
||||
<name status="s000000" import="i000004" active="yes">New Note</name>
|
||||
</item>
|
||||
<item handle="000000000000b" parent="None" root="000000000000b" order="3" type="ROOT" class="WORLD">
|
||||
<meta expanded="yes" />
|
||||
<name status="s000000" import="i000004">World</name>
|
||||
<name status="s000000" import="i000004">Locations</name>
|
||||
</item>
|
||||
<item handle="0000000000012" parent="000000000000b" root="000000000000b" order="0" type="FILE" class="WORLD" layout="NOTE">
|
||||
<meta expanded="no" heading="H1" charCount="51" wordCount="9" paraCount="1" cursorPos="68" />
|
||||
<item handle="0000000000013" parent="000000000000b" root="000000000000b" order="0" type="FILE" class="WORLD" layout="NOTE">
|
||||
<meta expanded="yes" heading="H1" charCount="51" wordCount="9" paraCount="1" cursorPos="68" />
|
||||
<name status="s000000" import="i000004" active="yes">New Note</name>
|
||||
</item>
|
||||
<item handle="0000000000010" parent="None" root="0000000000010" order="4" type="ROOT" class="TRASH">
|
||||
<meta expanded="yes" />
|
||||
<name status="s000000" import="i000004">Trash</name>
|
||||
</item>
|
||||
</content>
|
||||
</novelWriterXML>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<novelWriterXML appVersion="2.4rc1" hexVersion="0x020400c1" fileVersion="1.5" fileRevision="4" timeStamp="2024-04-09 22:31:14">
|
||||
<novelWriterXML appVersion="2.6b1" hexVersion="0x020600b1" fileVersion="1.5" fileRevision="4" timeStamp="2024-11-23 17:46:20">
|
||||
<project id="d0f3fe10-c6e6-4310-8bfd-181eb4224eed" saveCount="2" autoCount="1" editTime="0">
|
||||
<name>New Project</name>
|
||||
<author>Jane Doe</author>
|
||||
@@ -59,7 +59,7 @@
|
||||
</item>
|
||||
<item handle="000000000000b" parent="None" root="000000000000b" order="3" type="ROOT" class="WORLD">
|
||||
<meta expanded="no" />
|
||||
<name status="s000000" import="i000004">World</name>
|
||||
<name status="s000000" import="i000004">Locations</name>
|
||||
</item>
|
||||
</content>
|
||||
</novelWriterXML>
|
||||
|
||||
@@ -275,7 +275,7 @@ def testCoreItem_Methods(mockGUI, mockRnd, fncPath):
|
||||
"handle": "000000000000f",
|
||||
"parent": "000000000000d",
|
||||
"root": "0000000000008",
|
||||
"order": "0",
|
||||
"order": "1",
|
||||
"type": "FILE",
|
||||
"class": "NOVEL",
|
||||
"layout": "DOCUMENT"
|
||||
|
||||
@@ -161,7 +161,7 @@ def testDlgProjSettings_StatusImport(qtbot, monkeypatch, nwGUI, projPath, mockRn
|
||||
project.tree[hCharNote].setImport(C.iMajor) # type: ignore
|
||||
project.tree[hWorldNote].setImport(C.iMain) # type: ignore
|
||||
|
||||
nwGUI.projView.populateTree()
|
||||
project.tree.refreshAllItems()
|
||||
project.countStatus()
|
||||
|
||||
assert [e.count for _, e in project.data.itemStatus.iterItems()] == [2, 0, 2, 1]
|
||||
|
||||
@@ -29,7 +29,7 @@ from PyQt5.QtGui import QDesktopServices, QMouseEvent, QTextCursor
|
||||
from PyQt5.QtWidgets import QAction, QApplication, QMenu
|
||||
|
||||
from novelwriter import CONFIG, SHARED
|
||||
from novelwriter.enum import nwDocAction
|
||||
from novelwriter.enum import nwChange, nwDocAction
|
||||
from novelwriter.formats.toqdoc import ToQTextDocument
|
||||
from novelwriter.types import QtModNone, QtMouseLeft
|
||||
|
||||
@@ -206,12 +206,12 @@ def testGuiViewer_Main(qtbot, monkeypatch, nwGUI, prjLipsum):
|
||||
nwItem = SHARED.project.tree["4c4f28287af27"]
|
||||
nwItem.setName("Test Title") # type: ignore
|
||||
assert nwItem.itemName == "Test Title" # type: ignore
|
||||
docViewer.updateDocInfo("4c4f28287af27")
|
||||
docViewer.onProjectItemChanged("4c4f28287af27", nwChange.UPDATE)
|
||||
assert docViewer.docHeader.itemTitle.text() == "Characters \u203a Test Title"
|
||||
|
||||
# Title without full path
|
||||
CONFIG.showFullPath = False
|
||||
docViewer.updateDocInfo("4c4f28287af27")
|
||||
docViewer.onProjectItemChanged("4c4f28287af27", nwChange.UPDATE)
|
||||
assert docViewer.docHeader.itemTitle.text() == "Test Title"
|
||||
CONFIG.showFullPath = True
|
||||
|
||||
|
||||
@@ -38,8 +38,7 @@ def testGuiViewerPanel_BackRefs(qtbot, monkeypatch, nwGUI, projPath, mockRnd):
|
||||
monkeypatch.setattr(GuiEditLabel, "getLabel", lambda *a, text: (text, True))
|
||||
|
||||
buildTestProject(nwGUI, projPath)
|
||||
projTree = nwGUI.projView.projTree
|
||||
projTree.expandAll()
|
||||
nwGUI.projView.projTree.expandAll()
|
||||
viewPanel = nwGUI.docViewerPanel
|
||||
tabBackRefs = viewPanel.tabBackRefs
|
||||
|
||||
@@ -81,7 +80,7 @@ def testGuiViewerPanel_BackRefs(qtbot, monkeypatch, nwGUI, projPath, mockRnd):
|
||||
|
||||
# Update Label
|
||||
SHARED.project.tree[C.hSceneDoc].setName("First Scene") # type: ignore
|
||||
projTree.renameTreeItem(C.hSceneDoc)
|
||||
nwGUI.projView.renameTreeItem(C.hSceneDoc)
|
||||
item = tabBackRefs.topLevelItem(0)
|
||||
assert item.text(tabBackRefs.C_DOC) == "First Scene"
|
||||
assert item.text(tabBackRefs.C_TITLE) == "Scene One"
|
||||
@@ -127,8 +126,7 @@ def testGuiViewerPanel_Tags(qtbot, monkeypatch, caplog, nwGUI, projPath, mockRnd
|
||||
monkeypatch.setattr(GuiEditLabel, "getLabel", lambda *a, text: (text, True))
|
||||
|
||||
buildTestProject(nwGUI, projPath)
|
||||
projTree = nwGUI.projView.projTree
|
||||
projTree.expandAll()
|
||||
nwGUI.projView.projTree.expandAll()
|
||||
viewPanel = nwGUI.docViewerPanel
|
||||
|
||||
nwGUI.openDocument(C.hSceneDoc)
|
||||
@@ -175,7 +173,7 @@ def testGuiViewerPanel_Tags(qtbot, monkeypatch, caplog, nwGUI, projPath, mockRnd
|
||||
nwGUI.docEditor.setPlainText("# Jane Smith\n\n@tag: Janey\n\n")
|
||||
nwGUI.saveDocument()
|
||||
SHARED.project.tree[hJane].setName("Awesome Jane") # type: ignore
|
||||
projTree.renameTreeItem(hJane)
|
||||
nwGUI.projView.renameTreeItem(hJane)
|
||||
item = charTab.topLevelItem(0)
|
||||
assert item.text(charTab.C_NAME) == "Janey"
|
||||
assert item.text(charTab.C_DOC) == "Awesome Jane"
|
||||
@@ -221,8 +219,7 @@ def testGuiViewerPanel_Tags(qtbot, monkeypatch, caplog, nwGUI, projPath, mockRnd
|
||||
nwJohn = SHARED.project.tree[hJohn]
|
||||
assert isinstance(nwJohn, NWItem)
|
||||
nwJohn.setActive(False)
|
||||
projTree.setTreeItemValues(nwJohn)
|
||||
projTree._alertTreeChange(hJohn, flush=False)
|
||||
nwJohn.notifyToRefresh()
|
||||
assert charTab.topLevelItemCount() == 1
|
||||
|
||||
# Update Labels
|
||||
|
||||
@@ -210,9 +210,8 @@ def testGuiMain_Editing(qtbot, monkeypatch, nwGUI, projPath, tstPaths, mockRnd):
|
||||
assert nwGUI.closeProject()
|
||||
|
||||
assert len(SHARED.project.tree) == 0
|
||||
assert len(SHARED.project.tree._order) == 0
|
||||
assert len(SHARED.project.tree._roots) == 0
|
||||
assert SHARED.project.tree.trashRoot is None
|
||||
assert len(SHARED.project.tree._items) == 0
|
||||
assert len(SHARED.project.tree._nodes) == 0
|
||||
assert SHARED.project.data.name == ""
|
||||
assert SHARED.project.data.author == ""
|
||||
assert SHARED.project.data.spellCheck is False
|
||||
@@ -228,23 +227,22 @@ def testGuiMain_Editing(qtbot, monkeypatch, nwGUI, projPath, tstPaths, mockRnd):
|
||||
assert nwGUI.openProject(projPath)
|
||||
|
||||
# Check that we loaded the data
|
||||
assert len(SHARED.project.tree) == 8
|
||||
assert len(SHARED.project.tree._order) == 8
|
||||
assert len(SHARED.project.tree._roots) == 4
|
||||
assert SHARED.project.tree.trashRoot is None
|
||||
assert len(SHARED.project.tree) == 9
|
||||
assert SHARED.project.tree.model.root.childCount() == 5
|
||||
assert SHARED.project.tree.trash is not None # Created automatically
|
||||
assert SHARED.project.data.name == "New Project"
|
||||
assert SHARED.project.data.author == "Jane Doe"
|
||||
assert SHARED.project.data.spellCheck is False
|
||||
|
||||
# Check that tree items have been created
|
||||
assert nwGUI.projView.projTree._getTreeItem(C.hNovelRoot) is not None
|
||||
assert nwGUI.projView.projTree._getTreeItem(C.hPlotRoot) is not None
|
||||
assert nwGUI.projView.projTree._getTreeItem(C.hCharRoot) is not None
|
||||
assert nwGUI.projView.projTree._getTreeItem(C.hWorldRoot) is not None
|
||||
assert nwGUI.projView.projTree._getTreeItem(C.hTitlePage) is not None
|
||||
assert nwGUI.projView.projTree._getTreeItem(C.hChapterDir) is not None
|
||||
assert nwGUI.projView.projTree._getTreeItem(C.hChapterDoc) is not None
|
||||
assert nwGUI.projView.projTree._getTreeItem(C.hSceneDoc) is not None
|
||||
assert SHARED.project.tree[C.hNovelRoot] is not None
|
||||
assert SHARED.project.tree[C.hPlotRoot] is not None
|
||||
assert SHARED.project.tree[C.hCharRoot] is not None
|
||||
assert SHARED.project.tree[C.hWorldRoot] is not None
|
||||
assert SHARED.project.tree[C.hTitlePage] is not None
|
||||
assert SHARED.project.tree[C.hChapterDir] is not None
|
||||
assert SHARED.project.tree[C.hChapterDoc] is not None
|
||||
assert SHARED.project.tree[C.hSceneDoc] is not None
|
||||
|
||||
nwGUI.mainMenu.aSpellCheck.setChecked(True)
|
||||
nwGUI.mainMenu._toggleSpellCheck()
|
||||
@@ -256,10 +254,12 @@ def testGuiMain_Editing(qtbot, monkeypatch, nwGUI, projPath, tstPaths, mockRnd):
|
||||
CONFIG.autoScroll = True
|
||||
|
||||
# Add a Character File
|
||||
nwGUI._switchFocus(nwFocus.TREE)
|
||||
nwGUI._changeView(nwView.PROJECT)
|
||||
nwGUI.projView.projTree.expandAll()
|
||||
nwGUI.projView.projTree.clearSelection()
|
||||
nwGUI.projView.projTree._getTreeItem(C.hCharRoot).setSelected(True)
|
||||
nwGUI.projView.projTree.setSelectedHandle(C.hCharRoot)
|
||||
nwGUI.projView.projTree.newTreeItem(nwItemType.FILE, None, isNote=True)
|
||||
nwGUI.projView.projTree.expandAll()
|
||||
nwGUI.openSelectedItem()
|
||||
|
||||
# Text Editor
|
||||
@@ -290,10 +290,11 @@ def testGuiMain_Editing(qtbot, monkeypatch, nwGUI, projPath, tstPaths, mockRnd):
|
||||
qtbot.keyClick(docEditor, Qt.Key.Key_Return, delay=KEY_DELAY)
|
||||
|
||||
# Add a Plot File
|
||||
nwGUI._switchFocus(nwFocus.TREE)
|
||||
nwGUI.projView.projTree.expandAll()
|
||||
nwGUI.projView.projTree.clearSelection()
|
||||
nwGUI.projView.projTree._getTreeItem(C.hPlotRoot).setSelected(True)
|
||||
nwGUI.projView.projTree.setSelectedHandle(C.hPlotRoot)
|
||||
nwGUI.projView.projTree.newTreeItem(nwItemType.FILE, None, isNote=True)
|
||||
nwGUI.projView.projTree.expandAll()
|
||||
nwGUI.openSelectedItem()
|
||||
|
||||
# Type something into the document
|
||||
@@ -312,10 +313,11 @@ def testGuiMain_Editing(qtbot, monkeypatch, nwGUI, projPath, tstPaths, mockRnd):
|
||||
qtbot.keyClick(docEditor, Qt.Key.Key_Return, delay=KEY_DELAY)
|
||||
|
||||
# Add a World File
|
||||
nwGUI._switchFocus(nwFocus.TREE)
|
||||
nwGUI.projView.projTree.expandAll()
|
||||
nwGUI.projView.projTree.clearSelection()
|
||||
nwGUI.projView.projTree._getTreeItem(C.hWorldRoot).setSelected(True)
|
||||
nwGUI.projView.projTree.setSelectedHandle(C.hWorldRoot)
|
||||
nwGUI.projView.projTree.newTreeItem(nwItemType.FILE, None, isNote=True)
|
||||
nwGUI.projView.projTree.expandAll()
|
||||
nwGUI.openSelectedItem()
|
||||
|
||||
# Add Some Text
|
||||
@@ -343,11 +345,9 @@ def testGuiMain_Editing(qtbot, monkeypatch, nwGUI, projPath, tstPaths, mockRnd):
|
||||
nwGUI._autoSaveProject()
|
||||
|
||||
# Select the 'New Scene' file
|
||||
nwGUI._switchFocus(nwFocus.TREE)
|
||||
nwGUI.projView.projTree.expandAll()
|
||||
nwGUI.projView.projTree.clearSelection()
|
||||
nwGUI.projView.projTree._getTreeItem(C.hNovelRoot).setExpanded(True)
|
||||
nwGUI.projView.projTree._getTreeItem(C.hChapterDir).setExpanded(True)
|
||||
nwGUI.projView.projTree._getTreeItem(C.hSceneDoc).setSelected(True)
|
||||
nwGUI.projView.projTree.setSelectedHandle(C.hSceneDoc)
|
||||
nwGUI.openSelectedItem()
|
||||
|
||||
# Type something into the document
|
||||
@@ -533,6 +533,7 @@ def testGuiMain_Editing(qtbot, monkeypatch, nwGUI, projPath, tstPaths, mockRnd):
|
||||
# Indent and Align
|
||||
# ================
|
||||
|
||||
nwGUI._switchFocus(nwView.EDITOR)
|
||||
for c in "\t\"Tab-indented text\"":
|
||||
qtbot.keyClick(docEditor, c, delay=KEY_DELAY)
|
||||
qtbot.keyClick(docEditor, Qt.Key.Key_Return, delay=KEY_DELAY)
|
||||
@@ -622,12 +623,6 @@ def testGuiMain_Editing(qtbot, monkeypatch, nwGUI, projPath, tstPaths, mockRnd):
|
||||
copyfile(projFile, testFile)
|
||||
assert cmpFiles(testFile, compFile, ignoreStart=NWD_IGNORE)
|
||||
|
||||
projFile = projPath / "content" / "0000000000010.nwd"
|
||||
testFile = tstPaths.outDir / "guiEditor_Main_Final_0000000000010.nwd"
|
||||
compFile = tstPaths.refDir / "guiEditor_Main_Final_0000000000010.nwd"
|
||||
copyfile(projFile, testFile)
|
||||
assert cmpFiles(testFile, compFile, ignoreStart=NWD_IGNORE)
|
||||
|
||||
projFile = projPath / "content" / "0000000000011.nwd"
|
||||
testFile = tstPaths.outDir / "guiEditor_Main_Final_0000000000011.nwd"
|
||||
compFile = tstPaths.refDir / "guiEditor_Main_Final_0000000000011.nwd"
|
||||
@@ -640,6 +635,12 @@ def testGuiMain_Editing(qtbot, monkeypatch, nwGUI, projPath, tstPaths, mockRnd):
|
||||
copyfile(projFile, testFile)
|
||||
assert cmpFiles(testFile, compFile, ignoreStart=NWD_IGNORE)
|
||||
|
||||
projFile = projPath / "content" / "0000000000013.nwd"
|
||||
testFile = tstPaths.outDir / "guiEditor_Main_Final_0000000000013.nwd"
|
||||
compFile = tstPaths.refDir / "guiEditor_Main_Final_0000000000013.nwd"
|
||||
copyfile(projFile, testFile)
|
||||
assert cmpFiles(testFile, compFile, ignoreStart=NWD_IGNORE)
|
||||
|
||||
# qtbot.stop()
|
||||
|
||||
|
||||
|
||||
@@ -197,7 +197,8 @@ def testGuiOutline_Content(qtbot, monkeypatch, nwGUI, prjLipsum, fncPath, tstPat
|
||||
assert outlineBar.novelValue.itemData(2) == "" # All novels
|
||||
|
||||
# Add a second novel folder
|
||||
newHandle = SHARED.project.newRoot(nwItemClass.NOVEL)
|
||||
with qtbot.waitSignal(SHARED.rootFolderChanged):
|
||||
newHandle = SHARED.project.newRoot(nwItemClass.NOVEL)
|
||||
|
||||
# Check new values in dropdown list
|
||||
assert outlineBar.novelValue.itemData(0) == lipHandle
|
||||
@@ -277,7 +278,7 @@ def testGuiOutline_Content(qtbot, monkeypatch, nwGUI, prjLipsum, fncPath, tstPat
|
||||
assert outlineData.fileValue.text() == "Scene One"
|
||||
assert outlineData.itemValue.text() == "Finished"
|
||||
|
||||
outlineTree._treeDoubleClick(selItem, 0)
|
||||
outlineTree._onItemDoubleClicked(selItem, 0)
|
||||
assert nwGUI.docEditor.docHandle == "88243afbe5ed8"
|
||||
|
||||
# Dump to CSV
|
||||
|
||||
@@ -86,9 +86,11 @@ def testGuiStatusBar_Main(qtbot, nwGUI, projPath, mockRnd):
|
||||
|
||||
# Project Stats
|
||||
CONFIG.incNotesWCount = False
|
||||
nwGUI._lastTotalCount = 0
|
||||
nwGUI._updateStatusWordCount()
|
||||
assert nwGUI.mainStatus.statsText.text() == "Words: 9 (+9)"
|
||||
CONFIG.incNotesWCount = True
|
||||
nwGUI._lastTotalCount = 0
|
||||
nwGUI._updateStatusWordCount()
|
||||
assert nwGUI.mainStatus.statsText.text() == "Words: 11 (+11)"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user