Skip to content

Open Next/Previous - use current dialog filter #277

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

Closed
ProgerXP opened this issue Feb 26, 2020 · 3 comments
Closed

Open Next/Previous - use current dialog filter #277

ProgerXP opened this issue Feb 26, 2020 · 3 comments
Assignees

Comments

@ProgerXP
Copy link
Owner

#43 is currently using * mask to create the file list that it traverses (n2e_OpenNextFile). #258 implemented remembering of last used open/save dialog filter (iOpenSaveFilterIndex). Make it so that Open Next/Previous now use this filter instead of the hardcoded *. This will allow traversing only files matching the filter which was used last.

@cshnik
Copy link
Collaborator

cshnik commented Feb 27, 2020

Done.

@cshnik cshnik assigned ProgerXP and unassigned cshnik Feb 27, 2020
@ProgerXP
Copy link
Owner Author

ProgerXP commented Feb 28, 2020

if (psz[0] == L'*')

This makes an assumption that filters start with * but this is not necessary so. Valid filters like ?foo.* or foo.* won't be recognized. And there can be multiple masks per one filter. You should count \0 pairs instead.

Make it so that Open Next/Previous now use this filter instead of the hardcoded *.

If there was a misunderstanding: I meant that szFileFilter should receive the entire filter string (between two | or \0), not part of that string. For example, for foo|*;*;*|bar|?;?;? with iOpenSaveFilterIndex = 2 it should take ?;?;?, not a single ?.

@cshnik
Copy link
Collaborator

cshnik commented Feb 28, 2020

This makes an assumption that filters start with * but this is not necessary so. Valid filters like ?foo.* or foo.* won't be recognized.

Fixed.

If there was a misunderstanding: I meant that szFileFilter should receive the entire filter string (between two | or \0), not part of that string. For example, for foo|*;*;*|bar|?;?;? with iOpenSaveFilterIndex = 2 it should take ?;?;?, not a single ?.

Done. But there is a limitation:

  1. Multiple file type strings (*.txt;*.doc) work for Open/Save dialogs.
  2. Multiple file type strings are not supported by FindFirstFile.

@cshnik cshnik assigned ProgerXP and unassigned cshnik Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants