diff --git a/src/sakia/gui/graphs/graph_tab.py b/src/sakia/gui/graphs/graph_tab.py index b3bd4fa1bbb55293808e5126d2bb0857fb4d5ec1..d308245b821fb6a43169b3780b0204436cc7c47a 100644 --- a/src/sakia/gui/graphs/graph_tab.py +++ b/src/sakia/gui/graphs/graph_tab.py @@ -31,8 +31,14 @@ class GraphTabWidget(QObject): self.app = app def set_scene(self, scene): + """ + Set the scene and connects the signals + :param sakia.gui.views.scenes.base_scene.BaseScene scene: the scene + :return: + """ # add scene events scene.node_context_menu_requested.connect(self.node_context_menu) + scene.node_clicked.connect(self.handle_node_click) @once_at_a_time @asyncify @@ -159,6 +165,7 @@ class GraphTabWidget(QObject): identity = await self.app.identities_registry.future_find(pubkey, self.community) menu = ContextMenu.from_data(self.widget, self.app, self.account, self.community, self.password_asker, (identity,)) + menu.view_identity_in_wot.connect(self.draw_graph) # Show the context menu. menu.qmenu.popup(QCursor.pos()) diff --git a/src/sakia/gui/identities_tab.py b/src/sakia/gui/identities_tab.py index 36bca853aaa4d98404e381f765da90692b3fe8e4..02badc49cf9e7b5c52531f7ca038002c00097377 100644 --- a/src/sakia/gui/identities_tab.py +++ b/src/sakia/gui/identities_tab.py @@ -25,7 +25,7 @@ class IdentitiesTabWidget(QObject): """ classdocs """ - view_in_wot = pyqtSignal(Identity) + view_in_wot = pyqtSignal(object) money_sent = pyqtSignal() _direct_connections_text = QT_TRANSLATE_NOOP("IdentitiesTabWidget", "Search direct certifications") @@ -104,6 +104,7 @@ class IdentitiesTabWidget(QObject): identity = await self.app.identities_registry.future_find(pubkey, self.community) menu = ContextMenu.from_data(self.widget, self.app, self.account, self.community, self.password_asker, (identity,)) + menu.view_identity_in_wot.connect(self.view_in_wot) # Show the context menu. menu.qmenu.popup(QCursor.pos()) diff --git a/src/sakia/gui/transactions_tab.py b/src/sakia/gui/transactions_tab.py index bf2f6e658feff39d80d70fe36518f080a9250cd8..cead5a8578d629063199e5d4382f8432e65ec0c6 100644 --- a/src/sakia/gui/transactions_tab.py +++ b/src/sakia/gui/transactions_tab.py @@ -182,6 +182,7 @@ class TransactionsTabWidget(QObject): transfer = model.sourceModel().transfers()[source_index.row()] menu = ContextMenu.from_data(self.widget, self.app, self.account, self.community, self.password_asker, (identity, transfer)) + menu.view_identity_in_wot.connect(self.view_in_wot) # Show the context menu. menu.qmenu.popup(QCursor.pos()) diff --git a/src/sakia/gui/views/nodes/base_node.py b/src/sakia/gui/views/nodes/base_node.py index ec41cb7f328f9a40554a59bbb34bcf98cd87e2bf..04aadd2f43f37099306b6751f48bda7d4972658b 100644 --- a/src/sakia/gui/views/nodes/base_node.py +++ b/src/sakia/gui/views/nodes/base_node.py @@ -1,7 +1,6 @@ -from PyQt5.QtWidgets import QGraphicsEllipseItem, \ - QMenu, QAction, QGraphicsSceneHoverEvent, \ +from PyQt5.QtWidgets import QGraphicsEllipseItem, QGraphicsSceneHoverEvent, \ QGraphicsSceneContextMenuEvent -from PyQt5.QtCore import Qt, QCoreApplication, QT_TRANSLATE_NOOP, pyqtSignal +from PyQt5.QtCore import Qt from PyQt5.QtGui import QMouseEvent from ....core.graph.constants import NodeStatus diff --git a/src/sakia/gui/views/scenes/base_scene.py b/src/sakia/gui/views/scenes/base_scene.py index ec8d59c45490bb4571021d2fce09aee9de6bb14d..36cd72880a4def8abc332cd47f0b5c06e68aaede 100644 --- a/src/sakia/gui/views/scenes/base_scene.py +++ b/src/sakia/gui/views/scenes/base_scene.py @@ -6,6 +6,7 @@ class BaseScene(QGraphicsScene): # This defines signals taking string arguments node_context_menu_requested = pyqtSignal(str) node_hovered = pyqtSignal(str) + node_clicked = pyqtSignal(str, dict) def __init__(self, parent=None): super().__init__(parent)