Skip to content
Snippets Groups Projects
Commit 1b5ac3fe authored by inso's avatar inso
Browse files

Fix transactions tab

parent 515fb3a1
No related branches found
No related tags found
No related merge requests found
...@@ -150,6 +150,7 @@ class TransactionsTabWidget(QObject): ...@@ -150,6 +150,7 @@ class TransactionsTabWidget(QObject):
@asyncify @asyncify
async def refresh_balance(self): async def refresh_balance(self):
self.ui.busy_balance.show() self.ui.busy_balance.show()
try:
amount = await self.app.current_account.amount(self.community) amount = await self.app.current_account.amount(self.community)
localized_amount = await self.app.current_account.current_ref.instance(amount, self.community, localized_amount = await self.app.current_account.current_ref.instance(amount, self.community,
self.app).localized(units=True, self.app).localized(units=True,
...@@ -162,6 +163,10 @@ class TransactionsTabWidget(QObject): ...@@ -162,6 +163,10 @@ class TransactionsTabWidget(QObject):
localized_amount localized_amount
) )
) )
except NoPeerAvailable as e:
logging.debug(str(e))
except errors.DuniterError as e:
logging.debug(str(e))
self.ui.busy_balance.hide() self.ui.busy_balance.hide()
@once_at_a_time @once_at_a_time
......
...@@ -150,7 +150,7 @@ class ExplorerScene(BaseScene): ...@@ -150,7 +150,7 @@ class ExplorerScene(BaseScene):
if not data[current]['sparent']: if not data[current]['sparent']:
theta = 0 theta = 0
else: else:
theta = data[current]['theta'] - data[current]['span'] / 2 theta = data[current]['theta'] - data[current]['span'] / 8
for edge in nx_graph.to_undirected().edges(current): for edge in nx_graph.to_undirected().edges(current):
next_node = edge[0] if edge[0] != current else edge[1] next_node = edge[0] if edge[0] != current else edge[1]
...@@ -159,7 +159,7 @@ class ExplorerScene(BaseScene): ...@@ -159,7 +159,7 @@ class ExplorerScene(BaseScene):
if data[next_node]['theta']: if data[next_node]['theta']:
continue continue
data[next_node]['theta'] = theta + data[next_node]['span'] / 2.0 data[next_node]['theta'] = theta + data[next_node]['span'] / 8.0
theta += data[next_node]['span'] theta += data[next_node]['span']
if data[next_node]['nchild'] > 0: if data[next_node]['nchild'] > 0:
ExplorerScene._set_positions(nx_graph, data, next_node) ExplorerScene._set_positions(nx_graph, data, next_node)
...@@ -196,7 +196,7 @@ class ExplorerScene(BaseScene): ...@@ -196,7 +196,7 @@ class ExplorerScene(BaseScene):
for node in nx_graph.nodes(): for node in nx_graph.nodes():
hyp = distances[node] + 1 hyp = distances[node] + 1
theta = data[node]['theta'] theta = data[node]['theta']
nx_pos[node] = (hyp * math.cos(theta) * 100, hyp * math.sin(theta) * 100) nx_pos[node] = (hyp * math.cos(theta) * 200, hyp * math.sin(theta) * 200)
return nx_pos return nx_pos
def clear(self): def clear(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment