1
0

separate core and gui in different modules

This commit is contained in:
thomasv
2013-03-02 12:26:21 +01:00
parent f9f59d8dff
commit a563091f30
17 changed files with 53 additions and 1072 deletions

26
gui/history_widget.py Normal file
View File

@@ -0,0 +1,26 @@
from PyQt4.QtGui import *
from i18n import _
class HistoryWidget(QTreeWidget):
def __init__(self, parent=None):
QTreeWidget.__init__(self, parent)
self.setColumnCount(2)
self.setHeaderLabels([_("Amount"), _("To / From"), _("When")])
self.setIndentation(0)
def empty(self):
self.clear()
def append(self, address, amount, date):
if address is None:
address = _("Unknown")
if amount is None:
amount = _("Unknown")
if date is None:
date = _("Unknown")
item = QTreeWidgetItem([amount, address, date])
if float(amount) < 0:
item.setForeground(0, QBrush(QColor("#BC1E1E")))
self.insertTopLevelItem(0, item)