From c90b2497f580cc38ef2fd1e4ccc46bdbfdd70752 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Mon, 10 Oct 2016 10:32:47 +0200 Subject: [PATCH] in-place labels update (fix #1841) --- gui/qt/history_list.py | 9 +++++++++ gui/qt/util.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gui/qt/history_list.py b/gui/qt/history_list.py index b38a6082..1ac05f2f 100644 --- a/gui/qt/history_list.py +++ b/gui/qt/history_list.py @@ -95,6 +95,15 @@ class HistoryList(MyTreeWidget): if current_tx == tx_hash: self.setCurrentItem(item) + def update_labels(self): + root = self.invisibleRootItem() + child_count = root.childCount() + for i in range(child_count): + item = root.child(i) + txid = str(item.data(0, Qt.UserRole).toString()) + label = self.wallet.get_label(txid) + item.setText(3, label) + def update_item(self, tx_hash, height, conf, timestamp): status, status_str = self.wallet.get_tx_status(tx_hash, height, conf, timestamp) icon = QIcon(":icons/" + TX_ICONS[status]) diff --git a/gui/qt/util.py b/gui/qt/util.py index 95311e69..b0065eaa 100644 --- a/gui/qt/util.py +++ b/gui/qt/util.py @@ -472,7 +472,7 @@ class MyTreeWidget(QTreeWidget): key = str(item.data(0, Qt.UserRole).toString()) text = unicode(item.text(column)) self.parent.wallet.set_label(key, text) - self.parent.history_list.update() + self.parent.history_list.update_labels() self.parent.update_completions() def update(self):