Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run history_list_filter hook on updated labels #1990

Merged
merged 4 commits into from
Sep 12, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions gui/qt/history_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,18 @@ def update_labels(self):
return
root = self.invisibleRootItem()
child_count = root.childCount()
filtered_list = []
for i in range(child_count):
item = root.child(i)
txid = item.data(0, Qt.UserRole)
label = self.wallet.get_label(txid)
item.setText(3, label)
filtered = run_hook("history_list_filter", self, item, label, multi=True) or []
cculianu marked this conversation as resolved.
Show resolved Hide resolved
if any(filtered):
filtered_list.append(item)

for item in filtered_list:
root.removeChild(item)

def update_item(self, tx_hash, height, conf, timestamp):
if not self.wallet: return # can happen on startup if this is called before self.on_update()
Expand Down