Skip to content

Commit

Permalink
Change rendering keymap context in helpscreen
Browse files Browse the repository at this point in the history
I agree with Huevos that this is indeed kind of tricky and after the
release of 9.1 indeed some strings were found that were not correctly
transformed from camalcase to a good readable string with spaces. E.g.
when CCCam is splitted and we had more examples. This at least better
works then what I initially did suggested.
  • Loading branch information
Littlesat committed Dec 30, 2024
1 parent 358cfd1 commit 557b5b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/python/Components/HelpMenuList.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def getActionmapGroupKey(actionmap, context):
if sortKey:
actionMapHelp[actionmapGroupKey].sort(key=sortKey)
self.addListBoxContext(actionMapHelp[actionmapGroupKey], formatFlags)
self.list.append((None, actionmap.description if getattr(actionmap, "description", None) else _(re.sub(r"(\w)([A-Z])([a-z])", r"\1 \2\3", context)), None) + extendedPadding)
self.list.append((None, actionmap.description if getattr(actionmap, "description", None) else _(re.sub(r"(?:(?=(?<=[^A-Z])[A-Z])|(?=Actions|Select))(?!(?<=Pi)P)", " ", context)), None) + extendedPadding)
self.list.extend(actionMapHelp[actionmapGroupKey])
del actionMapHelp[actionmapGroupKey]

Expand Down Expand Up @@ -214,7 +214,7 @@ def _sortKeyAlpha(self, hlp):

def _sortHeadingsAlpha(self, a):
# ignore case
return (getattr(a[0], "description", None) or _(re.sub(r"(\w)([A-Z])([a-z])", r"\1 \2\3", a[1]))).lower()
return (getattr(a[0], "description", None) or _(re.sub(r"(?:(?=(?<=[^A-Z])[A-Z])|(?=Actions|Select))(?!(?<=Pi)P)", " ", a[1]))).lower()

def ok(self):
# a list entry has a "private" tuple as first entry...
Expand Down

0 comments on commit 557b5b2

Please sign in to comment.