Skip to content

Commit

Permalink
desktop: Improve filters in file pickers
Browse files Browse the repository at this point in the history
  • Loading branch information
kjarosh authored and torokati44 committed Sep 11, 2024
1 parent 14302b8 commit 75e4eaa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions desktop/assets/texts/en-US/file_picker.ftl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
file-picker-title-open-file = Open a single file
file-picker-filter-flash-files = Flash Files
file-picker-filter-all-files = All Files
file-picker-filter-supported = All Supported Files
file-picker-filter-swf = SWF (*.swf)
file-picker-filter-spl = FutureSplash Animator (*.spl)
file-picker-filter-ruf = Ruffle Bundle (*.ruf)
file-picker-filter-all = All Files
7 changes: 5 additions & 2 deletions desktop/src/gui/picker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,13 @@ impl FilePicker {
let locale = &self.data.preferences.language();
let mut dialog = AsyncFileDialog::new()
.add_filter(
text(locale, "file-picker-filter-flash-files"),
text(locale, "file-picker-filter-supported"),
&["swf", "spl", "ruf"],
)
.add_filter(text(locale, "file-picker-filter-all-files"), &["*"])
.add_filter(text(locale, "file-picker-filter-swf"), &["swf"])
.add_filter(text(locale, "file-picker-filter-spl"), &["spl"])
.add_filter(text(locale, "file-picker-filter-ruf"), &["ruf"])
.add_filter(text(locale, "file-picker-filter-all"), &["*"])
.set_title(text(locale, "file-picker-title-open-file"));

if let Some(dir) = dir {
Expand Down

0 comments on commit 75e4eaa

Please sign in to comment.