Skip to content
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

Replace "Hide tray icon" option with positive "Show tray icon" one #115

Merged
merged 2 commits into from
Dec 15, 2020

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented Oct 24, 2020

This change makes easier both (1) using this option, and (2) reasoning about the code.

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review ACK a124ee7.

settings.setValue("fHideTrayIcon", false);
fHideTrayIcon = settings.value("fHideTrayIcon").toBool();
Q_EMIT hideTrayIconChanged(fHideTrayIcon);
if (!settings.contains("bShowTrayIcon")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, is there a reason to change setting key? No big deal in this case, but ideally "old" key would be migrated - if you wish to rename the key.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not just renaming here. fHideTrayIcon and bShowTrayIcon are different semantically. As the Bitcoin-Qt.conf is written in the human readable format, I'd prefer to introduce a new setting key to avoid any possible confusing.

An old key migration sounds good to me. But is it worth to add more code for such a non-critical key?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not just renaming here. fHideTrayIcon and bShowTrayIcon are different semantically.

Of course, you would have to take the !fHideTrayIcon.

An old key migration sounds good to me. But is it worth to add more code for such a non-critical key?

I've started with "nit" 😅

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not just renaming here. fHideTrayIcon and bShowTrayIcon are different semantically.

How?

As the Bitcoin-Qt.conf is written in the human readable format, I'd prefer to introduce a new setting key to avoid any possible confusing.

That's not a good reason IMO

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not just renaming here. fHideTrayIcon and bShowTrayIcon are different semantically.

How?

The meaning of fHideTrayIcon is opposite to bShowTrayIcon, no?

As the Bitcoin-Qt.conf is written in the human readable format, I'd prefer to introduce a new setting key to avoid any possible confusing.

That's not a good reason IMO

What do you suggest?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The meaning of fHideTrayIcon is opposite to bShowTrayIcon, no?

It's a strict opposite.

What do you suggest?

Leave fHideTrayIcon alone and just change the UI presentation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonasschnelli jonasschnelli added this to the 0.22.0 milestone Nov 11, 2020
settings.setValue("fHideTrayIcon", false);
fHideTrayIcon = settings.value("fHideTrayIcon").toBool();
Q_EMIT hideTrayIconChanged(fHideTrayIcon);
if (!settings.contains("bShowTrayIcon")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not just renaming here. fHideTrayIcon and bShowTrayIcon are different semantically.

How?

As the Bitcoin-Qt.conf is written in the human readable format, I'd prefer to introduce a new setting key to avoid any possible confusing.

That's not a good reason IMO

This change makes easier both (1) using this option, and (2) reasoning
about the code.
The removed BitcoinGUI::setTrayIconVisible just duplicates
QSystemTrayIcon::setVisible.
@hebasto
Copy link
Member Author

hebasto commented Nov 15, 2020

Updated a124ee7 -> 03edb52 (pr115.01 -> pr115.02, diff):

Leave fHideTrayIcon alone and just change the UI presentation.

Copy link
Member

@luke-jr luke-jr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

nit: I would split it into more commits. (eg, one changing GUI, one changing internals)

Copy link
Contributor

@jonasschnelli jonasschnelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 03edb52

@jonasschnelli jonasschnelli merged commit 33d6337 into bitcoin-core:master Dec 15, 2020
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Dec 15, 2020
@hebasto hebasto deleted the 201024-tray branch December 15, 2020 18:22
@hebasto hebasto mentioned this pull request Feb 21, 2021
@bitcoin-core bitcoin-core locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants