mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-12-13 10:33:16 +00:00
Add utils dialog
Centralize for later, control icon, etc. Pylint.
This commit is contained in:
parent
9e9054865a
commit
21f8a62ebd
3 changed files with 63 additions and 50 deletions
|
|
@ -80,7 +80,6 @@ class InitialSetup(object):
|
|||
current_server = self.user_client.get_server()
|
||||
if current_server is not None:
|
||||
server = self.connectmanager.get_server(current_server)
|
||||
log.info(server)
|
||||
settings('ServerId', value=server['Id'])
|
||||
self.user_client.get_userid()
|
||||
self.user_client.get_token()
|
||||
|
|
@ -95,7 +94,7 @@ class InitialSetup(object):
|
|||
self._set_server(server_address, server)
|
||||
#self._set_user(server['UserId'], server['AccessToken'])
|
||||
return True
|
||||
|
||||
|
||||
return False
|
||||
|
||||
def _user_identification(self):
|
||||
|
|
|
|||
|
|
@ -50,6 +50,23 @@ def language(string_id):
|
|||
# Central string retrieval - unicode
|
||||
return xbmcaddon.Addon(id='plugin.video.emby').getLocalizedString(string_id)
|
||||
|
||||
def dialog(type_, **kwargs):
|
||||
|
||||
d = xbmcgui.Dialog()
|
||||
|
||||
if "icon" in kwargs:
|
||||
kwargs['icon'] = kwargs['icon'].replace("{default}",
|
||||
"special://home/addons/plugin.video.emby/icon.png")
|
||||
|
||||
types = {
|
||||
'yesno': d.yesno,
|
||||
'ok': d.ok,
|
||||
'notification': d.notification,
|
||||
'input': d.input
|
||||
}
|
||||
return types[type_](**kwargs)
|
||||
|
||||
|
||||
class JSONRPC(object):
|
||||
|
||||
id_ = 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue