mirror of
https://github.com/anxdpanic/plugin.video.youtube.git
synced 2025-12-06 02:30:50 -08:00
Try to make http server IP address selection even more obvious when running Setup Wizard #1320
This commit is contained in:
parent
36e2809028
commit
37b898a0c4
2 changed files with 11 additions and 5 deletions
|
|
@ -464,7 +464,8 @@ class AbstractSettings(object):
|
||||||
ip_address = '.'.join(map(str, octets))
|
ip_address = '.'.join(map(str, octets))
|
||||||
|
|
||||||
if value is not None:
|
if value is not None:
|
||||||
return self.set_string(SETTINGS.HTTPD_LISTEN, ip_address)
|
if not self.set_string(SETTINGS.HTTPD_LISTEN, ip_address):
|
||||||
|
return False
|
||||||
return ip_address
|
return ip_address
|
||||||
|
|
||||||
def httpd_whitelist(self):
|
def httpd_whitelist(self):
|
||||||
|
|
|
||||||
|
|
@ -111,8 +111,9 @@ def process_default_settings(context, step, steps, **_kwargs):
|
||||||
background=False,
|
background=False,
|
||||||
) as progress_dialog:
|
) as progress_dialog:
|
||||||
progress_dialog.update()
|
progress_dialog.update()
|
||||||
if settings.httpd_listen() == '0.0.0.0':
|
ip_address = settings.httpd_listen()
|
||||||
settings.httpd_listen('127.0.0.1')
|
if ip_address == '0.0.0.0':
|
||||||
|
ip_address = settings.httpd_listen('127.0.0.1')
|
||||||
if not httpd_status(context):
|
if not httpd_status(context):
|
||||||
port = settings.httpd_port()
|
port = settings.httpd_port()
|
||||||
addresses = get_listen_addresses()
|
addresses = get_listen_addresses()
|
||||||
|
|
@ -120,13 +121,17 @@ def process_default_settings(context, step, steps, **_kwargs):
|
||||||
for address in addresses:
|
for address in addresses:
|
||||||
progress_dialog.update()
|
progress_dialog.update()
|
||||||
if httpd_status(context, (address, port)):
|
if httpd_status(context, (address, port)):
|
||||||
settings.httpd_listen(address)
|
ip_address = settings.httpd_listen(address)
|
||||||
break
|
break
|
||||||
context.sleep(5)
|
context.sleep(3)
|
||||||
else:
|
else:
|
||||||
ui.show_notification(localize('httpd.connect.failed'),
|
ui.show_notification(localize('httpd.connect.failed'),
|
||||||
header=localize('httpd'))
|
header=localize('httpd'))
|
||||||
settings.httpd_listen('0.0.0.0')
|
settings.httpd_listen('0.0.0.0')
|
||||||
|
ip_address = None
|
||||||
|
if ip_address:
|
||||||
|
ui.on_ok(context.get_name(),
|
||||||
|
context.localize('client.ip.is.x', ip_address))
|
||||||
return step
|
return step
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue