From 9279016d4cc93bc9b8b5ae0d3b3b8c5a9d795564 Mon Sep 17 00:00:00 2001 From: Rowland Creed Date: Tue, 18 Jul 2023 03:19:17 +0200 Subject: [PATCH] [EventView] Allow display of plugin description if available in EventViewContextMenu --- lib/python/Screens/EventView.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/python/Screens/EventView.py b/lib/python/Screens/EventView.py index a1e8461db73..f6ba5834b52 100644 --- a/lib/python/Screens/EventView.py +++ b/lib/python/Screens/EventView.py @@ -19,6 +19,7 @@ from Components.Sources.ServiceEvent import ServiceEvent from Components.Sources.Event import Event from RecordTimer import AFTEREVENT +from Components.Sources.StaticText import StaticText from Screens.TimerEntry import TimerEntry, addTimerFromEvent from Plugins.Plugin import PluginDescriptor from Tools.BoundFunction import boundFunction @@ -29,6 +30,8 @@ def __init__(self, session, menu): Screen.__init__(self, session) self.setTitle(_('Event view menu')) + self["description"] = StaticText() + self["actions"] = ActionMap(["OkCancelActions"], { "ok": self.okbuttonClick, @@ -36,6 +39,9 @@ def __init__(self, session, menu): }) self["menu"] = MenuList(menu) + if self.updateDescription not in self["menu"].onSelectionChanged: + self["menu"].onSelectionChanged.append(self.updateDescription) + self.updateDescription() def okbuttonClick(self): self["menu"].getCurrent() and self["menu"].getCurrent()[1]() @@ -43,6 +49,10 @@ def okbuttonClick(self): def cancelClick(self): self.close(False) + def updateDescription(self): + current = self["menu"].getCurrent() + self["description"].text = current and len(current) > 2 and hasattr(current[2], "description") and current[2].description or "" + class EventViewBase: def __init__(self, event, ref, callback=None, similarEPGCB=None): @@ -257,7 +267,7 @@ def doContext(self): for p in plugins.getPlugins(PluginDescriptor.WHERE_EVENTINFO): #only list service or event specific eventinfo plugins here, no servelist plugins if "servicelist" not in p.fnc.__code__.co_varnames: - menu.append((p.name, boundFunction(self.runPlugin, p))) + menu.append((p.name, boundFunction(self.runPlugin, p), p)) if menu: self.session.open(EventViewContextMenu, menu)