add explanations to network dialog

This commit is contained in:
ThomasV 2016-02-22 11:49:37 +01:00
parent d3c537d0db
commit 9b99693ca1
2 changed files with 17 additions and 13 deletions

View File

@ -156,15 +156,17 @@ class SettingsDialog(Factory.Popup):
d = ChoiceDialog(_('Coin selection'), choosers, chooser_name, cb)
d.open()
def openalias_dialog(self, label, dt):
from label_dialog import LabelDialog
def callback(text):
label.text = text
d = LabelDialog(_('OpenAlias'), '', callback)
d.open()
def network_dialog(self, label, dt):
def network_dialog(self, item, dt):
server, port, protocol, proxy, auto_connect = self.app.network.get_parameters()
def cb(popup):
server = popup.ids.host.text
auto_connect = popup.ids.auto_connect.active
self.app.network.set_parameters(server, port, protocol, proxy, auto_connect)
item.status = self.network_status()
popup = Builder.load_file('gui/kivy/uix/ui_screens/network.kv')
popup.ids.host.text = server
popup.ids.auto_connect.active = auto_connect
popup.on_dismiss = lambda: cb(popup)
popup.open()
def network_status(self):

View File

@ -4,8 +4,6 @@ Popup:
n_nodes: len(app.network.get_interfaces())
blockchain_height: app.network.get_local_height()
is_connected: app.network.is_connected()
on_open:
host.text, nd.port, nd.protocol, nd.proxy, auto_connect.active = app.network.get_parameters()
BoxLayout:
orientation: 'vertical'
@ -20,7 +18,7 @@ Popup:
GridLayout:
cols: 2
Label:
text: _('Address server')
text: _('Server')
Spinner:
id: host
height: '48dp'
@ -35,7 +33,12 @@ Popup:
Widget:
size_hint: 1, 0.1
TopLabel:
text: _("Electrum retrieves your wallet information from a single server (Address server). In addition, it connects to a number of extra nodes, in order to fetch block headers. Block headers are used to verify the information sent by the address server, using Simple Payment Verification (SPV).")
text: _("Electrum retrieves your wallet information from a single node (address server). In addition, it connects to a number of extra nodes, in order to fetch block headers. Block headers are used to verify the information sent by the address server, using Simple Payment Verification (SPV).")
font_size: '6pt'
Widget:
size_hint: 1, 0.1
TopLabel:
text: _("If auto-connect is checked, the address server will be selected automatically.")
font_size: '6pt'
Widget:
size_hint: 1, 0.1
@ -48,5 +51,4 @@ Popup:
height: '48dp'
text: _('OK')
on_release:
app.network.set_parameters(host.text, nd.port, nd.protocol, nd.proxy, auto_connect.active)
nd.dismiss()