diff --git a/src/cutecoin/gui/views/wot.py b/src/cutecoin/gui/views/wot.py index 20fac1cc2de0184900eb38c37e18e098bfa2a20b..36baa15dac06e32b8ad54e8cadcf990a3a4b0bef 100644 --- a/src/cutecoin/gui/views/wot.py +++ b/src/cutecoin/gui/views/wot.py @@ -241,9 +241,13 @@ class Node(QGraphicsEllipseItem): def contextMenuEvent(self, event: QGraphicsSceneContextMenuEvent): """ Right click on node to show node menu + Except on wallet node :param event: scene context menu event """ + #Â no menu on the wallet node + if self.status_wallet: + return None #Â create node context menus self.menu = QMenu() #Â action add identity as contact diff --git a/src/cutecoin/gui/wot_tab.py b/src/cutecoin/gui/wot_tab.py index 0d8e4bafbe013ab9b94caa871d3505150da39364..c290209550a22533a4584846ce09c89123b09ca1 100644 --- a/src/cutecoin/gui/wot_tab.py +++ b/src/cutecoin/gui/wot_tab.py @@ -54,14 +54,32 @@ class WotTabWidget(QWidget, Ui_WotTabWidget): :param public_key: Public key of the identity """ + # reset graph + graph = dict() + try: certifiers = self.community.request(bma.wot.CertifiersOf, {'search': public_key}) except ValueError as e: logging.debug('bma.wot.CertifiersOf request error : ' + str(e)) - return False + try: + results = self.community.request(bma.wot.Lookup, {'search': public_key}) + except ValueError as e: + logging.debug('bma.wot.CertifiersOf request error : ' + str(e)) + return False - # reset graph - graph = dict() + #Â show only node of this non member (to certify him) + node_status = 0 + if public_key == self.account.pubkey: + node_status += NODE_STATUS_HIGHLIGHTED + node_status += NODE_STATUS_OUT + node_status += NODE_STATUS_SELECTED + + # selected node + graph[public_key] = {'id': public_key, 'arcs': list(), 'text': results['results'][0]['uids'][0]['uid'], 'tooltip': public_key, 'status': node_status} + + # draw graph in qt scene + self.graphicsView.scene().update_wot(graph) + return False #Â add wallet node node_status = 0 @@ -215,6 +233,7 @@ class WotTabWidget(QWidget, Ui_WotTabWidget): def sign_node(self, metadata): # open certify dialog dialog = CertificationDialog(self.account, self.password_asker) + dialog.combo_community.setCurrentText(self.community.name()) dialog.edit_pubkey.setText(metadata['id']) dialog.radio_pubkey.setChecked(True) dialog.combo_community.setCurrentText(self.community.name())