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

System Notifications : OK (Issue #100)

parent 891dc126
No related branches found
No related tags found
No related merge requests found
......@@ -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']
......
......@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment