|
@ -28,7 +28,9 @@ from electrum.plugins import run_hook |
|
|
class HistoryWidget(MyTreeWidget): |
|
|
class HistoryWidget(MyTreeWidget): |
|
|
|
|
|
|
|
|
def __init__(self, parent=None): |
|
|
def __init__(self, parent=None): |
|
|
MyTreeWidget.__init__(self, parent, self.create_menu, ['', '', _('Date'), _('Description') , _('Amount'), _('Balance')], 3) |
|
|
headers = ['', '', _('Date'), _('Description') , _('Amount'), _('Balance')] |
|
|
|
|
|
run_hook('history_tab_headers', headers) |
|
|
|
|
|
MyTreeWidget.__init__(self, parent, self.create_menu, headers, 3) |
|
|
self.setColumnHidden(1, True) |
|
|
self.setColumnHidden(1, True) |
|
|
self.config = self.parent.config |
|
|
self.config = self.parent.config |
|
|
self.setSortingEnabled(False) |
|
|
self.setSortingEnabled(False) |
|
@ -63,11 +65,12 @@ class HistoryWidget(MyTreeWidget): |
|
|
v_str = self.parent.format_amount(value, True, whitespaces=True) |
|
|
v_str = self.parent.format_amount(value, True, whitespaces=True) |
|
|
balance_str = self.parent.format_amount(balance, whitespaces=True) |
|
|
balance_str = self.parent.format_amount(balance, whitespaces=True) |
|
|
label, is_default_label = self.wallet.get_label(tx_hash) |
|
|
label, is_default_label = self.wallet.get_label(tx_hash) |
|
|
item = EditableItem(['', tx_hash, time_str, label, v_str, balance_str]) |
|
|
entry = ['', tx_hash, time_str, label, v_str, balance_str] |
|
|
|
|
|
run_hook('history_tab_update', tx, entry) |
|
|
|
|
|
item = EditableItem(entry) |
|
|
item.setIcon(0, icon) |
|
|
item.setIcon(0, icon) |
|
|
item.setFont(3, QFont(MONOSPACE_FONT)) |
|
|
for i in range(len(entry)): |
|
|
item.setFont(4, QFont(MONOSPACE_FONT)) |
|
|
item.setFont(i, QFont(MONOSPACE_FONT)) |
|
|
item.setFont(5, QFont(MONOSPACE_FONT)) |
|
|
|
|
|
if value < 0: |
|
|
if value < 0: |
|
|
item.setForeground(4, QBrush(QColor("#BC1E1E"))) |
|
|
item.setForeground(4, QBrush(QColor("#BC1E1E"))) |
|
|
if tx_hash: |
|
|
if tx_hash: |
|
@ -78,7 +81,6 @@ class HistoryWidget(MyTreeWidget): |
|
|
if current_tx == tx_hash: |
|
|
if current_tx == tx_hash: |
|
|
self.setCurrentItem(item) |
|
|
self.setCurrentItem(item) |
|
|
entries.append((item, tx)) |
|
|
entries.append((item, tx)) |
|
|
run_hook('history_tab_update', self.parent, entries) |
|
|
|
|
|
|
|
|
|
|
|
def update_item(self, tx_hash, conf, timestamp): |
|
|
def update_item(self, tx_hash, conf, timestamp): |
|
|
icon, time_str = self.get_icon(conf, timestamp) |
|
|
icon, time_str = self.get_icon(conf, timestamp) |
|
|