Merge pull request #5823 from Chris-777/master
Qt address list: add "funded or unused" filter option
This commit is contained in:
@@ -102,9 +102,9 @@ Builder.load_string('''
|
|||||||
spacing: '5dp'
|
spacing: '5dp'
|
||||||
AddressButton:
|
AddressButton:
|
||||||
id: search
|
id: search
|
||||||
text: {0:_('All'), 1:_('Unused'), 2:_('Funded'), 3:_('Used')}[root.show_used]
|
text: {0:_('All'), 1:_('Unused'), 2:_('Funded'), 3:_('Used'), 4:(_('Funded')+'|'+_('Unused'))}[root.show_used]
|
||||||
on_release:
|
on_release:
|
||||||
root.show_used = (root.show_used + 1) % 4
|
root.show_used = (root.show_used + 1) % 5
|
||||||
Clock.schedule_once(lambda dt: root.update())
|
Clock.schedule_once(lambda dt: root.update())
|
||||||
AddressFilter:
|
AddressFilter:
|
||||||
opacity: 1
|
opacity: 1
|
||||||
@@ -271,6 +271,8 @@ class AddressesDialog(Factory.Popup):
|
|||||||
continue
|
continue
|
||||||
if self.show_used == 3 and not is_used_and_empty:
|
if self.show_used == 3 and not is_used_and_empty:
|
||||||
continue
|
continue
|
||||||
|
if self.show_used == 4 and is_used_and_empty:
|
||||||
|
continue
|
||||||
card = self.get_card(address, balance, is_used_and_empty, label)
|
card = self.get_card(address, balance, is_used_and_empty, label)
|
||||||
if search and not self.ext_search(card, search):
|
if search and not self.ext_search(card, search):
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ class AddressUsageStateFilter(IntEnum):
|
|||||||
UNUSED = 1
|
UNUSED = 1
|
||||||
FUNDED = 2
|
FUNDED = 2
|
||||||
USED_AND_EMPTY = 3
|
USED_AND_EMPTY = 3
|
||||||
|
FUNDED_OR_UNUSED = 4
|
||||||
|
|
||||||
def ui_text(self) -> str:
|
def ui_text(self) -> str:
|
||||||
return {
|
return {
|
||||||
@@ -50,6 +51,7 @@ class AddressUsageStateFilter(IntEnum):
|
|||||||
self.UNUSED: _('Unused'),
|
self.UNUSED: _('Unused'),
|
||||||
self.FUNDED: _('Funded'),
|
self.FUNDED: _('Funded'),
|
||||||
self.USED_AND_EMPTY: _('Used'),
|
self.USED_AND_EMPTY: _('Used'),
|
||||||
|
self.FUNDED_OR_UNUSED: _('Funded or Unused'),
|
||||||
}[self]
|
}[self]
|
||||||
|
|
||||||
|
|
||||||
@@ -173,6 +175,8 @@ class AddressList(MyTreeView):
|
|||||||
continue
|
continue
|
||||||
if self.show_used == AddressUsageStateFilter.USED_AND_EMPTY and not is_used_and_empty:
|
if self.show_used == AddressUsageStateFilter.USED_AND_EMPTY and not is_used_and_empty:
|
||||||
continue
|
continue
|
||||||
|
if self.show_used == AddressUsageStateFilter.FUNDED_OR_UNUSED and is_used_and_empty:
|
||||||
|
continue
|
||||||
balance_text = self.parent.format_amount(balance, whitespaces=True)
|
balance_text = self.parent.format_amount(balance, whitespaces=True)
|
||||||
# create item
|
# create item
|
||||||
if fx and fx.get_fiat_address_config():
|
if fx and fx.get_fiat_address_config():
|
||||||
|
|||||||
Reference in New Issue
Block a user