flxzt / rnote

Sketch and take handwritten notes.
https://rnote.flxzt.net
GNU General Public License v3.0
6.42k stars 215 forks source link

fix: `filters` not working for the save dialog #1075

Closed Doublonmousse closed 2 months ago

Doublonmousse commented 2 months ago

To fix #1073 .

Makes the filter on the save dialog work.

image

Before this the file type part was empty (filter not applied) leading to various potential errors, including the possibility to create files that have no extension.

flxzt commented 2 months ago

Thanks a lot! Adding filters() before using default_filter() is missing in several places in the code, do you want to fix this everywhere?

Doublonmousse commented 2 months ago

On it. For now I'm doing it kinda "naively" for the export part (meaning that there's a single filter shown for .svg if svg is selected in the previous export window, but there is no bidirectional link that would allow to change the file type in the file chooser window to say, a .pdf file and have the change propagated back into the application)

Doublonmousse commented 2 months ago

I do get some

(rnote:36736): Gtk-WARNING **: 13:05:01.848: gtk_file_chooser_add_filter() called on filter already in list

for the import file dialog somehow.

flxzt commented 2 months ago

ListStore's are also deprecated.. nevermind, only gtk4::ListStore is

But I'd prefer to keep it a single filter anyway, because then it is immediatly clear what is importable - everything that is visibly listed in the filepicker

Doublonmousse commented 2 months ago

Is it ? On gtk-rs gtk4::ListStore is shown as deprecated, with gio::ListStore to use instead.

flxzt commented 2 months ago

My bad, gio::ListStore is not

flxzt commented 2 months ago

Works now for me. Thanks for this fix :)