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

Right clicks on tables

parent 9de184b5
No related branches found
No related tags found
No related merge requests found
...@@ -58,6 +58,8 @@ class CommunityWidget(QWidget, Ui_CommunityWidget): ...@@ -58,6 +58,8 @@ class CommunityWidget(QWidget, Ui_CommunityWidget):
self.tab_network = NetworkTabWidget(self.app) self.tab_network = NetworkTabWidget(self.app)
self.tab_identities.view_in_wot.connect(self.tab_wot.draw_graph) self.tab_identities.view_in_wot.connect(self.tab_wot.draw_graph)
self.tab_identities.view_in_wot.connect(lambda: self.tabs.setCurrentWidget(self.tab_wot)) self.tab_identities.view_in_wot.connect(lambda: self.tabs.setCurrentWidget(self.tab_wot))
self.tab_history.view_in_wot.connect(self.tab_wot.draw_graph)
self.tab_history.view_in_wot.connect(lambda: self.tabs.setCurrentWidget(self.tab_wot))
self.tabs.addTab(self.tab_history, self.tabs.addTab(self.tab_history,
QIcon(':/icons/tx_icon'), QIcon(':/icons/tx_icon'),
......
...@@ -75,12 +75,6 @@ class IdentitiesTabWidget(QWidget, Ui_IdentitiesTab): ...@@ -75,12 +75,6 @@ class IdentitiesTabWidget(QWidget, Ui_IdentitiesTab):
@asyncify @asyncify
@asyncio.coroutine @asyncio.coroutine
def identity_context_menu(self, point): def identity_context_menu(self, point):
def exec_menu(menu):
future = asyncio.Future()
menu.triggered.connect(future.set_result(True))
menu.popup(QCursor.pos())
return future
index = self.table_identities.indexAt(point) index = self.table_identities.indexAt(point)
model = self.table_identities.model() model = self.table_identities.model()
if index.row() < model.rowCount(): if index.row() < model.rowCount():
...@@ -118,7 +112,7 @@ class IdentitiesTabWidget(QWidget, Ui_IdentitiesTab): ...@@ -118,7 +112,7 @@ class IdentitiesTabWidget(QWidget, Ui_IdentitiesTab):
menu.addAction(view_wot) menu.addAction(view_wot)
# Show the context menu. # Show the context menu.
yield from exec_menu(menu) menu.popup(QCursor.pos())
def menu_informations(self): def menu_informations(self):
person = self.sender().data() person = self.sender().data()
......
...@@ -129,6 +129,8 @@ class TransactionsTabWidget(QWidget, Ui_transactionsTabWidget): ...@@ -129,6 +129,8 @@ class TransactionsTabWidget(QWidget, Ui_transactionsTabWidget):
) )
) )
@asyncify
@asyncio.coroutine
def history_context_menu(self, point): def history_context_menu(self, point):
index = self.table_history.indexAt(point) index = self.table_history.indexAt(point)
model = self.table_history.model() model = self.table_history.model()
...@@ -141,9 +143,11 @@ class TransactionsTabWidget(QWidget, Ui_transactionsTabWidget): ...@@ -141,9 +143,11 @@ class TransactionsTabWidget(QWidget, Ui_transactionsTabWidget):
state_data = model.sourceModel().data(state_index, Qt.DisplayRole) state_data = model.sourceModel().data(state_index, Qt.DisplayRole)
pubkey_col = model.sourceModel().columns_types.index('pubkey') pubkey_col = model.sourceModel().columns_types.index('pubkey')
identity_index = model.sourceModel().index(source_index.row(), pubkey_index = model.sourceModel().index(source_index.row(),
pubkey_col) pubkey_col)
identity = model.sourceModel().data(identity_index, Qt.DisplayRole) pubkey = model.sourceModel().data(pubkey_index, Qt.DisplayRole)
identity = yield from self.app.identities_registry.future_find(pubkey, self.community)
transfer = model.sourceModel().transfers[source_index.row()] transfer = model.sourceModel().transfers[source_index.row()]
if state_data == Transfer.REFUSED or state_data == Transfer.TO_SEND: if state_data == Transfer.REFUSED or state_data == Transfer.TO_SEND:
send_back = QAction(self.tr("Send again"), self) send_back = QAction(self.tr("Send again"), self)
...@@ -184,7 +188,7 @@ class TransactionsTabWidget(QWidget, Ui_transactionsTabWidget): ...@@ -184,7 +188,7 @@ class TransactionsTabWidget(QWidget, Ui_transactionsTabWidget):
menu.addAction(copy_pubkey) menu.addAction(copy_pubkey)
# Show the context menu. # Show the context menu.
menu.exec_(QCursor.pos()) menu.popup(QCursor.pos())
def copy_pubkey_to_clipboard(self): def copy_pubkey_to_clipboard(self):
data = self.sender().data() data = self.sender().data()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment