Closed giswqs closed 3 years ago
Sounds good. I'll need to check what would be the easiest option to implement. I'll finish https://github.com/crahan/ipyfilechooser/issues/35 first and release a new version. Then pivot back to this.
The easiest way to solve this is by keeping the select
or change
button disabled unless the user specifies a filename that matches one of the configured filter patterns. For example, if the filter pattern is set to ['*.txt', '*.png']
, only filenames ending in txt
or png
will enable the button and allow the selection to be saved.
If the user needs to be made aware of this restriction, I'd recommend using the title
property or a separate label alongside the filechooser widget to display an additional message with more details.
Good solution. Thanks.
Thanks for the quick feedback! I'll include this in 0.4.3 together with the top_folder
property that restricts navigation to a specific top folder. Should be available in the next day or 2.
Aplogies for the delay on implementing this and the top_folder
fix. Unfortunatley, I had to focus on a more pressing matter. I'm picking this back up now.
No problem. Thank you for your support.
Version 0.4.3 (https://github.com/crahan/ipyfilechooser/releases/tag/v0.4.3) now prevents the chosen filename from being applied when the name does not align with one of the filter_pattern
values. PyPi and Conda-forge releases should now be available as well.
Thank you for implementing the filter pattern to allow multiple file extensions. It works like a charm! I would like to make a suggestion. If the user creates a new file with a file extension not in the allowed extension list, it is probably better to prompt the user the correct the file extension. If it is something difficult to implement, maybe changing the text color to red rather than the default green color would work.