Browse Source

wrap list updates in setUpdatesEnabled()

master
ThomasV 9 years ago
parent
commit
cd65516ff0
  1. 5
      gui/qt/history_list.py
  2. 2
      gui/qt/util.py

5
gui/qt/history_list.py

@ -30,7 +30,7 @@ from util import *
from electrum.i18n import _
from electrum.util import block_explorer_URL, format_satoshis, format_time
from electrum.plugins import run_hook
from electrum.util import timestamp_to_datetime
from electrum.util import timestamp_to_datetime, profiler
TX_ICONS = [
@ -66,16 +66,15 @@ class HistoryList(MyTreeWidget):
'''Replaced in address_dialog.py'''
return self.wallet.get_addresses()
@profiler
def on_update(self):
self.wallet = self.parent.wallet
h = self.wallet.get_history(self.get_domain())
item = self.currentItem()
current_tx = item.data(0, Qt.UserRole).toString() if item else None
self.clear()
fx = self.parent.fx
fx.history_used_spot = False
for h_item in h:
tx_hash, height, conf, timestamp, value, balance = h_item
status, status_str = self.wallet.get_tx_status(tx_hash, height, conf, timestamp)

2
gui/qt/util.py

@ -474,7 +474,9 @@ class MyTreeWidget(QTreeWidget):
if self.editor:
self.pending_update = True
else:
self.setUpdatesEnabled(False)
self.on_update()
self.setUpdatesEnabled(True)
def on_update(self):
pass

Loading…
Cancel
Save