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

Signal money_sent to refresh transfers table

parent b755651e
No related branches found
No related tags found
No related merge requests found
...@@ -59,6 +59,9 @@ class CommunityWidget(QWidget, Ui_CommunityWidget): ...@@ -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_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(self.tab_wot.draw_graph)
self.tab_history.view_in_wot.connect(lambda: self.tabs.setCurrentWidget(self.tab_wot)) 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, self.tabs.addTab(self.tab_history,
QIcon(':/icons/tx_icon'), QIcon(':/icons/tx_icon'),
......
...@@ -27,6 +27,7 @@ class IdentitiesTabWidget(QWidget, Ui_IdentitiesTab): ...@@ -27,6 +27,7 @@ class IdentitiesTabWidget(QWidget, Ui_IdentitiesTab):
classdocs classdocs
""" """
view_in_wot = pyqtSignal(Identity) view_in_wot = pyqtSignal(Identity)
money_sent = pyqtSignal()
def __init__(self, app): def __init__(self, app):
""" """
...@@ -158,8 +159,7 @@ class IdentitiesTabWidget(QWidget, Ui_IdentitiesTab): ...@@ -158,8 +159,7 @@ class IdentitiesTabWidget(QWidget, Ui_IdentitiesTab):
result = TransferMoneyDialog.send_money_to_identity(self.app, self.account, self.password_asker, result = TransferMoneyDialog.send_money_to_identity(self.app, self.account, self.password_asker,
self.community, identity) self.community, identity)
if result == QDialog.Accepted: if result == QDialog.Accepted:
currency_tab = self.window().currencies_tabwidget.currentWidget() self.money_sent.emit()
currency_tab.tab_history.table_history.model().sourceModel().refresh_transfers()
def certify_identity(self, identity): def certify_identity(self, identity):
CertificationDialog.certify_identity(self.app, self.account, self.password_asker, CertificationDialog.certify_identity(self.app, self.account, self.password_asker,
......
...@@ -294,8 +294,8 @@ class MainWindow(QMainWindow, Ui_MainWindow): ...@@ -294,8 +294,8 @@ class MainWindow(QMainWindow, Ui_MainWindow):
""" """
logging.debug("Refresh started") logging.debug("Refresh started")
self.refresh_accounts() self.refresh_accounts()
self.homescreen.show()
self.community_view.hide() self.community_view.hide()
self.homescreen.show()
self.homescreen.refresh() self.homescreen.refresh()
if self.app.current_account is None: if self.app.current_account is None:
......
...@@ -161,7 +161,7 @@ class TransactionsTabWidget(QWidget, Ui_transactionsTabWidget): ...@@ -161,7 +161,7 @@ class TransactionsTabWidget(QWidget, Ui_transactionsTabWidget):
pubkey = model.sourceModel().data(pubkey_index, Qt.DisplayRole) pubkey = model.sourceModel().data(pubkey_index, Qt.DisplayRole)
identity = yield from self.app.identities_registry.future_find(pubkey, self.community) 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)
send_back.triggered.connect(self.send_again) send_back.triggered.connect(self.send_again)
...@@ -244,8 +244,7 @@ class TransactionsTabWidget(QWidget, Ui_transactionsTabWidget): ...@@ -244,8 +244,7 @@ class TransactionsTabWidget(QWidget, Ui_transactionsTabWidget):
result = TransferMoneyDialog.send_money_to_identity(self.app, self.account, self.password_asker, result = TransferMoneyDialog.send_money_to_identity(self.app, self.account, self.password_asker,
self.community, identity) self.community, identity)
if result == QDialog.Accepted: if result == QDialog.Accepted:
currency_tab = self.window().currencies_tabwidget.currentWidget() self.table_history.model().sourceModel().refresh_transfers()
currency_tab.tab_history.table_history.model().sourceModel().refresh_transfers()
def certify_identity(self, identity): def certify_identity(self, identity):
CertificationDialog.certify_identity(self.app, self.account, self.password_asker, CertificationDialog.certify_identity(self.app, self.account, self.password_asker,
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import logging import logging
import asyncio import asyncio
from PyQt5.QtWidgets import QWidget, QComboBox, QDialog 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.exceptions import MembershipNotFoundError
from ..tools.decorators import asyncify, once_at_a_time, cancel_once_task 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 ...@@ -20,6 +20,9 @@ from cutecoin.gui.views.wot import NODE_STATUS_HIGHLIGHTED, NODE_STATUS_SELECTED
class WotTabWidget(QWidget, Ui_WotTabWidget): class WotTabWidget(QWidget, Ui_WotTabWidget):
money_sent = pyqtSignal()
def __init__(self, app): def __init__(self, app):
""" """
:param cutecoin.core.app.Application app: Application instance :param cutecoin.core.app.Application app: Application instance
......
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