Merge branch 'dev' into feature/build_gui

This commit is contained in:
Veronica Berglyd Olsen
2023-04-13 18:21:41 +02:00
37 changed files with 5112 additions and 631 deletions
+6 -4
View File
@@ -59,17 +59,17 @@ __license__ = "GPLv3"
__author__ = "Veronica Berglyd Olsen"
__maintainer__ = "Veronica Berglyd Olsen"
__email__ = "code@vkbo.net"
__version__ = "2.1-alpha0"
__hexversion__ = "0x020100a0"
__date__ = "2023-02-12"
__version__ = "2.0.6"
__hexversion__ = "0x020006f0"
__date__ = "2023-02-26"
__status__ = "Stable"
__domain__ = "novelwriter.io"
__url__ = "https://novelwriter.io"
__docurl__ = "https://docs.novelwriter.io/"
__sourceurl__ = "https://github.com/vkbo/novelWriter"
__issuesurl__ = "https://github.com/vkbo/novelWriter/issues"
__helpurl__ = "https://github.com/vkbo/novelWriter/discussions"
__releaseurl__ = "https://github.com/vkbo/novelWriter/releases/latest"
__docurl__ = "https://novelwriter.readthedocs.io"
logger = logging.getLogger(__name__)
@@ -246,6 +246,8 @@ def main(sysArgs=None):
nwApp.setApplicationName(CONFIG.appName)
nwApp.setApplicationVersion(__version__)
nwApp.setOrganizationDomain(__domain__)
nwApp.setOrganizationName(__domain__)
nwApp.setDesktopFileName(CONFIG.appName)
# Connect the exception handler before making the main GUI
sys.excepthook = exceptionHandler
+105
View File
@@ -0,0 +1,105 @@
{
"Synopsis": "あらすじ",
"Comment": "コメント ",
"Notes": "ノート",
"0": "零",
"1": "一",
"2": "二",
"3": "三",
"4": "四",
"5": "五",
"6": "六",
"7": "七",
"8": "八",
"9": "九",
"10": "十",
"11": "十一",
"12": "十二",
"13": "十三",
"14": "十四",
"15": "十五",
"16": "十六",
"17": "十七",
"18": "十八",
"19": "十九",
"20": "二十",
"21": "二十一",
"22": "二十二",
"23": "二十三",
"24": "二十四",
"25": "二十五",
"26": "二十六",
"27": "二十七",
"28": "二十八",
"29": "二十九",
"30": "三十",
"31": "三十一",
"32": "三十二",
"33": "三十三",
"34": "三十四",
"35": "三十五",
"36": "三十六",
"37": "三十七",
"38": "三十八",
"39": "三十九",
"40": "四十",
"41": "四十一",
"42": "四十二",
"43": "四十三",
"44": "四十四",
"45": "四十五",
"46": "四十六",
"47": "四十七",
"48": "四十八",
"49": "四十九",
"50": "五十",
"51": "五十一",
"52": "五十二",
"53": "五十三",
"54": "五十四",
"55": "五十五",
"56": "五十六",
"57": "五十七",
"58": "五十八",
"59": "五十九",
"60": "六十",
"61": "六十一",
"62": "六十二",
"63": "六十三",
"64": "六十四",
"65": "六十五",
"66": "六十六",
"67": "六十七",
"68": "六十八",
"69": "六十九",
"70": "七十",
"71": "七十一",
"72": "七十二",
"73": "七十三",
"74": "七十四",
"75": "七十五",
"76": "七十六",
"77": "七十七",
"78": "七十八",
"79": "七十九",
"80": "八十",
"81": "八十一",
"82": "八十二",
"83": "八十三",
"84": "八十四",
"85": "八十五",
"86": "八十六",
"87": "八十七",
"88": "八十八",
"89": "八十九",
"90": "九十",
"91": "九十一",
"92": "九十二",
"93": "九十三",
"94": "九十四",
"95": "九十五",
"96": "九十六",
"97": "九十七",
"98": "九十八",
"99": "九十九"
}
+1
View File
@@ -26,6 +26,7 @@ translators for the languages currently available:</p>
<b>French:</b> Jan Lüdke (<a href="https://github.com/jyhelle">@jyhelle</a>)<br>
<b>German:</b> Myian (<a href="https://github.com/heymyian">@heymyian</a>)<br>
<b>Italian:</b> Riccardo Mangili<br>
<b>Japanese:</b> hebekeg (<a href="https://github.com/hebekeg">@hebekeg</a>)<br>
<b>Latin American Spanish:</b> Tommy Marplatt (<a href="https://github.com/tmarplatt">@tmarplatt</a>)<br>
<b>Norwegian:</b> Veronica Berglyd Olsen (<a href="https://github.com/vkbo">@vkbo</a>)<br>
<b>Portuguese:</b> Bruno Meneguello (<a href="https://github.com/bkmeneguello">@bkmeneguello</a>)<br>
+14 -16
View File
@@ -724,14 +724,13 @@ class GuiDocEditor(QTextEdit):
_, theProvider = self.spEnchant.describeDict()
self.spellDictionaryChanged.emit(str(theLang), str(theProvider))
if not self._bigDoc:
self.spellCheckDocument()
return True
def toggleSpellCheck(self, theMode):
"""This is the master spell check setting function, and this one
"""This is the main spell check setting function, and this one
should call all other setSpellCheck functions in other classes.
If the spell check mode (theMode) is not defined (None), then
toggle the current status saved in this class.
@@ -754,7 +753,8 @@ class GuiDocEditor(QTextEdit):
self.mainGui.mainMenu.setSpellCheck(theMode)
self.theProject.data.setSpellCheck(theMode)
self.highLight.setSpellCheck(theMode)
if not self._bigDoc:
if not self._bigDoc or theMode is False:
# We don't run the spell checker automatically on big docs
self.spellCheckDocument()
logger.debug("Spell check is set to '%s'", str(theMode))
@@ -768,18 +768,16 @@ class GuiDocEditor(QTextEdit):
the undo stack, so we only do it for big documents.
"""
logger.debug("Running spell checker")
if self._spellCheck:
bfTime = time()
qApp.setOverrideCursor(QCursor(Qt.WaitCursor))
if self._bigDoc:
theText = self.getText()
self.setPlainText(theText)
else:
self.highLight.rehighlight()
qApp.restoreOverrideCursor()
afTime = time()
logger.debug("Document highlighted in %.3f ms", 1000*(afTime-bfTime))
self.mainGui.mainStatus.setStatus(self.tr("Spell check complete"))
start = time()
qApp.setOverrideCursor(QCursor(Qt.WaitCursor))
if self._bigDoc:
# This is much faster for large documents
self.setPlainText(self.getText())
else:
self.highLight.rehighlight()
qApp.restoreOverrideCursor()
logger.debug("Document highlighted in %.3f ms", 1000*(time() - start))
self.mainGui.mainStatus.setStatus(self.tr("Spell check complete"))
return True
@@ -1359,7 +1357,7 @@ class GuiDocEditor(QTextEdit):
if self._docHandle is None or self._nwItem is None:
return
logger.debug("User selectee %d words", wCount)
logger.debug("User selected %d words", wCount)
self.docFooter.updateCounts(wCount=wCount, cCount=cCount)
self.wcTimerSel.stop()
+22 -1
View File
@@ -38,6 +38,7 @@ from PyQt5.QtWidgets import (
QMenu, QShortcut, QSizePolicy, QToolButton, QTreeWidget, QTreeWidgetItem,
QVBoxLayout, QWidget
)
from novelwriter.core.item import NWItem
from novelwriter.enum import nwDocMode, nwItemType, nwItemClass, nwItemLayout, nwAlert, nwWidget
from novelwriter.constants import nwHeaders, nwUnicode, trConst, nwLabels
@@ -108,6 +109,9 @@ class GuiProjectView(QWidget):
self.keyContext.setContext(Qt.WidgetShortcut)
self.keyContext.activated.connect(lambda: self.projTree.openContextOnSelected())
# Signals
self.selectedItemChanged.connect(self.projBar._treeSelectionChanged)
# Function Mappings
self.emptyTrash = self.projTree.emptyTrash
self.requestDeleteItem = self.projTree.requestDeleteItem
@@ -418,6 +422,23 @@ class GuiProjectToolBar(QWidget):
return
##
# Slots
##
@pyqtSlot(str)
def _treeSelectionChanged(self, tHandle):
"""Toggle the visibility of the new item enties for novel
documents. They should only be visible if novel documents can
actually be added.
"""
nwItem = self.theProject.tree[tHandle]
allowDoc = isinstance(nwItem, NWItem) and nwItem.documentAllowed()
self.aAddEmpty.setVisible(allowDoc)
self.aAddChap.setVisible(allowDoc)
self.aAddScene.setVisible(allowDoc)
return
# END Class GuiProjectToolBar
@@ -1204,7 +1225,7 @@ class GuiProjectTree(QTreeWidget):
# Edit Item Settings
# ==================
aLabel = ctxMenu.addAction(self.tr("Change Label"))
aLabel = ctxMenu.addAction(self.tr("Rename"))
aLabel.triggered.connect(lambda: self.renameTreeItem(tHandle))
if isFile: