From 3330376496a3d352a26adeef5c57b6ccf91d2850 Mon Sep 17 00:00:00 2001 From: Inso <insomniak.fr@gmail.com> Date: Sat, 20 Jun 2015 10:06:55 +0200 Subject: [PATCH] Fix wot refresh --- src/cutecoin/gui/wot_tab.py | 78 ++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/src/cutecoin/gui/wot_tab.py b/src/cutecoin/gui/wot_tab.py index e17630b8..0bbd670f 100644 --- a/src/cutecoin/gui/wot_tab.py +++ b/src/cutecoin/gui/wot_tab.py @@ -61,48 +61,48 @@ class WotTabWidget(QWidget, Ui_WotTabWidget): identity_account = self.account.identity(self.community) #Disconnect old identity - if self._current_identity != identity: - try: - if self._current_identity: - self._current_identity.inner_data_changed.disconnect(self.handle_identity_change) - except TypeError as e: - if "disconnect()" in str(e): - logging.debug("Disconnect of old identity failed.") - #Connect new identity - identity.inner_data_changed.connect(self.handle_identity_change) + try: + if self._current_identity and self._current_identity != identity: + self._current_identity.inner_data_changed.disconnect(self.handle_identity_change) + except TypeError as e: + if "disconnect()" in str(e): + logging.debug("Disconnect of old identity failed.") + #Connect new identity + if self._current_identity != identity: self._current_identity = identity + identity.inner_data_changed.connect(self.handle_identity_change) - # create Identity from node metadata - certifier_list = identity.certifiers_of(self.community) - certified_list = identity.certified_by(self.community) - - # create empty graph instance - graph = Graph(self.community) - - #Â add wallet node - node_status = 0 - if identity == identity_account: - node_status += NODE_STATUS_HIGHLIGHTED - if identity.is_member(self.community) is False: - node_status += NODE_STATUS_OUT - node_status += NODE_STATUS_SELECTED - graph.add_identity(identity, node_status) - - # populate graph with certifiers-of - graph.add_certifier_list(certifier_list, identity, identity_account) - # populate graph with certified-by - graph.add_certified_list(certified_list, identity, identity_account) - - # draw graph in qt scene - self.graphicsView.scene().update_wot(graph.get()) - - # if selected member is not the account member... - if identity.pubkey != identity_account.pubkey: - # add path from selected member to account member - path = graph.get_shortest_path_between_members(identity, identity_account) - if path: - self.graphicsView.scene().update_path(path) + # create Identity from node metadata + certifier_list = identity.certifiers_of(self.community) + certified_list = identity.certified_by(self.community) + + # create empty graph instance + graph = Graph(self.community) + + #Â add wallet node + node_status = 0 + if identity == identity_account: + node_status += NODE_STATUS_HIGHLIGHTED + if identity.is_member(self.community) is False: + node_status += NODE_STATUS_OUT + node_status += NODE_STATUS_SELECTED + graph.add_identity(identity, node_status) + + # populate graph with certifiers-of + graph.add_certifier_list(certifier_list, identity, identity_account) + # populate graph with certified-by + graph.add_certified_list(certified_list, identity, identity_account) + + # draw graph in qt scene + self.graphicsView.scene().update_wot(graph.get()) + + # if selected member is not the account member... + if identity.pubkey != identity_account.pubkey: + # add path from selected member to account member + path = graph.get_shortest_path_between_members(identity, identity_account) + if path: + self.graphicsView.scene().update_path(path) def reset(self): """ -- GitLab