Merge changes from 2.6.2 and 2.6.3 (#2252)
This commit is contained in:
+59
-2
@@ -1,5 +1,62 @@
|
||||
# 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]
|
||||
|
||||
### 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
|
||||
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
|
||||
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
|
||||
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.
|
||||
@@ -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.
|
||||
* 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
|
||||
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.
|
||||
* 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
|
||||
|
||||
@@ -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
|
||||
translators for the languages currently available:
|
||||
|
||||
* **Czech:** Tomáš Zmek (perteus)
|
||||
* **Dutch:** Martijn van der Kleijn (mvdkleijn)
|
||||
* **French:** Jan Lüdke (jyhelle)
|
||||
* **German:** Myian (HeyMyian)
|
||||
|
||||
+339
-342
File diff suppressed because it is too large
Load Diff
+5109
File diff suppressed because it is too large
Load Diff
+1102
-1105
File diff suppressed because it is too large
Load Diff
+1102
-1105
File diff suppressed because it is too large
Load Diff
+1102
-1105
File diff suppressed because it is too large
Load Diff
+351
-354
File diff suppressed because it is too large
Load Diff
+1107
-1110
File diff suppressed because it is too large
Load Diff
+1102
-1105
File diff suppressed because it is too large
Load Diff
+1102
-1105
File diff suppressed because it is too large
Load Diff
+351
-354
File diff suppressed because it is too large
Load Diff
+1106
-1109
File diff suppressed because it is too large
Load Diff
+1105
-1108
File diff suppressed because it is too large
Load Diff
+350
-353
File diff suppressed because it is too large
Load Diff
+350
-353
File diff suppressed because it is too large
Load Diff
@@ -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"
|
||||
}
|
||||
@@ -26,6 +26,7 @@
|
||||
translators for the languages currently available:</p>
|
||||
|
||||
<ul>
|
||||
<li><b>Czech:</b> Tomáš Zmek (perteus)</li>
|
||||
<li><b>Dutch:</b> Martijn van der Kleijn (mvdkleijn)</li>
|
||||
<li><b>French:</b> Jan Lüdke (jyhelle)</li>
|
||||
<li><b>German:</b> Myian (HeyMyian)</li>
|
||||
|
||||
+35
-30
@@ -35,6 +35,11 @@ def trConst(text: str) -> str:
|
||||
return QCoreApplication.translate("Constant", text)
|
||||
|
||||
|
||||
def trStats(text: str) -> str:
|
||||
"""Wrapper function for locally translating stats constants."""
|
||||
return QCoreApplication.translate("Stats", text)
|
||||
|
||||
|
||||
class nwConst:
|
||||
|
||||
# Date and Time Formats
|
||||
@@ -370,32 +375,32 @@ class nwLabels:
|
||||
nwBuildFmt.J_NWD: ".json",
|
||||
}
|
||||
SHAPES_PLAIN = {
|
||||
nwStatusShape.SQUARE: QT_TRANSLATE_NOOP("Shape", "Square"),
|
||||
nwStatusShape.TRIANGLE: QT_TRANSLATE_NOOP("Shape", "Triangle"),
|
||||
nwStatusShape.NABLA: QT_TRANSLATE_NOOP("Shape", "Nabla"),
|
||||
nwStatusShape.DIAMOND: QT_TRANSLATE_NOOP("Shape", "Diamond"),
|
||||
nwStatusShape.PENTAGON: QT_TRANSLATE_NOOP("Shape", "Pentagon"),
|
||||
nwStatusShape.HEXAGON: QT_TRANSLATE_NOOP("Shape", "Hexagon"),
|
||||
nwStatusShape.STAR: QT_TRANSLATE_NOOP("Shape", "Star"),
|
||||
nwStatusShape.PACMAN: QT_TRANSLATE_NOOP("Shape", "Pacman"),
|
||||
nwStatusShape.SQUARE: QT_TRANSLATE_NOOP("Constant", "Square"),
|
||||
nwStatusShape.TRIANGLE: QT_TRANSLATE_NOOP("Constant", "Triangle"),
|
||||
nwStatusShape.NABLA: QT_TRANSLATE_NOOP("Constant", "Nabla"),
|
||||
nwStatusShape.DIAMOND: QT_TRANSLATE_NOOP("Constant", "Diamond"),
|
||||
nwStatusShape.PENTAGON: QT_TRANSLATE_NOOP("Constant", "Pentagon"),
|
||||
nwStatusShape.HEXAGON: QT_TRANSLATE_NOOP("Constant", "Hexagon"),
|
||||
nwStatusShape.STAR: QT_TRANSLATE_NOOP("Constant", "Star"),
|
||||
nwStatusShape.PACMAN: QT_TRANSLATE_NOOP("Constant", "Pacman"),
|
||||
}
|
||||
SHAPES_CIRCLE = {
|
||||
nwStatusShape.CIRCLE_Q: QT_TRANSLATE_NOOP("Shape", "1/4 Circle"),
|
||||
nwStatusShape.CIRCLE_H: QT_TRANSLATE_NOOP("Shape", "Half Circle"),
|
||||
nwStatusShape.CIRCLE_T: QT_TRANSLATE_NOOP("Shape", "3/4 Circle"),
|
||||
nwStatusShape.CIRCLE: QT_TRANSLATE_NOOP("Shape", "Full Circle"),
|
||||
nwStatusShape.CIRCLE_Q: QT_TRANSLATE_NOOP("Constant", "1/4 Circle"),
|
||||
nwStatusShape.CIRCLE_H: QT_TRANSLATE_NOOP("Constant", "Half Circle"),
|
||||
nwStatusShape.CIRCLE_T: QT_TRANSLATE_NOOP("Constant", "3/4 Circle"),
|
||||
nwStatusShape.CIRCLE: QT_TRANSLATE_NOOP("Constant", "Full Circle"),
|
||||
}
|
||||
SHAPES_BARS = {
|
||||
nwStatusShape.BARS_1: QT_TRANSLATE_NOOP("Shape", "1 Bar"),
|
||||
nwStatusShape.BARS_2: QT_TRANSLATE_NOOP("Shape", "2 Bars"),
|
||||
nwStatusShape.BARS_3: QT_TRANSLATE_NOOP("Shape", "3 Bars"),
|
||||
nwStatusShape.BARS_4: QT_TRANSLATE_NOOP("Shape", "4 Bars"),
|
||||
nwStatusShape.BARS_1: QT_TRANSLATE_NOOP("Constant", "1 Bar"),
|
||||
nwStatusShape.BARS_2: QT_TRANSLATE_NOOP("Constant", "2 Bars"),
|
||||
nwStatusShape.BARS_3: QT_TRANSLATE_NOOP("Constant", "3 Bars"),
|
||||
nwStatusShape.BARS_4: QT_TRANSLATE_NOOP("Constant", "4 Bars"),
|
||||
}
|
||||
SHAPES_BLOCKS = {
|
||||
nwStatusShape.BLOCK_1: QT_TRANSLATE_NOOP("Shape", "1 Block"),
|
||||
nwStatusShape.BLOCK_2: QT_TRANSLATE_NOOP("Shape", "2 Blocks"),
|
||||
nwStatusShape.BLOCK_3: QT_TRANSLATE_NOOP("Shape", "3 Blocks"),
|
||||
nwStatusShape.BLOCK_4: QT_TRANSLATE_NOOP("Shape", "4 Blocks"),
|
||||
nwStatusShape.BLOCK_1: QT_TRANSLATE_NOOP("Constant", "1 Block"),
|
||||
nwStatusShape.BLOCK_2: QT_TRANSLATE_NOOP("Constant", "2 Blocks"),
|
||||
nwStatusShape.BLOCK_3: QT_TRANSLATE_NOOP("Constant", "3 Blocks"),
|
||||
nwStatusShape.BLOCK_4: QT_TRANSLATE_NOOP("Constant", "4 Blocks"),
|
||||
}
|
||||
FILE_FILTERS = {
|
||||
"*.txt": QT_TRANSLATE_NOOP("Constant", "Text files"),
|
||||
@@ -431,16 +436,16 @@ class nwLabels:
|
||||
"Custom": (-1.0, -1.0),
|
||||
}
|
||||
THEME_COLORS = {
|
||||
"theme": QT_TRANSLATE_NOOP("Color", "Theme Colours"),
|
||||
"default": QT_TRANSLATE_NOOP("Color", "Foreground Colour"),
|
||||
"faded": QT_TRANSLATE_NOOP("Color", "Faded Colour"),
|
||||
"red": QT_TRANSLATE_NOOP("Color", "Red"),
|
||||
"orange": QT_TRANSLATE_NOOP("Color", "Orange"),
|
||||
"yellow": QT_TRANSLATE_NOOP("Color", "Yellow"),
|
||||
"green": QT_TRANSLATE_NOOP("Color", "Green"),
|
||||
"aqua": QT_TRANSLATE_NOOP("Color", "Aqua"),
|
||||
"blue": QT_TRANSLATE_NOOP("Color", "Blue"),
|
||||
"purple": QT_TRANSLATE_NOOP("Color", "Purple"),
|
||||
"theme": QT_TRANSLATE_NOOP("Constant", "Theme Colours"),
|
||||
"default": QT_TRANSLATE_NOOP("Constant", "Foreground Colour"),
|
||||
"faded": QT_TRANSLATE_NOOP("Constant", "Faded Colour"),
|
||||
"red": QT_TRANSLATE_NOOP("Constant", "Red"),
|
||||
"orange": QT_TRANSLATE_NOOP("Constant", "Orange"),
|
||||
"yellow": QT_TRANSLATE_NOOP("Constant", "Yellow"),
|
||||
"green": QT_TRANSLATE_NOOP("Constant", "Green"),
|
||||
"aqua": QT_TRANSLATE_NOOP("Constant", "Aqua"),
|
||||
"blue": QT_TRANSLATE_NOOP("Constant", "Blue"),
|
||||
"purple": QT_TRANSLATE_NOOP("Constant", "Purple"),
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -326,7 +326,7 @@ class ProjectModel(QAbstractItemModel):
|
||||
|
||||
def parent(self, index: QModelIndex) -> QModelIndex:
|
||||
"""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 QModelIndex()
|
||||
|
||||
@@ -377,7 +377,9 @@ class ProjectModel(QAbstractItemModel):
|
||||
row: int, column: int, parent: QModelIndex
|
||||
) -> bool:
|
||||
"""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(
|
||||
self, data: QMimeData, action: Qt.DropAction,
|
||||
|
||||
@@ -30,7 +30,7 @@ import logging
|
||||
from pathlib import Path
|
||||
|
||||
from PyQt6.QtCore import Qt, pyqtSignal, pyqtSlot
|
||||
from PyQt6.QtGui import QAction, QCloseEvent, QColor
|
||||
from PyQt6.QtGui import QCloseEvent, QColor
|
||||
from PyQt6.QtWidgets import (
|
||||
QAbstractItemView, QApplication, QColorDialog, QDialogButtonBox,
|
||||
QFileDialog, QGridLayout, QHBoxLayout, QLineEdit, QMenu, QStackedWidget,
|
||||
@@ -38,7 +38,7 @@ from PyQt6.QtWidgets import (
|
||||
)
|
||||
|
||||
from novelwriter import CONFIG, SHARED
|
||||
from novelwriter.common import formatFileFilter, qtLambda, simplified
|
||||
from novelwriter.common import formatFileFilter, qtAddAction, qtLambda, simplified
|
||||
from novelwriter.constants import nwLabels, trConst
|
||||
from novelwriter.core.status import NWStatus, StatusEntry
|
||||
from novelwriter.enum import nwStatusShape
|
||||
@@ -404,7 +404,8 @@ class _StatusPage(NFixedPage):
|
||||
if menu is not None:
|
||||
for shape, label in items.items():
|
||||
icon = NWStatus.createIcon(self._iPx, iColor, shape)
|
||||
action = QAction(icon, trConst(label))
|
||||
action = qtAddAction(menu, trConst(label))
|
||||
action.setIcon(icon)
|
||||
action.triggered.connect(qtLambda(self._selectShape, shape))
|
||||
menu.addAction(action)
|
||||
self._icons[shape] = icon
|
||||
|
||||
@@ -32,7 +32,7 @@ from PyQt6.QtWidgets import QGridLayout, QLabel, QWidget
|
||||
|
||||
from novelwriter import SHARED
|
||||
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.types import (
|
||||
QtAlignLeft, QtAlignLeftBase, QtAlignRight, QtAlignRightBase,
|
||||
@@ -62,9 +62,9 @@ class GuiItemDetails(QWidget):
|
||||
fntValue = self.font()
|
||||
fntValue.setPointSizeF(0.9*fPt)
|
||||
|
||||
trStats1 = trConst(nwLabels.STATS_NAME[nwStats.CHARS])
|
||||
trStats2 = trConst(nwLabels.STATS_NAME[nwStats.WORDS])
|
||||
trStats3 = trConst(nwLabels.STATS_NAME[nwStats.PARAGRAPHS])
|
||||
trStats1 = trStats(nwLabels.STATS_NAME[nwStats.CHARS])
|
||||
trStats2 = trStats(nwLabels.STATS_NAME[nwStats.WORDS])
|
||||
trStats3 = trStats(nwLabels.STATS_NAME[nwStats.PARAGRAPHS])
|
||||
|
||||
# Label
|
||||
self.labelName = QLabel(self.tr("Label"), self)
|
||||
|
||||
@@ -36,7 +36,7 @@ from novelwriter import CONFIG, SHARED
|
||||
from novelwriter.common import openExternalPath, qtAddAction, qtAddMenu, qtLambda
|
||||
from novelwriter.constants import (
|
||||
nwConst, nwKeyWords, nwLabels, nwShortcode, nwStats, nwStyles, nwUnicode,
|
||||
trConst
|
||||
trConst, trStats
|
||||
)
|
||||
from novelwriter.enum import nwDocAction, nwDocInsert, nwFocus, nwView
|
||||
from novelwriter.extensions.eventfilters import StatusTipFilter
|
||||
@@ -602,7 +602,7 @@ class GuiMainMenu(QMenuBar):
|
||||
self.mInsField = qtAddMenu(self.insMenu, self.tr("Word/Character Count"))
|
||||
for field in nwStats.ALL_FIELDS:
|
||||
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))
|
||||
|
||||
# Insert > Breaks and Vertical Space
|
||||
|
||||
@@ -43,7 +43,7 @@ from PyQt6.QtWidgets import (
|
||||
|
||||
from novelwriter import CONFIG, SHARED
|
||||
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.error import logException
|
||||
from novelwriter.extensions.configlayout import NColorLabel
|
||||
@@ -818,9 +818,9 @@ class GuiOutlineDetails(QScrollArea):
|
||||
|
||||
bFont = SHARED.theme.guiFontB
|
||||
|
||||
trStats1 = trConst(nwLabels.STATS_NAME[nwStats.CHARS])
|
||||
trStats2 = trConst(nwLabels.STATS_NAME[nwStats.WORDS])
|
||||
trStats3 = trConst(nwLabels.STATS_NAME[nwStats.PARAGRAPHS])
|
||||
trStats1 = trStats(nwLabels.STATS_NAME[nwStats.CHARS])
|
||||
trStats2 = trStats(nwLabels.STATS_NAME[nwStats.WORDS])
|
||||
trStats3 = trStats(nwLabels.STATS_NAME[nwStats.PARAGRAPHS])
|
||||
|
||||
# Details Area
|
||||
self.titleLabel = QLabel(self.tr("Title"), self)
|
||||
|
||||
@@ -177,6 +177,7 @@ class GuiProjectView(QWidget):
|
||||
self.projTree.addAction(trash)
|
||||
rename.triggered.connect(self.renameTreeItem)
|
||||
delete.triggered.connect(self.projTree.processDeleteRequest)
|
||||
trash.triggered.connect(self.projTree.emptyTrash)
|
||||
return
|
||||
|
||||
##
|
||||
|
||||
@@ -43,7 +43,7 @@ from PyQt6.QtWidgets import (
|
||||
|
||||
from novelwriter import CONFIG, SHARED
|
||||
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.docbuild import NWBuildDocument
|
||||
from novelwriter.extensions.modified import NIconToggleButton, NIconToolButton, NToolDialog
|
||||
@@ -1024,17 +1024,17 @@ class _StatsWidget(QWidget):
|
||||
|
||||
def _buildBottomPanel(self) -> None:
|
||||
"""Build the bottom page."""
|
||||
trAllChars = trConst(nwLabels.STATS_NAME[nwStats.CHARS])
|
||||
trTextChars = trConst(nwLabels.STATS_NAME[nwStats.CHARS_TEXT])
|
||||
trTitleChars = trConst(nwLabels.STATS_NAME[nwStats.CHARS_TITLE])
|
||||
trParagraphCount = trConst(nwLabels.STATS_NAME[nwStats.PARAGRAPHS])
|
||||
trTitleCount = trConst(nwLabels.STATS_NAME[nwStats.TITLES])
|
||||
trAllWordChars = trConst(nwLabels.STATS_NAME[nwStats.WCHARS_ALL])
|
||||
trTextWordChars = trConst(nwLabels.STATS_NAME[nwStats.WCHARS_TEXT])
|
||||
trTitleWordChars = trConst(nwLabels.STATS_NAME[nwStats.WCHARS_TITLE])
|
||||
trAllWords = trConst(nwLabels.STATS_NAME[nwStats.WORDS])
|
||||
trTextWords = trConst(nwLabels.STATS_NAME[nwStats.WORDS_TEXT])
|
||||
trTitleWords = trConst(nwLabels.STATS_NAME[nwStats.WORDS_TITLE])
|
||||
trAllChars = trStats(nwLabels.STATS_NAME[nwStats.CHARS])
|
||||
trTextChars = trStats(nwLabels.STATS_NAME[nwStats.CHARS_TEXT])
|
||||
trTitleChars = trStats(nwLabels.STATS_NAME[nwStats.CHARS_TITLE])
|
||||
trParagraphCount = trStats(nwLabels.STATS_NAME[nwStats.PARAGRAPHS])
|
||||
trTitleCount = trStats(nwLabels.STATS_NAME[nwStats.TITLES])
|
||||
trAllWordChars = trStats(nwLabels.STATS_NAME[nwStats.WCHARS_ALL])
|
||||
trTextWordChars = trStats(nwLabels.STATS_NAME[nwStats.WCHARS_TEXT])
|
||||
trTitleWordChars = trStats(nwLabels.STATS_NAME[nwStats.WCHARS_TITLE])
|
||||
trAllWords = trStats(nwLabels.STATS_NAME[nwStats.WORDS])
|
||||
trTextWords = trStats(nwLabels.STATS_NAME[nwStats.WORDS_TEXT])
|
||||
trTitleWords = trStats(nwLabels.STATS_NAME[nwStats.WORDS_TITLE])
|
||||
|
||||
# Minimal Form
|
||||
self.minWordCount = QLabel(self)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<novelWriterXML appVersion="2.7a3" hexVersion="0x020700a3" fileVersion="1.5" fileRevision="4" timeStamp="2025-02-04 13:53:28">
|
||||
<project id="e2be99af-f9bf-4403-857a-c3d1ac25abea" saveCount="2156" autoCount="281" editTime="95855">
|
||||
<novelWriterXML appVersion="2.7a3" hexVersion="0x020700a3" fileVersion="1.5" fileRevision="4" timeStamp="2025-02-16 21:53:19">
|
||||
<project id="e2be99af-f9bf-4403-857a-c3d1ac25abea" saveCount="2160" autoCount="281" editTime="95932">
|
||||
<name>Sample Project</name>
|
||||
<author>Jane Smith</author>
|
||||
</project>
|
||||
|
||||
@@ -358,11 +358,12 @@ def testCoreItemModel_ProjectModel_DragNDrop(mockGUI, mockRnd, fncPath):
|
||||
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.setData("plain/text", b"foobar")
|
||||
|
||||
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
|
||||
|
||||
# Drop the scene on the novel folder
|
||||
|
||||
Reference in New Issue
Block a user