mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +01:00
merge bitcoin-core/gui#403: Make paths to update Encryption and HD wallet statuses simpler
This commit is contained in:
parent
ba5ad1fc6c
commit
594177d5fe
@ -112,14 +112,15 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const NetworkStyle* networkStyle,
|
||||
{
|
||||
/** Create wallet frame*/
|
||||
walletFrame = new WalletFrame(this);
|
||||
connect(walletFrame, &WalletFrame::message, [this](const QString& title, const QString& message, unsigned int style) {
|
||||
this->message(title, message, style);
|
||||
});
|
||||
connect(walletFrame, &WalletFrame::createWalletButtonClicked, [this] {
|
||||
auto activity = new CreateWalletActivity(getWalletController(), this);
|
||||
connect(activity, &CreateWalletActivity::finished, activity, &QObject::deleteLater);
|
||||
activity->create();
|
||||
});
|
||||
connect(walletFrame, &WalletFrame::message, [this](const QString& title, const QString& message, unsigned int style) {
|
||||
this->message(title, message, style);
|
||||
});
|
||||
connect(walletFrame, &WalletFrame::currentWalletSet, [this] { updateWalletStatus(); });
|
||||
} else
|
||||
#endif // ENABLE_WALLET
|
||||
{
|
||||
@ -932,7 +933,6 @@ void BitcoinGUI::addWallet(WalletModel* walletModel)
|
||||
});
|
||||
connect(wallet_view, &WalletView::encryptionStatusChanged, this, &BitcoinGUI::updateWalletStatus);
|
||||
connect(wallet_view, &WalletView::incomingTransaction, this, &BitcoinGUI::incomingTransaction);
|
||||
connect(wallet_view, &WalletView::hdEnabledStatusChanged, this, &BitcoinGUI::updateWalletStatus);
|
||||
connect(this, &BitcoinGUI::setPrivacy, wallet_view, &WalletView::setPrivacy);
|
||||
wallet_view->setPrivacy(isPrivacyModeActivated());
|
||||
const QString display_name = walletModel->getDisplayName();
|
||||
@ -1679,7 +1679,9 @@ void BitcoinGUI::changeEvent(QEvent *e)
|
||||
if (e->type() == QEvent::StyleChange) {
|
||||
updateNetworkState();
|
||||
#ifdef ENABLE_WALLET
|
||||
if (walletFrame) {
|
||||
updateWalletStatus();
|
||||
}
|
||||
#endif
|
||||
if (m_node.masternodeSync().isSynced()) {
|
||||
labelBlocksIcon->setPixmap(GUIUtil::getIcon("synced", GUIUtil::ThemedColor::GREEN).pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
|
||||
@ -1911,9 +1913,8 @@ void BitcoinGUI::setEncryptionStatus(int status)
|
||||
|
||||
void BitcoinGUI::updateWalletStatus()
|
||||
{
|
||||
if (!walletFrame) {
|
||||
return;
|
||||
}
|
||||
assert(walletFrame);
|
||||
|
||||
WalletView * const walletView = walletFrame->currentWalletView();
|
||||
if (!walletView) {
|
||||
return;
|
||||
|
@ -123,7 +123,8 @@ void WalletFrame::setCurrentWallet(WalletModel* wallet_model)
|
||||
walletView->updateGeometry();
|
||||
|
||||
walletStack->setCurrentWidget(walletView);
|
||||
walletView->updateEncryptionStatus();
|
||||
|
||||
Q_EMIT currentWalletSet();
|
||||
}
|
||||
|
||||
void WalletFrame::removeWallet(WalletModel* wallet_model)
|
||||
|
@ -50,6 +50,7 @@ public:
|
||||
|
||||
Q_SIGNALS:
|
||||
void message(const QString& title, const QString& message, unsigned int style);
|
||||
void currentWalletSet();
|
||||
|
||||
void createWalletButtonClicked();
|
||||
|
||||
|
@ -177,10 +177,6 @@ void WalletView::setWalletModel(WalletModel *_walletModel)
|
||||
|
||||
// Handle changes in encryption status
|
||||
connect(_walletModel, &WalletModel::encryptionStatusChanged, this, &WalletView::encryptionStatusChanged);
|
||||
updateEncryptionStatus();
|
||||
|
||||
// update HD status
|
||||
Q_EMIT hdEnabledStatusChanged();
|
||||
|
||||
// Balloon pop-up for new transaction
|
||||
connect(_walletModel->getTransactionTableModel(), &TransactionTableModel::rowsInserted, this, &WalletView::processNewTransaction);
|
||||
@ -304,11 +300,6 @@ void WalletView::showOutOfSyncWarning(bool fShow)
|
||||
overviewPage->showOutOfSyncWarning(fShow);
|
||||
}
|
||||
|
||||
void WalletView::updateEncryptionStatus()
|
||||
{
|
||||
Q_EMIT encryptionStatusChanged();
|
||||
}
|
||||
|
||||
void WalletView::encryptWallet()
|
||||
{
|
||||
if(!walletModel)
|
||||
@ -317,7 +308,7 @@ void WalletView::encryptWallet()
|
||||
dlg.setModel(walletModel);
|
||||
dlg.exec();
|
||||
|
||||
updateEncryptionStatus();
|
||||
Q_EMIT encryptionStatusChanged();
|
||||
}
|
||||
|
||||
void WalletView::backupWallet()
|
||||
|
@ -116,9 +116,6 @@ public Q_SLOTS:
|
||||
/** Show used receiving addresses */
|
||||
void usedReceivingAddresses();
|
||||
|
||||
/** Re-emit encryption status signal */
|
||||
void updateEncryptionStatus();
|
||||
|
||||
/** Show progress dialog e.g. for rescan */
|
||||
void showProgress(const QString &title, int nProgress);
|
||||
|
||||
@ -132,8 +129,6 @@ Q_SIGNALS:
|
||||
void message(const QString &title, const QString &message, unsigned int style);
|
||||
/** Encryption status of wallet changed */
|
||||
void encryptionStatusChanged();
|
||||
/** HD-Enabled status of wallet changed (only possible during startup) */
|
||||
void hdEnabledStatusChanged();
|
||||
/** Notify that a new transaction appeared */
|
||||
void incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address, const QString& label, const QString& walletName);
|
||||
/** Notify that the out of sync warning icon has been pressed */
|
||||
|
Loading…
Reference in New Issue
Block a user