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

Refresh tabs with cancel of transaction

parent 38a7ff59
No related branches found
No related tags found
No related merge requests found
...@@ -35,6 +35,7 @@ class Application(QObject): ...@@ -35,6 +35,7 @@ class Application(QObject):
version_requested = pyqtSignal() version_requested = pyqtSignal()
view_identity_in_wot = pyqtSignal(Identity) view_identity_in_wot = pyqtSignal(Identity)
refresh_transfers = pyqtSignal()
def __init__(self, qapp, loop, identities_registry): def __init__(self, qapp, loop, identities_registry):
""" """
......
...@@ -62,6 +62,7 @@ class TransactionsTabWidget(QObject): ...@@ -62,6 +62,7 @@ class TransactionsTabWidget(QObject):
model.modelAboutToBeReset.connect(lambda: self.ui.table_history.setEnabled(False)) model.modelAboutToBeReset.connect(lambda: self.ui.table_history.setEnabled(False))
model.modelReset.connect(lambda: self.ui.table_history.setEnabled(True)) model.modelReset.connect(lambda: self.ui.table_history.setEnabled(True))
self.app.refresh_transfers.connect(self.refresh)
self.ui.progressbar.hide() self.ui.progressbar.hide()
self.refresh() self.refresh()
......
...@@ -144,8 +144,7 @@ class ContextMenu(QObject): ...@@ -144,8 +144,7 @@ class ContextMenu(QObject):
async def send_money(self, identity): async def send_money(self, identity):
await TransferMoneyDialog.send_money_to_identity(self._app, self._account, self._password_asker, await TransferMoneyDialog.send_money_to_identity(self._app, self._account, self._password_asker,
self._community, identity) self._community, identity)
#TODO: Send signal from account to refresh transfers self._app.refresh_transfers.emit()
#self.ui.table_history.model().sourceModel().refresh_transfers()
def view_wot(self, identity): def view_wot(self, identity):
self.view_identity_in_wot.emit(identity) self.view_identity_in_wot.emit(identity)
...@@ -159,18 +158,16 @@ class ContextMenu(QObject): ...@@ -159,18 +158,16 @@ class ContextMenu(QObject):
async def send_again(self, transfer): async def send_again(self, transfer):
await TransferMoneyDialog.send_transfer_again(self._app, self._app.current_account, await TransferMoneyDialog.send_transfer_again(self._app, self._app.current_account,
self._password_asker, self._community, transfer) self._password_asker, self._community, transfer)
#TODO: Send signal from account to refresh transfers self._app.refresh_transfers.emit()
#self.ui.table_history.model().sourceModel().refresh_transfers()
def cancel_transfer(self, transfer): def cancel_transfer(self, transfer):
reply = QMessageBox.warning(self, self.tr("Warning"), reply = QMessageBox.warning(self.qmenu, self.tr("Warning"),
self.tr("""Are you sure ? self.tr("""Are you sure ?
This money transfer will be removed and not sent."""), This money transfer will be removed and not sent."""),
QMessageBox.Ok | QMessageBox.Cancel) QMessageBox.Ok | QMessageBox.Cancel)
if reply == QMessageBox.Ok: if reply == QMessageBox.Ok:
transfer.cancel() transfer.cancel()
#TODO: Send signal from transfer to refresh transfers self._app.refresh_transfers.emit()
#self.ui.table_history.model().sourceModel().refresh_transfers()
@asyncify @asyncify
async def copy_transaction_to_clipboard(self, tx): async def copy_transaction_to_clipboard(self, tx):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment