Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VirtualKeyBoard] add missing summary #4081

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/python/Components/Input.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def __init__(self, text="", maxSize=False, visible_width=False, type=TEXT, currP
self.visible_width = visible_width
self.offset = 0
self.overwrite = maxSize or self.type == self.NUMBER
self.onChangedEntry = []
self.setText(text)

def __len__(self):
Expand Down Expand Up @@ -57,6 +58,9 @@ def update(self):
self.text += (x == " " and " " or "*")
else:
self.text = self.Text + " "
for cb in self.onChangedEntry:
if callable(cb):
cb()

def setText(self, text):
if not len(text):
Expand Down
24 changes: 23 additions & 1 deletion lib/python/Screens/VirtualKeyBoard.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from Components.Sources.StaticText import StaticText
from Screens.ChoiceBox import ChoiceBox
from Screens.HelpMenu import HelpableScreen
from Screens.Screen import Screen
from Screens.Screen import Screen, ScreenSummary
from Tools.Directories import SCOPE_CURRENT_SKIN, resolveFilename
from Tools.LoadPixmap import LoadPixmap
from Tools.NumericalTextInput import NumericalTextInput
Expand Down Expand Up @@ -1177,3 +1177,25 @@ def selectAsciiKey(self, char):
return True
selkey += 1
return False

def createSummary(self):
return VirtualKeyBoardSummary


class VirtualKeyBoardSummary(ScreenSummary):
def __init__(self, session, parent):
ScreenSummary.__init__(self, session, parent=parent)
self.skinName = ["VirtualKeyBoardSummary", "PluginBrowserSummary"]
self["entry"] = StaticText()
self.onShow.append(self.addWatcher)
self.onHide.append(self.removeWatcher)

def addWatcher(self):
self.parent["text"].onChangedEntry.append(self.selectionChanged)
self.selectionChanged()

def removeWatcher(self):
self.parent["text"].onChangedEntry.remove(self.selectionChanged)

def selectionChanged(self):
self["entry"].text = self.parent["text"].getText()
Loading