mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-06-02 06:16:11 +00:00
Workaround for LibreElec bug with edit control (#127)
This commit is contained in:
parent
d41e3d7fe1
commit
4413f469a3
8 changed files with 147 additions and 146 deletions
|
@ -22,8 +22,6 @@ SIGN_IN = 200
|
|||
CANCEL = 201
|
||||
ERROR_TOGGLE = 202
|
||||
ERROR_MSG = 203
|
||||
USER = 204
|
||||
PASSWORD = 205
|
||||
ERROR = {
|
||||
'Invalid': 1,
|
||||
'Empty': 2
|
||||
|
@ -54,14 +52,21 @@ class LoginConnect(xbmcgui.WindowXMLDialog):
|
|||
|
||||
def onInit(self):
|
||||
|
||||
self.user_field = self.getControl(USER)
|
||||
self.user_field = self._add_editcontrol(755, 358, 40, 415)
|
||||
self.setFocus(self.user_field)
|
||||
self.password_field = self.getControl(PASSWORD)
|
||||
self.password_field = self._add_editcontrol(755, 458, 40, 415, password=1)
|
||||
self.signin_button = self.getControl(SIGN_IN)
|
||||
self.remind_button = self.getControl(CANCEL)
|
||||
self.error_toggle = self.getControl(ERROR_TOGGLE)
|
||||
self.error_msg = self.getControl(ERROR_MSG)
|
||||
|
||||
self.user_field.controlUp(self.remind_button)
|
||||
self.user_field.controlDown(self.password_field)
|
||||
self.password_field.controlUp(self.user_field)
|
||||
self.password_field.controlDown(self.signin_button)
|
||||
self.signin_button.controlUp(self.password_field)
|
||||
self.remind_button.controlDown(self.user_field)
|
||||
|
||||
def onClick(self, control):
|
||||
|
||||
if control == SIGN_IN:
|
||||
|
@ -92,6 +97,24 @@ class LoginConnect(xbmcgui.WindowXMLDialog):
|
|||
if action in (ACTION_BACK, ACTION_PARENT_DIR, ACTION_PREVIOUS_MENU):
|
||||
self.close()
|
||||
|
||||
def _add_editcontrol(self, x, y, height, width, password=0):
|
||||
|
||||
media = os.path.join(addon.getAddonInfo('path'), 'resources', 'skins', 'default', 'media')
|
||||
control = xbmcgui.ControlEdit(0, 0, 0, 0,
|
||||
label="User",
|
||||
font="font10",
|
||||
textColor="FF52b54b",
|
||||
disabledColor="FF888888",
|
||||
focusTexture="-",
|
||||
noFocusTexture="-",
|
||||
isPassword=password)
|
||||
control.setPosition(x, y)
|
||||
control.setHeight(height)
|
||||
control.setWidth(width)
|
||||
|
||||
self.addControl(control)
|
||||
return control
|
||||
|
||||
def _login(self, username, password):
|
||||
|
||||
result = self.connect_manager.loginToConnect(username, password)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue