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):
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'),
......
......@@ -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,
......
......@@ -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:
......
......@@ -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,
......
......@@ -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
......
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