mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-13 13:22:38 -03:00
Merge bitcoin-core/gui#708: Mask values on Transactions View
4492de1be1
qt: mask values on transactions view (pablomartin4btc) Pull request description: Currently the mask values option (Settings menu->Mask values) hides the wallet balances shown on the Overview page including the recent transactions list from the right panel but it doesn't hide the amounts from the transaction view. ![mask values - hiding wallet balances on overview tab but not on transactions tab](https://user-images.githubusercontent.com/110166421/216876325-56a68006-1be0-4b3f-b1e2-a0575c377cf5.gif) This enhancement has been mentioned on PR #701 as a [desirable follow-up](https://github.com/bitcoin-core/gui/pull/701#issuecomment-1401350037). First approach was to hide the amounts on the transactions view when mask values option is checked: ![mask values - hiding amounts on transactions tab](https://user-images.githubusercontent.com/110166421/216876440-0ff1a2ec-2ef2-405c-8b62-e4a94b9221cc.gif) But later on as reviewer **furszy** recommended, I've disabled the Transaction tab directly and switch to the Overview tab if the mask values option is set, check the new screenshots in the [comment below](https://github.com/bitcoin-core/gui/pull/708#issuecomment-1449025828). ACKs for top commit: achow101: ACK4492de1be1
furszy: ACK4492de1
hernanmarino: ACK4492de1be1
Tree-SHA512: 94c04064cde456ab916cb91fc4619353cf4c8ef0e92aa1522a6b2c18a8d0fa641db9fddac04c2e1a290128879db598a9dfc4a0003dcf6e3413543908ada95afb
This commit is contained in:
commit
460e394625
6 changed files with 40 additions and 1 deletions
|
@ -456,6 +456,7 @@ void BitcoinGUI::createActions()
|
|||
m_wallet_controller->closeAllWallets(this);
|
||||
});
|
||||
connect(m_mask_values_action, &QAction::toggled, this, &BitcoinGUI::setPrivacy);
|
||||
connect(m_mask_values_action, &QAction::toggled, this, &BitcoinGUI::enableHistoryAction);
|
||||
}
|
||||
#endif // ENABLE_WALLET
|
||||
|
||||
|
@ -668,6 +669,12 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel, interfaces::BlockAndH
|
|||
}
|
||||
|
||||
#ifdef ENABLE_WALLET
|
||||
void BitcoinGUI::enableHistoryAction(bool privacy)
|
||||
{
|
||||
historyAction->setEnabled(!privacy);
|
||||
if (historyAction->isChecked()) gotoOverviewPage();
|
||||
}
|
||||
|
||||
void BitcoinGUI::setWalletController(WalletController* wallet_controller)
|
||||
{
|
||||
assert(!m_wallet_controller);
|
||||
|
@ -716,7 +723,9 @@ void BitcoinGUI::addWallet(WalletModel* walletModel)
|
|||
connect(wallet_view, &WalletView::encryptionStatusChanged, this, &BitcoinGUI::updateWalletStatus);
|
||||
connect(wallet_view, &WalletView::incomingTransaction, this, &BitcoinGUI::incomingTransaction);
|
||||
connect(this, &BitcoinGUI::setPrivacy, wallet_view, &WalletView::setPrivacy);
|
||||
wallet_view->setPrivacy(isPrivacyModeActivated());
|
||||
const bool privacy = isPrivacyModeActivated();
|
||||
wallet_view->setPrivacy(privacy);
|
||||
enableHistoryAction(privacy);
|
||||
const QString display_name = walletModel->getDisplayName();
|
||||
m_wallet_selector->addItem(display_name, QVariant::fromValue(walletModel));
|
||||
}
|
||||
|
|
|
@ -288,6 +288,8 @@ public Q_SLOTS:
|
|||
void gotoVerifyMessageTab(QString addr = "");
|
||||
/** Load Partially Signed Bitcoin Transaction from file or clipboard */
|
||||
void gotoLoadPSBT(bool from_clipboard = false);
|
||||
/** Enable history action when privacy is changed */
|
||||
void enableHistoryAction(bool privacy);
|
||||
|
||||
/** Show open dialog */
|
||||
void openClicked();
|
||||
|
|
|
@ -531,6 +531,7 @@ void TransactionView::showDetails()
|
|||
{
|
||||
TransactionDescDialog *dlg = new TransactionDescDialog(selection.at(0));
|
||||
dlg->setAttribute(Qt::WA_DeleteOnClose);
|
||||
m_opened_dialogs.append(dlg);
|
||||
dlg->show();
|
||||
}
|
||||
}
|
||||
|
@ -637,6 +638,11 @@ bool TransactionView::eventFilter(QObject *obj, QEvent *event)
|
|||
return true;
|
||||
}
|
||||
}
|
||||
if (event->type() == QEvent::EnabledChange) {
|
||||
if (!isEnabled()) {
|
||||
closeOpenedDialogs();
|
||||
}
|
||||
}
|
||||
return QWidget::eventFilter(obj, event);
|
||||
}
|
||||
|
||||
|
@ -646,3 +652,12 @@ void TransactionView::updateWatchOnlyColumn(bool fHaveWatchOnly)
|
|||
watchOnlyWidget->setVisible(fHaveWatchOnly);
|
||||
transactionView->setColumnHidden(TransactionTableModel::Watchonly, !fHaveWatchOnly);
|
||||
}
|
||||
|
||||
void TransactionView::closeOpenedDialogs()
|
||||
{
|
||||
// close all dialogs opened from this view
|
||||
for (QDialog* dlg : m_opened_dialogs) {
|
||||
dlg->close();
|
||||
}
|
||||
m_opened_dialogs.clear();
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include <QKeyEvent>
|
||||
|
||||
class PlatformStyle;
|
||||
class TransactionDescDialog;
|
||||
class TransactionFilterProxy;
|
||||
class WalletModel;
|
||||
|
||||
|
@ -90,6 +91,8 @@ private:
|
|||
|
||||
const PlatformStyle* m_platform_style;
|
||||
|
||||
QList<TransactionDescDialog*> m_opened_dialogs;
|
||||
|
||||
private Q_SLOTS:
|
||||
void contextualMenu(const QPoint &);
|
||||
void dateRangeChanged();
|
||||
|
@ -121,6 +124,7 @@ public Q_SLOTS:
|
|||
void changedAmount();
|
||||
void changedSearch();
|
||||
void exportClicked();
|
||||
void closeOpenedDialogs();
|
||||
void focusTransaction(const QModelIndex&);
|
||||
void focusTransaction(const uint256& txid);
|
||||
};
|
||||
|
|
|
@ -93,6 +93,7 @@ WalletView::WalletView(WalletModel* wallet_model, const PlatformStyle* _platform
|
|||
connect(transactionView, &TransactionView::message, this, &WalletView::message);
|
||||
|
||||
connect(this, &WalletView::setPrivacy, overviewPage, &OverviewPage::setPrivacy);
|
||||
connect(this, &WalletView::setPrivacy, this, &WalletView::disableTransactionView);
|
||||
|
||||
// Receive and pass through messages from wallet model
|
||||
connect(walletModel, &WalletModel::message, this, &WalletView::message);
|
||||
|
@ -278,3 +279,8 @@ void WalletView::showProgress(const QString &title, int nProgress)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void WalletView::disableTransactionView(bool disable)
|
||||
{
|
||||
transactionView->setDisabled(disable);
|
||||
}
|
||||
|
|
|
@ -107,6 +107,9 @@ public Q_SLOTS:
|
|||
/** Show progress dialog e.g. for rescan */
|
||||
void showProgress(const QString &title, int nProgress);
|
||||
|
||||
private Q_SLOTS:
|
||||
void disableTransactionView(bool disable);
|
||||
|
||||
Q_SIGNALS:
|
||||
void setPrivacy(bool privacy);
|
||||
void transactionClicked();
|
||||
|
|
Loading…
Reference in a new issue