From b8ca6d3119c05283e08ef7f985ec63e283c8bfb0 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Sun, 3 Jul 2016 22:24:39 -0500 Subject: [PATCH] Emby connect - login dialog --- resources/lib/dialog/loginconnect.py | 82 ++++++++++++++++++ .../1080i/script-emby-connect-login.xml | 37 ++------ .../skins/default/media/button-focus.png | Bin 0 -> 1023 bytes 3 files changed, 87 insertions(+), 32 deletions(-) create mode 100644 resources/lib/dialog/loginconnect.py create mode 100644 resources/skins/default/media/button-focus.png diff --git a/resources/lib/dialog/loginconnect.py b/resources/lib/dialog/loginconnect.py new file mode 100644 index 00000000..4b35946e --- /dev/null +++ b/resources/lib/dialog/loginconnect.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- + +################################################################################################## + +import os + +import xbmcgui + +import userclient + +import sys +import xbmc +import xbmcaddon +import json as json +import urllib + +################################################################################################## + +addon = xbmcaddon.Addon('plugin.video.emby') + +ACTION_BACK = 92 +SIGN_IN = 200 +REMIND_LATER = 201 + + +class LoginConnect(xbmcgui.WindowXMLDialog): + + + def __init__(self, *args, **kwargs): + + self.UserClient = userclient.UserClient() + xbmcgui.WindowXMLDialog.__init__(self, *args, **kwargs) + + 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="ff464646", + focusTexture=os.path.join(media, "button-focus.png"), + noFocusTexture=os.path.join(media, "button-focus.png"), + isPassword=password) + + control.setPosition(x,y) + control.setHeight(height) + control.setWidth(width) + + self.addControl(control) + return control + + def onInit(self): + + self.user_field = self.__add_editcontrol(685,385,40,500) + self.setFocus(self.user_field) + self.password_field = self.__add_editcontrol(685,470,40,500, password=1) + self.signin_button = self.getControl(SIGN_IN) + + self.user_field.controlDown(self.password_field) + self.user_field.controlRight(self.password_field) + self.password_field.controlUp(self.user_field) + self.password_field.controlDown(self.signin_button) + self.password_field.controlRight(self.signin_button) + self.signin_button.controlUp(self.password_field) + + def onClick(self, control): + + if control == SIGN_IN: + # Sign in to emby connect + self.user = self.user_field.getText() + __password = self.password_field.getText() + + ### REVIEW ONCE CONNECT MODULE IS MADE + + elif control == REMIND_LATER: + # Remind me later + self.close() + + def onAction(self, action): + + if action == ACTION_BACK: + self.close() \ No newline at end of file diff --git a/resources/skins/default/1080i/script-emby-connect-login.xml b/resources/skins/default/1080i/script-emby-connect-login.xml index 3d755222..b5b01632 100644 --- a/resources/skins/default/1080i/script-emby-connect-login.xml +++ b/resources/skins/default/1080i/script-emby-connect-login.xml @@ -1,6 +1,6 @@ - 100 + 200 0 dialogeffect @@ -53,19 +53,6 @@ top - - Username field - box.png - box.png - User - 100% - 40 - ff464646 - font10 - 25 - 101 - - separator 102% @@ -86,20 +73,6 @@ font10 top - - - Password field - box.png - box.png - Password - 100% - 40 - ff464646 - font10 - 25 - 200 - 100 - separator @@ -113,7 +86,7 @@ Buttons - 365 + 385 Sign in box.png @@ -124,7 +97,6 @@ 100% 50 201 - 101 @@ -143,7 +115,7 @@ Disclaimer - 490 + 510 Disclaimer label @@ -170,7 +142,8 @@ green right top - 151 + 120 + 160 diff --git a/resources/skins/default/media/button-focus.png b/resources/skins/default/media/button-focus.png new file mode 100644 index 0000000000000000000000000000000000000000..d1427a2c0fa4e14f4311776d9a878fad7ec7ebcf GIT binary patch literal 1023 zcmbVLy>8P$95;$op`uQ(PziBzK>`W;e74W2t(wr!CNciL0xT$@veIafq z%GLoko`9tjFTj8p7`Pc`mEo6W(72s zy%HlAamv|(u+k_}FBlRAe6klMw)peoClN%UE$-m9(oP*Rh&GNhvVFYS3yz0@8H$a^ zV5P9QftWB46!AflTZJu7>{@(ZUPBQ~AZ%!h)1dn84sd8j0G6>7C`bo&Q$`r+%jgkM z6{JB$gGiH*YAL3LFql0e_m+jbR@Ysh`Qj&A959wz5RS)Vd92Aa+k?n7O{l0)RV9v) z@}q=#g_Pt=l?9jNK^CPfq6sK1dOjU7TjY^WQ;5@c`@(RN&kDs$1`98RNLFARmw8Rl zIqQ-?VO)yNdq*jOU6RvL7Vv)TE>&b+yQ>|QKpu^?l|{TM-hoSlQA`rna&3|Sk;5po zLep0?#SbOl({;%}x+a;5iY3hmu!>DXts_#|xr|>|OubphnvP5Zp{B8>Eo0L$*9-$| z4n}IlZ6!JLl7LjcBkp^~Rj=e)PDVUNvmT`f)f99Fl+k=ZQ{Xt@!A_KfbeumdJ2Xw$ zC0X>6gzFiN!KB1ibcy?aOMS`@|F?9I2L;PH`D<>fD?W_n_Cf{xaG@iTaPeeZCC`VQ zyIf)STJCDE_~!pQKX26VwVSnfpU+O-&%Iq--v4oS;(U4XN~j6ZjoSV12Hq+q*=laO JAJ$&H{tW@9H|zia literal 0 HcmV?d00001