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 ...@@ -10,7 +10,7 @@ from ucoinpy.documents.block import Block
from ucoinpy.documents.transaction import InputSource, OutputSource, Transaction from ucoinpy.documents.transaction import InputSource, OutputSource, Transaction
from ucoinpy.key import SigningKey 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 .transfer import Transfer, Received
from .person import Person from .person import Person
...@@ -140,6 +140,7 @@ class Cache(): ...@@ -140,6 +140,7 @@ class Cache():
self._parse_transaction(community, tx, block_number, self._parse_transaction(community, tx, block_number,
block_doc.mediantime, received_list) block_doc.mediantime, received_list)
logging.debug("Received {0} transactions".format(len(received_list)))
awaiting = [t for t in self._transfers awaiting = [t for t in self._transfers
if t.state == Transfer.AWAITING] if t.state == Transfer.AWAITING]
# After we checked all transactions, we check if # After we checked all transactions, we check if
...@@ -151,7 +152,6 @@ class Cache(): ...@@ -151,7 +152,6 @@ class Cache():
def refresh(self, community, received_list): def refresh(self, community, received_list):
current_block = 0 current_block = 0
received_list = []
try: try:
block_data = community.current_blockid() block_data = community.current_blockid()
current_block = block_data['number'] current_block = block_data['number']
......
...@@ -162,6 +162,7 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget): ...@@ -162,6 +162,7 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget):
self.tab_history.progressbar.hide() self.tab_history.progressbar.hide()
self.refresh_status() self.refresh_status()
self.tab_history.refresh_balance()
@pyqtSlot() @pyqtSlot()
def refresh_status(self): def refresh_status(self):
...@@ -180,14 +181,17 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget): ...@@ -180,14 +181,17 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget):
@pyqtSlot(list) @pyqtSlot(list)
def notify_transfers(self, transfers_list): def notify_transfers(self, transfers_list):
text = self.tr("Received {0} {1}") transfers_txt = ""
amount = 0 amount = 0
currency = self.community.name currency = self.community.name
for t in transfers_list: for t in transfers_list:
amount += t.metadata['amount'] amount += t.metadata['amount']
text += """{0}
""".format(t.metadata['uid']) logging.debug(transfers_txt)
text.format(amount, currency) 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) toast.display(self.tr("New transactions received"), text)
def refresh_wallets(self): def refresh_wallets(self):
......
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