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 committed Aug 28, 2024
1 parent ba22b15 commit be44ccf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 deletions desktop/assets/texts/en-US/dialogs.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ dialog-ok = OK
dialog-cancel = Cancel
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
9 changes: 6 additions & 3 deletions desktop/src/gui/picker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@ 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"), &["*"])
.set_title(text(locale, "file-picker-title-open-file"));
.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, "picker-title-open-file"));

if let Some(dir) = dir {
dialog = dialog.set_directory(dir);
Expand Down

0 comments on commit be44ccf

Please sign in to comment.