Bug 578096 - FileDialog event on filter change
Summary: FileDialog event on filter change
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.22   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-07 07:49 EST by Christoph Laeubrich CLA
Modified: 2022-01-11 23:55 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Laeubrich CLA 2022-01-07 07:49:23 EST
I'd like to adjust the name of the file according to the selected filter. Currently there is no way to know when the user selects a different filter.

The use case is that i like to auto extend the file-extension to the name, currently I do this after closing the dialog but this is a bit undesirable as I can't use the "overwrite" feature reliable then.
Comment 1 Alexander Kurtakov CLA 2022-01-07 07:58:08 EST
Gtk doesn't provide signal for changed filter https://docs.gtk.org/gtk3/iface.FileChooser.html so not much we can do.
Comment 2 Christoph Laeubrich CLA 2022-01-07 07:59:09 EST
What about Windows/Mac? Maybe it could be at least added as "best effort"?
Comment 3 Alexander Kurtakov CLA 2022-01-07 08:04:50 EST
Win/Mac has to be checked too so the API can be implemented on these platforms too. I just happen to have zero knowledge about these platforms.
The path forward here for GTK/Linux would be to report issue against GTK so they provide signal for filter-changed for FileChooser.
Comment 4 Christoph Laeubrich CLA 2022-01-09 12:59:40 EST
(In reply to Alexander Kurtakov from comment #3)
> The path forward here for GTK/Linux would be to report issue against GTK so
> they provide signal for filter-changed for FileChooser.

I'm not very familiar with GTK+reporting issues against it, would you mind open an enhancement request there?

I could even think about simply checking each 300ms the current value and if it differs generate a custom event if some platforms do not support it out of the box.
Comment 5 Joel Majano CLA 2022-01-11 15:28:17 EST
I created an issue with GTK, I will keep checking to see if there are any updates. See https://gitlab.gnome.org/GNOME/gtk/-/issues/4626
Comment 6 Christoph Laeubrich CLA 2022-01-11 23:55:59 EST
(In reply to Joel Majano from comment #5)
> I created an issue with GTK, I will keep checking to see if there are any
> updates. See https://gitlab.gnome.org/GNOME/gtk/-/issues/4626

Many thanks! We should still discuss if it would be suitable to have a poly-fill for systems (currently) not supporting this natively.