diff --git a/resources/lib/plex_tv.py b/resources/lib/plex_tv.py index e5e686db..40882e21 100644 --- a/resources/lib/plex_tv.py +++ b/resources/lib/plex_tv.py @@ -216,7 +216,12 @@ def sign_in_with_pin(): Writes to Kodi settings file and returns the HomeUser or None """ - xml = _sign_in_with_pin() + from .windows import background + bkgrd = background.BackgroundWindow.create(function=_sign_in_with_pin) + bkgrd.modal() + xml = bkgrd.result + del bkgrd + if not xml: return user = HomeUser(xml.attrib) @@ -235,7 +240,6 @@ def _sign_in_with_pin(): pre = signin.PreSignInWindow.open() try: - pre = signin.PreSignInWindow.open() try: if not pre.doSignin: return diff --git a/resources/lib/windows/background.py b/resources/lib/windows/background.py index 77919832..057cd053 100644 --- a/resources/lib/windows/background.py +++ b/resources/lib/windows/background.py @@ -19,10 +19,16 @@ class BackgroundWindow(kodigui.BaseWindow): def __init__(self, *args, **kwargs): kodigui.BaseWindow.__init__(self, *args, **kwargs) + self.result = None self.function = kwargs.get('function') + + def onAction(self, action): + kodigui.BaseWindow.onAction(self, action) + + def onFirstInit(self): - self.function() + self.result = self.function() self.doClose() diff --git a/resources/lib/windows/signin.py b/resources/lib/windows/signin.py index 8e96c8a4..4b083ebf 100644 --- a/resources/lib/windows/signin.py +++ b/resources/lib/windows/signin.py @@ -56,6 +56,7 @@ class SignInPlexPass(kodigui.BaseWindow): if action == xbmcgui.ACTION_SELECT_ITEM: self.retry = True self.doClose() + kodigui.BaseWindow.onAction(self, action) def onClick(self, controlID): if controlID == self.RETRY_BUTTON_ID: @@ -84,6 +85,7 @@ class PreSignInWindow(kodigui.BaseWindow): if action == xbmcgui.ACTION_SELECT_ITEM: self.doSignin = True self.doClose() + kodigui.BaseWindow.onAction(self, action) def onClick(self, controlID): if controlID == self.SIGNIN_BUTTON_ID: @@ -117,12 +119,8 @@ class PinLoginWindow(kodigui.BaseWindow): self.setProperty('pin.image.3', '') def onAction(self, action): - try: - if action == xbmcgui.ACTION_NAV_BACK or action == xbmcgui.ACTION_PREVIOUS_MENU: - self.abort = True - except: - utils.ERROR() - + if action == xbmcgui.ACTION_NAV_BACK or action == xbmcgui.ACTION_PREVIOUS_MENU: + self.abort = True kodigui.BaseWindow.onAction(self, action) diff --git a/resources/skins/Main/skin.xml b/resources/skins/Main/skin.xml deleted file mode 100644 index 757461a6..00000000 --- a/resources/skins/Main/skin.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 1080i - 1080i - 1.0 - - - 0 - - - Main - Plex - - \ No newline at end of file