mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 17:31:36 +00:00
qt tabs: restore filter state after refresh
This commit is contained in:
parent
1110f13c62
commit
46a236f167
7 changed files with 10 additions and 6 deletions
|
@ -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']
|
||||
|
|
Loading…
Add table
Reference in a new issue