mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-06-14 08:54:34 +12:00
Better cheat sheet
This commit is contained in:
parent
91de15e542
commit
719f6e6fe0
Binary file not shown.
|
@ -1100,27 +1100,27 @@ des lignes:</translation>
|
||||||
<translation>Filtre</translation>
|
<translation>Filtre</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/ui/cheatSheet.py" line="55"/>
|
<location filename="../src/ui/cheatSheet.py" line="56"/>
|
||||||
<source>Minor</source>
|
<source>Minor</source>
|
||||||
<translation>Mineur</translation>
|
<translation>Mineur</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/ui/cheatSheet.py" line="55"/>
|
<location filename="../src/ui/cheatSheet.py" line="56"/>
|
||||||
<source>Secondary</source>
|
<source>Secondary</source>
|
||||||
<translation>Secondaire</translation>
|
<translation>Secondaire</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/ui/cheatSheet.py" line="55"/>
|
<location filename="../src/ui/cheatSheet.py" line="56"/>
|
||||||
<source>Main</source>
|
<source>Main</source>
|
||||||
<translation>Principal</translation>
|
<translation>Principal</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/ui/cheatSheet.py" line="58"/>
|
<location filename="../src/ui/cheatSheet.py" line="59"/>
|
||||||
<source>Characters</source>
|
<source>Characters</source>
|
||||||
<translation>Personnages</translation>
|
<translation>Personnages</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/ui/cheatSheet.py" line="70"/>
|
<location filename="../src/ui/cheatSheet.py" line="71"/>
|
||||||
<source>Texts</source>
|
<source>Texts</source>
|
||||||
<translation>Textes</translation>
|
<translation>Textes</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -1346,47 +1346,47 @@ des lignes:</translation>
|
||||||
<context>
|
<context>
|
||||||
<name>outlineModel</name>
|
<name>outlineModel</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/models/outlineModel.py" line="132"/>
|
<location filename="../src/models/outlineModel.py" line="140"/>
|
||||||
<source>Title</source>
|
<source>Title</source>
|
||||||
<translation>Titre</translation>
|
<translation>Titre</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/models/outlineModel.py" line="134"/>
|
<location filename="../src/models/outlineModel.py" line="142"/>
|
||||||
<source>POV</source>
|
<source>POV</source>
|
||||||
<translation>POV</translation>
|
<translation>POV</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/models/outlineModel.py" line="136"/>
|
<location filename="../src/models/outlineModel.py" line="144"/>
|
||||||
<source>Label</source>
|
<source>Label</source>
|
||||||
<translation>Label</translation>
|
<translation>Label</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/models/outlineModel.py" line="138"/>
|
<location filename="../src/models/outlineModel.py" line="146"/>
|
||||||
<source>Status</source>
|
<source>Status</source>
|
||||||
<translation>Status</translation>
|
<translation>Status</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/models/outlineModel.py" line="140"/>
|
<location filename="../src/models/outlineModel.py" line="148"/>
|
||||||
<source>Compile</source>
|
<source>Compile</source>
|
||||||
<translation>Compilation</translation>
|
<translation>Compilation</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/models/outlineModel.py" line="142"/>
|
<location filename="../src/models/outlineModel.py" line="150"/>
|
||||||
<source>Word count</source>
|
<source>Word count</source>
|
||||||
<translation>Nombre de mots</translation>
|
<translation>Nombre de mots</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/models/outlineModel.py" line="144"/>
|
<location filename="../src/models/outlineModel.py" line="152"/>
|
||||||
<source>Goal</source>
|
<source>Goal</source>
|
||||||
<translation>Goal</translation>
|
<translation>Goal</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/models/outlineModel.py" line="665"/>
|
<location filename="../src/models/outlineModel.py" line="679"/>
|
||||||
<source>{} words / {} ({})</source>
|
<source>{} words / {} ({})</source>
|
||||||
<translation>{} mots / {} ({})</translation>
|
<translation>{} mots / {} ({})</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/models/outlineModel.py" line="670"/>
|
<location filename="../src/models/outlineModel.py" line="684"/>
|
||||||
<source>{} words</source>
|
<source>{} words</source>
|
||||||
<translation>{} mots</translation>
|
<translation>{} mots</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -1542,24 +1542,109 @@ des lignes:</translation>
|
||||||
<context>
|
<context>
|
||||||
<name>references</name>
|
<name>references</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/models/references.py" line="123"/>
|
<location filename="../src/models/references.py" line="243"/>
|
||||||
<source>Unknown reference: {}.</source>
|
<source>Unknown reference: {}.</source>
|
||||||
<translation>Référence inconnue: {}.</translation>
|
<translation>Référence inconnue: {}.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/models/references.py" line="112"/>
|
<location filename="../src/models/references.py" line="232"/>
|
||||||
<source>Text: <b>{}</b></source>
|
<source>Text: <b>{}</b></source>
|
||||||
<translation>Texte: <b>{}</b></translation>
|
<translation>Texte: <b>{}</b></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/models/references.py" line="120"/>
|
<location filename="../src/models/references.py" line="240"/>
|
||||||
<source>Character: <b>{}</b></source>
|
<source>Character: <b>{}</b></source>
|
||||||
<translation>Personnage: <b>{}</b></translation>
|
<translation>Personnage: <b>{}</b></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/models/references.py" line="111"/>
|
||||||
|
<source>Basic infos</source>
|
||||||
|
<translation>Informations générales</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/models/references.py" line="112"/>
|
||||||
|
<source>Detailed infos</source>
|
||||||
|
<translation>Informations détaillées</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/models/references.py" line="113"/>
|
||||||
|
<source>POV of:</source>
|
||||||
|
<translation>POV de:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/models/references.py" line="114"/>
|
||||||
|
<source>Referenced in:</source>
|
||||||
|
<translation>Référencé dans:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/models/references.py" line="119"/>
|
||||||
|
<source>Motivation</source>
|
||||||
|
<translation>Motivation</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/models/references.py" line="120"/>
|
||||||
|
<source>Goal</source>
|
||||||
|
<translation>Goal</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/models/references.py" line="121"/>
|
||||||
|
<source>Conflict</source>
|
||||||
|
<translation>Conflit</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/models/references.py" line="122"/>
|
||||||
|
<source>Epiphany</source>
|
||||||
|
<translation>Épiphanie</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/models/references.py" line="123"/>
|
||||||
|
<source>Short summary</source>
|
||||||
|
<translation>Résumé court</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/models/references.py" line="124"/>
|
||||||
|
<source>Longer summary</source>
|
||||||
|
<translation>Résumé long</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/models/references.py" line="26"/>
|
||||||
|
<source>Path:</source>
|
||||||
|
<translation>Chemin:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/models/references.py" line="27"/>
|
||||||
|
<source>Stats:</source>
|
||||||
|
<translation>Stats:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/models/references.py" line="28"/>
|
||||||
|
<source>POV:</source>
|
||||||
|
<translation>POV:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/models/references.py" line="29"/>
|
||||||
|
<source>Status:</source>
|
||||||
|
<translation>Status:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/models/references.py" line="30"/>
|
||||||
|
<source>Label:</source>
|
||||||
|
<translation>Label:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/models/references.py" line="31"/>
|
||||||
|
<source>Short summary:</source>
|
||||||
|
<translation>Résumé court:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/models/references.py" line="32"/>
|
||||||
|
<source>Long summary:</source>
|
||||||
|
<translation>Résumé long:</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/models/references.py" line="33"/>
|
<location filename="../src/models/references.py" line="33"/>
|
||||||
<source>None</source>
|
<source>Notes:</source>
|
||||||
<translation>Aucun</translation>
|
<translation>Notes:</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
|
|
|
@ -55,6 +55,14 @@ class outlineModel(QAbstractItemModel):
|
||||||
item = index.internalPointer()
|
item = index.internalPointer()
|
||||||
return item.ID()
|
return item.ID()
|
||||||
|
|
||||||
|
def findItemsByPOV(self, POV):
|
||||||
|
"Returns a list of IDs of all items whose POV is ``POV``."
|
||||||
|
return self.rootItem.findItemsByPOV(POV)
|
||||||
|
|
||||||
|
def findItemsContaining(self, text, column):
|
||||||
|
"Returns a list of IDs of all items containing ``text`` in column ``column``."
|
||||||
|
return self.rootItem.findItemsContaining(text, column)
|
||||||
|
|
||||||
def getIndexByID(self, ID):
|
def getIndexByID(self, ID):
|
||||||
"Returns the index of item whose ID is ``ID``. If none, returns QModelIndex()."
|
"Returns the index of item whose ID is ``ID``. If none, returns QModelIndex()."
|
||||||
def search(item):
|
def search(item):
|
||||||
|
@ -630,6 +638,12 @@ class outlineItem():
|
||||||
def POV(self):
|
def POV(self):
|
||||||
return self.data(Outline.POV.value)
|
return self.data(Outline.POV.value)
|
||||||
|
|
||||||
|
def status(self):
|
||||||
|
return self.data(Outline.status.value)
|
||||||
|
|
||||||
|
def label(self):
|
||||||
|
return self.data(Outline.label.value)
|
||||||
|
|
||||||
def path(self):
|
def path(self):
|
||||||
"Returns path to item as string."
|
"Returns path to item as string."
|
||||||
if self.parent().parent():
|
if self.parent().parent():
|
||||||
|
@ -737,4 +751,28 @@ class outlineItem():
|
||||||
path = self.data(Outline.ID.value)
|
path = self.data(Outline.ID.value)
|
||||||
if self.parent().parent():
|
if self.parent().parent():
|
||||||
path = "{}:{}".format(self.parent().pathToItem(), path)
|
path = "{}:{}".format(self.parent().pathToItem(), path)
|
||||||
return path
|
return path
|
||||||
|
|
||||||
|
def findItemsByPOV(self, POV):
|
||||||
|
"Returns a list of IDs of all subitems whose POV is ``POV``."
|
||||||
|
lst = []
|
||||||
|
if self.POV() == POV:
|
||||||
|
lst.append(self.ID())
|
||||||
|
|
||||||
|
for c in self.children():
|
||||||
|
lst.extend(c.findItemsByPOV(POV))
|
||||||
|
|
||||||
|
return lst
|
||||||
|
|
||||||
|
def findItemsContaining(self, text, column):
|
||||||
|
"""Returns a list if IDs of all subitems
|
||||||
|
containing ``text`` in column ``column``.
|
||||||
|
"""
|
||||||
|
lst = []
|
||||||
|
if text in self.data(column):
|
||||||
|
lst.append(self.ID())
|
||||||
|
|
||||||
|
for c in self.children():
|
||||||
|
lst.extend(c.findItemsContaining(text, column))
|
||||||
|
|
||||||
|
return lst
|
|
@ -165,5 +165,13 @@ class persosModel(QStandardItemModel):
|
||||||
rm.reverse()
|
rm.reverse()
|
||||||
for r in rm:
|
for r in rm:
|
||||||
perso.takeRow(r)
|
perso.takeRow(r)
|
||||||
|
|
||||||
|
def listPersoInfos(self, index):
|
||||||
|
infos = []
|
||||||
|
for i in range(self.rowCount(index)):
|
||||||
|
name = self.data(index.child(i, Perso.infoName.value))
|
||||||
|
val = self.data(index.child(i, Perso.infoData.value))
|
||||||
|
infos.append((name, val))
|
||||||
|
|
||||||
|
return infos
|
||||||
|
|
|
@ -22,15 +22,33 @@ def infoForRef(ref):
|
||||||
|
|
||||||
item = idx.internalPointer()
|
item = idx.internalPointer()
|
||||||
|
|
||||||
#<p><b>Status:</b> {status}</p>
|
#Titles
|
||||||
#<p><b>Label:</b> {label}</p>
|
pathTitle = qApp.translate("references", "Path:")
|
||||||
|
statsTitle = qApp.translate("references", "Stats:")
|
||||||
|
POVTitle = qApp.translate("references", "POV:")
|
||||||
|
statusTitle = qApp.translate("references", "Status:")
|
||||||
|
labelTitle = qApp.translate("references", "Label:")
|
||||||
|
ssTitle = qApp.translate("references", "Short summary:")
|
||||||
|
lsTitle = qApp.translate("references", "Long summary:")
|
||||||
|
notesTitle = qApp.translate("references", "Notes:")
|
||||||
|
|
||||||
|
POV = ""
|
||||||
if item.POV():
|
if item.POV():
|
||||||
POV = "<a href='{ref}'>{text}</a>".format(
|
POV = "<a href='{ref}'>{text}</a>".format(
|
||||||
ref="::C:{}::".format(item.POV()),
|
ref="::C:{}::".format(item.POV()),
|
||||||
text=mainWindow().mdlPersos.getPersoNameByID(item.POV()))
|
text=mainWindow().mdlPersos.getPersoNameByID(item.POV()))
|
||||||
|
|
||||||
|
status = item.status()
|
||||||
|
if status:
|
||||||
|
status = mainWindow().mdlStatus.item(int(status), 0).text()
|
||||||
else:
|
else:
|
||||||
POV = qApp.translate("references", "None")
|
status = ""
|
||||||
|
|
||||||
|
label = item.label()
|
||||||
|
if label:
|
||||||
|
label = mainWindow().mdlLabels.item(int(label), 0).text()
|
||||||
|
else:
|
||||||
|
label = ""
|
||||||
|
|
||||||
path = item.pathID()
|
path = item.pathID()
|
||||||
pathStr = []
|
pathStr = []
|
||||||
|
@ -40,28 +58,125 @@ def infoForRef(ref):
|
||||||
text=title))
|
text=title))
|
||||||
path = " > ".join(pathStr)
|
path = " > ".join(pathStr)
|
||||||
|
|
||||||
|
ss = item.data(Outline.summarySentance.value)
|
||||||
|
ls = item.data(Outline.summaryFull.value)
|
||||||
|
notes = item.data(Outline.notes.value)
|
||||||
|
|
||||||
text = """<h1>{title}</h1>
|
text = """<h1>{title}</h1>
|
||||||
<p><b>Path:</b> {path}</p>
|
<p><b>{pathTitle}</b> {path}</p>
|
||||||
<p><b>Stats:</b> {stats}</p>
|
<p><b>{statsTitle}</b> {stats}<br>
|
||||||
<p><b>POV:</b> {POV}</p>
|
{POV}
|
||||||
<p><b>Short summary:</b> {ss}</p>
|
{status}
|
||||||
<p><b>Long summary:</b> {ls}</p>
|
{label}</p>
|
||||||
<p><b>Notes:</b> {notes}</p>
|
{ss}
|
||||||
|
{ls}
|
||||||
|
{notes}
|
||||||
""".format(
|
""".format(
|
||||||
title=item.title(),
|
title=item.title(),
|
||||||
|
pathTitle=pathTitle,
|
||||||
path=path,
|
path=path,
|
||||||
|
statsTitle=statsTitle,
|
||||||
stats=item.stats(),
|
stats=item.stats(),
|
||||||
POV=POV,
|
POV="<b>{POVTitle}</b> {POV}<br>".format(
|
||||||
ss=item.data(Outline.summarySentance.value).replace("\n", "<br>"),
|
POVTitle=POVTitle,
|
||||||
ls=item.data(Outline.summaryFull.value).replace("\n", "<br>"),
|
POV=POV) if POV else "",
|
||||||
notes=linkifyAllRefs(item.data(Outline.notes.value)).replace("\n", "<br>"))
|
status="<b>{statusTitle}</b> {status}<br>".format(
|
||||||
|
statusTitle=statusTitle,
|
||||||
|
status=status) if status else "",
|
||||||
|
label="<b>{labelTitle}</b> {label}</p>".format(
|
||||||
|
labelTitle=labelTitle,
|
||||||
|
label=label) if label else "",
|
||||||
|
ss="<p><b>{ssTitle}</b> {ss}</p>".format(
|
||||||
|
ssTitle=ssTitle,
|
||||||
|
ss=ss.replace("\n", "<br>")) if ss else "",
|
||||||
|
ls="<p><b>{lsTitle}</b><br>{ls}</p>".format(
|
||||||
|
lsTitle=lsTitle,
|
||||||
|
ls=ls.replace("\n", "<br>")) if ls else "",
|
||||||
|
notes="<p><b>{notesTitle}</b><br>{notes}</p>".format(
|
||||||
|
notesTitle=notesTitle,
|
||||||
|
notes=linkifyAllRefs(notes).replace("\n", "<br>")) if notes else "",
|
||||||
|
)
|
||||||
|
|
||||||
return text
|
return text
|
||||||
|
|
||||||
elif _type == "C":
|
elif _type == "C":
|
||||||
m = mainWindow().mdlPersos
|
m = mainWindow().mdlPersos
|
||||||
name = m.item(int(_ref), Perso.name.value).text()
|
index = m.getIndexFromID(_ref)
|
||||||
return "<h1>{}</h1>".format(name)
|
name = m.name(index.row())
|
||||||
|
|
||||||
|
# Titles
|
||||||
|
basicTitle = qApp.translate("references", "Basic infos")
|
||||||
|
detailedTitle = qApp.translate("references", "Detailed infos")
|
||||||
|
POVof = qApp.translate("references", "POV of:")
|
||||||
|
referencedIn = qApp.translate("references", "Referenced in:")
|
||||||
|
|
||||||
|
# basic infos
|
||||||
|
basic = []
|
||||||
|
for i in [
|
||||||
|
(Perso.motivation, qApp.translate("references", "Motivation"), False),
|
||||||
|
(Perso.goal, qApp.translate("references", "Goal"), False),
|
||||||
|
(Perso.conflict, qApp.translate("references", "Conflict"), False),
|
||||||
|
(Perso.epiphany, qApp.translate("references", "Epiphany"), False),
|
||||||
|
(Perso.summarySentance, qApp.translate("references", "Short summary"), True),
|
||||||
|
(Perso.summaryPara, qApp.translate("references", "Longer summary"), True),
|
||||||
|
]:
|
||||||
|
val = m.data(index.sibling(index.row(), i[0].value))
|
||||||
|
if val:
|
||||||
|
basic .append("<b>{title}:</b>{n}{val}".format(
|
||||||
|
title=i[1],
|
||||||
|
n = "\n" if i[2] else " ",
|
||||||
|
val=val))
|
||||||
|
basic = "<br>".join(basic)
|
||||||
|
|
||||||
|
# detailed infos
|
||||||
|
detailed = []
|
||||||
|
for _name, _val in m.listPersoInfos(index):
|
||||||
|
detailed.append("<b>{}:</b> {}".format(
|
||||||
|
_name,
|
||||||
|
_val))
|
||||||
|
detailed = "<br>".join(detailed)
|
||||||
|
|
||||||
|
# list scenes of which it is POV
|
||||||
|
oM = mainWindow().mdlOutline
|
||||||
|
lst = oM.findItemsByPOV(_ref)
|
||||||
|
|
||||||
|
listPOV = ""
|
||||||
|
for t in lst:
|
||||||
|
idx = oM.getIndexByID(t)
|
||||||
|
listPOV += "<li><a href='{link}'>{text}</a>".format(
|
||||||
|
link="::T:{}::".format(t),
|
||||||
|
text=oM.data(idx, Outline.title.value))
|
||||||
|
|
||||||
|
# List scences where character is referenced
|
||||||
|
listRefs = ""
|
||||||
|
lst = oM.findItemsContaining(ref, Outline.notes.value)
|
||||||
|
for t in lst:
|
||||||
|
idx = oM.getIndexByID(t)
|
||||||
|
listRefs += "<li><a href='{link}'>{text}</a>".format(
|
||||||
|
link="::T:{}::".format(t),
|
||||||
|
text=oM.data(idx, Outline.title.value))
|
||||||
|
|
||||||
|
text = """<h1>{name}</h1>
|
||||||
|
{basicInfos}
|
||||||
|
{detailedInfos}
|
||||||
|
{POV}
|
||||||
|
{references}
|
||||||
|
""".format(
|
||||||
|
name=name,
|
||||||
|
basicInfos="<h2>{basicTitle}</h2>{basic}".format(
|
||||||
|
basicTitle=basicTitle,
|
||||||
|
basic=basic) if basic else "",
|
||||||
|
detailedInfos="<h2>{detailedTitle}</h2>{detailed}".format(
|
||||||
|
detailedTitle=detailedTitle,
|
||||||
|
detailed=detailed) if detailed else "",
|
||||||
|
POV="<h2>{POVof}</h2><ul>{listPOV}</ul>".format(
|
||||||
|
POVof=POVof,
|
||||||
|
listPOV=listPOV) if listPOV else "",
|
||||||
|
references="<h2>{referencedIn}</h2><ul>{listRefs}</ul>".format(
|
||||||
|
referencedIn=referencedIn,
|
||||||
|
listRefs=listRefs) if listRefs else "",
|
||||||
|
)
|
||||||
|
return text
|
||||||
|
|
||||||
else:
|
else:
|
||||||
return qApp.translate("references", "Unknown reference: {}.").format(ref)
|
return qApp.translate("references", "Unknown reference: {}.").format(ref)
|
||||||
|
|
|
@ -24,6 +24,7 @@ class cheatSheet(QWidget, Ui_cheatSheet):
|
||||||
self.list.setItemDelegate(self.listDelegate)
|
self.list.setItemDelegate(self.listDelegate)
|
||||||
self.list.itemActivated.connect(self.showInfos)
|
self.list.itemActivated.connect(self.showInfos)
|
||||||
self.view.linkActivated.connect(self.openLink)
|
self.view.linkActivated.connect(self.openLink)
|
||||||
|
self.view.linkHovered.connect(self.linkHovered)
|
||||||
|
|
||||||
self.outlineModel = None
|
self.outlineModel = None
|
||||||
self.persoModel = None
|
self.persoModel = None
|
||||||
|
@ -104,6 +105,10 @@ class cheatSheet(QWidget, Ui_cheatSheet):
|
||||||
def openLink(self, link):
|
def openLink(self, link):
|
||||||
openReference(link)
|
openReference(link)
|
||||||
|
|
||||||
|
def linkHovered(self, link):
|
||||||
|
if link:
|
||||||
|
QToolTip.showText(QCursor.pos(), tooltipForRef(link))
|
||||||
|
|
||||||
def keyPressEvent(self, event):
|
def keyPressEvent(self, event):
|
||||||
if event.key() in [Qt.Key_Up, Qt.Key_Down]:
|
if event.key() in [Qt.Key_Up, Qt.Key_Down]:
|
||||||
self.list.keyPressEvent(event)
|
self.list.keyPressEvent(event)
|
||||||
|
|
Loading…
Reference in a new issue