Skip to content

Commit 7d0d4c0

Browse files
committed
qt: Add WalletFrame::currentWalletSet signal
The connection of the WalletFrame::currentWalletSet signal to the BitcoinGUI::updateWalletStatus is a shorter and more descriptive way to call both the setHDStatus and setEncryptionStatus member functions of the BitcoinGUI class in comparison to using of the WalletView::updateEncryptionStatus slot.
1 parent adf9bcf commit 7d0d4c0

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

src/qt/bitcoingui.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty
113113
connect(walletFrame, &WalletFrame::message, [this](const QString& title, const QString& message, unsigned int style) {
114114
this->message(title, message, style);
115115
});
116+
connect(walletFrame, &WalletFrame::currentWalletSet, [this] { updateWalletStatus(); });
116117
setCentralWidget(walletFrame);
117118
} else
118119
#endif // ENABLE_WALLET

src/qt/walletframe.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ void WalletFrame::setCurrentWallet(WalletModel* wallet_model)
109109
walletView->updateGeometry();
110110

111111
walletStack->setCurrentWidget(walletView);
112-
walletView->updateEncryptionStatus();
112+
113+
Q_EMIT currentWalletSet();
113114
}
114115

115116
void WalletFrame::removeWallet(WalletModel* wallet_model)

src/qt/walletframe.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class WalletFrame : public QFrame
4949
Q_SIGNALS:
5050
void createWalletButtonClicked();
5151
void message(const QString& title, const QString& message, unsigned int style);
52+
void currentWalletSet();
5253

5354
private:
5455
QStackedWidget *walletStack;

0 commit comments

Comments
 (0)