mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
gui: don't show account names if there is only one account
This commit is contained in:
parent
217900bbfa
commit
9723a5e9ec
1 changed files with 22 additions and 13 deletions
|
@ -1198,22 +1198,31 @@ class ElectrumWindow(QMainWindow):
|
||||||
else:
|
else:
|
||||||
account_items = []
|
account_items = []
|
||||||
|
|
||||||
for k, account in account_items:
|
pending_accounts = self.wallet.get_pending_accounts()
|
||||||
name = self.wallet.get_account_name(k)
|
|
||||||
c,u = self.wallet.get_account_balance(k)
|
|
||||||
account_item = QTreeWidgetItem( [ name, '', self.format_amount(c+u), ''] )
|
|
||||||
l.addTopLevelItem(account_item)
|
|
||||||
account_item.setExpanded(self.accounts_expanded.get(k, True))
|
|
||||||
account_item.setData(0, 32, k)
|
|
||||||
|
|
||||||
if not self.wallet.is_seeded(k):
|
for k, account in account_items:
|
||||||
icon = QIcon(":icons/key.png")
|
|
||||||
account_item.setIcon(0, icon)
|
if len(account_items) + len(pending_accounts) > 1:
|
||||||
|
name = self.wallet.get_account_name(k)
|
||||||
|
c,u = self.wallet.get_account_balance(k)
|
||||||
|
account_item = QTreeWidgetItem( [ name, '', self.format_amount(c+u), ''] )
|
||||||
|
l.addTopLevelItem(account_item)
|
||||||
|
account_item.setExpanded(self.accounts_expanded.get(k, True))
|
||||||
|
account_item.setData(0, 32, k)
|
||||||
|
if not self.wallet.is_seeded(k):
|
||||||
|
icon = QIcon(":icons/key.png")
|
||||||
|
account_item.setIcon(0, icon)
|
||||||
|
else:
|
||||||
|
account_item = None
|
||||||
|
|
||||||
for is_change in ([0,1]):
|
for is_change in ([0,1]):
|
||||||
name = _("Receiving") if not is_change else _("Change")
|
name = _("Receiving") if not is_change else _("Change")
|
||||||
seq_item = QTreeWidgetItem( [ name, '', '', '', ''] )
|
seq_item = QTreeWidgetItem( [ name, '', '', '', ''] )
|
||||||
account_item.addChild(seq_item)
|
if account_item:
|
||||||
|
account_item.addChild(seq_item)
|
||||||
|
else:
|
||||||
|
l.addTopLevelItem(seq_item)
|
||||||
|
|
||||||
used_item = QTreeWidgetItem( [ _("Used"), '', '', '', ''] )
|
used_item = QTreeWidgetItem( [ _("Used"), '', '', '', ''] )
|
||||||
used_flag = False
|
used_flag = False
|
||||||
if not is_change: seq_item.setExpanded(True)
|
if not is_change: seq_item.setExpanded(True)
|
||||||
|
@ -1246,7 +1255,7 @@ class ElectrumWindow(QMainWindow):
|
||||||
seq_item.addChild(item)
|
seq_item.addChild(item)
|
||||||
|
|
||||||
|
|
||||||
for k, addr in self.wallet.get_pending_accounts():
|
for k, addr in pending_accounts:
|
||||||
name = self.wallet.labels.get(k,'')
|
name = self.wallet.labels.get(k,'')
|
||||||
account_item = QTreeWidgetItem( [ name + " [ "+_('pending account')+" ]", '', '', ''] )
|
account_item = QTreeWidgetItem( [ name + " [ "+_('pending account')+" ]", '', '', ''] )
|
||||||
self.update_receive_item(item)
|
self.update_receive_item(item)
|
||||||
|
@ -1451,7 +1460,7 @@ class ElectrumWindow(QMainWindow):
|
||||||
name = str(e.text())
|
name = str(e.text())
|
||||||
if not name: return
|
if not name: return
|
||||||
|
|
||||||
self.wallet.create_pending_account('1of1', name, password)
|
self.wallet.create_pending_account(name, password)
|
||||||
self.update_receive_tab()
|
self.update_receive_tab()
|
||||||
self.tabs.setCurrentIndex(2)
|
self.tabs.setCurrentIndex(2)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue