From 78f6ad7da87af69f5ebde2096e91ba7deda00790 Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Sun, 2 Jul 2017 18:04:22 +0200 Subject: [PATCH] Plex connect server dialog --- .../resource.language.en_gb/strings.po | 22 ++++++++++++++++++ resources/lib/connectmanager.py | 16 ++++++++++--- resources/lib/dialogs/serverconnect.py | 2 +- ...ver.xml => script-plex-connect-server.xml} | 16 ++++++------- resources/skins/default/media/logo-white.png | Bin 2078 -> 8356 bytes 5 files changed, 44 insertions(+), 12 deletions(-) rename resources/skins/default/1080i/{script-emby-connect-server.xml => script-plex-connect-server.xml} (94%) diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index 6a5d051c..37b6e154 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -1155,6 +1155,28 @@ msgctxt "#30545" msgid "Force transcode pictures" msgstr "" + +# Server selection dialog: button text to sign in or sign out of plex.tv +msgctxt "#30600" +msgid "Toggle plex.tv sign-in" +msgstr "" + +# Server selection dialog: button text to add server manually +msgctxt "#30601" +msgid "Manually add server" +msgstr "" + +# Button text, e.g. to cancel a dialog +msgctxt "#30602" +msgid "Cancel" +msgstr "" + +# Server selection dialog: button text to select the main PMS +msgctxt "#30607" +msgid "Select main PMS" +msgstr "" + + # service add-on msgctxt "#33000" diff --git a/resources/lib/connectmanager.py b/resources/lib/connectmanager.py index 1db49c41..b152a384 100644 --- a/resources/lib/connectmanager.py +++ b/resources/lib/connectmanager.py @@ -96,7 +96,15 @@ class ConnectManager(object): """ Will return selected server or raise RuntimeError """ - dia = ServerConnect("script-emby-connect-server.xml", *XML_PATH) + dia = ServerConnect("script-plex-connect-server.xml", *XML_PATH) + kwargs = { + 'connect_manager': None, # self._connect + 'username': settings('username'), + 'user_image': window('PlexUserImage'), + # 'servers': state.get('Servers') or [], + # 'emby_connect': False if user else True + } + dia.set_args(**kwargs) dia.doModal() if dia.is_server_selected(): @@ -106,7 +114,6 @@ class ConnectManager(object): elif dia._is_connect_login(): log.debug("Login to plex.tv") try: - # Login to emby connect self._login_connect() except RuntimeError: pass @@ -270,7 +277,10 @@ class ConnectManager(object): if not self.server or not self.serverid: show_dialog = True if show_dialog is True: - server = self.select_servers() + try: + server = self.select_servers() + except RuntimeError: + pass log.info("Server: %s", server) server = self.__user_pick_pms() else: diff --git a/resources/lib/dialogs/serverconnect.py b/resources/lib/dialogs/serverconnect.py index e5077bde..4d7bc040 100644 --- a/resources/lib/dialogs/serverconnect.py +++ b/resources/lib/dialogs/serverconnect.py @@ -69,7 +69,7 @@ class ServerConnect(xbmcgui.WindowXMLDialog): server_type = "wifi" if server.get('ExchangeToken') else "network" self.list_.addItem(self._add_listitem(server['Name'], server['Id'], server_type)) - self.getControl(USER_NAME).setLabel("%s %s" % ('Switch plex.tv user', self.username.decode('utf-8'))) + self.getControl(USER_NAME).setLabel("%s %s" % (lang(33000), self.username.decode('utf-8'))) if self.user_image is not None: self.getControl(USER_IMAGE).setImage(self.user_image) diff --git a/resources/skins/default/1080i/script-emby-connect-server.xml b/resources/skins/default/1080i/script-plex-connect-server.xml similarity index 94% rename from resources/skins/default/1080i/script-emby-connect-server.xml rename to resources/skins/default/1080i/script-plex-connect-server.xml index bc751e8c..241e5654 100644 --- a/resources/skins/default/1080i/script-emby-connect-server.xml +++ b/resources/skins/default/1080i/script-plex-connect-server.xml @@ -27,7 +27,7 @@ logo-white.png keep 120 - 49 + 120 30 25 @@ -82,7 +82,7 @@ Select server ffa6a6a6 - + font10 center top @@ -202,10 +202,10 @@ 150 True - Sign in Connect - box.png - box.png - + Toggle plex.tv sign-in + box.png + box.png + font10 ffa6a6a6 white @@ -221,7 +221,7 @@ Manually add server box.png box.png - + font10 ffa6a6a6 white @@ -239,7 +239,7 @@ Cancel box.png box.png - + font10 ffa6a6a6 white diff --git a/resources/skins/default/media/logo-white.png b/resources/skins/default/media/logo-white.png index c4cf11a339ec332b2b29d290ede3236af7d0bb9a..15f85524db9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