Fix logic for selecting action in file dialog#2003
Merged
corranwebster merged 1 commit intoenthought:mainfrom Apr 11, 2023
Merged
Fix logic for selecting action in file dialog#2003corranwebster merged 1 commit intoenthought:mainfrom
corranwebster merged 1 commit intoenthought:mainfrom
Conversation
corranwebster
approved these changes
Apr 6, 2023
Contributor
corranwebster
left a comment
There was a problem hiding this comment.
Looks good to me!
Thanks for the PR.
Contributor
Author
|
While running this change, I've noticed that the |
Contributor
|
Could you update this to the current main branch - we've moved traitsui/qt4 to traitsui/qt and github can't automatically merge |
906224b to
f83cd39
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
FileDialog.actioncan have valuesopen,open files, orsave as, see https://github.com/enthought/pyface/blob/a9bf0264cb2afe9d05ce8856de650fd6efbc2684/pyface/ui/wx/file_dialog.py#L37 and https://github.com/enthought/pyface/blob/a9bf0264cb2afe9d05ce8856de650fd6efbc2684/pyface/ui/qt/file_dialog.py#L36.The
dialog_styleon the other hand can have valuesopenandsave, seetraitsui/traitsui/editors/file_editor.py
Lines 77 to 78 in c08f891
As such, the logic for converting from
dialog_styletoactionwas the wrong way around. As a result,the file dialog would always open in "open" mode.