From 5ce871ef55697ef8c2500eb8b405c3a10f65b085 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Wed, 4 Oct 2017 14:21:45 +0200 Subject: [PATCH] fix: editing labels in [QT GUI] Addresses tab for headings resulted in errors --- gui/qt/address_list.py | 3 +++ plugins/labels/labels.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/gui/qt/address_list.py b/gui/qt/address_list.py index c37c3c17..c5587a93 100644 --- a/gui/qt/address_list.py +++ b/gui/qt/address_list.py @@ -158,3 +158,6 @@ class AddressList(MyTreeWidget): run_hook('receive_menu', menu, addrs, self.wallet) menu.exec_(self.viewport().mapToGlobal(position)) + def on_permit_edit(self, item, column): + # labels for headings, e.g. "receiving" or "used" should not be editable + return item.childCount() == 0 diff --git a/plugins/labels/labels.py b/plugins/labels/labels.py index 3e435a13..88a24c59 100644 --- a/plugins/labels/labels.py +++ b/plugins/labels/labels.py @@ -47,6 +47,8 @@ class LabelsPlugin(BasePlugin): def set_label(self, wallet, item, label): if not wallet in self.wallets: return + if not item: + return nonce = self.get_nonce(wallet) wallet_id = self.wallets[wallet][2] bundle = {"walletId": wallet_id,