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

FileMenu : Fix premature exit when opening backup containing error #2527

Merged
merged 1 commit into from Apr 4, 2018

Conversation

johnhaddon
Copy link
Member

This occurred when opening a file with gaffer somefile.gfr, and the sequence of operations was this :

  • Find backup, prompt to open it (in FileMenu.__addScript)
  • Delete prompt dialogue
  • QApplication decides it should quit, because the last top level window
    has been closed
  • Load script and attempt to display error dialogue, but this
    closes immediately because the modal event loop returns
    immediately
  • Application closes

This is fixed by not deleting the dialogue until exit from the function, and merely hiding it instead. An alternative would be to call QApplication.setQuitOnLastWindowClosed( False ), but that might affect existing applications.

Fixes #2526

Note : Implemented and tested on MacOS - need to test on Linux before merging.

This occurred when opening a file with `gaffer somefile.gfr`, and the sequence of operations was this :

- Find backup, prompt to open it (in FileMenu.__addScript)
- Delete prompt dialogue
- QApplication decides it should quit, because the last top level window
  has been closed
- Load script and attempt to display error dialogue, but this
  closes immediately because the modal event loop returns
  immediately
- Application closes

This is fixed by not deleting the dialogue until exit from the function, and merely hiding it instead. An alternative would be to call `QApplication.setQuitOnLastWindowClosed( False )`, but that might affect existing applications.

Fixes GafferHQ#2526
@johnhaddon
Copy link
Member Author

I tested this OK on Linux so I'm removing the pr-onHold label.

@andrewkaufman andrewkaufman merged commit a41f39a into GafferHQ:master Apr 4, 2018
@johnhaddon johnhaddon deleted the fileMenuFix branch April 5, 2018 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gaffer App : Command Line Script Argument Dialog Problem
2 participants