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

Fix repeating close dialog on macOS and qt 5.12 #5337

Merged
merged 2 commits into from
Nov 16, 2022

Conversation

Czaki
Copy link
Collaborator

@Czaki Czaki commented Nov 14, 2022

Description

Try to solve (from @tlambert03)

if you press cmd-q, and then press it again (as the dialog instructs), it doesn't quit... it just opens more dialogs

Untitled.mov

Type of change

  • Bug-fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

References

closes #5335

How has this been tested?

  • example: the test suite for my feature covers cases x, y, and z
  • example: all tests pass with my change
  • example: I check if my changes works with both PySide and PyQt backends
    as there are small differences between the two Qt bindings.

Final checklist:

  • My PR is the minimum possible work for the desired functionality
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • If I included new strings, I have used trans. to make them localizable.
    For more information see our translations guide.

@github-actions github-actions bot added the qt Relates to qt label Nov 14, 2022
@codecov
Copy link

codecov bot commented Nov 14, 2022

Codecov Report

Merging #5337 (f42d49e) into main (aaea9f0) will increase coverage by 0.00%.
The diff coverage is 20.00%.

@@           Coverage Diff           @@
##             main    #5337   +/-   ##
=======================================
  Coverage   89.08%   89.08%           
=======================================
  Files         582      582           
  Lines       49313    49318    +5     
=======================================
+ Hits        43931    43936    +5     
  Misses       5382     5382           
Impacted Files Coverage Δ
napari/_qt/qt_main_window.py 76.04% <20.00%> (-0.52%) ⬇️
napari/utils/theme.py 89.79% <0.00%> (+0.68%) ⬆️
napari/utils/info.py 83.33% <0.00%> (+1.11%) ⬆️
napari/_qt/__init__.py 55.17% <0.00%> (+6.89%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@psobolewskiPhD
Copy link
Member

I can't say I get the code, but it does fix the issue in my macOS 12.6 Rosetta-emulated x86 env with pyqt 5.12.3.
👍 @Czaki

@Czaki
Copy link
Collaborator Author

Czaki commented Nov 14, 2022

I add comments with explanations.

@psobolewskiPhD
Copy link
Member

OK, I think I see it now. I was writting a question and explained it to myself.
My hangup was that quit_app is actually a bool so either False or True so it works with the dict you defined at the beginning in L118.
I'd still rather someone else review this just to be safe,

@Czaki
Copy link
Collaborator Author

Czaki commented Nov 14, 2022

I could change bool to enum to increase readability if needed.

@psobolewskiPhD
Copy link
Member

No no, it's me being an imbecile and not comprehending: self._is_close_dialog[quit_app]

@tlambert03
Copy link
Contributor

tlambert03 commented Nov 14, 2022

nice job @Czaki :) (can confirm this fixes it on 5.12 for me)

@Czaki
Copy link
Collaborator Author

Czaki commented Nov 14, 2022

Would you vote for 0.4.18 bugfix release or could it wait until 0.5.0?

@tlambert03
Copy link
Contributor

don't have an opinion

@Czaki Czaki added this to the 0.5.0 milestone Nov 14, 2022
@Czaki
Copy link
Collaborator Author

Czaki commented Nov 14, 2022

Ok. Will merge after 24h.

@Czaki Czaki changed the title Try to fix repeating close dialog on macOS and qt 5.12 Fix repeating close dialog on macOS and qt 5.12 Nov 16, 2022
@Czaki Czaki merged commit 6154efe into napari:main Nov 16, 2022
@Czaki Czaki deleted the bugfix/close_window_confirm branch November 16, 2022 09:18
@Czaki Czaki added the bugfix PR with bugfix label Dec 5, 2022
@Czaki Czaki mentioned this pull request Jun 7, 2023
@Czaki Czaki modified the milestones: 0.5.0, 0.4.18 Jun 16, 2023
Czaki added a commit that referenced this pull request Jun 16, 2023
Czaki added a commit that referenced this pull request Jun 17, 2023
Czaki added a commit that referenced this pull request Jun 18, 2023
Czaki added a commit that referenced this pull request Jun 19, 2023
Czaki added a commit that referenced this pull request Jun 21, 2023
Czaki added a commit that referenced this pull request Jun 21, 2023
Czaki added a commit that referenced this pull request Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix PR with bugfix qt Relates to qt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

double command-q no longer quitting
3 participants