tfix: update history when label changed - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 27f4a0c28e9b07f59342fdb790243ebb4f25b008 DIR parent ada24d24632ac49b431e1e02d0ca8ee14e161fdf HTML Author: ThomasV <thomasv@gitorious> Date: Wed, 17 Oct 2012 07:18:48 +0200 fix: update history when label changed Diffstat: M lib/gui_qt.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) --- DIR diff --git a/lib/gui_qt.py b/lib/gui_qt.py t@@ -408,19 +408,29 @@ class ElectrumWindow(QMainWindow): def address_label_changed(self, item, column, l, column_addr, column_label): addr = unicode( item.text(column_addr) ) text = unicode( item.text(column_label) ) + changed = False + if text: if text not in self.wallet.aliases.keys(): - self.wallet.labels[addr] = text + old_addr = self.wallet.labels.get(text) + if old_addr != addr: + self.wallet.labels[addr] = text + changed = True else: print_error("Error: This is one of your aliases") label = self.wallet.labels.get(addr,'') item.setText(column_label, QString(label)) else: s = self.wallet.labels.get(addr) - if s: self.wallet.labels.pop(addr) + if s: + self.wallet.labels.pop(addr) + changed = True + + if changed: + self.wallet.update_tx_labels() + self.update_history_tab() + self.update_completions() - self.update_history_tab() - self.update_completions() def update_history_tab(self): self.history_list.clear()