Browse Source
qt tabs: restore filter state after refresh
regtest_lnd
SomberNight
6 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
7 changed files with
10 additions and
6 deletions
-
electrum/gui/qt/address_list.py
-
electrum/gui/qt/contact_list.py
-
electrum/gui/qt/history_list.py
-
electrum/gui/qt/invoice_list.py
-
electrum/gui/qt/request_list.py
-
electrum/gui/qt/util.py
-
electrum/gui/qt/utxo_list.py
|
|
@ -173,6 +173,7 @@ class AddressList(MyTreeView): |
|
|
|
self.showColumn(self.Columns.FIAT_BALANCE) |
|
|
|
else: |
|
|
|
self.hideColumn(self.Columns.FIAT_BALANCE) |
|
|
|
self.filter() |
|
|
|
|
|
|
|
def create_menu(self, position): |
|
|
|
from electrum.wallet import Multisig_Wallet |
|
|
|
|
|
@ -121,4 +121,5 @@ class ContactList(MyTreeView): |
|
|
|
self.set_current_idx(set_current) |
|
|
|
# FIXME refresh loses sort order; so set "default" here: |
|
|
|
self.sortByColumn(self.Columns.NAME, Qt.AscendingOrder) |
|
|
|
self.filter() |
|
|
|
run_hook('update_contacts_tab', self) |
|
|
|
|
|
@ -249,9 +249,7 @@ class HistoryModel(QAbstractItemModel, PrintError): |
|
|
|
self.endInsertRows() |
|
|
|
if selected_row: |
|
|
|
self.view.selectionModel().select(self.createIndex(selected_row, 0), QItemSelectionModel.Rows | QItemSelectionModel.SelectCurrent) |
|
|
|
f = self.view.current_filter |
|
|
|
if f: |
|
|
|
self.view.filter(f) |
|
|
|
self.view.filter() |
|
|
|
# update summary |
|
|
|
self.summary = r['summary'] |
|
|
|
if not self.view.years and self.transactions: |
|
|
|
|
|
@ -89,6 +89,7 @@ class InvoiceList(MyTreeView): |
|
|
|
b = len(inv_list) > 0 |
|
|
|
self.setVisible(b) |
|
|
|
self.parent.invoices_label.setVisible(b) |
|
|
|
self.filter() |
|
|
|
|
|
|
|
def import_invoices(self): |
|
|
|
import_meta_gui(self.parent, _('invoices'), self.parent.invoices.import_file, self.update) |
|
|
|
|
|
@ -135,6 +135,7 @@ class RequestList(MyTreeView): |
|
|
|
items[self.Columns.STATUS].setIcon(read_QIcon(pr_icons.get(status))) |
|
|
|
items[self.Columns.DESCRIPTION].setData(address, Qt.UserRole) |
|
|
|
self.model().insertRow(self.model().rowCount(), items) |
|
|
|
self.filter() |
|
|
|
|
|
|
|
def create_menu(self, position): |
|
|
|
idx = self.indexAt(position) |
|
|
|
|
|
@ -547,9 +547,10 @@ class MyTreeView(QTreeView): |
|
|
|
# we did not find the filter in any columns, hide the item |
|
|
|
self.setRowHidden(row_num, QModelIndex(), True) |
|
|
|
|
|
|
|
def filter(self, p): |
|
|
|
p = p.lower() |
|
|
|
self.current_filter = p |
|
|
|
def filter(self, p=None): |
|
|
|
if p is not None: |
|
|
|
p = p.lower() |
|
|
|
self.current_filter = p |
|
|
|
self.hide_rows() |
|
|
|
|
|
|
|
def hide_rows(self): |
|
|
|
|
|
@ -69,6 +69,7 @@ class UTXOList(MyTreeView): |
|
|
|
self.update_headers(self.__class__.headers) |
|
|
|
for idx, x in enumerate(utxos): |
|
|
|
self.insert_utxo(idx, x) |
|
|
|
self.filter() |
|
|
|
|
|
|
|
def insert_utxo(self, idx, x): |
|
|
|
address = x['address'] |
|
|
|