Browse Source

qt tabs: restore filter state after refresh

regtest_lnd
SomberNight 6 years ago
parent
commit
46a236f167
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 1
      electrum/gui/qt/address_list.py
  2. 1
      electrum/gui/qt/contact_list.py
  3. 4
      electrum/gui/qt/history_list.py
  4. 1
      electrum/gui/qt/invoice_list.py
  5. 1
      electrum/gui/qt/request_list.py
  6. 3
      electrum/gui/qt/util.py
  7. 1
      electrum/gui/qt/utxo_list.py

1
electrum/gui/qt/address_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

1
electrum/gui/qt/contact_list.py

@ -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)

4
electrum/gui/qt/history_list.py

@ -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:

1
electrum/gui/qt/invoice_list.py

@ -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)

1
electrum/gui/qt/request_list.py

@ -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)

3
electrum/gui/qt/util.py

@ -547,7 +547,8 @@ 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):
def filter(self, p=None):
if p is not None:
p = p.lower()
self.current_filter = p
self.hide_rows()

1
electrum/gui/qt/utxo_list.py

@ -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…
Cancel
Save