diff --git a/resources/lib/dialogs/loginconnect.py b/resources/lib/dialogs/loginconnect.py index a7c630c0..31bd8fba 100644 --- a/resources/lib/dialogs/loginconnect.py +++ b/resources/lib/dialogs/loginconnect.py @@ -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) diff --git a/resources/lib/dialogs/loginmanual.py b/resources/lib/dialogs/loginmanual.py index c4aee908..380f12ce 100644 --- a/resources/lib/dialogs/loginmanual.py +++ b/resources/lib/dialogs/loginmanual.py @@ -23,8 +23,6 @@ SIGN_IN = 200 CANCEL = 201 ERROR_TOGGLE = 202 ERROR_MSG = 203 -USER = 204 -PASSWORD = 205 ERROR = { 'Invalid': 1, 'Empty': 2 @@ -52,7 +50,7 @@ class LoginManual(xbmcgui.WindowXMLDialog): self.server = server def set_user(self, user): - self.username = user or None + self.username = user or {} def get_user(self): return self._user @@ -63,8 +61,8 @@ class LoginManual(xbmcgui.WindowXMLDialog): self.cancel_button = self.getControl(CANCEL) self.error_toggle = self.getControl(ERROR_TOGGLE) self.error_msg = self.getControl(ERROR_MSG) - self.user_field = self.getControl(USER) - self.password_field = self.getControl(PASSWORD) + self.user_field = self._add_editcontrol(755, 458, 40, 415) + self.password_field = self._add_editcontrol(755, 558, 40, 415, password=1) if self.username: self.user_field.setText(self.username) @@ -72,6 +70,13 @@ class LoginManual(xbmcgui.WindowXMLDialog): else: self.setFocus(self.user_field) + self.user_field.controlUp(self.cancel_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.cancel_button.controlDown(self.user_field) + def onClick(self, control): if control == SIGN_IN: @@ -101,6 +106,24 @@ class LoginManual(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): try: diff --git a/resources/lib/dialogs/servermanual.py b/resources/lib/dialogs/servermanual.py index 3aa0b268..cc751da5 100644 --- a/resources/lib/dialogs/servermanual.py +++ b/resources/lib/dialogs/servermanual.py @@ -24,8 +24,6 @@ CONNECT = 200 CANCEL = 201 ERROR_TOGGLE = 202 ERROR_MSG = 203 -HOST = 204 -PORT = 205 ERROR = { 'Invalid': 1, 'Empty': 2 @@ -59,12 +57,19 @@ class ServerManual(xbmcgui.WindowXMLDialog): self.cancel_button = self.getControl(CANCEL) self.error_toggle = self.getControl(ERROR_TOGGLE) self.error_msg = self.getControl(ERROR_MSG) - self.host_field = self.getControl(HOST) - self.port_field = self.getControl(PORT) + self.host_field = self._add_editcontrol(755, 458, 40, 415) + self.port_field = self._add_editcontrol(755, 558, 40, 415) self.port_field.setText('8096') self.setFocus(self.host_field) + self.host_field.controlUp(self.cancel_button) + self.host_field.controlDown(self.port_field) + self.port_field.controlUp(self.host_field) + self.port_field.controlDown(self.connect_button) + self.connect_button.controlUp(self.port_field) + self.cancel_button.controlDown(self.host_field) + def onClick(self, control): if control == CONNECT: @@ -94,6 +99,23 @@ class ServerManual(xbmcgui.WindowXMLDialog): if action in (ACTION_BACK, ACTION_PARENT_DIR, ACTION_PREVIOUS_MENU): self.close() + def _add_editcontrol(self, x, y, height, width): + + 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="-") + control.setPosition(x, y) + control.setHeight(height) + control.setWidth(width) + + self.addControl(control) + return control + def _connect_to_server(self, server, port): server_address = "%s:%s" % (server, port) if port else server diff --git a/resources/skins/default/1080i/script-emby-connect-login-manual.xml b/resources/skins/default/1080i/script-emby-connect-login-manual.xml index 35f48010..f77d043d 100644 --- a/resources/skins/default/1080i/script-emby-connect-login-manual.xml +++ b/resources/skins/default/1080i/script-emby-connect-login-manual.xml @@ -1,27 +1,27 @@ 200 + + + + + + + + - 0 - 0 - 0 - 0 + -200 + -200 + -200 + -200 white.png stretch WindowOpen WindowClose - - - - - - - - 50% 50% 470 @@ -69,18 +69,8 @@ top 20 - - 35 - 20 - 20 + 50 - font10 - FF888888 - FF52b54b - 66000000 - 205 - - - - 20 @@ -100,20 +90,8 @@ top 20 - - 35 - 20 - 20 + 50 - font10 - FF888888 - FF52b54b - 66000000 - 204 - 200 - - - - - true separator diff --git a/resources/skins/default/1080i/script-emby-connect-login.xml b/resources/skins/default/1080i/script-emby-connect-login.xml index 4ac5ab04..0f47747d 100644 --- a/resources/skins/default/1080i/script-emby-connect-login.xml +++ b/resources/skins/default/1080i/script-emby-connect-login.xml @@ -1,26 +1,26 @@ + + + + + + + + - 0 - 0 - 0 - 0 + -200 + -200 + -200 + -200 white.png stretch WindowOpen WindowClose - - - - - - - - 50% 50% 470 @@ -68,18 +68,8 @@ top 20 - - 35 - 20 - 20 + 50 - font10 - FF888888 - FF52b54b - 66000000 - 205 - - - - 20 @@ -99,20 +89,8 @@ top 20 - - 35 - 20 - 20 + 50 - font10 - FF888888 - FF52b54b - 66000000 - 204 - 200 - - - - - true separator diff --git a/resources/skins/default/1080i/script-emby-connect-server-manual.xml b/resources/skins/default/1080i/script-emby-connect-server-manual.xml index fdc45b0e..c9ab4552 100644 --- a/resources/skins/default/1080i/script-emby-connect-server-manual.xml +++ b/resources/skins/default/1080i/script-emby-connect-server-manual.xml @@ -1,28 +1,27 @@ 200 - 0 + + + + + + + + - 0 - 0 - 0 - 0 + -200 + -200 + -200 + -200 white.png stretch WindowOpen WindowClose - - - - - - - - 50% 50% 470 @@ -70,19 +69,8 @@ top 20 - - 35 - 20 - 20 + 50 - font10 - FF888888 - FF52b54b - 66000000 - 205 - [COLOR ff464646]IP or https://myserver.com[/COLOR] - - - - 20 @@ -102,19 +90,8 @@ top 20 - - 35 - 20 - 20 + 50 - font10 - FF888888 - FF52b54b - 66000000 - 204 - 200 - - - - separator diff --git a/resources/skins/default/1080i/script-emby-connect-server.xml b/resources/skins/default/1080i/script-emby-connect-server.xml index 65e10181..8a2a1fb5 100644 --- a/resources/skins/default/1080i/script-emby-connect-server.xml +++ b/resources/skins/default/1080i/script-emby-connect-server.xml @@ -1,27 +1,27 @@ 205 + + + + + + + + - 0 - 0 - 0 - 0 + -200 + -200 + -200 + -200 white.png stretch WindowOpen WindowClose - - - - - - - - 50% 50% 470 diff --git a/resources/skins/default/1080i/script-emby-connect-users.xml b/resources/skins/default/1080i/script-emby-connect-users.xml index 264acbbb..0f1d0d56 100644 --- a/resources/skins/default/1080i/script-emby-connect-users.xml +++ b/resources/skins/default/1080i/script-emby-connect-users.xml @@ -1,27 +1,27 @@ 155 + + + + + + + + - 0 - 0 - 0 - 0 + -200 + -200 + -200 + -200 white.png stretch WindowOpen WindowClose - - - - - - - - 50% 50% 920