network dialog: refresh display on each new header
This commit is contained in:
parent
bf7deaa1fb
commit
ba2211f52e
|
@ -46,9 +46,8 @@ class NetworkDialog(QDialog):
|
||||||
vbox = QVBoxLayout(self)
|
vbox = QVBoxLayout(self)
|
||||||
vbox.addLayout(self.nlayout.layout())
|
vbox.addLayout(self.nlayout.layout())
|
||||||
vbox.addLayout(Buttons(CloseButton(self)))
|
vbox.addLayout(Buttons(CloseButton(self)))
|
||||||
|
|
||||||
self.connect(self, QtCore.SIGNAL('updated'), self.on_update)
|
self.connect(self, QtCore.SIGNAL('updated'), self.on_update)
|
||||||
network.register_callback(self.on_network, ['updated'])
|
network.register_callback(self.on_network, ['updated', 'interfaces'])
|
||||||
|
|
||||||
def on_network(self, event, *args):
|
def on_network(self, event, *args):
|
||||||
self.emit(QtCore.SIGNAL('updated'), event, *args)
|
self.emit(QtCore.SIGNAL('updated'), event, *args)
|
||||||
|
|
|
@ -205,7 +205,7 @@ class Network(util.DaemonThread):
|
||||||
config = {} # Do not use mutables as default values!
|
config = {} # Do not use mutables as default values!
|
||||||
util.DaemonThread.__init__(self)
|
util.DaemonThread.__init__(self)
|
||||||
self.config = SimpleConfig(config) if type(config) == type({}) else config
|
self.config = SimpleConfig(config) if type(config) == type({}) else config
|
||||||
self.num_server = 18 if not self.config.get('oneserver') else 0
|
self.num_server = 10 if not self.config.get('oneserver') else 0
|
||||||
self.blockchains = { 0:Blockchain(self.config, 'blockchain_headers', None) }
|
self.blockchains = { 0:Blockchain(self.config, 'blockchain_headers', None) }
|
||||||
for x in os.listdir(self.config.path):
|
for x in os.listdir(self.config.path):
|
||||||
if x.startswith('blockchain_fork_'):
|
if x.startswith('blockchain_fork_'):
|
||||||
|
@ -215,7 +215,6 @@ class Network(util.DaemonThread):
|
||||||
self.blockchain_index = config.get('blockchain_index', 0)
|
self.blockchain_index = config.get('blockchain_index', 0)
|
||||||
if self.blockchain_index not in self.blockchains.keys():
|
if self.blockchain_index not in self.blockchains.keys():
|
||||||
self.blockchain_index = 0
|
self.blockchain_index = 0
|
||||||
|
|
||||||
# Server for addresses and transactions
|
# Server for addresses and transactions
|
||||||
self.default_server = self.config.get('server')
|
self.default_server = self.config.get('server')
|
||||||
# Sanitize default server
|
# Sanitize default server
|
||||||
|
@ -512,6 +511,7 @@ class Network(util.DaemonThread):
|
||||||
if filtered:
|
if filtered:
|
||||||
choice = random.choice(filtered)
|
choice = random.choice(filtered)
|
||||||
self.switch_to_interface(choice)
|
self.switch_to_interface(choice)
|
||||||
|
self.notify('updated')
|
||||||
|
|
||||||
def switch_to_interface(self, server):
|
def switch_to_interface(self, server):
|
||||||
'''Switch to server as our interface. If no connection exists nor
|
'''Switch to server as our interface. If no connection exists nor
|
||||||
|
@ -1004,9 +1004,8 @@ class Network(util.DaemonThread):
|
||||||
self.request_header(interface, height - 1)
|
self.request_header(interface, height - 1)
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
if interface == self.interface:
|
self.switch_lagging_interface()
|
||||||
self.switch_lagging_interface()
|
self.notify('interfaces')
|
||||||
self.notify('updated')
|
|
||||||
|
|
||||||
def blockchain(self):
|
def blockchain(self):
|
||||||
if self.interface and self.interface.blockchain is not None:
|
if self.interface and self.interface.blockchain is not None:
|
||||||
|
|
Loading…
Reference in New Issue