No need to pass daemon and network together
The daemon has the network
This commit is contained in:
parent
0a1b3eac9c
commit
58d5215e2e
6
electrum
6
electrum
|
@ -91,12 +91,12 @@ def prompt_password(prompt, confirm=True):
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def init_gui(config, network, daemon, plugins):
|
def init_gui(config, daemon, plugins):
|
||||||
gui_name = config.get('gui', 'qt')
|
gui_name = config.get('gui', 'qt')
|
||||||
if gui_name in ['lite', 'classic']:
|
if gui_name in ['lite', 'classic']:
|
||||||
gui_name = 'qt'
|
gui_name = 'qt'
|
||||||
gui = __import__('electrum_gui.' + gui_name, fromlist=['electrum_gui'])
|
gui = __import__('electrum_gui.' + gui_name, fromlist=['electrum_gui'])
|
||||||
gui = gui.ElectrumGui(config, network, daemon, plugins)
|
gui = gui.ElectrumGui(config, daemon, plugins)
|
||||||
return gui
|
return gui
|
||||||
|
|
||||||
|
|
||||||
|
@ -329,7 +329,7 @@ if __name__ == '__main__':
|
||||||
result = server.gui(config_options)
|
result = server.gui(config_options)
|
||||||
else:
|
else:
|
||||||
daemon = Daemon(config)
|
daemon = Daemon(config)
|
||||||
gui = init_gui(config, daemon.network, daemon, plugins)
|
gui = init_gui(config, daemon, plugins)
|
||||||
daemon.gui = gui
|
daemon.gui = gui
|
||||||
gui.main()
|
gui.main()
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# To create a new GUI, please add its code to this directory.
|
# To create a new GUI, please add its code to this directory.
|
||||||
# Three objects are passed to the ElectrumGui: config, network and plugins
|
# Three objects are passed to the ElectrumGui: config, daemon and plugins
|
||||||
# The Wallet object is instanciated by the GUI
|
# The Wallet object is instanciated by the GUI
|
||||||
|
|
||||||
# Notifications about network events are sent to the GUI by using network.register_callback()
|
# Notifications about network events are sent to the GUI by using network.register_callback()
|
||||||
|
|
|
@ -903,9 +903,9 @@ config = None
|
||||||
|
|
||||||
class ElectrumGui:
|
class ElectrumGui:
|
||||||
|
|
||||||
def __init__(self, _config, _network, daemon, plugins):
|
def __init__(self, _config, daemon, plugins):
|
||||||
global wallet, network, contacts, config
|
global wallet, network, contacts, config
|
||||||
network = _network
|
network = daemon.network
|
||||||
config = _config
|
config = _config
|
||||||
network.register_callback(update_callback, ['updated'])
|
network.register_callback(update_callback, ['updated'])
|
||||||
|
|
||||||
|
|
|
@ -38,9 +38,9 @@ from main_window import ElectrumWindow
|
||||||
|
|
||||||
class ElectrumGui:
|
class ElectrumGui:
|
||||||
|
|
||||||
def __init__(self, config, network, daemon, plugins):
|
def __init__(self, config, daemon, plugins):
|
||||||
Logger.debug('ElectrumGUI: initialising')
|
Logger.debug('ElectrumGUI: initialising')
|
||||||
self.network = network
|
self.network = daemon.network
|
||||||
self.config = config
|
self.config = config
|
||||||
self.plugins = plugins
|
self.plugins = plugins
|
||||||
set_language(config.get('language'))
|
set_language(config.get('language'))
|
||||||
|
|
|
@ -66,13 +66,12 @@ class OpenFileEventFilter(QObject):
|
||||||
|
|
||||||
class ElectrumGui:
|
class ElectrumGui:
|
||||||
|
|
||||||
def __init__(self, config, network, daemon, plugins):
|
def __init__(self, config, daemon, plugins):
|
||||||
set_language(config.get('language'))
|
set_language(config.get('language'))
|
||||||
# Uncomment this call to verify objects are being properly
|
# Uncomment this call to verify objects are being properly
|
||||||
# GC-ed when windows are closed
|
# GC-ed when windows are closed
|
||||||
#network.add_jobs([DebugMem([Abstract_Wallet, SPV, Synchronizer,
|
#network.add_jobs([DebugMem([Abstract_Wallet, SPV, Synchronizer,
|
||||||
# ElectrumWindow], interval=5)])
|
# ElectrumWindow], interval=5)])
|
||||||
self.network = network
|
|
||||||
self.config = config
|
self.config = config
|
||||||
self.daemon = daemon
|
self.daemon = daemon
|
||||||
self.plugins = plugins
|
self.plugins = plugins
|
||||||
|
|
|
@ -109,7 +109,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
||||||
|
|
||||||
self.gui_object = gui_object
|
self.gui_object = gui_object
|
||||||
self.config = config = gui_object.config
|
self.config = config = gui_object.config
|
||||||
self.network = gui_object.network
|
self.network = gui_object.daemon.network
|
||||||
self.invoices = gui_object.invoices
|
self.invoices = gui_object.invoices
|
||||||
self.contacts = gui_object.contacts
|
self.contacts = gui_object.contacts
|
||||||
self.tray = gui_object.tray
|
self.tray = gui_object.tray
|
||||||
|
|
|
@ -12,9 +12,9 @@ import sys, getpass, datetime
|
||||||
|
|
||||||
class ElectrumGui:
|
class ElectrumGui:
|
||||||
|
|
||||||
def __init__(self, config, network, daemon, plugins):
|
def __init__(self, config, daemon, plugins):
|
||||||
self.network = network
|
|
||||||
self.config = config
|
self.config = config
|
||||||
|
network = daemon.network
|
||||||
storage = WalletStorage(config.get_wallet_path())
|
storage = WalletStorage(config.get_wallet_path())
|
||||||
if not storage.file_exists:
|
if not storage.file_exists:
|
||||||
print "Wallet not found. try 'electrum create'"
|
print "Wallet not found. try 'electrum create'"
|
||||||
|
|
|
@ -13,10 +13,10 @@ _ = lambda x:x
|
||||||
|
|
||||||
class ElectrumGui:
|
class ElectrumGui:
|
||||||
|
|
||||||
def __init__(self, config, network, daemon, plugins):
|
def __init__(self, config, daemon, plugins):
|
||||||
|
|
||||||
self.config = config
|
self.config = config
|
||||||
self.network = network
|
self.network = daemon.network
|
||||||
storage = WalletStorage(config.get_wallet_path())
|
storage = WalletStorage(config.get_wallet_path())
|
||||||
if not storage.file_exists:
|
if not storage.file_exists:
|
||||||
print "Wallet not found. try 'electrum create'"
|
print "Wallet not found. try 'electrum create'"
|
||||||
|
|
Loading…
Reference in New Issue