From d263de02059c5d5f2ce9ee791e557b47c60b8567 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Thu, 21 May 2020 14:45:00 +0200 Subject: [PATCH 1/6] Ensure setSelectedhandle also makes the item visible in the scroll view --- nw/gui/elements/doctree.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nw/gui/elements/doctree.py b/nw/gui/elements/doctree.py index a30fb856..5f818fd2 100644 --- a/nw/gui/elements/doctree.py +++ b/nw/gui/elements/doctree.py @@ -485,6 +485,11 @@ class GuiDocTree(QTreeWidget): if tHandle in self.theMap: self.clearSelection() self.theMap[tHandle].setSelected(True) + selItems = self.selectedIndexes() + if selItems: + self.scrollTo( + selItems[0], QAbstractItemView.PositionAtCenter + ) return True return False From d3c95887e637c96579cd3bf47c00bf824fe09e2c Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Thu, 21 May 2020 14:52:26 +0200 Subject: [PATCH 2/6] Added an option to turn off syntax highlighting for text in quotes --- nw/config.py | 5 +++++ nw/gui/dialogs/configeditor.py | 9 +++++++++ nw/gui/tools/dochighlight.py | 32 +++++++++++++++++--------------- 3 files changed, 31 insertions(+), 15 deletions(-) diff --git a/nw/config.py b/nw/config.py index e0d008ee..ff30078c 100644 --- a/nw/config.py +++ b/nw/config.py @@ -119,6 +119,7 @@ class Config: self.showLineEndings = False self.bigDocLimit = 800 self.showFullPath = True + self.highlightQuotes = True self.fmtApostrophe = nwUnicode.U_RSQUO self.fmtSingleQuotes = [nwUnicode.U_LSQUO,nwUnicode.U_RSQUO] @@ -414,6 +415,9 @@ class Config: self.showFullPath = self._parseLine( cnfParse, cnfSec, "showfullpath", self.CNF_BOOL, self.showFullPath ) + self.highlightQuotes = self._parseLine( + cnfParse, cnfSec, "highlightquotes", self.CNF_BOOL, self.highlightQuotes + ) ## Backup cnfSec = "Backup" @@ -504,6 +508,7 @@ class Config: cnfParse.set(cnfSec,"showlineendings", str(self.showLineEndings)) cnfParse.set(cnfSec,"bigdoclimit", str(self.bigDocLimit)) cnfParse.set(cnfSec,"showfullpath", str(self.showFullPath)) + cnfParse.set(cnfSec,"highlightquotes", str(self.highlightQuotes)) ## Backup cnfSec = "Backup" diff --git a/nw/gui/dialogs/configeditor.py b/nw/gui/dialogs/configeditor.py index da3158c0..e6778853 100644 --- a/nw/gui/dialogs/configeditor.py +++ b/nw/gui/dialogs/configeditor.py @@ -222,6 +222,13 @@ class GuiConfigEditGeneralTab(QWidget): self.showFullPath ) + self.highlightQuotes = QSwitch() + self.highlightQuotes.setChecked(self.mainConf.highlightQuotes) + self.mainForm.addRow( + "Add highlighting to text in quotes", + self.highlightQuotes + ) + # AutoSave Settings # ================= self.mainForm.addGroupLabel("Automatic Save") @@ -296,6 +303,7 @@ class GuiConfigEditGeneralTab(QWidget): guiIcons = self.selectIcons.currentData() guiDark = self.preferDarkIcons.isChecked() showFullPath = self.showFullPath.isChecked() + highlightQuotes = self.highlightQuotes.isChecked() autoSaveDoc = self.autoSaveDoc.value() autoSaveProj = self.autoSaveProj.value() backupPath = self.backupPath @@ -311,6 +319,7 @@ class GuiConfigEditGeneralTab(QWidget): self.mainConf.guiIcons = guiIcons self.mainConf.guiDark = guiDark self.mainConf.showFullPath = showFullPath + self.mainConf.highlightQuotes = highlightQuotes self.mainConf.autoSaveDoc = autoSaveDoc self.mainConf.autoSaveProj = autoSaveProj self.mainConf.backupPath = backupPath diff --git a/nw/gui/tools/dochighlight.py b/nw/gui/tools/dochighlight.py index 5ac14af5..9d57b612 100644 --- a/nw/gui/tools/dochighlight.py +++ b/nw/gui/tools/dochighlight.py @@ -159,22 +159,24 @@ class GuiDocHighlighter(QSyntaxHighlighter): )) # Quoted Strings - self.hRules.append(( - "{:s}(.+?){:s}".format('"','"'), { - 0 : self.hStyles["dialogue1"], - } - )) - self.hRules.append(( - "{:s}(.+?){:s}".format(*self.mainConf.fmtDoubleQuotes), { - 0 : self.hStyles["dialogue2"], - } - )) - self.hRules.append(( - "{:s}(.+?){:s}".format(*self.mainConf.fmtSingleQuotes), { - 0 : self.hStyles["dialogue3"], - } - )) + if self.mainConf.highlightQuotes: + self.hRules.append(( + "{:s}(.+?){:s}".format('"','"'), { + 0 : self.hStyles["dialogue1"], + } + )) + self.hRules.append(( + "{:s}(.+?){:s}".format(*self.mainConf.fmtDoubleQuotes), { + 0 : self.hStyles["dialogue2"], + } + )) + self.hRules.append(( + "{:s}(.+?){:s}".format(*self.mainConf.fmtSingleQuotes), { + 0 : self.hStyles["dialogue3"], + } + )) + # Auto-Replace Tags self.hRules.append(( r"<(\S+?)>", { 0 : self.hStyles["replace"], From 9c2a52a9a18f9787b086c1d311df27ce1761fa9e Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Thu, 21 May 2020 14:53:58 +0200 Subject: [PATCH 3/6] Fixed tests --- tests/reference/novelwriter.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/reference/novelwriter.conf b/tests/reference/novelwriter.conf index 53a4944a..acc95a94 100644 --- a/tests/reference/novelwriter.conf +++ b/tests/reference/novelwriter.conf @@ -1,5 +1,5 @@ [Main] -timestamp = 2020-05-01 21:28:25 +timestamp = 2020-05-21 14:52:36 theme = default syntax = default_light icons = typicons_grey_light @@ -40,6 +40,7 @@ showtabsnspaces = False showlineendings = False bigdoclimit = 800 showfullpath = True +highlightquotes = True [Backup] backuppath = From 6a94a03cd0c086581df7a8d030286b53ed809064 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Thu, 21 May 2020 15:02:09 +0200 Subject: [PATCH 4/6] Bumped version to 0.5.2 --- docs/source/conf.py | 4 ++-- docs/source/started.txt | 4 ++-- nw/__init__.py | 4 ++-- setup.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index c0b1ce34..0ab76427 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -24,9 +24,9 @@ copyright = "2018-2020, Veronica Berglyd Olsen" author = "Veronica Berglyd Olsen" # The short X.Y version -version = "0.5.1" +version = "0.5.2" # The full version, including alpha/beta/rc tags -release = "0.5.1" +release = "0.5.2" # -- General configuration --------------------------------------------------- diff --git a/docs/source/started.txt b/docs/source/started.txt index 49bf0b08..dc151d93 100644 --- a/docs/source/started.txt +++ b/docs/source/started.txt @@ -6,8 +6,8 @@ You can download novelWriter from https://github.com/vkbo/novelWriter/releases Latest version is |version|: -* ZIP file: https://github.com/vkbo/novelWriter/archive/v0.5.1.zip -* TAR file: https://github.com/vkbo/novelWriter/archive/v0.5.1.tar.gz +* ZIP file: https://github.com/vkbo/novelWriter/archive/v0.5.2.zip +* TAR file: https://github.com/vkbo/novelWriter/archive/v0.5.2.tar.gz Extract the archive to a location of your choice. diff --git a/nw/__init__.py b/nw/__init__.py index 9d27b993..daac7b81 100644 --- a/nw/__init__.py +++ b/nw/__init__.py @@ -40,9 +40,9 @@ __package__ = "novelWriter" __author__ = "Veronica Berglyd Olsen" __copyright__ = "Copyright 2018–2020, Veronica Berglyd Olsen" __license__ = "GPLv3" -__version__ = "0.5.1" +__version__ = "0.5.2" __hexversion__ = "0x000501f0" -__date__ = "2020-05-14" +__date__ = "2020-05-21" __maintainer__ = "Veronica Berglyd Olsen" __email__ = "code@vkbo.net" __status__ = "Pre-Release" diff --git a/setup.py b/setup.py index 7ffa7b7e..a84ce257 100755 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ with open("README.md", "r") as inFile: setuptools.setup( name = "novelWriter", - version = "0.5.1", + version = "0.5.2", author = "Veronica Berglyd Olsen", author_email = "code@vkbo.net", description = "A markdown-like document editor for writing novels", From 64ce12e22039db03e19e6fcac3523710baf8b3fa Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Thu, 21 May 2020 15:13:43 +0200 Subject: [PATCH 5/6] Updated changelog --- CHANGELOG.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 554526cd..48836112 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # novelWriter ChangeLog +## Version 0.5.2 [2020-05-21] + +**Bugfixes** + +* When running on Windows 10, some of the buttons were missing icons. More fallback icons have been added to ensure that all current buttons have a fallback path that always ends in an icon. PR #211 + +**User Interface** + +* The statusbar has been redesigned a bit. The block icons showing document and project saved status have been replaced by LED icons. The statistics has been moved to a separate label, and most of the detailed stats moved to its tooltip. PR #210 +* Default icon theme is now `Typicons Grey Light`. PR #211 +* Clicking on the document header selects the document in the project tree, but this functionality has been enhanced to also ensure the document is expanded and visible in the tree. If it's scrolled out of view, the tree will scroll it into view. PR #215 +* Syntax highlighting of text in quotes can now be turned off in Preferences. #215 + +**Core Functionality** + +* Checking for version dependencies and a few packages (aside from PyQt5) is now done later in the start-up so that it is possible to alert the user with a dialog box instead of terminal error messages. PR #210 +* Made a few minor changes to the code so novelWriter can run with Python 3.4.3 and Qt 5.2.1, that is, it runs on last version of Ubuntu 14.04. This level of compatibility is not guaranteed to remain in the future, but for now, the changes have no impact on functionality. PR #210 + ## Version 0.5.1 [2020-05-14] **Bugfixes** From 35f6d8dbe7d91cbb1297d5b641014aa99efefc39 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Thu, 21 May 2020 15:14:48 +0200 Subject: [PATCH 6/6] Forgot to bump hex version --- nw/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nw/__init__.py b/nw/__init__.py index daac7b81..9020b85c 100644 --- a/nw/__init__.py +++ b/nw/__init__.py @@ -41,7 +41,7 @@ __author__ = "Veronica Berglyd Olsen" __copyright__ = "Copyright 2018–2020, Veronica Berglyd Olsen" __license__ = "GPLv3" __version__ = "0.5.2" -__hexversion__ = "0x000501f0" +__hexversion__ = "0x000502f0" __date__ = "2020-05-21" __maintainer__ = "Veronica Berglyd Olsen" __email__ = "code@vkbo.net"