You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
746 B
27 lines
746 B
13 years ago
|
from PyQt4.QtGui import *
|
||
|
from i18n import _
|
||
|
|
||
|
class HistoryWidget(QTreeWidget):
|
||
|
|
||
|
def __init__(self, parent=None):
|
||
|
QTreeWidget.__init__(self, parent)
|
||
|
self.setColumnCount(2)
|
||
12 years ago
|
self.setHeaderLabels([_("Amount"), _("To / From"), _("When")])
|
||
13 years ago
|
self.setIndentation(0)
|
||
|
|
||
12 years ago
|
def empty(self):
|
||
|
self.clear()
|
||
|
|
||
|
def append(self, address, amount, date):
|
||
12 years ago
|
if address is None:
|
||
12 years ago
|
address = _("Unknown")
|
||
12 years ago
|
if amount is None:
|
||
12 years ago
|
amount = _("Unknown")
|
||
12 years ago
|
if date is None:
|
||
12 years ago
|
date = _("Unknown")
|
||
12 years ago
|
item = QTreeWidgetItem([amount, address, date])
|
||
12 years ago
|
if float(amount) < 0:
|
||
12 years ago
|
item.setForeground(0, QBrush(QColor("#BC1E1E")))
|
||
13 years ago
|
self.insertTopLevelItem(0, item)
|
||
|
|