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

Make win filechooser use modern windows browser and fix small issues. #535

Merged
merged 1 commit into from
Jan 23, 2020

Conversation

matham
Copy link
Member

@matham matham commented Jan 23, 2020

This fixes a bunch of issues with filechooser on windows:

  • When browsing for files and the user provides a initial default path, previously it'd set the default filename in the GUI to the final component of the provided path and the root to the dirname of the provided path. However, when passing a directory as the initial path, we should be using that path, not its parent, so that is fixed.
  • The default extension included the period before the extension, but that made windows append two periods to the selected filename. So we strip the period before passing the extension to windows.
  • The OFN_EXTENSIONDIFFERENT doesn't do anything because it's only set by windows, not by us, so I removed it.
  • I added the OFN_HIDEREADONLY because before the GUI showed the option to open the file as read only, but the user is not actually notified when this option is selected. With the flag that option is not shown.
  • When the user cancels the GUI and doesn't select anything, previously it'd print an error, now it doesn't (user is still notified with an empty selection).
  • Previously, in multi-selection mode, if only one file was selected, the selection would be empty - this is fixed.
  • Previously, when in directory selection mode, the GUI used a very old and restrictive viewer - I changed it to use a newer and friendlier Windows user interface.
  • Now we catch all exceptions, rather than only a few ones so we can tell the user when selection was empty.

Hopefully, in the future we could use the newest windows selection API, which is much more friendlier, but that is not supported by pywin32 yet.

@matham matham merged commit 48c8b62 into master Jan 23, 2020
@matham matham deleted the matham-patch-1 branch January 23, 2020 17:05
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.

1 participant