tMerge pull request #1164 from kyuupichan/genfilter - electrum - Electrum Bitcoin wallet (HTM) git clone https://git.parazyd.org/electrum (DIR) Log (DIR) Files (DIR) Refs (DIR) Submodules --- (DIR) commit 1b868a9753dea721987dea3472bee91d0b981790 (DIR) parent f39e213554396757d645bd266328e325a7604385 (HTM) Author: ThomasV <electrumdev@gmail.com> Date: Mon, 27 Apr 2015 17:33:56 +0200 Merge pull request #1164 from kyuupichan/genfilter Search across multiple columns Diffstat: M gui/qt/main_window.py | 10 +++++----- M gui/qt/util.py | 6 ++++-- 2 files changed, 9 insertions(+), 7 deletions(-) --- (DIR) diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py t@@ -1717,15 +1717,15 @@ class ElectrumWindow(QMainWindow): def do_search(self, t): i = self.tabs.currentIndex() if i == 0: - self.history_list.filter(t, 2) + self.history_list.filter(t, [1, 2, 3]) # Date, Description, Amount elif i == 1: - self.invoices_list.filter(t, 2) + self.invoices_list.filter(t, [0, 1, 2, 3]) # Date, Requestor, Description, Amount elif i == 2: - self.receive_list.filter(t, 3) + self.receive_list.filter(t, [0, 1, 2, 3, 4]) # Date, Account, Address, Description, Amount elif i == 3: - self.address_list.filter(t, 1) + self.address_list.filter(t, [0,1, 2]) # Address, Label, Balance elif i == 4: - self.contacts_list.filter(t, 0) + self.contacts_list.filter(t, [0, 1]) # Key, Value def new_contact_dialog(self): (DIR) diff --git a/gui/qt/util.py b/gui/qt/util.py t@@ -340,9 +340,11 @@ class MyTreeWidget(QTreeWidget): for x in self.get_leaves(item): yield x - def filter(self, p, column): + def filter(self, p, columns): + p = unicode(p).lower() for item in self.get_leaves(self.invisibleRootItem()): - item.setHidden(unicode(item.text(column)).lower().find(p) == -1) + item.setHidden(all([unicode(item.text(column)).lower().find(p) == -1 + for column in columns])) class ButtonsWidget(QWidget):