From f74a760b45f0b57ba5704c412b3ec7df18d6b3f9 Mon Sep 17 00:00:00 2001 From: Inso <insomniak.fr@gmail.com> Date: Thu, 7 May 2015 18:56:39 +0200 Subject: [PATCH] System Notifications : OK (Issue #100) --- src/cutecoin/core/wallet.py | 4 ++-- src/cutecoin/gui/currency_tab.py | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/cutecoin/core/wallet.py b/src/cutecoin/core/wallet.py index 2f43ea25..145ae112 100644 --- a/src/cutecoin/core/wallet.py +++ b/src/cutecoin/core/wallet.py @@ -10,7 +10,7 @@ from ucoinpy.documents.block import Block from ucoinpy.documents.transaction import InputSource, OutputSource, Transaction from ucoinpy.key import SigningKey -from ..tools.exceptions import NotEnoughMoneyError, Error, NoPeerAvailable, PersonNotFoundError +from ..tools.exceptions import NotEnoughMoneyError, NoPeerAvailable, PersonNotFoundError from .transfer import Transfer, Received from .person import Person @@ -140,6 +140,7 @@ class Cache(): self._parse_transaction(community, tx, block_number, block_doc.mediantime, received_list) + logging.debug("Received {0} transactions".format(len(received_list))) awaiting = [t for t in self._transfers if t.state == Transfer.AWAITING] # After we checked all transactions, we check if @@ -151,7 +152,6 @@ class Cache(): def refresh(self, community, received_list): current_block = 0 - received_list = [] try: block_data = community.current_blockid() current_block = block_data['number'] diff --git a/src/cutecoin/gui/currency_tab.py b/src/cutecoin/gui/currency_tab.py index 7f090c63..90c64dbd 100644 --- a/src/cutecoin/gui/currency_tab.py +++ b/src/cutecoin/gui/currency_tab.py @@ -162,6 +162,7 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget): self.tab_history.progressbar.hide() self.refresh_status() + self.tab_history.refresh_balance() @pyqtSlot() def refresh_status(self): @@ -180,14 +181,17 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget): @pyqtSlot(list) def notify_transfers(self, transfers_list): - text = self.tr("Received {0} {1}") + transfers_txt = "" amount = 0 currency = self.community.name for t in transfers_list: amount += t.metadata['amount'] - text += """{0} -""".format(t.metadata['uid']) - text.format(amount, currency) + + logging.debug(transfers_txt) + text = self.tr("Received {0} {1} from {2} transfers").format(amount, + currency, + len(transfers_list)) + text += transfers_txt toast.display(self.tr("New transactions received"), text) def refresh_wallets(self): -- GitLab