Merge branch 'release' into from_2.6.3

This commit is contained in:
Veronica Berglyd Olsen
2025-02-16 21:46:57 +01:00
27 changed files with 15912 additions and 10656 deletions
+59 -2
View File
@@ -1,5 +1,62 @@
# novelWriter Changelog # novelWriter Changelog
## Version 2.6.3 [2025-02-16]
### Release Notes
This is a patch release that fixes a translation issue that affected several labels on the user
interface where the wrong or no translation was used. The bug affected all languages except for
English.
### Detailed Changelog
**Bugfixes**
* Fix retrieval of translation string for stats and shape constants. This particularly affected the
details panel below the project tree, some labels on the outline, the statics panel on the
Manuscript tool and the status icon shape menu in Project Settings. It also affected the
statistics submenu in the Insert menu. Issue #2246. PRs #2247 and #2249.
----
## Version 2.6.2 [2025-02-16]
### Release Notes
This is a patch release that fixes a few issues with the project tree: The Empty Trash option in
the menu now works again, and it is no longer possible to accidentally drag and drop project items
onto the root of the project tree.
In addition, a Czech translation has been added by Tomáš Zmek, and the Italian, Polish and
Brazilian Portuguese translations have been updated.
### Detailed Changelog
**Bugfixes**
* Fixed a bug where alternative scene formats were ignored when splitting a document. Issue #2233.
PR #2234.
* Fixed the Empty Trash menu entry in the Project menu. It was not connected to the project tree
and therefore selecting it did nothing. Issue #2239. PR #2242.
* Fixed a bug where it was possible to drag items to the root levels as long as they were dropped
between existing root items. This action is now properly blocked. PR #2242.
**Improvements**
* Added an extra check in the project tree item model that can prevent a crash in certain
circumstances when moving multiple project items. It is probably a corner case caused by
competing garbage collectors in Python and Qt, but the additional check should handle. PR #2242.
**Internationalisation**
* Add Czech translation by Tomáš Zmek. PR #2244.
* Updated Italian, Polish and Brazilian Portuguese translations. PR #2244.
See the [translation activity stream](https://crowdin.com/project/novelwriter/activity-stream) for
more details.
----
## Version 2.6.1 [2025-02-02] ## Version 2.6.1 [2025-02-02]
### Release Notes ### Release Notes
@@ -246,7 +303,7 @@ careful when using this version on live writing projects, and make sure you take
markup processing and syntax highlighting. It is both slightly faster, and there are issues with markup processing and syntax highlighting. It is both slightly faster, and there are issues with
text encoding in at least some versions of Qt6 or PyQt6. PRs #2028 and #2043. text encoding in at least some versions of Qt6 or PyQt6. PRs #2028 and #2043.
* Preparation for Qt6: Added a wrapper function for connecting signals to slots that has a * Preparation for Qt6: Added a wrapper function for connecting signals to slots that has a
different function signature. Python lambdas generate warnings inn Qt6. PR #2075. different function signature. Python lambdas generate warnings in Qt6. PR #2075.
* Refactored manuscript formats and moved most of the processing to the Tokenizer class to simplify * Refactored manuscript formats and moved most of the processing to the Tokenizer class to simplify
the format classes and also make them more consistent. PRs #2060, #2061 and #2062. the format classes and also make them more consistent. PRs #2060, #2061 and #2062.
* The document builder has been refactored to support more generalised format classes. PR #2047. * The document builder has been refactored to support more generalised format classes. PR #2047.
@@ -1126,7 +1183,7 @@ _These Release Notes also include the changes from the 2.2 Beta 1 and 2.2 RC 1 r
of 1 second. PR #1634. of 1 second. PR #1634.
* The document viewer panel now shows the importance label next to each entry, and double-clicking * The document viewer panel now shows the importance label next to each entry, and double-clicking
an entry will open it in the viewer. All entries also now show the content in tooltips so that an entry will open it in the viewer. All entries also now show the content in tooltips so that
the columns can be shrunk to only view the icon if there is too little space. Issue #16220. the columns can be shrunk to only view the icon if there is too little space. Issue #1620.
PR #1639. PR #1639.
* The editor toolbar no longer uses the same buttons for markdown and shortcodes style formatting. * The editor toolbar no longer uses the same buttons for markdown and shortcodes style formatting.
They have each received their separate buttons. Some additional space has been added between the They have each received their separate buttons. Some additional space has been added between the
+1
View File
@@ -21,6 +21,7 @@ The artwork on the Welcome dialog was created by Louis Durrant.
The default language is English (UK) with English (US) as an option. These are the original The default language is English (UK) with English (US) as an option. These are the original
translators for the languages currently available: translators for the languages currently available:
* **Czech:** Tomáš Zmek (perteus)
* **Dutch:** Martijn van der Kleijn (mvdkleijn) * **Dutch:** Martijn van der Kleijn (mvdkleijn)
* **French:** Jan Lüdke (jyhelle) * **French:** Jan Lüdke (jyhelle)
* **German:** Myian (HeyMyian) * **German:** Myian (HeyMyian)
+339 -342
View File
File diff suppressed because it is too large Load Diff
+5109
View File
File diff suppressed because it is too large Load Diff
+1102 -1105
View File
File diff suppressed because it is too large Load Diff
+1102 -1105
View File
File diff suppressed because it is too large Load Diff
+1102 -1105
View File
File diff suppressed because it is too large Load Diff
+351 -354
View File
File diff suppressed because it is too large Load Diff
+1107 -1110
View File
File diff suppressed because it is too large Load Diff
+1102 -1105
View File
File diff suppressed because it is too large Load Diff
+1102 -1105
View File
File diff suppressed because it is too large Load Diff
+351 -354
View File
File diff suppressed because it is too large Load Diff
+1106 -1109
View File
File diff suppressed because it is too large Load Diff
+1105 -1108
View File
File diff suppressed because it is too large Load Diff
+350 -353
View File
File diff suppressed because it is too large Load Diff
+350 -353
View File
File diff suppressed because it is too large Load Diff
+118
View File
@@ -0,0 +1,118 @@
{
"Synopsis": "Synopse",
"Short Description": "Krátký popis",
"Footnotes": "Poznámky pod čarou",
"Comment": "Komentář",
"Notes": "Poznámka",
"Tag": "Štítek",
"Point of View": "Úhel pohledu",
"Focus": "Zaměření",
"Characters": "Postavy",
"Plot": "Zápletka",
"Timeline": "Časová osa",
"Locations": "Lokality",
"Objects": "Objekty",
"Entities": "Subjekty",
"Custom": "Vlastní",
"New Page": "Nová stránka",
"0": "Nula",
"1": "Jedna",
"2": "Dva",
"3": "Tři",
"4": "Čtyři",
"5": "Pět",
"6": "Šest",
"7": "Sedm",
"8": "Osm",
"9": "Devět",
"10": "Deset",
"11": "Jedenáct",
"12": "Dvanáct",
"13": "Třináct",
"14": "Čtrnáct",
"15": "Patnáct",
"16": "Šestnáct",
"17": "Sedmnáct",
"18": "Osmnáct",
"19": "Devatenáct",
"20": "Dvacet",
"21": "Dvacet jedna",
"22": "Dvacet dva",
"23": "Dvacet tři",
"24": "Dvacet čtyři",
"25": "Dvacet pět",
"26": "Dvacet šest",
"27": "Dvacet sedm",
"28": "Dvacet osm",
"29": "Dvacet devět",
"30": "Třicet",
"31": "Třicet jedna",
"32": "Třicet dva",
"33": "Třicet tři",
"34": "Třicet čtyři",
"35": "Třicet pět",
"36": "Třicet šest",
"37": "Třicet sedm",
"38": "Třicet osm",
"39": "Třicet devět",
"40": "Čtyřicet",
"41": "Čtyřicet jedna",
"42": "Čtyřicet dva",
"43": "Čtyřicet tři",
"44": "Čtyřicet čtyři",
"45": "Čtyřicet pět",
"46": "Čtyřicet šest",
"47": "Čtyřicet sedm",
"48": "Deset osm",
"49": "Čtyřicet devět",
"50": "Padesát",
"51": "Padesát jedna",
"52": "Padesát dva",
"53": "Padesát tři",
"54": "Padesát čtyři",
"55": "Padesát pět",
"56": "Padesát šest",
"57": "Padesát sedm",
"58": "Padesát osm",
"59": "Padesát devět",
"60": "Šedesát",
"61": "Šedesát jedna",
"62": "Šedesát dva",
"63": "Šedesát tři",
"64": "Šedesát čtyři",
"65": "Šedesát pět",
"66": "Šedesát šest",
"67": "Šedesát sedm",
"68": "Šedesát osm",
"69": "Šedesát devět",
"70": "Sedmdesát",
"71": "Sedmdesát jedna",
"72": "Sedmdesát dva",
"73": "Sedmdesát tři",
"74": "Sedmdesát čtyři",
"75": "Sedmdesát pět",
"76": "Sedmdesát šest",
"77": "Sedmdesát sedm",
"78": "Sedmnáct osm",
"79": "Sedmdesát devět",
"80": "Osmdesát",
"81": "Osmdesát jedna",
"82": "Osmdesát dva",
"83": "Osmdesát tři",
"84": "Osmdesát čtyři",
"85": "Osmdesát pět",
"86": "Osmdesát šest",
"87": "Osmdesát sedm",
"88": "Osmdesát osum",
"89": "Osmdesát devět",
"90": "Devadesát",
"91": "Devadesát jedna",
"92": "Devadesát dva",
"93": "Devadesát tři",
"94": "Devadesát čtyři",
"95": "Devadesát pět",
"96": "Devadesát šest",
"97": "Devadesát sedm",
"98": "Devadesát osm",
"99": "Devadesát devět"
}
+1
View File
@@ -26,6 +26,7 @@
translators for the languages currently available:</p> translators for the languages currently available:</p>
<ul> <ul>
<li><b>Czech:</b> Tomáš Zmek (perteus)</li>
<li><b>Dutch:</b> Martijn van der Kleijn (mvdkleijn)</li> <li><b>Dutch:</b> Martijn van der Kleijn (mvdkleijn)</li>
<li><b>French:</b> Jan Lüdke (jyhelle)</li> <li><b>French:</b> Jan Lüdke (jyhelle)</li>
<li><b>German:</b> Myian (HeyMyian)</li> <li><b>German:</b> Myian (HeyMyian)</li>
+25 -20
View File
@@ -35,6 +35,11 @@ def trConst(text: str) -> str:
return QCoreApplication.translate("Constant", text) return QCoreApplication.translate("Constant", text)
def trStats(text: str) -> str:
"""Wrapper function for locally translating stats constants."""
return QCoreApplication.translate("Stats", text)
class nwConst: class nwConst:
# Date and Time Formats # Date and Time Formats
@@ -370,32 +375,32 @@ class nwLabels:
nwBuildFmt.J_NWD: ".json", nwBuildFmt.J_NWD: ".json",
} }
SHAPES_PLAIN = { SHAPES_PLAIN = {
nwStatusShape.SQUARE: QT_TRANSLATE_NOOP("Shape", "Square"), nwStatusShape.SQUARE: QT_TRANSLATE_NOOP("Constant", "Square"),
nwStatusShape.TRIANGLE: QT_TRANSLATE_NOOP("Shape", "Triangle"), nwStatusShape.TRIANGLE: QT_TRANSLATE_NOOP("Constant", "Triangle"),
nwStatusShape.NABLA: QT_TRANSLATE_NOOP("Shape", "Nabla"), nwStatusShape.NABLA: QT_TRANSLATE_NOOP("Constant", "Nabla"),
nwStatusShape.DIAMOND: QT_TRANSLATE_NOOP("Shape", "Diamond"), nwStatusShape.DIAMOND: QT_TRANSLATE_NOOP("Constant", "Diamond"),
nwStatusShape.PENTAGON: QT_TRANSLATE_NOOP("Shape", "Pentagon"), nwStatusShape.PENTAGON: QT_TRANSLATE_NOOP("Constant", "Pentagon"),
nwStatusShape.HEXAGON: QT_TRANSLATE_NOOP("Shape", "Hexagon"), nwStatusShape.HEXAGON: QT_TRANSLATE_NOOP("Constant", "Hexagon"),
nwStatusShape.STAR: QT_TRANSLATE_NOOP("Shape", "Star"), nwStatusShape.STAR: QT_TRANSLATE_NOOP("Constant", "Star"),
nwStatusShape.PACMAN: QT_TRANSLATE_NOOP("Shape", "Pacman"), nwStatusShape.PACMAN: QT_TRANSLATE_NOOP("Constant", "Pacman"),
} }
SHAPES_CIRCLE = { SHAPES_CIRCLE = {
nwStatusShape.CIRCLE_Q: QT_TRANSLATE_NOOP("Shape", "1/4 Circle"), nwStatusShape.CIRCLE_Q: QT_TRANSLATE_NOOP("Constant", "1/4 Circle"),
nwStatusShape.CIRCLE_H: QT_TRANSLATE_NOOP("Shape", "Half Circle"), nwStatusShape.CIRCLE_H: QT_TRANSLATE_NOOP("Constant", "Half Circle"),
nwStatusShape.CIRCLE_T: QT_TRANSLATE_NOOP("Shape", "3/4 Circle"), nwStatusShape.CIRCLE_T: QT_TRANSLATE_NOOP("Constant", "3/4 Circle"),
nwStatusShape.CIRCLE: QT_TRANSLATE_NOOP("Shape", "Full Circle"), nwStatusShape.CIRCLE: QT_TRANSLATE_NOOP("Constant", "Full Circle"),
} }
SHAPES_BARS = { SHAPES_BARS = {
nwStatusShape.BARS_1: QT_TRANSLATE_NOOP("Shape", "1 Bar"), nwStatusShape.BARS_1: QT_TRANSLATE_NOOP("Constant", "1 Bar"),
nwStatusShape.BARS_2: QT_TRANSLATE_NOOP("Shape", "2 Bars"), nwStatusShape.BARS_2: QT_TRANSLATE_NOOP("Constant", "2 Bars"),
nwStatusShape.BARS_3: QT_TRANSLATE_NOOP("Shape", "3 Bars"), nwStatusShape.BARS_3: QT_TRANSLATE_NOOP("Constant", "3 Bars"),
nwStatusShape.BARS_4: QT_TRANSLATE_NOOP("Shape", "4 Bars"), nwStatusShape.BARS_4: QT_TRANSLATE_NOOP("Constant", "4 Bars"),
} }
SHAPES_BLOCKS = { SHAPES_BLOCKS = {
nwStatusShape.BLOCK_1: QT_TRANSLATE_NOOP("Shape", "1 Block"), nwStatusShape.BLOCK_1: QT_TRANSLATE_NOOP("Constant", "1 Block"),
nwStatusShape.BLOCK_2: QT_TRANSLATE_NOOP("Shape", "2 Blocks"), nwStatusShape.BLOCK_2: QT_TRANSLATE_NOOP("Constant", "2 Blocks"),
nwStatusShape.BLOCK_3: QT_TRANSLATE_NOOP("Shape", "3 Blocks"), nwStatusShape.BLOCK_3: QT_TRANSLATE_NOOP("Constant", "3 Blocks"),
nwStatusShape.BLOCK_4: QT_TRANSLATE_NOOP("Shape", "4 Blocks"), nwStatusShape.BLOCK_4: QT_TRANSLATE_NOOP("Constant", "4 Blocks"),
} }
FILE_FILTERS = { FILE_FILTERS = {
"*.txt": QT_TRANSLATE_NOOP("Constant", "Text files"), "*.txt": QT_TRANSLATE_NOOP("Constant", "Text files"),
+4 -2
View File
@@ -326,7 +326,7 @@ class ProjectModel(QAbstractItemModel):
def parent(self, index: QModelIndex) -> QModelIndex: def parent(self, index: QModelIndex) -> QModelIndex:
"""Get the parent model index of another index.""" """Get the parent model index of another index."""
if index.isValid() and (parent := index.internalPointer().parent()): if index.isValid() and (node := index.internalPointer()) and (parent := node.parent()):
return self.createIndex(parent.row(), 0, parent) return self.createIndex(parent.row(), 0, parent)
return QModelIndex() return QModelIndex()
@@ -377,7 +377,9 @@ class ProjectModel(QAbstractItemModel):
row: int, column: int, parent: QModelIndex row: int, column: int, parent: QModelIndex
) -> bool: ) -> bool:
"""Check if mime data can be dropped on the current location.""" """Check if mime data can be dropped on the current location."""
return data.hasFormat(nwConst.MIME_HANDLE) and action == Qt.DropAction.MoveAction if parent.isValid() and parent.internalPointer() is not self._root:
return data.hasFormat(nwConst.MIME_HANDLE) and action == Qt.DropAction.MoveAction
return False
def dropMimeData( def dropMimeData(
self, data: QMimeData, action: Qt.DropAction, self, data: QMimeData, action: Qt.DropAction,
+4 -4
View File
@@ -32,7 +32,7 @@ from PyQt6.QtWidgets import QGridLayout, QLabel, QWidget
from novelwriter import SHARED from novelwriter import SHARED
from novelwriter.common import elide from novelwriter.common import elide
from novelwriter.constants import nwLabels, nwStats, trConst from novelwriter.constants import nwLabels, nwStats, trConst, trStats
from novelwriter.enum import nwChange from novelwriter.enum import nwChange
from novelwriter.types import ( from novelwriter.types import (
QtAlignLeft, QtAlignLeftBase, QtAlignRight, QtAlignRightBase, QtAlignLeft, QtAlignLeftBase, QtAlignRight, QtAlignRightBase,
@@ -62,9 +62,9 @@ class GuiItemDetails(QWidget):
fntValue = self.font() fntValue = self.font()
fntValue.setPointSizeF(0.9*fPt) fntValue.setPointSizeF(0.9*fPt)
trStats1 = trConst(nwLabels.STATS_NAME[nwStats.CHARS]) trStats1 = trStats(nwLabels.STATS_NAME[nwStats.CHARS])
trStats2 = trConst(nwLabels.STATS_NAME[nwStats.WORDS]) trStats2 = trStats(nwLabels.STATS_NAME[nwStats.WORDS])
trStats3 = trConst(nwLabels.STATS_NAME[nwStats.PARAGRAPHS]) trStats3 = trStats(nwLabels.STATS_NAME[nwStats.PARAGRAPHS])
# Label # Label
self.labelName = QLabel(self.tr("Label"), self) self.labelName = QLabel(self.tr("Label"), self)
+2 -2
View File
@@ -36,7 +36,7 @@ from novelwriter import CONFIG, SHARED
from novelwriter.common import openExternalPath, qtAddAction, qtAddMenu, qtLambda from novelwriter.common import openExternalPath, qtAddAction, qtAddMenu, qtLambda
from novelwriter.constants import ( from novelwriter.constants import (
nwConst, nwKeyWords, nwLabels, nwShortcode, nwStats, nwStyles, nwUnicode, nwConst, nwKeyWords, nwLabels, nwShortcode, nwStats, nwStyles, nwUnicode,
trConst trConst, trStats
) )
from novelwriter.enum import nwDocAction, nwDocInsert, nwFocus, nwView from novelwriter.enum import nwDocAction, nwDocInsert, nwFocus, nwView
from novelwriter.extensions.eventfilters import StatusTipFilter from novelwriter.extensions.eventfilters import StatusTipFilter
@@ -602,7 +602,7 @@ class GuiMainMenu(QMenuBar):
self.mInsField = qtAddMenu(self.insMenu, self.tr("Word/Character Count")) self.mInsField = qtAddMenu(self.insMenu, self.tr("Word/Character Count"))
for field in nwStats.ALL_FIELDS: for field in nwStats.ALL_FIELDS:
value = nwShortcode.FIELD_VALUE.format(field) value = nwShortcode.FIELD_VALUE.format(field)
action = qtAddAction(self.mInsField, trConst(nwLabels.STATS_NAME[field])) action = qtAddAction(self.mInsField, trStats(nwLabels.STATS_NAME[field]))
action.triggered.connect(qtLambda(self.requestDocInsertText.emit, value)) action.triggered.connect(qtLambda(self.requestDocInsertText.emit, value))
# Insert > Breaks and Vertical Space # Insert > Breaks and Vertical Space
+4 -4
View File
@@ -43,7 +43,7 @@ from PyQt6.QtWidgets import (
from novelwriter import CONFIG, SHARED from novelwriter import CONFIG, SHARED
from novelwriter.common import checkInt, formatFileFilter from novelwriter.common import checkInt, formatFileFilter
from novelwriter.constants import nwKeyWords, nwLabels, nwStats, nwStyles, trConst from novelwriter.constants import nwKeyWords, nwLabels, nwStats, nwStyles, trConst, trStats
from novelwriter.enum import nwChange, nwDocMode, nwItemClass, nwItemLayout, nwItemType, nwOutline from novelwriter.enum import nwChange, nwDocMode, nwItemClass, nwItemLayout, nwItemType, nwOutline
from novelwriter.error import logException from novelwriter.error import logException
from novelwriter.extensions.configlayout import NColorLabel from novelwriter.extensions.configlayout import NColorLabel
@@ -818,9 +818,9 @@ class GuiOutlineDetails(QScrollArea):
bFont = SHARED.theme.guiFontB bFont = SHARED.theme.guiFontB
trStats1 = trConst(nwLabels.STATS_NAME[nwStats.CHARS]) trStats1 = trStats(nwLabels.STATS_NAME[nwStats.CHARS])
trStats2 = trConst(nwLabels.STATS_NAME[nwStats.WORDS]) trStats2 = trStats(nwLabels.STATS_NAME[nwStats.WORDS])
trStats3 = trConst(nwLabels.STATS_NAME[nwStats.PARAGRAPHS]) trStats3 = trStats(nwLabels.STATS_NAME[nwStats.PARAGRAPHS])
# Details Area # Details Area
self.titleLabel = QLabel(self.tr("Title"), self) self.titleLabel = QLabel(self.tr("Title"), self)
+1
View File
@@ -177,6 +177,7 @@ class GuiProjectView(QWidget):
self.projTree.addAction(trash) self.projTree.addAction(trash)
rename.triggered.connect(self.renameTreeItem) rename.triggered.connect(self.renameTreeItem)
delete.triggered.connect(self.projTree.processDeleteRequest) delete.triggered.connect(self.projTree.processDeleteRequest)
trash.triggered.connect(self.projTree.emptyTrash)
return return
## ##
+12 -12
View File
@@ -43,7 +43,7 @@ from PyQt6.QtWidgets import (
from novelwriter import CONFIG, SHARED from novelwriter import CONFIG, SHARED
from novelwriter.common import fuzzyTime, qtLambda from novelwriter.common import fuzzyTime, qtLambda
from novelwriter.constants import nwLabels, nwStats, trConst from novelwriter.constants import nwLabels, nwStats, trStats
from novelwriter.core.buildsettings import BuildCollection, BuildSettings from novelwriter.core.buildsettings import BuildCollection, BuildSettings
from novelwriter.core.docbuild import NWBuildDocument from novelwriter.core.docbuild import NWBuildDocument
from novelwriter.extensions.modified import NIconToggleButton, NIconToolButton, NToolDialog from novelwriter.extensions.modified import NIconToggleButton, NIconToolButton, NToolDialog
@@ -1024,17 +1024,17 @@ class _StatsWidget(QWidget):
def _buildBottomPanel(self) -> None: def _buildBottomPanel(self) -> None:
"""Build the bottom page.""" """Build the bottom page."""
trAllChars = trConst(nwLabels.STATS_NAME[nwStats.CHARS]) trAllChars = trStats(nwLabels.STATS_NAME[nwStats.CHARS])
trTextChars = trConst(nwLabels.STATS_NAME[nwStats.CHARS_TEXT]) trTextChars = trStats(nwLabels.STATS_NAME[nwStats.CHARS_TEXT])
trTitleChars = trConst(nwLabels.STATS_NAME[nwStats.CHARS_TITLE]) trTitleChars = trStats(nwLabels.STATS_NAME[nwStats.CHARS_TITLE])
trParagraphCount = trConst(nwLabels.STATS_NAME[nwStats.PARAGRAPHS]) trParagraphCount = trStats(nwLabels.STATS_NAME[nwStats.PARAGRAPHS])
trTitleCount = trConst(nwLabels.STATS_NAME[nwStats.TITLES]) trTitleCount = trStats(nwLabels.STATS_NAME[nwStats.TITLES])
trAllWordChars = trConst(nwLabels.STATS_NAME[nwStats.WCHARS_ALL]) trAllWordChars = trStats(nwLabels.STATS_NAME[nwStats.WCHARS_ALL])
trTextWordChars = trConst(nwLabels.STATS_NAME[nwStats.WCHARS_TEXT]) trTextWordChars = trStats(nwLabels.STATS_NAME[nwStats.WCHARS_TEXT])
trTitleWordChars = trConst(nwLabels.STATS_NAME[nwStats.WCHARS_TITLE]) trTitleWordChars = trStats(nwLabels.STATS_NAME[nwStats.WCHARS_TITLE])
trAllWords = trConst(nwLabels.STATS_NAME[nwStats.WORDS]) trAllWords = trStats(nwLabels.STATS_NAME[nwStats.WORDS])
trTextWords = trConst(nwLabels.STATS_NAME[nwStats.WORDS_TEXT]) trTextWords = trStats(nwLabels.STATS_NAME[nwStats.WORDS_TEXT])
trTitleWords = trConst(nwLabels.STATS_NAME[nwStats.WORDS_TITLE]) trTitleWords = trStats(nwLabels.STATS_NAME[nwStats.WORDS_TITLE])
# Minimal Form # Minimal Form
self.minWordCount = QLabel(self) self.minWordCount = QLabel(self)
+1 -1
View File
@@ -162,4 +162,4 @@
<name status="sf12341" import="ia857f0" active="yes">Delete Me!</name> <name status="sf12341" import="ia857f0" active="yes">Delete Me!</name>
</item> </item>
</content> </content>
</novelWriterXML> </>
+2 -1
View File
@@ -358,11 +358,12 @@ def testCoreItemModel_ProjectModel_DragNDrop(mockGUI, mockRnd, fncPath):
novel.item.itemHandle, folder.item.itemHandle, scene.item.itemHandle, novel.item.itemHandle, folder.item.itemHandle, scene.item.itemHandle,
] ]
# Check that drop is possible # Check that drop is possible, but only with valid items and not on root
invalidMime = QMimeData() invalidMime = QMimeData()
invalidMime.setData("plain/text", b"foobar") invalidMime.setData("plain/text", b"foobar")
assert model.canDropMimeData(invalidMime, Qt.DropAction.MoveAction, 0, 0, novelIdx) is False assert model.canDropMimeData(invalidMime, Qt.DropAction.MoveAction, 0, 0, novelIdx) is False
assert model.canDropMimeData(sceneMime, Qt.DropAction.MoveAction, 0, 0, rootIdx) is False
assert model.canDropMimeData(sceneMime, Qt.DropAction.MoveAction, 0, 0, novelIdx) is True assert model.canDropMimeData(sceneMime, Qt.DropAction.MoveAction, 0, 0, novelIdx) is True
# Drop the scene on the novel folder # Drop the scene on the novel folder