From 1071d75857173534a28646a4c8bc53ad840f4de1 Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 3 Feb 2019 10:53:19 +0100 Subject: [PATCH] Improve dialog to manually enter PMS IP and port --- .../language/resource.language.en_gb/strings.po | 12 +++++++++++- resources/lib/initialsetup.py | 16 ++++++++++------ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index a486189a..b98f74bd 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -1081,6 +1081,16 @@ msgctxt "#39082" msgid "Direct Paths" msgstr "" +# Dialog for manually entering PMS +msgctxt "#39083" +msgid "Enter PMS IP or URL" +msgstr "" + +# Dialog for manually entering PMS +msgctxt "#39084" +msgid "Enter PMS port" +msgstr "" + msgctxt "#39200" msgid "Log-out Plex Home User " msgstr "" @@ -1133,7 +1143,7 @@ msgid "Enter your Plex Media Server's IP or URL, Examples are:" msgstr "" msgctxt "#39217" -msgid "Does your Plex Media Server support SSL connections? (https instead of http)?" +msgid "Use HTTPS (SSL) connections? With Kodi 18 or later, HTTPS will likely not work!" msgstr "" msgctxt "#39218" diff --git a/resources/lib/initialsetup.py b/resources/lib/initialsetup.py index 43718a35..269fa7a6 100644 --- a/resources/lib/initialsetup.py +++ b/resources/lib/initialsetup.py @@ -70,20 +70,22 @@ class InitialSetup(object): utils.window('plex_allows_mediaDeletion', value=value) def enter_new_pms_address(self): + LOG.info('Start getting manual PMS address and port') # "Enter your Plex Media Server's IP or URL. Examples are:" utils.messageDialog(utils.lang(29999), '%s\n%s\n%s' % (utils.lang(39215), '192.168.1.2', 'plex.myServer.org')) - address = utils.dialog('input', "Enter PMS IP or URL") - if address == '': + # "Enter PMS IP or URL" + address = utils.dialog('input', utils.lang(39083)) + if not address: return False - port = utils.dialog('input', "Enter PMS port", '32400', type='{numeric}') - if port == '': + port = utils.dialog('input', utils.lang(39084), '32400', type='{numeric}') + if not port: return False url = '%s:%s' % (address, port) - # "Does your Plex Media Server support SSL connections? - # (https instead of http)" + # "Use HTTPS (SSL) connections? With Kodi 18 or later, HTTPS will likely + # not work!" https = utils.yesno_dialog(utils.lang(29999), utils.lang(39217)) if https: url = 'https://%s' % url @@ -92,6 +94,7 @@ class InitialSetup(object): https = 'true' if https else 'false' machine_identifier = PF.GetMachineIdentifier(url) if machine_identifier is None: + LOG.error('Could not get machine identifier') # "Error contacting url # Abort (Yes) or save address anyway (No)" if utils.yesno_dialog(utils.lang(29999), @@ -100,6 +103,7 @@ class InitialSetup(object): utils.lang(39219))): return False else: + LOG.info('Saving manual address anyway') utils.settings('plex_machineIdentifier', '') else: utils.settings('plex_machineIdentifier', machine_identifier)