From 497d4dd7f964f0422f793fc8c0e71346ba71ccb8 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Tue, 4 Jun 2024 17:56:30 +0200 Subject: [PATCH 1/2] Add stubs file to dev requirements --- requirements-dev.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements-dev.txt b/requirements-dev.txt index 8499c6e83..e2e3b1d0e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,3 +3,4 @@ flake8-pep585 flake8-pyproject flake8-annotations isort +pyqt5-stubs From 83d2cb4f827d219654afef89cf7582a0afee1185 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Tue, 4 Jun 2024 18:19:21 +0200 Subject: [PATCH 2/2] Swap project name and app name in window title (#1910) --- novelwriter/guimain.py | 5 +---- tests/test_dialogs/test_dlg_projectsettings.py | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/novelwriter/guimain.py b/novelwriter/guimain.py index 14b124fa2..cb818aba9 100644 --- a/novelwriter/guimain.py +++ b/novelwriter/guimain.py @@ -1361,10 +1361,7 @@ def _connectMenuActions(self) -> None: def _updateWindowTitle(self, projName: str | None = None) -> None: """Set the window title and add the project's name.""" - winTitle = CONFIG.appName - if projName is not None: - winTitle += " - %s" % projName - self.setWindowTitle(winTitle) + self.setWindowTitle(" - ".join(filter(None, [projName, CONFIG.appName]))) return def _getTagSource(self, tag: str) -> tuple[str | None, str | None]: diff --git a/tests/test_dialogs/test_dlg_projectsettings.py b/tests/test_dialogs/test_dlg_projectsettings.py index 210012731..36fba384e 100644 --- a/tests/test_dialogs/test_dlg_projectsettings.py +++ b/tests/test_dialogs/test_dlg_projectsettings.py @@ -129,7 +129,7 @@ def testDlgProjSettings_SettingsPage(qtbot, monkeypatch, nwGUI, fncPath, projPat assert project.data.doBackup is False nwGUI._processProjectSettingsChanges(False) - assert nwGUI.windowTitle() == "novelWriter - Project Name" + assert nwGUI.windowTitle() == "Project Name - novelWriter" # qtbot.stop()