kivy: add server chooser to network dialog

This commit is contained in:
ThomasV 2015-10-15 11:57:07 +02:00
parent 59948d725c
commit 6bd191966e
2 changed files with 21 additions and 11 deletions

View file

@ -5,9 +5,6 @@ Popup:
on_open: on_open:
host.text, nd.port, nd.protocol, nd.proxy, auto_connect.active = app.network.get_parameters() host.text, nd.port, nd.protocol, nd.proxy, auto_connect.active = app.network.get_parameters()
on_dismiss:
app.network.set_parameters(host.text, nd.port, nd.protocol, nd.proxy, auto_connect.active)
BoxLayout: BoxLayout:
orientation: 'vertical' orientation: 'vertical'
@ -21,14 +18,26 @@ Popup:
size_hint_y: None size_hint_y: None
Label: Label:
text: _('Server') text: _('Server')
Label: Spinner:
id: host id: host
text: ''
values: app.network.get_servers()
BoxLayout:
Button: Button:
size_hint: 0.5, None size_hint: 0.5, None
height: '48dp' height: '48dp'
text: _('Close') text: _('Cancel')
on_release: nd.dismiss() on_release:
nd.dismiss()
Button:
size_hint: 0.5, None
height: '48dp'
text: _('OK')
on_release:
app.network.set_parameters(host.text, nd.port, nd.protocol, nd.proxy, auto_connect.active)
nd.dismiss()
Widget: Widget:
size_hint: 1, 1 size_hint: 1, 1

View file

@ -9,10 +9,11 @@ Popup:
GridLayout: GridLayout:
cols: 2 cols: 2
size_hint: 1, None size_hint: 1, None
height: '100dp'
Label: Label:
text: _('Base unit') text: _('Base unit')
height: '48dp'
size_hint: 1, None size_hint: 1, None
height: '48dp'
Button: Button:
text: app.base_unit text: app.base_unit
size_hint: 1, None size_hint: 1, None
@ -35,5 +36,5 @@ Popup:
on_release: settings.dismiss() on_release: settings.dismiss()
Widget: Widget:
size_hint: 1, 0.8 size_hint: 1, 1