Added colour for tag errors
This commit is contained in:
@@ -44,6 +44,7 @@ class GuiDocHighlighter(QSyntaxHighlighter):
|
|||||||
self.colKey = QColor(*self.theTheme.colKey)
|
self.colKey = QColor(*self.theTheme.colKey)
|
||||||
self.colVal = QColor(*self.theTheme.colVal)
|
self.colVal = QColor(*self.theTheme.colVal)
|
||||||
self.colSpell = QColor(*self.theTheme.colSpell)
|
self.colSpell = QColor(*self.theTheme.colSpell)
|
||||||
|
self.colTagErr = QColor(*self.theTheme.colTagErr)
|
||||||
|
|
||||||
self.hStyles = {
|
self.hStyles = {
|
||||||
"header1" : self._makeFormat(self.colHead, "bold",1.8),
|
"header1" : self._makeFormat(self.colHead, "bold",1.8),
|
||||||
@@ -197,7 +198,7 @@ class GuiDocHighlighter(QSyntaxHighlighter):
|
|||||||
self.setFormat(xPos, xLen, self.hStyles["value"])
|
self.setFormat(xPos, xLen, self.hStyles["value"])
|
||||||
else:
|
else:
|
||||||
kwFmt = self.format(xPos)
|
kwFmt = self.format(xPos)
|
||||||
kwFmt.setUnderlineColor(self.colSpell)
|
kwFmt.setUnderlineColor(self.colTagErr)
|
||||||
kwFmt.setUnderlineStyle(QTextCharFormat.SpellCheckUnderline)
|
kwFmt.setUnderlineStyle(QTextCharFormat.SpellCheckUnderline)
|
||||||
self.setFormat(xPos, xLen, kwFmt)
|
self.setFormat(xPos, xLen, kwFmt)
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -266,7 +266,7 @@ class NWIndex():
|
|||||||
if nBits == 0:
|
if nBits == 0:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
# If we have a tag, the first value is always OK, rest is ignored
|
# If we have a tag, only the first value is accepted, the rest is ignored
|
||||||
if theBits[0] == self.TAG_KEY and nBits > 1:
|
if theBits[0] == self.TAG_KEY and nBits > 1:
|
||||||
isGood[0] = True
|
isGood[0] = True
|
||||||
if theBits[1] in self.tagIndex.keys():
|
if theBits[1] in self.tagIndex.keys():
|
||||||
@@ -278,7 +278,7 @@ class NWIndex():
|
|||||||
isGood[1] = True
|
isGood[1] = True
|
||||||
return isGood
|
return isGood
|
||||||
|
|
||||||
# If we're still here, we better check the references
|
# If we're still here, we better check that the references exist
|
||||||
if tItem.itemClass == nwItemClass.NOVEL:
|
if tItem.itemClass == nwItemClass.NOVEL:
|
||||||
isGood[0] = theBits[0] in self.NOVEL_KEYS
|
isGood[0] = theBits[0] in self.NOVEL_KEYS
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ class Theme:
|
|||||||
self.colKey = [0,0,0]
|
self.colKey = [0,0,0]
|
||||||
self.colVal = [0,0,0]
|
self.colVal = [0,0,0]
|
||||||
self.colSpell = [0,0,0]
|
self.colSpell = [0,0,0]
|
||||||
|
self.colTagErr = [0,0,0]
|
||||||
|
|
||||||
# Changeable Settings
|
# Changeable Settings
|
||||||
self.guiTheme = None
|
self.guiTheme = None
|
||||||
@@ -94,6 +95,7 @@ class Theme:
|
|||||||
self.colKey = self._loadColour(confParser,cnfSec,"keyword")
|
self.colKey = self._loadColour(confParser,cnfSec,"keyword")
|
||||||
self.colVal = self._loadColour(confParser,cnfSec,"value")
|
self.colVal = self._loadColour(confParser,cnfSec,"value")
|
||||||
self.colSpell = self._loadColour(confParser,cnfSec,"spellcheckline")
|
self.colSpell = self._loadColour(confParser,cnfSec,"spellcheckline")
|
||||||
|
self.colTagErr = self._loadColour(confParser,cnfSec,"tagerror")
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
@@ -9,3 +9,4 @@ hidden = 150, 150, 150
|
|||||||
keyword = 200, 46, 0
|
keyword = 200, 46, 0
|
||||||
value = 184, 200, 0
|
value = 184, 200, 0
|
||||||
spellcheckline = 200, 46, 0
|
spellcheckline = 200, 46, 0
|
||||||
|
tagerror = 46, 200, 0
|
||||||
|
|||||||
Reference in New Issue
Block a user