Skip to content

Commit

Permalink
[Picon] user option for png/svg priority
Browse files Browse the repository at this point in the history
  • Loading branch information
Huevos committed Nov 23, 2024
1 parent 09eac91 commit aabd4c6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions data/setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<item level="2" text="Enable new GStreamer playback" description="If enabled, the new GStreamer playback engine will be used.">config.misc.usegstplaybin3</item>
<item level="2" text="Remote control source*" requires="DeveloperImage" description="In Developer images only. Allows swapping between oe-alliance/branding or oe-alliance/remotes for button position mapping and rc graphic.">config.misc.RCSource</item>
<item level="0" text="Force alpha blending" description="Alpha blending is the process of combining an image with a background to create the appearance of partial or full transparency. 'Always' may cause receivers that don't support hardware acceleration to render images more slowly. Also some skins may show strange side effects.">config.skin.pixmap_force_alphablending</item>
<item level="0" text="Picon type priority" description="Set the lookup priority when searching for picons. If all your picons are png set to 'png only' to save on lookup time.">config.usage.picon_lookup_priority</item>
</setup>
<setup key="streamrelay" title="Stream Relay Settings">
<item level="2" text="Stream Relay url" description="The IP address of the streamrelay server that is used to descramble services that can only be decrypted via stream relay.">config.misc.softcam_streamrelay_url</item>
Expand Down
12 changes: 10 additions & 2 deletions lib/python/Components/Renderer/Picon.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from enigma import ePixmap, eServiceReference

from Components.config import config
from Components.Harddisk import harddiskmanager
from Components.Renderer.Renderer import Renderer
from Tools.Alternatives import GetWithAlternative
Expand Down Expand Up @@ -49,14 +50,21 @@ def __onPartitionChange(self, why, part):
self.__onMountpointRemoved(part.mountpoint)

def findPicon(self, service):
ext_priority = {
"png_only": (".png",),
"svg_only": (".svg",),
"png_svg": (".png", ".svg"),
"svg_png": (".svg", ".png")}

exts = ext_priority[config.usage.picon_lookup_priority.value]
if self.activePiconPath is not None:
for ext in (".png", ".svg"):
for ext in exts:
pngname = self.activePiconPath + service + ext
if pathExists(pngname):
return pngname
else:
for path in self.searchPaths:
for ext in (".png", ".svg"):
for ext in exts:
pngname = path + service + ext
if pathExists(pngname):
self.activePiconPath = path
Expand Down
1 change: 1 addition & 0 deletions lib/python/Components/UsageConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def showsecondinfobarChanged(configElement):

config.usage.infobar_frontend_source = ConfigSelection(default="tuner", choices=[("settings", _("Settings")), ("tuner", _("Tuner"))])

config.usage.picon_lookup_priority = ConfigSelection(default="png_svg", choices=[("png_only", _("png only")), ("svg_only", _("svg only")), ("png_svg", _("png, then svg")), ("svg_png", _("svg, then png"))])
config.usage.show_picon_bkgrn = ConfigSelection(default="transparent", choices=[("none", _("Disabled")), ("transparent", _("Transparent")), ("blue", _("Blue")), ("red", _("Red")), ("black", _("Black")), ("white", _("White")), ("lightgrey", _("Light Grey")), ("grey", _("Grey"))])
config.usage.show_genre_info = ConfigYesNo(default=False)
config.usage.menu_style = ConfigSelection(default="standard", choices=[("standard", _("Standard")), ("horizontal", _("Horizontal"))])
Expand Down

0 comments on commit aabd4c6

Please sign in to comment.