Added history to lite view.
[electrum-nvc.git] / lib / history_widget.py
1 from PyQt4.QtGui import *
2 from i18n import _
3
4 class HistoryWidget(QTreeWidget):
5
6     def __init__(self, parent=None):
7         QTreeWidget.__init__(self, parent)
8         self.setColumnCount(2)
9         self.setHeaderLabels([_("Amount"), _("To / From")])
10         self.setIndentation(0)
11
12     def append(self, address, amount):
13         if amount >= 0:
14             display_amount = "+%s" % amount
15         else:
16             display_amount = "-%s" % (-amount)
17         item = QTreeWidgetItem([display_amount, address])
18         self.insertTopLevelItem(0, item)
19