From bd3e23da334f18c950c4c112540c51ad2b2fa1c2 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Tue, 10 Jun 2025 23:16:10 +0200 Subject: [PATCH 1/3] Build index on new project creation --- novelwriter/core/coretools.py | 1 + 1 file changed, 1 insertion(+) diff --git a/novelwriter/core/coretools.py b/novelwriter/core/coretools.py index a4b2a0b1..5113d8e7 100644 --- a/novelwriter/core/coretools.py +++ b/novelwriter/core/coretools.py @@ -609,6 +609,7 @@ class ProjectBuilder: project.data.setSaveCount(0) project.data.setAutoCount(0) project.data.setEditTime(0) + project.index.rebuild() project.saveProject() project.closeProject() return From 4e02c8a63a4564766b25a63f3fc2be43b2bc4c8d Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Tue, 10 Jun 2025 23:28:58 +0200 Subject: [PATCH 2/3] Change a few defaults in config --- novelwriter/config.py | 6 +++--- tests/reference/baseConfig_novelwriter.conf | 9 +++++---- tests/test_dialogs/test_dlg_preferences.py | 12 ++++++------ 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/novelwriter/config.py b/novelwriter/config.py index 404391b1..9258bcca 100644 --- a/novelwriter/config.py +++ b/novelwriter/config.py @@ -180,8 +180,8 @@ class Config: # Project Settings self.autoSaveProj = 60 # Interval for auto-saving project, in seconds self.autoSaveDoc = 30 # Interval for auto-saving document, in seconds - self.emphLabels = True # Add emphasis to H1 and H2 item labels - self.backupOnClose = False # Flag for running automatic backups + self.emphLabels = False # Add emphasis to H1 and H2 item labels + self.backupOnClose = True # Flag for running automatic backups self.askBeforeBackup = True # Flag for asking before running automatic backup self.askBeforeExit = True # Flag for asking before exiting the app @@ -208,7 +208,7 @@ class Config: self.doReplaceDash = True # Replace multiple hyphens with dashes self.doReplaceDots = True # Replace three dots with ellipsis - self.autoScroll = False # Typewriter-like scrolling + self.autoScroll = True # Typewriter-like scrolling self.autoScrollPos = 30 # Start point for typewriter-like scrolling self.scrollPastEnd = True # Scroll past end of document, and centre cursor diff --git a/tests/reference/baseConfig_novelwriter.conf b/tests/reference/baseConfig_novelwriter.conf index 8943a9b2..fa16b190 100644 --- a/tests/reference/baseConfig_novelwriter.conf +++ b/tests/reference/baseConfig_novelwriter.conf @@ -1,5 +1,5 @@ [Meta] -timestamp = 2025-06-02 16:21:38 +timestamp = 2025-06-10 23:18:12 [Main] font = @@ -27,9 +27,9 @@ outlinepane = 500, 150 [Project] autosaveproject = 60 autosavedoc = 30 -emphlabels = True +emphlabels = False backuppath = -backuponclose = False +backuponclose = True askbeforebackup = True askbeforeexit = True lastauthor = @@ -49,7 +49,7 @@ repsquotes = True repdquotes = True repdash = True repdots = True -autoscroll = False +autoscroll = True autoscrollpos = 30 scrollpastend = True fmtsquoteopen = ‘ @@ -91,3 +91,4 @@ searchmatchcap = False searchprojcase = False searchprojword = False searchprojregex = False + diff --git a/tests/test_dialogs/test_dlg_preferences.py b/tests/test_dialogs/test_dlg_preferences.py index 1c54da98..9add0573 100644 --- a/tests/test_dialogs/test_dlg_preferences.py +++ b/tests/test_dialogs/test_dlg_preferences.py @@ -196,11 +196,11 @@ def testDlgPreferences_Settings(qtbot, monkeypatch, nwGUI, fncPath, tstPaths): # Project View prefs.iconColTree.setCurrentData("faded", "default") prefs.iconColDocs.setChecked(True) - prefs.emphLabels.setChecked(False) + prefs.emphLabels.setChecked(True) assert CONFIG.iconColTree == "theme" assert CONFIG.iconColDocs is False - assert CONFIG.emphLabels is True + assert CONFIG.emphLabels is False # Behaviour prefs.autoSaveDoc.stepUp() @@ -261,11 +261,11 @@ def testDlgPreferences_Settings(qtbot, monkeypatch, nwGUI, fncPath, tstPaths): # Editor Scrolling prefs.scrollPastEnd.setChecked(False) - prefs.autoScroll.setChecked(True) + prefs.autoScroll.setChecked(False) prefs.autoScrollPos.stepUp() assert CONFIG.scrollPastEnd is True - assert CONFIG.autoScroll is False + assert CONFIG.autoScroll is True assert CONFIG.autoScrollPos == 30 # Text Highlighting @@ -362,7 +362,7 @@ def testDlgPreferences_Settings(qtbot, monkeypatch, nwGUI, fncPath, tstPaths): # Project View assert CONFIG.iconColTree == "faded" assert CONFIG.iconColDocs is True - assert CONFIG.emphLabels is False + assert CONFIG.emphLabels is True # Behaviour assert CONFIG.autoSaveDoc == 31 @@ -395,7 +395,7 @@ def testDlgPreferences_Settings(qtbot, monkeypatch, nwGUI, fncPath, tstPaths): # Editor Scrolling assert CONFIG.scrollPastEnd is False - assert CONFIG.autoScroll is True + assert CONFIG.autoScroll is False assert CONFIG.autoScrollPos == 31 # Text Highlighting From f7691f6909d2e91b20d2b985e93905382435cc42 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Tue, 10 Jun 2025 23:29:17 +0200 Subject: [PATCH 3/3] Make sure manual files exist for testing --- tests/conftest.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 33baa870..a2c3ad03 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -39,6 +39,7 @@ from tests.mocked import MockGuiMain, MockTheme from tests.tools import cleanProject _TST_ROOT = Path(__file__).parent +_SRC_ROOT = _TST_ROOT.parent _TMP_ROOT = _TST_ROOT / "temp" _TMP_CONF = _TMP_ROOT / "conf" @@ -75,6 +76,8 @@ def sessionFixture(): _TMP_ROOT.mkdir() _TMP_CONF.mkdir() (_TMP_ROOT / "manual.pdf").touch() + (_SRC_ROOT / "novelwriter" / "assets"/ "manual.pdf").touch() + (_SRC_ROOT / "novelwriter" / "assets"/ "manual_fr.pdf").touch() return