FileCommander.InputBoxmod.InputBox adds some extra actions to the action map over Screens.InputBox.InputBox, but is otherwise functionally identical. Similarly for FileCommander.InputBoxmod.PinInput and Screens.InputBox.PinInput. FileCommander.InputBoxmod.PinInput is not used in the FileCommander code. FileCommander.Inputmod.Input and FileCommander.InputBoxmod.InputBoxmod are byte-for-byte identical, except that FileCommander.InputBoxmod.InputBoxmod defines its own FileCommander.InputBoxmod.InputBoxmod.skin.
FileCommander.Inputmod.Input and Components.Input.Input really only differ in any significant way in their instantiation parameters and in handleAscii().
Most of the changes I want to make to rationalise all of that are straight-forward, but I'm not sure about handleAscii().
FileCommander.Inputmod.Input.handleAscii() is:
Code: Select all
def handleAscii(self, code):
if self.type == self.TEXT:
self.timeout()
if self.allmarked:
self.deleteAllChars()
self.allmarked = False
# self.insertChar(unichr(code), self.currPos, False, False)
from Components.config import getCharValue
newcode = getCharValue(code)
if newcode is None:
return
self.insertChar(newcode, self.currPos, False, False)
self.innerright()
self.update()
Code: Select all
def handleAscii(self, code):
if self.type == self.TEXT:
self.timeout()
if self.allmarked:
self.deleteAllChars()
self.allmarked = False
self.insertChar(unichr(code), self.currPos, False, False)
self.innerright()
self.update()
Code: Select all
# ### EGAMI
...
rckeyboard_enable = False
# if file("/proc/stb/info/boxmodel").read().strip() in ["we will add someday keyboard rcusupport for boxtype"]:
# rckeyboard_enable = True
def getCharValue(code):
global egmapidx
global egkeymap
global rckeyboard_enable
print "got ascii code : %d [%d]" % (code, egmapidx)
if rckeyboard_enable:
if code == 0:
egmapidx = 0
return None
elif code == 42:
egmapidx += 1
return None
elif code == 56:
egmapidx += 3
return None
elif code == 100:
egmapidx += 2
return None
try:
return egkeymap[code][egmapidx]
except:
return None
else:
return unichr(getPrevAsciiCode())
# ### EGAMI
The issues with getCharValue() can be demonstrated by gong to MENU>Sources / Files, navigating in the panel to a file, then BLUE Rename, and trying then to enter ASCII text using a keyboard, instead of SMS-style entry using the remote.
So I think that the FileCommander.Inputmod.Input code can be simply thrown out, and any modification to the input argument naming to Input can be handled in FileCommander.InputBoxmod.InputBox and FileCommander.InputBoxmod.InputBoxmod. [/c]Input[/] is only referenced from within FileCommander.InputBoxmod.
The motivation for this is to allow fixes to Components.Input to allow proper scrolling in the text entry box while editing text (Bug #317: Unable to edit long file names) to be integrated into text input in FileCommander without more copy-paste. Also, because I hate inheritance-by-copy-paste.
Any objections? Suggestions?