Optimize code

This commit is contained in:
croneter 2018-12-02 16:03:20 +01:00
parent 8b3272aa7b
commit 59af1d09a3
2 changed files with 7 additions and 6 deletions

View file

@ -117,12 +117,6 @@ class InitialSetup(object):
Returns True if successful, or False if not Returns True if successful, or False if not
""" """
LOG.info('Showing plex.tv sign in window')
# Fix for:
# DEBUG: Activating window ID: 13000
# INFO: Activate of window '13000' refused because there are active modal dialogs
# DEBUG: Activating window ID: 13000
executebuiltin("Dialog.Close(all, true)")
user = plex_tv.sign_in_with_pin() user = plex_tv.sign_in_with_pin()
if user: if user:
self.plex_login = user.username self.plex_login = user.username

View file

@ -4,6 +4,7 @@ from __future__ import absolute_import, division, unicode_literals
from logging import getLogger from logging import getLogger
import time import time
import threading import threading
import xbmc
from .downloadutils import DownloadUtils as DU from .downloadutils import DownloadUtils as DU
from . import utils, app from . import utils, app
@ -216,6 +217,12 @@ def sign_in_with_pin():
Writes to Kodi settings file and returns the HomeUser or None Writes to Kodi settings file and returns the HomeUser or None
""" """
LOG.info('Showing plex.tv sign in window')
# Fix for:
# DEBUG: Activating window ID: 13000
# INFO: Activate of window '13000' refused because there are active modal dialogs
# DEBUG: Activating window ID: 13000
xbmc.executebuiltin("Dialog.Close(all, true)")
from .windows import background from .windows import background
bkgrd = background.BackgroundWindow.create(function=_sign_in_with_pin) bkgrd = background.BackgroundWindow.create(function=_sign_in_with_pin)
bkgrd.modal() bkgrd.modal()