1
0

add blockchain.get_name method, update kivy gui

This commit is contained in:
ThomasV
2017-07-19 09:29:20 +02:00
parent 9576f8510d
commit b424a83a57
5 changed files with 22 additions and 37 deletions

View File

@@ -95,14 +95,13 @@ class NodesListWidget(QTreeWidget):
def update(self, network):
self.clear()
self.addChild = self.addTopLevelItem
checkpoint = network.get_checkpoint()
chains = network.get_blockchains()
n_chains = len(chains)
for k, items in chains.items():
b = network.blockchains[k]
name = network.get_blockchain_name(b)
name = b.get_name()
if n_chains >1:
x = QTreeWidgetItem([name + '@%d'%checkpoint, '%d'%b.height()])
x = QTreeWidgetItem([name + '@%d'%b.get_checkpoint(), '%d'%b.height()])
x.setData(0, Qt.UserRole, 1)
x.setData(1, Qt.UserRole, b.checkpoint)
else:
@@ -361,8 +360,8 @@ class NetworkChoiceLayout(object):
chains = self.network.get_blockchains()
if len(chains)>1:
chain = self.network.blockchain()
checkpoint = self.network.get_checkpoint()
name = self.network.get_blockchain_name(self.network.blockchain())
checkpoint = chain.get_checkpoint()
name = chain.get_name()
msg = _('Chain split detected at block %d')%checkpoint + '\n'
msg += (_('You are following branch') if auto_connect else _('Your server is on branch'))+ ' ' + name
msg += ' (%d %s)' % (chain.get_branch_size(), _('blocks'))