diff --git a/src/cutecoin/gui/community_view.py b/src/cutecoin/gui/community_view.py index 39b822482af2c7cf635916942b928a286c1250ed..3cee35643cc2c95696672e7334ac65ab2a099dd8 100644 --- a/src/cutecoin/gui/community_view.py +++ b/src/cutecoin/gui/community_view.py @@ -59,6 +59,9 @@ class CommunityWidget(QWidget, Ui_CommunityWidget): 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.tab_identities.money_sent.connect(lambda: self.tab_history.table_history.model().sourceModel().refresh_transfers()) + self.tab_wot.money_sent.connect(lambda: self.tab_history.table_history.model().sourceModel().refresh_transfers()) + self.tabs.addTab(self.tab_history, QIcon(':/icons/tx_icon'), diff --git a/src/cutecoin/gui/identities_tab.py b/src/cutecoin/gui/identities_tab.py index d8b40b4a70b6483e7457b0d95228f770b9b84d14..4121bc1fcd8354f0e9249ee2b67dc98e72d46fc6 100644 --- a/src/cutecoin/gui/identities_tab.py +++ b/src/cutecoin/gui/identities_tab.py @@ -27,6 +27,7 @@ class IdentitiesTabWidget(QWidget, Ui_IdentitiesTab): classdocs """ view_in_wot = pyqtSignal(Identity) + money_sent = pyqtSignal() def __init__(self, app): """ @@ -158,8 +159,7 @@ class IdentitiesTabWidget(QWidget, Ui_IdentitiesTab): result = TransferMoneyDialog.send_money_to_identity(self.app, self.account, self.password_asker, self.community, identity) if result == QDialog.Accepted: - currency_tab = self.window().currencies_tabwidget.currentWidget() - currency_tab.tab_history.table_history.model().sourceModel().refresh_transfers() + self.money_sent.emit() def certify_identity(self, identity): CertificationDialog.certify_identity(self.app, self.account, self.password_asker, diff --git a/src/cutecoin/gui/mainwindow.py b/src/cutecoin/gui/mainwindow.py index 9a716c1698c91c0ecde31ac74afb6842cabdee7e..50b6b2261c5f98a4e844770a2d147445280432f2 100644 --- a/src/cutecoin/gui/mainwindow.py +++ b/src/cutecoin/gui/mainwindow.py @@ -294,8 +294,8 @@ class MainWindow(QMainWindow, Ui_MainWindow): """ logging.debug("Refresh started") self.refresh_accounts() - self.homescreen.show() self.community_view.hide() + self.homescreen.show() self.homescreen.refresh() if self.app.current_account is None: diff --git a/src/cutecoin/gui/transactions_tab.py b/src/cutecoin/gui/transactions_tab.py index ac380a11539cc3e33b599c10ac7891138f3d39cc..f452b6694a52121330285acf471ba264156208d8 100644 --- a/src/cutecoin/gui/transactions_tab.py +++ b/src/cutecoin/gui/transactions_tab.py @@ -161,7 +161,7 @@ class TransactionsTabWidget(QWidget, Ui_transactionsTabWidget): 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: send_back = QAction(self.tr("Send again"), self) send_back.triggered.connect(self.send_again) @@ -244,8 +244,7 @@ class TransactionsTabWidget(QWidget, Ui_transactionsTabWidget): result = TransferMoneyDialog.send_money_to_identity(self.app, self.account, self.password_asker, self.community, identity) if result == QDialog.Accepted: - currency_tab = self.window().currencies_tabwidget.currentWidget() - currency_tab.tab_history.table_history.model().sourceModel().refresh_transfers() + self.table_history.model().sourceModel().refresh_transfers() def certify_identity(self, identity): CertificationDialog.certify_identity(self.app, self.account, self.password_asker, diff --git a/src/cutecoin/gui/wot_tab.py b/src/cutecoin/gui/wot_tab.py index b3457d2fe1e7272882702f10e926909d66cd1b0c..2a6548cfcc9ed2a797fd9b50d24d6938084a8b8a 100644 --- a/src/cutecoin/gui/wot_tab.py +++ b/src/cutecoin/gui/wot_tab.py @@ -3,7 +3,7 @@ import logging import asyncio from PyQt5.QtWidgets import QWidget, QComboBox, QDialog -from PyQt5.QtCore import pyqtSlot, QEvent, QLocale, QDateTime +from PyQt5.QtCore import pyqtSlot, QEvent, QLocale, QDateTime, pyqtSignal from ..tools.exceptions import MembershipNotFoundError from ..tools.decorators import asyncify, once_at_a_time, cancel_once_task @@ -20,6 +20,9 @@ from cutecoin.gui.views.wot import NODE_STATUS_HIGHLIGHTED, NODE_STATUS_SELECTED class WotTabWidget(QWidget, Ui_WotTabWidget): + + money_sent = pyqtSignal() + def __init__(self, app): """ :param cutecoin.core.app.Application app: Application instance