qt: HD wallet status indicator in status bar

Add a [HD] label next to the lock icon that shows whether the
wallet has a BIP39 HD seed active:
  - Red (#f26522, TRI brand color) when HD is enabled
  - Grey (#555555) when wallet is non-HD (legacy key pool)

Tooltip on hover explains what HD means and what the user must
back up to be able to restore the wallet.

Wired through a new updateHDStatus() slot that reads the
public WalletModel::hdEnabled() accessor and is called when
the wallet model is set. Lives in the icon cluster of the
status bar; the .onion and .b32.i2p address text sits in a
separate group on the right, so no crowding.

Closes the visible-state gap: the wallet already supported
HD seeds (BIP39/BIP32) and had a hdseeddialog, but there was
no visual confirmation of HD status anywhere in the UI.
This commit is contained in:
Krystie
2026-07-01 21:32:58 -07:00
parent 35f524ff34
commit f9d1723f6e
3 changed files with 50 additions and 1 deletions
+17
View File
@@ -1663,6 +1663,23 @@ QProgressBar::chunk {
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_hd">
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="toolTip">
<string>HD (BIP39) wallet seed status</string>
</property>
<property name="text">
<string notr="true">HD</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_staking">
<property name="text">
+31 -1
View File
@@ -359,6 +359,11 @@ TrianglesGUI::TrianglesGUI(bool fIsTestnet, QWidget *parent):
labelV3Icon = ui->label_v3;
labelV3Icon->setVisible(false);
// HD indicator next to lock icon (always visible; color reflects state)
labelHdIcon = ui->label_hd;
labelHdIcon->setVisible(true);
updateHDStatus();
// Tor icon next to onion address in the stacked address group (hidden until populated)
labelTorIcon = ui->label_tor_icon;
labelTorIcon->setVisible(false);
@@ -650,6 +655,9 @@ void TrianglesGUI::setWalletModel(WalletModel *walletModel)
connect(walletModel, SIGNAL(transactionSyncProgressChanged(bool,int)), this, SLOT(setWalletTransactionSyncProgress(bool,int)));
setWalletTransactionSyncState(walletModel->isTransactionSyncing());
// HD status reflects wallet capability — refresh whenever the wallet model changes
updateHDStatus();
// Balloon pop-up for new transaction
connect(walletModel->getTransactionTableModel(), SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SLOT(incomingTransaction(QModelIndex,int,int)));
@@ -1866,16 +1874,38 @@ void TrianglesGUI::updateI2PAddress()
labelI2PIcon->setVisible(false);
}
// I2P address text
if (!hasI2P) {
labelI2PAddress->setVisible(false);
return;
}
labelI2PAddress->setText(QString::fromStdString(i2pAddress));
labelI2PAddress->setToolTip(tr("This node's I2P .b32.i2p address. Click to copy."));
labelI2PAddress->setVisible(true);
}
void TrianglesGUI::updateHDStatus()
{
// Red (#f26522 — TRI brand color) when HD is enabled, grey when not.
// Placed next to the lock icon as a wallet-capability indicator.
if (!labelHdIcon) return;
bool fHD = false;
if (walletModel) {
fHD = walletModel->hdEnabled();
}
if (fHD) {
labelHdIcon->setStyleSheet("color: #f26522; font-weight: bold;");
labelHdIcon->setToolTip(tr("HD wallet: BIP39 seed active. Backup your seed phrase — individual keys alone will not restore this wallet."));
} else {
labelHdIcon->setStyleSheet("color: #555555; font-weight: bold;");
labelHdIcon->setToolTip(tr("Non-HD wallet: backup each address key separately. Use hdnew to upgrade to an HD seed."));
}
labelHdIcon->setText(QStringLiteral("HD"));
labelHdIcon->setVisible(true);
}
void TrianglesGUI::on_bHelp_clicked()
{
+2
View File
@@ -114,6 +114,7 @@ private:
QLabel *labelV3Icon;
QLabel *labelI2PIcon;
QLabel *labelTorIcon;
QLabel *labelHdIcon;
QLabel *progressBarLabel;
QProgressBar *progressBar;
@@ -182,6 +183,7 @@ public slots:
void setWalletTransactionSyncProgress(bool syncing, int pendingNotifications);
void updateOnionAddress();
void updateI2PAddress();
void updateHDStatus();
/** Notify the user of an error in the network or transaction handling code. */
void error(const QString &title, const QString &message, bool modal);