If a wallet is in private key disabled mode, the spendable balance is always zero, it does not have to show on GUI. Show the watch-only balance at normal balance column if a wallet is in that mode.

If a wallet is in private key disabled mode, the spendable balance is always zero, it does not have to show on GUI. Show the watch-only balance at normal balance column if a wallet is in that mode.

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
No conflicts as of last run.
183@@ -184,13 +184,24 @@ void OverviewPage::setBalance(const interfaces::WalletBalances& balances)
184 // show/hide watch-only labels
185 void OverviewPage::updateWatchOnlyLabels(bool showWatchOnly)
nit, since there is one caller only, could remove it and below do
0connect(model, &WalletModel::notifyWatchonlyChanged, [this](bool showWatchOnly) {
1 updateWalletLabels(showWatchOnly, !walletModel->privateKeysDisabled());
2});
173+ if (walletModel->privateKeysDisabled()) {
174+ ui->labelBalance->setText(BitcoinUnits::formatWithUnit(unit, balances.watch_only_balance, false, BitcoinUnits::separatorAlways));
175+ ui->labelUnconfirmed->setText(BitcoinUnits::formatWithUnit(unit, balances.unconfirmed_watch_only_balance, false, BitcoinUnits::separatorAlways));
176+ ui->labelImmature->setText(BitcoinUnits::formatWithUnit(unit, balances.immature_watch_only_balance, false, BitcoinUnits::separatorAlways));
177+ ui->labelTotal->setText(BitcoinUnits::formatWithUnit(unit, balances.watch_only_balance + balances.unconfirmed_watch_only_balance + balances.immature_watch_only_balance, false, BitcoinUnits::separatorAlways));
178+ }
} else {
Testing https://github.com/bitcoin/bitcoin/pull/13966/commits/fe1ff5026bace9b43ac01c14a26ed0dd75ccc6f7 using the following commands (in the Debug window given that we’re looking at a GUI change). Screenshots below, will review further shortly.
0src/qt/bitcoin-qt --testnet
1createwallet "regular-wallet" false
2createwallet "watch-only-wallet" true
3
4// import a random testnet address
5importaddress "some-address" "random-addr" false false
Concept ACK, the distinction between"spendable" and “watch-only” is confusing anyway, and a big source of scams (even if that particular scam is less likely here, though something to be aware of once #13100 is merged).
The concept of watch-only might become less clear in general moving forward. @sipa does this get in the way of the direction you have in mind for the wallet refactor?
214@@ -215,7 +215,7 @@ public Q_SLOTS:
215 @param[in] status current hd enabled status
tACK 82d6c5a on macOS 10.13.6
Before:
After:
1070+void BitcoinGUI::setHDStatus(bool privkeyDisabled, int hdEnabled)
1071 {
1072- labelWalletHDStatusIcon->setPixmap(platformStyle->SingleColorIcon(hdEnabled ? ":/icons/hd_enabled" : ":/icons/hd_disabled").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
1073- labelWalletHDStatusIcon->setToolTip(hdEnabled ? tr("HD key generation is <b>enabled</b>") : tr("HD key generation is <b>disabled</b>"));
1074+ labelWalletHDStatusIcon->setPixmap(platformStyle->SingleColorIcon(privkeyDisabled ? ":/icons/eye" : hdEnabled ? ":/icons/hd_enabled" : ":/icons/hd_disabled").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
1075+ labelWalletHDStatusIcon->setToolTip(privkeyDisabled ? tr("Private key <b>disabled</b>") : hdEnabled ? tr("HD key generation is <b>enabled</b>") : tr("HD key generation is <b>disabled</b>"));
key -> keys?
Tested ACK https://github.com/bitcoin/bitcoin/pull/13966/commits/82d6c5aad330bb06d0c918b4e9304c25ff2bdcc8
As an alternative which I think might be clearer, what about including the eye next to the Balances title like this?

micro-nit: typo in first commit message priveate -> private