mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-15 18:32:27 +12:00
Adjust syntax and formatting
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
This commit is contained in:
parent
19cbe7fdf6
commit
72933c9978
|
@ -410,12 +410,11 @@ def shortInfos(ref):
|
|||
_type = match.group(1)
|
||||
_ref = match.group(2)
|
||||
|
||||
infos = {}
|
||||
infos["ID"] = _ref
|
||||
_infos = dict()
|
||||
_infos["ID"] = _ref
|
||||
|
||||
if _type == TextLetter:
|
||||
|
||||
infos["type"] = TextLetter
|
||||
_infos["type"] = TextLetter
|
||||
|
||||
m = mainWindow().mdlOutline
|
||||
idx = m.getIndexByID(_ref)
|
||||
|
@ -426,48 +425,42 @@ def shortInfos(ref):
|
|||
item = idx.internalPointer()
|
||||
|
||||
if item.isFolder():
|
||||
infos["text_type"] = "folder"
|
||||
_infos["text_type"] = "folder"
|
||||
else:
|
||||
infos["text_type"] = "text"
|
||||
|
||||
infos["title"] = item.title()
|
||||
infos["path"] = item.path()
|
||||
return infos
|
||||
_infos["text_type"] = "text"
|
||||
|
||||
_infos["title"] = item.title()
|
||||
_infos["path"] = item.path()
|
||||
return _infos
|
||||
elif _type == CharacterLetter:
|
||||
|
||||
infos["type"] = CharacterLetter
|
||||
_infos["type"] = CharacterLetter
|
||||
|
||||
m = mainWindow().mdlCharacter
|
||||
c = m.getCharacterByID(_ref)
|
||||
|
||||
if c:
|
||||
infos["title"] = c.name()
|
||||
infos["name"] = c.name()
|
||||
return infos
|
||||
|
||||
_infos["title"] = c.name()
|
||||
_infos["name"] = c.name()
|
||||
return _infos
|
||||
elif _type == PlotLetter:
|
||||
|
||||
infos["type"] = PlotLetter
|
||||
_infos["type"] = PlotLetter
|
||||
|
||||
m = mainWindow().mdlPlots
|
||||
name = m.getPlotNameByID(_ref)
|
||||
if name:
|
||||
infos["title"] = name
|
||||
return infos
|
||||
|
||||
_infos["title"] = name
|
||||
return _infos
|
||||
elif _type == WorldLetter:
|
||||
|
||||
infos["type"] = WorldLetter
|
||||
_infos["type"] = WorldLetter
|
||||
|
||||
m = mainWindow().mdlWorld
|
||||
item = m.itemByID(_ref)
|
||||
if item:
|
||||
name = item.text()
|
||||
path = m.path(item)
|
||||
infos["title"] = name
|
||||
infos["path"] = path
|
||||
return infos
|
||||
_infos["title"] = name
|
||||
_infos["path"] = path
|
||||
return _infos
|
||||
|
||||
return None
|
||||
|
||||
|
@ -500,7 +493,6 @@ def tooltip(ref):
|
|||
if infos == -1:
|
||||
return safeTranslate(qApp, "references", "Not a reference: {}.").format(ref)
|
||||
|
||||
|
||||
if infos["type"] == TextLetter:
|
||||
if infos["text_type"] == "folder":
|
||||
tt = safeTranslate(qApp, "references", "Folder: <b>{}</b>").format(infos["title"])
|
||||
|
|
Loading…
Reference in a new issue