Mod, QMod: add long description property
This commit is contained in:
parent
da8749e1a7
commit
bb858ef261
2 changed files with 12 additions and 0 deletions
|
|
@ -41,6 +41,12 @@ class Mod:
|
|||
else:
|
||||
return self.__config.get("description", str)
|
||||
|
||||
@property
|
||||
def long_description(self) -> str | None:
|
||||
if "descriptionLong" in self.__meta:
|
||||
return self.__meta.get("descriptionLong", str)
|
||||
return None
|
||||
|
||||
@property
|
||||
def author(self) -> str | None:
|
||||
# TODO: return list with authors
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ QML_IMPORT_NAME = "Leek"
|
|||
QML_IMPORT_MAJOR_VERSION = 1
|
||||
|
||||
|
||||
# Qt follows C++ naming conventions
|
||||
# ruff: noqa: N802
|
||||
@QmlElement
|
||||
@QmlUncreatable("QMod is intended to be returned by a QModListModel")
|
||||
class QMod(QObject):
|
||||
|
|
@ -34,6 +36,10 @@ class QMod(QObject):
|
|||
def description(self) -> str | None:
|
||||
return self.__mod.description
|
||||
|
||||
@Property(str, constant=True)
|
||||
def longDescription(self) -> str | None:
|
||||
return self.__mod.long_description
|
||||
|
||||
mod_enabled = Signal(name="enabled")
|
||||
|
||||
@Property(bool, notify=mod_enabled)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue