From c4f6a441b6804ce2e94f6f4c5312ee80bda83502 Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 16 Sep 2018 16:08:44 +0200 Subject: [PATCH] Fix Info screen not returning --- resources/lib/plex_tv.py | 8 ++++++-- resources/lib/windows/background.py | 8 +++++++- resources/lib/windows/signin.py | 10 ++++------ resources/skins/Main/skin.xml | 14 -------------- 4 files changed, 17 insertions(+), 23 deletions(-) delete mode 100644 resources/skins/Main/skin.xml 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