Skip to content

Commit

Permalink
Add possibility to indent configs in setup.xml files
Browse files Browse the repository at this point in the history
Add a possiblity to indent a config in the setup.xml file by adding an
indent attribute where you can put a string (most likelu spaces) to
indent a config. E.g. when you have a switch or a config that allows
more additional settings then it can indent so you can build a better
overview. The new attribute in setup.xml is just a simple string that
will be added in front of the config text.
  • Loading branch information
Littlesat committed Jan 5, 2025
1 parent 2a6fc62 commit a63c5f1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/python/Screens/Setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,12 @@ def addItems(self, parentNode, including=True):
including = True

def addItem(self, element):
indent = element.get("indent", "")
if self.pluginLanguageDomain:
itemText = dgettext(self.pluginLanguageDomain, x) if (x := element.get("text")) else "* fix me *"
itemText = indent + (dgettext(self.pluginLanguageDomain, x) if (x := element.get("text")) else "* fix me *")
itemDescription = dgettext(self.pluginLanguageDomain, x) if (x := element.get("description")) else ""
else:
itemText = _(x) if (x := element.get("text")) else "* fix me *"
itemText = indent + (_(x) if (x := element.get("text")) else "* fix me *")
itemDescription = _(x) if (x := element.get("description")) else ""
item = eval(element.text or "")
if item == "":
Expand Down

0 comments on commit a63c5f1

Please sign in to comment.