Merge branch 'master' into dev_0.6
This commit is contained in:
+3
-3
@@ -40,9 +40,9 @@ __package__ = "novelWriter"
|
||||
__author__ = "Veronica Berglyd Olsen"
|
||||
__copyright__ = "Copyright 2018–2020, Veronica Berglyd Olsen"
|
||||
__license__ = "GPLv3"
|
||||
__version__ = "0.5.1"
|
||||
__hexversion__ = "0x000501f0"
|
||||
__date__ = "2020-05-14"
|
||||
__version__ = "0.5.2"
|
||||
__hexversion__ = "0x000502f0"
|
||||
__date__ = "2020-05-21"
|
||||
__maintainer__ = "Veronica Berglyd Olsen"
|
||||
__email__ = "code@vkbo.net"
|
||||
__status__ = "Pre-Release"
|
||||
|
||||
@@ -120,6 +120,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]
|
||||
@@ -415,6 +416,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"
|
||||
@@ -505,6 +509,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"
|
||||
|
||||
@@ -210,6 +210,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")
|
||||
@@ -284,6 +291,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
|
||||
@@ -299,6 +307,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
|
||||
|
||||
@@ -498,6 +498,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
|
||||
|
||||
|
||||
@@ -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"],
|
||||
|
||||
Reference in New Issue
Block a user