Browse Source

protocols

283
ThomasV 13 years ago
parent
commit
7405a758e8
  1. 27
      client/electrum4a.py

27
client/electrum4a.py

@ -116,7 +116,10 @@ def protocol_name(p):
def protocol_dialog(host, protocol, z): def protocol_dialog(host, protocol, z):
droid.dialogCreateAlert('Protocol',host) droid.dialogCreateAlert('Protocol',host)
if z:
protocols = z.keys() protocols = z.keys()
else:
protocols = ['t','h','n']
l = [] l = []
current = protocols.index(protocol) current = protocols.index(protocol)
for p in protocols: for p in protocols:
@ -788,7 +791,7 @@ def settings_loop():
is_encrypted = 'yes' if wallet.use_encryption else 'no' is_encrypted = 'yes' if wallet.use_encryption else 'no'
protocol = protocol_name(p) protocol = protocol_name(p)
droid.fullShow(settings_layout) droid.fullShow(settings_layout)
droid.fullSetList("myListView",['Server: ' + server, 'Port: '+port, 'Protocol: '+ protocol, 'Fee: '+fee, 'Password: '+is_encrypted, 'Seed']) droid.fullSetList("myListView",['Server: ' + server, 'Protocol: '+ protocol, 'Port: '+port, 'Fee: '+fee, 'Password: '+is_encrypted, 'Seed'])
set_listview() set_listview()
@ -824,25 +827,25 @@ def settings_loop():
modal_dialog('error','invalid server') modal_dialog('error','invalid server')
set_listview() set_listview()
elif pos == "1": #port elif pos == "1": #protocol
a_port = modal_input('Port', 'port number', port, "number") if host in plist:
if a_port: srv = protocol_dialog(host, protocol, plist[host])
if a_port != port: if srv:
srv = host + ':' + a_port + ':t'
try: try:
wallet.set_server(srv) wallet.set_server(srv)
except: except:
modal_dialog('error','invalid port number') modal_dialog('error','invalid server')
set_listview() set_listview()
elif pos == "2": #protocol elif pos == "2": #port
if host in plist: a_port = modal_input('Port number', 'If you use a public server, this field is set automatically when you set the protocol', port, "number")
srv = protocol_dialog(host, protocol, plist[host]) if a_port:
if srv: if a_port != port:
srv = host + ':' + a_port + ':'+ protocol
try: try:
wallet.set_server(srv) wallet.set_server(srv)
except: except:
modal_dialog('error','invalid server') modal_dialog('error','invalid port number')
set_listview() set_listview()
elif pos == "3": #fee elif pos == "3": #fee

Loading…
Cancel
Save