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

Fixing the way we handle person change and wot tab refresh

parent 4a050f6a
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,7 @@ class CommunityTabWidget(QWidget, Ui_CommunityTabWidget):
classdocs
'''
def __init__(self, account, community, password_asker):
def __init__(self, app, account, community, password_asker):
'''
Constructor
'''
......@@ -50,7 +50,7 @@ class CommunityTabWidget(QWidget, Ui_CommunityTabWidget):
self.button_membership.setText("Send membership demand")
self.button_leaving.hide()
self.wot_tab = WotTabWidget(account, community, password_asker, self)
self.wot_tab = WotTabWidget(app, account, community, password_asker, self)
self.tabs_information.addTab(self.wot_tab, QIcon(':/icons/wot_icon'), "WoT")
def member_context_menu(self, point):
......
......@@ -36,7 +36,8 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget):
self.community = community
self.password_asker = password_asker
self.status_label = status_label
self.tab_community = CommunityTabWidget(self.app.current_account,
self.tab_community = CommunityTabWidget(self.app,
self.app.current_account,
self.community,
self.password_asker)
......@@ -100,7 +101,8 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget):
QIcon(':/icons/tx_icon'),
"Transactions")
self.tab_community = CommunityTabWidget(self.app.current_account,
self.tab_community = CommunityTabWidget(self.app,
self.app.current_account,
self.community,
self.password_asker)
self.tabs_account.addTab(self.tab_community,
......@@ -140,9 +142,6 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget):
if self.tab_wallets:
self.tab_wallets.refresh()
if self.tab_community:
self.tab_community.wot_tab.refresh()
if self.tab_history.table_history.model():
self.tab_history.table_history.model().dataChanged.emit(
QModelIndex(),
......
......@@ -3,6 +3,7 @@
import logging
from cutecoin.core.graph import Graph
from PyQt5.QtWidgets import QWidget, QComboBox
from PyQt5.QtCore import pyqtSlot
from ..gen_resources.wot_tab_uic import Ui_WotTabWidget
from cutecoin.gui.views.wot import NODE_STATUS_HIGHLIGHTED, NODE_STATUS_SELECTED, NODE_STATUS_OUT, ARC_STATUS_STRONG, ARC_STATUS_WEAK
from ucoinpy.api import bma
......@@ -10,7 +11,7 @@ from cutecoin.core.person import Person
class WotTabWidget(QWidget, Ui_WotTabWidget):
def __init__(self, account, community, password_asker, parent=None):
def __init__(self, app, account, community, password_asker, parent=None):
"""
:param cutecoin.core.account.Account account:
......@@ -37,6 +38,7 @@ class WotTabWidget(QWidget, Ui_WotTabWidget):
self.graphicsView.scene().node_contact.connect(self.add_node_as_contact)
self.graphicsView.scene().node_member.connect(self.member_informations)
app.monitor.persons_watcher(community).person_changed.connect(self.handle_person_change)
self.account = account
self.community = community
self.password_asker = password_asker
......@@ -106,6 +108,11 @@ class WotTabWidget(QWidget, Ui_WotTabWidget):
"""
self.draw_graph(self._current_metadata)
@pyqtSlot(str)
def handle_person_change(self, pubkey):
if pubkey == self._current_metadata['id']:
self.refresh()
def search(self):
"""
Search nodes when return is pressed in combobox lineEdit
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment