Browse Source

kivy: add server chooser to network dialog

283
ThomasV 10 years ago
parent
commit
6bd191966e
  1. 27
      gui/kivy/uix/ui_screens/network.kv
  2. 5
      gui/kivy/uix/ui_screens/settings.kv

27
gui/kivy/uix/ui_screens/network.kv

@ -5,9 +5,6 @@ Popup:
on_open:
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:
orientation: 'vertical'
@ -21,14 +18,26 @@ Popup:
size_hint_y: None
Label:
text: _('Server')
Label:
Spinner:
id: host
text: ''
values: app.network.get_servers()
Button:
size_hint: 0.5, None
height: '48dp'
text: _('Close')
on_release: nd.dismiss()
BoxLayout:
Button:
size_hint: 0.5, None
height: '48dp'
text: _('Cancel')
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:
size_hint: 1, 1

5
gui/kivy/uix/ui_screens/settings.kv

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

Loading…
Cancel
Save