Skip to content

Commit

Permalink
Avoid groups are defined multiple
Browse files Browse the repository at this point in the history
Groups defined by the contexts from the keymap may appear twice. This
might need more investigation and maybe the code could make easier but
for now we do not have one group shown multiple.
  • Loading branch information
Littlesat committed Dec 16, 2024
1 parent fdbb17e commit 28dcb9e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/python/Components/HelpMenuList.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,20 @@ def actMapId():

l = []
extendedPadding = (None, ) if formatFlags & self.EXTENDED else ()

groups = []
for (actionmap, context, actions) in sorted(helplist, key=self._sortHeadingsAlpha):
amId = actMapId()
if headings and amId in actionMapHelp:
if sortKey:
actionMapHelp[amId].sort(key=sortKey)
self.addListBoxContext(actionMapHelp[amId], formatFlags)

l.append((None, actionmap.description or _(re.sub(r"(\w)([A-Z])([a-z])", r"\1 \2\3", context)), None) + extendedPadding)
if getattr(actionmap, "description", None):
l.append((None, actionmap.description, None) + extendedPadding)
else:
if context not in groups:
groups.append(context)
l.append((None, _(re.sub(r"(\w)([A-Z])([a-z])", r"\1 \2\3", context)), None) + extendedPadding)
l.extend(actionMapHelp[amId])
del actionMapHelp[amId]

Expand Down

0 comments on commit 28dcb9e

Please sign in to comment.