Skip to content

Commit

Permalink
Merge branch 'dev' into fix_index
Browse files Browse the repository at this point in the history
  • Loading branch information
vkbo authored Nov 5, 2023
2 parents d67cef2 + a2a1e2e commit a5a2b2c
Show file tree
Hide file tree
Showing 29 changed files with 579 additions and 467 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- name: Python Setup
uses: actions/setup-python@v4
with:
python-version: 3
python-version: "3.11"
architecture: x64

- name: Install Packages (apt)
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Python Setup
uses: actions/setup-python@v4
with:
python-version: 3
python-version: "3.11"
architecture: x64

- name: Install Packages (pip)
Expand Down
11 changes: 0 additions & 11 deletions .readthedocs.yml

This file was deleted.

57 changes: 57 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,62 @@
# novelWriter Changelog

## Version 2.1.1 [2023-11-05]

### Release Notes

This is a patch release that fixes a layout issue and internationalisation issues with the new
Manuscript Build tool. It also fixes a number of issues related to bugs in the underlying Qt
framework that affects drag and drop functionality in the project tree. These issues were mostly
only affecting Debian Linux package releases.

Other, minor issues related to updating the editor on colour theme change and project word list
changes have been fixed as well. See the full changelog for more details.

### Detailed Changelog

**Bugfixes**

* Fix an issue with width of the last two columns on Selection page of the Build Settings dialog on
Windows. They were far too wide by default. Issue #1551. PR #1553.
* Fix an issue where a lot of string were not translated to the UI language in the new Manuscript
Build tool. Issue #1563. PR #1565.
* Fix an issue in the Document Viewer where it wouldn't scroll to a heading further down the page
when following a reference pointing to it. Issue #1566. PR #1568.
* Add back in checks for illegal drag and drop moves in the project tree. In 2.0, the logic here
was changed to set certain restrictions on the elements of the project tree itself, but there are
numerous bugs in the Qt framework related to drag and drop, so the checks are ignored on at least
Qt 5.15.8. In particular, it is possible to drop items on the root level, and it's possible to
move root items to other locations. Neither should be possible and will severely mess up the
project if done. Issue #1569. PR #1570.
* Add a custom autoscroll feature when dragging an item in the project tree to near the top or
bottom. This is actually a default feature of the tree widget in the Qt library, but this too is
broken in some versions of Qt 5.15.x. The default feature has been permanently disabled and
replaced by a custom written feature that behaves similarly. Issue #1561. PR #1571.
* Fix an issue where the editor document wasn't re-highlighted when the Syntax Theme for it was
changed. Issue #1535. PR #1573.
* Fix an issue where editing the Project Word List would not refresh the spell checking of the
editor. Issue #1559. PR #1573.

**Usability**

* Changed how the default UI language is selected. It used to default to the system locale, but
that is now changed to British English if the system local is not available in novelWriter. The
only real effects of this is that the dropdown box in Preferences now selects British English if
the system locale is not available rather than the first in the list (currently Deutch). The
second effect is that the language on buttons and other Qt components will match the rest of the
UI. Issue #1564. PR #1565.
* There is a bug in Qt on Wayland desktops where menus don't open in the correct location.
According to one Qt ticket, QTBUG-68636, this can be mitigated by ensuring all QMenu instances
have a parent set. This does not fix all issues, but it should help. The menus without a parent
set have now been updated. Issue #1536. PR #1572.

**Documentation**

* Fixed a number of spelling errors and typing mistakes in the documentation for 2.1. Contributed
by @nisemono-neko. PR #1567.

----

## Version 2.1 [2023-10-17]

### Release Notes
Expand Down
14 changes: 2 additions & 12 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
else:
release = "unknown"

version = release.split("-")[0]
version = release.partition("-")[0]

# -- General Configuration ---------------------------------------------------

Expand Down Expand Up @@ -67,11 +67,6 @@
"**": ["navbar-logo", "sidebar-title", "sbt-sidebar-nav"],
}

# -- Options for HTMLHelp Output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = "novelWriterDoc"

# -- Options for LaTeX Output ------------------------------------------------

latex_elements = {
Expand All @@ -84,11 +79,6 @@
"figure_align": "htbp",
}
latex_logo = "_static/novelwriter-pdf.png"

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [(
master_doc, "manual.tex", "User Guide",
author, "manual"
master_doc, "manual.tex", "User Guide", author, "manual"
)]
6 changes: 3 additions & 3 deletions docs/source/int_customise.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ set as ``name`` inside the file.
Gustom GUI and Icons Theme
--------------------------

A GUI theme ``.conf`` file consists of the follwing settings:
A GUI theme ``.conf`` file consists of the following settings:

.. code-block:: cfg
Expand Down Expand Up @@ -127,7 +127,7 @@ In the Main section you must at least define the ``name`` and ``icontheme`` sett
``typicons_light`` or ``typicons_dark``, or to an icon theme in your custom icons directory. The
setting must match the icon theme's folder name.

The Palette values correspond the the Qt enum values for QPalette::ColorRole, see the
The Palette values correspond to the Qt enum values for QPalette::ColorRole, see the
`Qt documentation <https://doc.qt.io/qt-5.15/qpalette.html#ColorRole-enum>`_ for more details. The
colour values are RGB numbers on the format ``r, g, b`` where each is an integer from to 255.
Omitted values are not loaded and will use default values.
Expand Down Expand Up @@ -167,5 +167,5 @@ A syntax theme ``.conf`` file consists of the follwing settings:
modifier = 0, 0, 0
In the Main section, you must define at least the ``name`` setting. The Syntax colour values are
RGB numbers on the format ``r, g, b`` where each is an integer from to 255. Omitted values default
RGB numbers of the format ``r, g, b`` where each is an integer from to 255. Omitted values default
to black, except ``background`` which defaults to white,
4 changes: 2 additions & 2 deletions docs/source/int_glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Glossary
for more details.

Reference
A references is one of a set of :term:`keywords<keyword>` that can be used to link to a
A reference is one of a set of :term:`keywords<keyword>` that can be used to link to a
:term:`tag` in another document. The reference keywords are specific to the different
:term:`root folder` types. A full overview is available in the :ref:`a_references` chapter.

Expand All @@ -55,7 +55,7 @@ Glossary

Keyword
A keyword in novelWriter is a special command you put in the text of your documents. They are
not standard Markdown, but is used in novelWriter to add information that is interpreted by
not standard Markdown, but are used in novelWriter to add information that is interpreted by
the application. For instance, keywords are used for :term:`tags<tag>` and
:term:`references<reference>`.

Expand Down
6 changes: 3 additions & 3 deletions docs/source/int_introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Key Features
At its core, novelWriter is a multi-document plain text editor. It uses a markup syntax inspired by
Markdown_ to apply simple formatting to the text. It is designed for writing fiction, so the
formatting features available are limited to those relevant for this purpose. It is *not* suitable
for technical writing, and it is *not* a full-feature Markdown editor.
for technical writing, and it is *not* a full-featured Markdown editor.

Your novel project is organised as a collection of separate plain text documents instead of a
single, large document. The idea here is to make it easier to reorganise your project structure
Expand All @@ -32,11 +32,11 @@ Below are some key features of novelWriter.
formatting text. Formatting is therefore limited to a small set of formatting tags for simple
things like text emphasis and paragraph alignment. When you really want to focus on just
writing, you can switch the editor into :guilabel:`Focus Mode` where only the text editor panel
itself is vissible, and the project structure view is hidden away.
itself is visible, and the project structure view is hidden away.

**Keep an eye on your notes**
The main window can optionally show a document viewer to the right of the editor. This view
panel is intended for displaying another scene document, you character notes, plot notes, or any
panel is intended for displaying another scene document, your character notes, plot notes, or any
other document you may need to reference while writing. It is not intended as a preview panel
for the document you're editing, but if you wish, you can also use it for this purpose.

Expand Down
8 changes: 4 additions & 4 deletions docs/source/int_overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ novelWriter is built as a cross-platform application using `Python 3 <https://ww
the programming language, and `Qt 5 <https://www.qt.io/>`_ for the user interface.

novelWriter is built for Linux first, and this is where it works best. However, it also runs fine
on Windows and MacOS due to the cross-platform framework it's build on. The author of the
application doesn't own a Mac, so on-going Mac support is dependant on user feedback and user
on Windows and MacOS due to the cross-platform framework it's built on. The author of the
application doesn't own a Mac, so on-going Mac support is dependent on user feedback and user
contributions.

Spell checking in novelWriter is provided by a third party library called
Expand All @@ -36,7 +36,7 @@ read on.
This chapter explains the basics of how the application works and what it can and cannot do.

:ref:`a_ui_project` – Recommended Reading
This chapter will give you a more detailed explanation of how you the user interface components
This chapter will give you a more detailed explanation of how you can use the user interface components
to organise and view your project work.

:ref:`a_ui_writing` – Recommended Reading
Expand Down Expand Up @@ -68,7 +68,7 @@ read on.
Organising Your Projects
========================

In addition to manage a collection of plain text files, novelWriter can interpret and map the
In addition to managing a collection of plain text files, novelWriter can interpret and map the
structure of your novel and show you additional information about its flow and content. In order
to take advantage of these features, you must structure your text in a specific way and add some
meta data for it to extract.
Expand Down
4 changes: 2 additions & 2 deletions docs/source/usage_breakdown.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ much all collected meta data is available here in different columns.

You can select which novel root folder to display from the dropdown box, and you can select which
columns to show or hide from the menu button. You can also rearrange the columns by drag and drop.
The app will remember you column order and size between sessions, and for each individual project.
The app will remember your column order and size between sessions, and for each individual project.


Colour Themes
Expand Down Expand Up @@ -220,7 +220,7 @@ makes it easier to track them with version control software.
Drive is mapped on Linux Gnome desktops using gvfs/gio.

.. caution::
You should not add additional files to the project folder yourself. Nor should you,a s a rule,
You should not add additional files to the project folder yourself. Nor should you, as a rule,
manually edit files within it. If you really must manually edit the text files, e.g. with some
automated task you want to perform, you need to rebuild the :term:`Project Index` when you open
the project again.
Expand Down
12 changes: 6 additions & 6 deletions docs/source/usage_format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ have a distinct colour, and the references themselves will get a colour if they
references will get a squiggly error line underneath. The same applies to duplicate tags.

There are a number of syntax highlighter colour themes available, both for light and dark GUIs. You
can select them for :guilabel:`Preferences`.
can select them from :guilabel:`Preferences`.


.. _a_fmt_head:
Expand Down Expand Up @@ -72,7 +72,7 @@ For headers level one and two, adding a ``!`` modifies the behaviour of the head
``#! Title Text``
This tells the build tool that the level one heading is intended to be used for the novel's
main title, like for instance on the front page. When building the manuscript, this will use a
different styling and will exclude the title from for instance a Table of Contents in Libre
different styling and will exclude the title from, for instance, a Table of Contents in Libre
Office.

``##! Title Text``
Expand Down Expand Up @@ -170,7 +170,7 @@ in a special manner and will show up in the :ref:`a_ui_outline` in a dedicated c
indicate this by altering the colour of the word.

``% text...``
This is a comment. The text is not renderred by default (this can be overridden), seen in the
This is a comment. The text is not rendered by default (this can be overridden), seen in the
document viewer, or counted towards word counts.

``% Synopsis: text...``
Expand All @@ -196,10 +196,10 @@ Tags use the command ``@tag:`` to define a tag. The tag can be set once per sect
heading. Setting it multiple times under the same heading will just override the previous setting.

``@tag: value``
A tag commad followed by the tag value, like for instance the name of a character.
A tag command followed by the tag value, like for instance the name of a character.

References can be set anywhere within a section, and are collected according to their category.
References are on the form:
References are in the form:

``@keyword: value``
A reference keyword followed by a value, or a comma separated list of values.
Expand Down Expand Up @@ -236,7 +236,7 @@ Examples:
"``>> Centred text <<``", "The text paragraph is centred."
"``> Left indented text``", "The text has an increased left margin."
"``Right indented text <``", "The text has an increased right margin."
"``> Left/right indented text <``", "The text has an both margins increased."
"``> Left/right indented text <``", "The text has both margins increased."

.. note::
The text editor will not show the alignment and indentation live. But the viewer will show them
Expand Down
2 changes: 1 addition & 1 deletion docs/source/usage_shortcuts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Keyboard Shortcuts
******************

Most features in novelWriter are available as keyboard shortcuts. This is a reference list if these
Most features in novelWriter are available as keyboard shortcuts. This is a reference list of those
shortcuts. Most of them are also listed in the application's user interface.

.. note::
Expand Down
7 changes: 7 additions & 0 deletions i18n/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ instance `en_GB` for British English.
You will need the translation tool Qt 5 Linguist on your system.

For Ubuntu/Debian, run:

```bash
sudo apt install qttools5-dev-tools
```
Expand Down Expand Up @@ -75,6 +76,7 @@ The `i18n` folder at the root of the repository contains the `nw_XX.ts` translat

Whether to add a new language to the translation framework, or to update the file against the
current source code, you must first run the `qtlupdate` command:

```bash
python3 pkgutils.py qtlupdate i18n/nw_XX.ts
```
Expand All @@ -86,6 +88,10 @@ be a valid ISO language code, otherwise novelWriter will not accept the file.
For instance, the French translation uses the language code `fr_FR`, so its translation file will
be `nw_fr_FR.ts`

Note: The `qtlupdate` command needs the `lupdate` tool provided by PyQt6, which uses the latest
TS file format. The tool in PyQt5 generates an older file format. On Debian/Ubuntu it is provided
by the package `pyqt6-dev-tools`.


### Edit the Translation File in Qt Linguist

Expand All @@ -100,6 +106,7 @@ Please select "English" and "United Kingdom" as the _source_ language if prompte
The application does not use `.ts` files directly. The `novelwriter/assets/i18n/nw_XX.qm` files are
the actual files used to translate the GUI into another language other than the default British
English. These files are not generated by default, but they can be built with:

```bash
python3 pkgutils.py qtlrelease
```
Expand Down
13 changes: 13 additions & 0 deletions novelwriter/assets/text/release_notes.htm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<h2>Release Notes for 2.1</h2>
<p><i>Released on 17 October 2023</i></p>

<p>Scroll down for <a href="#patch">Patch Notes</a></p>

<p>The primary focus of this release has been a complete redesign of the Build Tool, that is, the
tool that assembles your project into a manuscript document. The new tool, called the "Manuscript
Build Tool" allows you to define multiple build definitions for your project. The build definitions
Expand All @@ -30,5 +32,16 @@ <h3>Other Changes</h3>

<p><i>See also the <a href="https://github.com/vkbo/novelWriter/releases">Releases</a> page.</i></p>

<a name="patch"></a><h2>Patch Notes</h2>

<h3>Patch 2.2.1 &ndash; 5 November 2023</h3>

<p>This is a patch release that fixes a layout issue and internationalisation issues with the new
Manuscript Build tool. It also fixes a number of issues related to bugs in the underlying Qt
framework that affects drag and drop functionality in the project tree. These issues were mostly
only affecting Debian Linux package releases.</p>
<p>Other, minor issues related to updating the editor on colour theme change and project word list
changes have been fixed as well. See the full changelog for more details.</p>

</body>
</html>
14 changes: 8 additions & 6 deletions novelwriter/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,12 @@ def __init__(self) -> None:

# Localisation
# Note that these paths must be strings
self._qLocale = QLocale.system()
self._qtTrans = {}
self._nwLangPath = self._appPath / "assets" / "i18n"
self._qtLangPath = QLibraryInfo.location(QLibraryInfo.TranslationsPath)
self._nwLangPath = str(self._appPath / "assets" / "i18n")

wantedLocale = self._nwLangPath / f"nw_{QLocale.system().name()}.qm"
self._qLocale = QLocale.system() if wantedLocale.exists() else QLocale("en_GB")
self._qtTrans = {}

# PDF Manual
pdfDocs = self._appPath / "assets" / "manual.pdf"
Expand Down Expand Up @@ -425,7 +427,7 @@ def listLanguages(self, lngSet: int) -> list[tuple[str, str]]:
else:
return []

for qmFile in Path(self._nwLangPath).iterdir():
for qmFile in self._nwLangPath.iterdir():
qmName = qmFile.name
if not (qmFile.is_file() and qmName.startswith(fPre) and qmName.endswith(fExt)):
continue
Expand Down Expand Up @@ -493,8 +495,8 @@ def initLocalisation(self, nwApp: QApplication) -> None:
self._qtTrans = {}

langList = [
(self._qtLangPath, "qtbase"), # Qt 5.x
(self._nwLangPath, "nw"), # novelWriter
(self._qtLangPath, "qtbase"), # Qt 5.x
(str(self._nwLangPath), "nw"), # novelWriter
]
for lngPath, lngBase in langList:
for lngCode in self._qLocale.uiLanguages():
Expand Down
Loading

0 comments on commit a5a2b2c

Please sign in to comment.