reformatting
This commit is contained in:
parent
a1eaf351a7
commit
fe9ec6de06
|
@ -498,7 +498,7 @@ class ButtonsWidget(QWidget):
|
|||
def addCopyButton(self, app):
|
||||
self.app = app
|
||||
f = lambda: self.app.clipboard().setText(str(self.text()))
|
||||
self.addButton(":icons/copy.png", f, _("Copy to Clipboard"))
|
||||
self.addButton(":icons/copy.png", f, _("Copy to clipboard"))
|
||||
|
||||
class ButtonsLineEdit(QLineEdit, ButtonsWidget):
|
||||
def __init__(self, text=None):
|
||||
|
|
18
gui/text.py
18
gui/text.py
|
@ -359,16 +359,15 @@ class ElectrumGui:
|
|||
w.refresh()
|
||||
if getchar: c = self.stdscr.getch()
|
||||
|
||||
|
||||
def run_popup(self, title, items):
|
||||
return self.run_dialog(title, map(lambda x: {'type':'button','label':x}, items), interval=1, y_pos = self.pos+3)
|
||||
|
||||
|
||||
def network_dialog(self):
|
||||
if not self.network: return
|
||||
host, port, protocol, proxy_config, auto_connect = self.network.get_parameters()
|
||||
if not self.network:
|
||||
return
|
||||
params = self.network.get_parameters()
|
||||
host, port, protocol, proxy_config, auto_connect = params
|
||||
srv = 'auto-connect' if auto_connect else self.network.default_server
|
||||
|
||||
out = self.run_dialog('Network', [
|
||||
{'label':'server', 'type':'str', 'value':srv},
|
||||
{'label':'proxy', 'type':'str', 'value':self.config.get('proxy', '')},
|
||||
|
@ -383,16 +382,9 @@ class ElectrumGui:
|
|||
except Exception:
|
||||
self.show_message("Error:" + server + "\nIn doubt, type \"auto-connect\"")
|
||||
return False
|
||||
|
||||
if out.get('proxy'):
|
||||
proxy = self.parse_proxy_options(out.get('proxy'))
|
||||
else:
|
||||
proxy = None
|
||||
|
||||
proxy = self.parse_proxy_options(out.get('proxy')) if out.get('proxy') else None
|
||||
self.network.set_parameters(host, port, protocol, proxy, auto_connect)
|
||||
|
||||
|
||||
|
||||
def settings_dialog(self):
|
||||
fee = str(Decimal(self.wallet.fee_per_kb(self.config)) / COIN)
|
||||
out = self.run_dialog('Settings', [
|
||||
|
|
|
@ -123,7 +123,6 @@ class TcpConnection(threading.Thread, util.PrintError):
|
|||
if s and self.check_host_name(s.getpeercert(), self.host):
|
||||
self.print_error("SSL certificate signed by CA")
|
||||
return s
|
||||
|
||||
# get server certificate.
|
||||
# Do not use ssl.get_server_certificate because it does not work with proxy
|
||||
s = self.get_simple_socket()
|
||||
|
|
|
@ -155,15 +155,18 @@ class Abstract_Wallet(PrintError):
|
|||
max_change_outputs = 3
|
||||
|
||||
def __init__(self, storage):
|
||||
self.electrum_version = ELECTRUM_VERSION
|
||||
self.storage = storage
|
||||
self.network = None
|
||||
self.electrum_version = ELECTRUM_VERSION
|
||||
# verifier (SPV) and synchronizer are started in start_threads
|
||||
self.synchronizer = None
|
||||
self.verifier = None
|
||||
|
||||
self.gap_limit_for_change = 6 # constant
|
||||
# saved fields
|
||||
self.seed_version = storage.get('seed_version', NEW_SEED_VERSION)
|
||||
self.use_change = storage.get('use_change',True)
|
||||
self.multiple_change = storage.get('multiple_change', False)
|
||||
|
||||
self.use_encryption = storage.get('use_encryption', False)
|
||||
self.seed = storage.get('seed', '') # encrypted
|
||||
self.labels = storage.get('labels', {})
|
||||
|
@ -171,9 +174,6 @@ class Abstract_Wallet(PrintError):
|
|||
self.stored_height = storage.get('stored_height', 0) # last known height (for offline mode)
|
||||
self.history = storage.get('addr_history',{}) # address -> list(txid, height)
|
||||
|
||||
# This attribute is set when wallet.start_threads is called.
|
||||
self.synchronizer = None
|
||||
|
||||
# imported_keys is deprecated. The GUI should call convert_imported_keys
|
||||
self.imported_keys = self.storage.get('imported_keys',{})
|
||||
|
||||
|
@ -184,8 +184,6 @@ class Abstract_Wallet(PrintError):
|
|||
# load requests
|
||||
self.receive_requests = self.storage.get('payment_requests', {})
|
||||
|
||||
# spv
|
||||
self.verifier = None
|
||||
# Transactions pending verification. A map from tx hash to transaction
|
||||
# height. Access is not contended so no lock is needed.
|
||||
self.unverified_tx = {}
|
||||
|
@ -1564,13 +1562,13 @@ class Deterministic_Wallet(Abstract_Wallet):
|
|||
|
||||
class BIP32_Wallet(Deterministic_Wallet):
|
||||
# abstract class, bip32 logic
|
||||
root_name = 'x/'
|
||||
|
||||
def __init__(self, storage):
|
||||
Deterministic_Wallet.__init__(self, storage)
|
||||
self.master_public_keys = storage.get('master_public_keys', {})
|
||||
self.master_private_keys = storage.get('master_private_keys', {})
|
||||
self.gap_limit = storage.get('gap_limit', 20)
|
||||
self.root_name = 'x/'
|
||||
|
||||
def is_watching_only(self):
|
||||
return not bool(self.master_private_keys)
|
||||
|
|
|
@ -319,8 +319,12 @@ class BTChipWallet(BIP44_Wallet):
|
|||
if not msg:
|
||||
msg = _("Do not enter your device PIN here !\r\n\r\n" \
|
||||
"Your Ledger Wallet wants to talk to you and tell you a unique second factor code.\r\n" \
|
||||
"For this to work, please open a text editor (on a different computer / device if you believe this computer is compromised) and put your cursor into it, unplug your Ledger Wallet and plug it back in.\r\n" \
|
||||
"It should show itself to your computer as a keyboard and output the second factor along with a summary of the transaction it is signing into the text-editor.\r\n\r\n" \
|
||||
"For this to work, please open a text editor " \
|
||||
"(on a different computer / device if you believe this computer is compromised) " \
|
||||
"and put your cursor into it, unplug your Ledger Wallet and plug it back in.\r\n" \
|
||||
"It should show itself to your computer as a keyboard " \
|
||||
"and output the second factor along with a summary of " \
|
||||
"the transaction being signed into the text-editor.\r\n\r\n" \
|
||||
"Check that summary and then enter the second factor code here.\r\n" \
|
||||
"Before clicking OK, re-plug the device once more (unplug it and plug it again if you read the second factor code on the same computer)")
|
||||
response = self.handler.prompt_auth(msg)
|
||||
|
|
Loading…
Reference in New Issue