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

Qt: Enable system tray icon by default if available #14228

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
8 participants
@hebasto
Contributor

hebasto commented Sep 15, 2018

Prevent a user from losing access to the main window by minimizing it to the tray on the systems which have not “system tray” or “notification area” available (e.g. GNOME 3.26+).

Tested on Fedora 28 + GNOME 3.28.

@fanquake fanquake added the GUI label Sep 16, 2018

@practicalswift

This comment has been minimized.

Show comment
Hide comment
@practicalswift

practicalswift Sep 16, 2018

Member

Original PR title: "Qt: Don't use systray icon on inappropriate systems"

When reading the PR title I first thought you were referring to Windows platforms :-)

Member

practicalswift commented Sep 16, 2018

Original PR title: "Qt: Don't use systray icon on inappropriate systems"

When reading the PR title I first thought you were referring to Windows platforms :-)

Show outdated Hide outdated src/qt/optionsmodel.cpp
@hebasto

This comment has been minimized.

Show comment
Hide comment
@hebasto

hebasto Sep 16, 2018

Contributor

@luke-jr
Thank you for your review. You're right. Fixed: the saved settings aren't touched.
Please re-review.

Contributor

hebasto commented Sep 16, 2018

@luke-jr
Thank you for your review. You're right. Fixed: the saved settings aren't touched.
Please re-review.

Show outdated Hide outdated src/qt/optionsmodel.cpp
@promag

How about createTrayIconMenu?

Show outdated Hide outdated src/qt/optionsmodel.cpp
Show outdated Hide outdated src/qt/bitcoingui.cpp
@hebasto

This comment has been minimized.

Show comment
Hide comment
@hebasto

hebasto Sep 16, 2018

Contributor

@promag

Thank you for your review.

How about createTrayIconMenu?

if (!trayIcon)
return;

Is it not enough?

Contributor

hebasto commented Sep 16, 2018

@promag

Thank you for your review.

How about createTrayIconMenu?

if (!trayIcon)
return;

Is it not enough?

@hebasto

This comment has been minimized.

Show comment
Hide comment
@hebasto

hebasto Sep 16, 2018

Contributor

@promag
You've suggested a more robust code. Fixed. Please re-review.

Contributor

hebasto commented Sep 16, 2018

@promag
You've suggested a more robust code. Fixed. Please re-review.

@hebasto hebasto changed the title from Qt: Don't use systray icon on inappropriate systems to Qt: Enable system tray icon by default if available Sep 16, 2018

@hebasto

This comment has been minimized.

Show comment
Hide comment
@hebasto

hebasto Sep 16, 2018

Contributor

This PR title has been changed as @promag proposed.
btw, gui prefix is not mentioned in the CONTRIBUTING.md. Is it valid? (answered by @laanwj on IRC)

Contributor

hebasto commented Sep 16, 2018

This PR title has been changed as @promag proposed.
btw, gui prefix is not mentioned in the CONTRIBUTING.md. Is it valid? (answered by @laanwj on IRC)

@hebasto

This comment has been minimized.

Show comment
Hide comment
@hebasto

hebasto Sep 17, 2018

Contributor

@luke-jr

Someone might run it on GNOME, and then run it on KDE.
Systems without a systray should just behave as if the option doesn't exist at all IMO.

You're right. Fixed: settings are not touched at all on systems without a systray.

Contributor

hebasto commented Sep 17, 2018

@luke-jr

Someone might run it on GNOME, and then run it on KDE.
Systems without a systray should just behave as if the option doesn't exist at all IMO.

You're right. Fixed: settings are not touched at all on systems without a systray.

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Sep 23, 2018

Member

utACK after squash

Member

laanwj commented Sep 23, 2018

utACK after squash

@hebasto

This comment has been minimized.

Show comment
Hide comment
@hebasto

hebasto Sep 23, 2018

Contributor

utACK after squash

@laanwj squashed

Contributor

hebasto commented Sep 23, 2018

utACK after squash

@laanwj squashed

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Sep 25, 2018

Member

lightly tested on OSes where the tray is available.
ACK 244774d.

Member

jonasschnelli commented Sep 25, 2018

lightly tested on OSes where the tray is available.
ACK 244774d.

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Sep 25, 2018

Member

Waiting on @promag's ack or further comments

Member

jonasschnelli commented Sep 25, 2018

Waiting on @promag's ack or further comments

@promag

This comment has been minimized.

Show comment
Hide comment
@promag

promag Sep 25, 2018

Member

@jonasschnelli thanks for the reminder, will check tonight.

Member

promag commented Sep 25, 2018

@jonasschnelli thanks for the reminder, will check tonight.

@promag

This comment has been minimized.

Show comment
Hide comment
@promag

promag Sep 26, 2018

Member

Could guard these mappings

mapper->addMapping(ui->hideTrayIcon, OptionsModel::HideTrayIcon);
mapper->addMapping(ui->minimizeToTray, OptionsModel::MinimizeToTray);

but since these widgets are disabled and the options dialog is the only place that changes these options, the guard is not necessary.

nit, could fix the comment

/* Window */

utACK 244774d — tomorrow I can setup a system without tray to test.

Member

promag commented Sep 26, 2018

Could guard these mappings

mapper->addMapping(ui->hideTrayIcon, OptionsModel::HideTrayIcon);
mapper->addMapping(ui->minimizeToTray, OptionsModel::MinimizeToTray);

but since these widgets are disabled and the options dialog is the only place that changes these options, the guard is not necessary.

nit, could fix the comment

/* Window */

utACK 244774d — tomorrow I can setup a system without tray to test.

@hebasto

This comment has been minimized.

Show comment
Hide comment
@hebasto

hebasto Sep 26, 2018

Contributor

@promag

but since these widgets are disabled and the options dialog is the only place that changes these options, the guard is not necessary.

Agree. (see below)

nit, could fix the comment

I did not catch your idea. What should it be like?

Contributor

hebasto commented Sep 26, 2018

@promag

but since these widgets are disabled and the options dialog is the only place that changes these options, the guard is not necessary.

Agree. (see below)

nit, could fix the comment

I did not catch your idea. What should it be like?

@promag

This comment has been minimized.

Show comment
Hide comment
@promag

promag Sep 26, 2018

Member

Should be "Non macOS"?

Member

promag commented Sep 26, 2018

Should be "Non macOS"?

@promag

This comment has been minimized.

Show comment
Hide comment
@promag

promag Sep 26, 2018

Member

BTW, I'm currently installing fedora..

Member

promag commented Sep 26, 2018

BTW, I'm currently installing fedora..

@hebasto

This comment has been minimized.

Show comment
Hide comment
@hebasto

hebasto Sep 26, 2018

Contributor

@promag

Should be "Non macOS"?

Ah, I see. The comment line /* Window */ just repeats the Options tab name.

Contributor

hebasto commented Sep 26, 2018

@promag

Should be "Non macOS"?

Ah, I see. The comment line /* Window */ just repeats the Options tab name.

@promag

This comment has been minimized.

Show comment
Hide comment
@promag

promag Sep 26, 2018

Member

@hebasto right, disregard that comment then.

Member

promag commented Sep 26, 2018

@hebasto right, disregard that comment then.

@hebasto

This comment has been minimized.

Show comment
Hide comment
@hebasto

hebasto Sep 27, 2018

Contributor

@promag

but since these widgets are disabled and the options dialog is the only place that changes these options, the guard is not necessary.

In fact, the guard around mapper is necessary: addMapping effectively overwrites ui settings in the OptionsDialog constructor.

Thank you for this catch. I'm going to fix it.

Contributor

hebasto commented Sep 27, 2018

@promag

but since these widgets are disabled and the options dialog is the only place that changes these options, the guard is not necessary.

In fact, the guard around mapper is necessary: addMapping effectively overwrites ui settings in the OptionsDialog constructor.

Thank you for this catch. I'm going to fix it.

Don't use systray icon on inappropriate systems
Prevent a user from losing access to the main window by minimizing it to
the tray on some systems (e.g. GNOME 3.26+).
@hebasto

This comment has been minimized.

Show comment
Hide comment
@hebasto

hebasto Sep 27, 2018

Contributor

@promag's catch has been fixed.

Contributor

hebasto commented Sep 27, 2018

@promag's catch has been fixed.

@DrahtBot

This comment has been minimized.

Show comment
Hide comment
@DrahtBot

DrahtBot Sep 28, 2018

Contributor
Coverage Change (pull 14228) Reference (master)
Lines +0.0287 % 87.0361 %
Functions +0.1235 % 84.1130 %
Branches +0.0085 % 51.5451 %
Contributor

DrahtBot commented Sep 28, 2018

Coverage Change (pull 14228) Reference (master)
Lines +0.0287 % 87.0361 %
Functions +0.1235 % 84.1130 %
Branches +0.0085 % 51.5451 %
@hebasto

This comment has been minimized.

Show comment
Hide comment
@hebasto

hebasto Oct 13, 2018

Contributor

@promag Would you mind re-reviewing this PR?

Contributor

hebasto commented Oct 13, 2018

@promag Would you mind re-reviewing this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment