Skip to content

Commit

Permalink
Add option to show numbers before menu items (default = OFF)
Browse files Browse the repository at this point in the history
  • Loading branch information
littlesat authored and arn354 committed Dec 23, 2016
1 parent 35912aa commit ab28723
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions data/setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<item level="0" text="Setup mode" description="Configure which access level to use for the configuration menu. Expert level gives access to all items.">config.usage.setup_level</item>
<item level="0" text="Sort order for menu entries" description="This option allows you to hide and sort menu entries. When selecting user you can change order and hide menu items via the blue button">config.usage.menu_sort_mode</item>
<item level="0" text="Show menu paths" description="This option allows you to show menu paths.">config.usage.menu_path</item>
<item level="0" text="Show menu numbers" description="This option allows you to show menu number quick links.">config.usage.menu_show_numbers</item>
<item level="1" text="Zap mode" requires="ZapMode" description="Configure the way in which the receiver changes channels.">config.misc.zapmode</item>
<item level="2" text="Channel zap delay mode" description="Setup delay mode to zap to channels.">config.usage.numzaptimeoutmode</item>
<item level="2" text="Channel zap delay first button" description="User defined delay when you press the first button to zap to the channel.">config.usage.numzaptimeout1</item>
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 @@ -94,6 +94,7 @@ def alternativeNumberModeChange(configElement):
("a_z", _("alphabetical")),
("default", _("Default")),
("user", _("user defined")),])
config.usage.menu_show_numbers = ConfigYesNo(default = False)
config.usage.menu_path = ConfigSelection(default = "off", choices = [
("off", _("Disabled")),
("small", _("Small")),
Expand Down
4 changes: 4 additions & 0 deletions lib/python/Screens/Menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ def createMenuList(self):
else:
# Sort by Weight
self.list.sort(key=lambda x: int(x[3]))

if config.usage.menu_show_numbers.value:
self.list = [(str(x[0] + 1) + " " +x[1][0], x[1][1], x[1][2]) for x in enumerate(self.list)]

self["menu"].updateList(self.list)

def keyNumberGlobal(self, number):
Expand Down

0 comments on commit ab28723

Please sign in to comment.