-
-
Notifications
You must be signed in to change notification settings - Fork 22.4k
Allow the filename_filter
property to be changed.
#104492
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
Allow the filename_filter
property to be changed.
#104492
Conversation
This fixes godotengine#104067 in a hacky way. This removes the problematic if statement in FileDialog, which was making the filename_filter box permanently un-editable.
f4ed584
to
760aea7
Compare
Simply removing the Although I wonder why is the filter even exposed as a property? |
filename_filter
property to be changed.
Hello, that was something I was unfortunately un-able to figure out; how to make the filter clear itself when the box is not visible. It seems that something is horribly wrong in the back-end, or I'm really looking at it wrong. Either way, I'm not sure how to proceed, and I'm open to ideas. I'm not sure what you mean by :
Apologies. |
Ok I looked at FileDialog again (sorry, I wasn't familiar with I think |
Hey. Those are good compromises/solutions. I'll give those a try and see which one is easier. Thanks! |
Yes, that should've been discussed in the original PR. Now it's too late .-.
|
Apologies if that was a joke that I did not get, but what PR are you talking about? There could be uses for a "default search text". I've used this property myself in my (now defunct) M3U editor. When clicking the name of an artist, a file dialog opens with the default search text (filename_filter) being the text of the artist name. Same applies to the song title. Admittedly later on I switched to using native dialogs. If it's intended to be used as a default search text, it could be renamed to something like What do you suggest I do? Patch the bug or completely remove this property? EDIT: When I say patch the bug, I'll find a new solution to the filename_filter not resetting properly when the box is hidden. |
I meant the implementation pull request (#88673). It's fairly recent, but it was merged in 4.4, so removing or renaming the property is not possible (it would break compatibility). Though if you say that default search text has some use then fine. I came up with another solution. My problem with the current one is that it can result in the dialog filtering entries with invisible filter. It can be solved by making the filter field automatically appear when |
It's a niche use indeed, but I feel it's still important to keep this property. It's not like we can remove it anyway. I'll take a look at that PR and see what I can gather about the current implementation. I'll also try all the solutions we've discussed and see which one works out the best. I didn't have much time recently but hopefully I will in this week. Thanks! |
Hello, just a status update. |
Hello. The issue stems from the fact that using _validate_property() in the source code side gets over-ridden by _validate_property() on the gdscript side, which means that I'm unable to force the (editor) box to be visible if its set to PROPERTY_USAGE_NO_EDITOR. Similarly, it seems that I'm unable to access |
Superseded by #106135. Thanks for the contribution! |
This fixes #104067 in a hacky way.
A downside of this PR is that if the property is hidden away using this code
The
filename_filter
property persists and still works. I could not find a fix for this, but suggestions are welcome. Using the code in commit14f519f47425a2062542f1f70aa68622be617e88
does not work due to some unknown reason. I even tried doing it like thisHowever that failed to provide the desired effect. As of now, it seems that removing the faulty code is the only way to proceed.
It appears that using
!show_filename_filter
makes the box permanently uneditable as it is being cleared all the time, and usingshow_filename_filter
allows editing but does not clear the box when it is hidden away then un-hidden. Truly quite a deep problem. I couldn't figure out how to print messages so that I could debug the state ofshow_filename_filter
, and exactly pinpoint what was going wrong.NOTE : Ready to merge.