-
Notifications
You must be signed in to change notification settings - Fork 314
Persist Mask Values option #701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
concept ACK, this is better for sure |
The mask values option is memory only. If a user has enabled this option, it's reasonable to expect that they would want to have it enabled on the next start.
ee96a37
to
4de02de
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK 4de02de
Had been on my list to-do for a while. I agree with this, a follow-up could be to have a setting that would make it so that you'd have to unlock the wallet (if it's encrypted) in order to unmask values.
tACK 4de02de Obfuscating the amounts in the Transactions panel based on this user preference may be a good follow up to this change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK , persisting this value seems like the natural option
It would be nice to have some words about how this PR differs from #655. |
Hmm, didn't realize that PR existed. The difference is that this PR uses |
I agree with the direction this takes over the other pr's approach |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, it set's the value to false in the config file when the check is unticked.
I agree with the follow-ups (@jarolrod & @RandyMcMillan).
Concept ACK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK 4de02de
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of raw "mask_values"
literals, suggesting to update the SettingName()
function:
--- a/src/qt/optionsmodel.cpp
+++ b/src/qt/optionsmodel.cpp
@@ -54,6 +54,7 @@ static const char* SettingName(OptionsModel::OptionID option)
case OptionsModel::ProxyPortTor: return "onion";
case OptionsModel::ProxyUseTor: return "onion";
case OptionsModel::Language: return "lang";
+ case OptionsModel::MaskValues: return "mask_values";
default: throw std::logic_error(strprintf("GUI option %i has no corresponding node setting.", option));
}
}
and use its return value.
UPD. It seems @ryanofsky has a different opinion, so feel free to ignore this comment.
@@ -647,6 +647,8 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel, interfaces::BlockAndH | |||
// initialize the disable state of the tray icon with the current value in the model. | |||
trayIcon->setVisible(optionsModel->getShowTrayIcon()); | |||
} | |||
|
|||
m_mask_values_action->setChecked(_clientModel->getOptionsModel()->getOption(OptionsModel::OptionID::MaskValues).toBool()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m_mask_values_action->setChecked(_clientModel->getOptionsModel()->getOption(OptionsModel::OptionID::MaskValues).toBool()); | |
m_mask_values_action->setChecked(optionsModel->getMaskValues()); |
accompanied with
--- a/src/qt/optionsmodel.h
+++ b/src/qt/optionsmodel.h
@@ -98,6 +98,7 @@ public:
bool getSubFeeFromAmount() const { return m_sub_fee_from_amount; }
bool getEnablePSBTControls() const { return m_enable_psbt_controls; }
const QString& getOverriddenByCommandLine() { return strOverriddenByCommandLine; }
+ bool getMaskValues() const { return m_mask_values; }
/* Explicit setters */
void SetPruneTargetGB(int prune_target_gb);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @ryanofsky was recommending to remove the case from the SettingsName
due to its purpose of mapping OptionsModel
to command line options but to add OptionsModel::MaksValues
(or leave in this case as @achow101 already added them) to setOption
and getOption
.
The implementation of the getter looks simpler but then you would need to add the setter too to make it consistent and revert the above (remove the case from setOption
and getOption
).
Perhaps as a follow-up we could check the model consistent with either solution for the rest of settings (?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'll leave this as is since it's consistent with most of the other settings which use the generic function with the enum.
@@ -647,6 +647,8 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel, interfaces::BlockAndH | |||
// initialize the disable state of the tray icon with the current value in the model. | |||
trayIcon->setVisible(optionsModel->getShowTrayIcon()); | |||
} | |||
|
|||
m_mask_values_action->setChecked(_clientModel->getOptionsModel()->getOption(OptionsModel::OptionID::MaskValues).toBool()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, you could just use OptionsModel::MaskValues
without the OptionID
, is this an issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not an issue, will change if I need to retouch.
Originally I had done that, but was looking into how that function is used and decided that adding the option there doesn't make sense. It looks like |
4de02de qt: Persist Mask Values option (Andrew Chow) Pull request description: The mask values option is memory only. If a user has enabled this option, it's reasonable to expect that they would want to have it enabled on the next start. ACKs for top commit: RandyMcMillan: tACK bitcoin-core/gui@4de02de jarolrod: tACK 4de02de pablomartin4btc: > tACK [4de02de](bitcoin-core/gui@4de02de) john-moffett: tACK 4de02de Tree-SHA512: 247deb78df4911516625bf8b25d752feb480ce30eb31335cf9baeb07b7c6c225fcc37d5c45de62d6e6895ec10c7eefabb15527e3c9723a3b8ddda1e12ebbf46b
4492de1 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.  This enhancement has been mentioned on PR #701 as a [desirable follow-up](#701 (comment)). First approach was to hide the amounts on the transactions view when mask values option is checked:  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](#708 (comment)). ACKs for top commit: achow101: ACK 4492de1 furszy: ACK 4492de1 hernanmarino: ACK 4492de1 Tree-SHA512: 94c04064cde456ab916cb91fc4619353cf4c8ef0e92aa1522a6b2c18a8d0fa641db9fddac04c2e1a290128879db598a9dfc4a0003dcf6e3413543908ada95afb
The mask values option is memory only. If a user has enabled this option, it's reasonable to expect that they would want to have it enabled on the next start.