fileChooser: Only list supported image formats
Closes #151 Part-of: <https://gitlab.gnome.org/GNOME/Incubator/loupe/-/merge_requests/238>
This commit is contained in:
parent
cc1c8a3da5
commit
eb94683d1f
2 changed files with 14 additions and 12 deletions
17
Cargo.lock
generated
17
Cargo.lock
generated
|
|
@ -1081,19 +1081,18 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "glycin"
|
name = "glycin"
|
||||||
version = "0.0.1"
|
version = "0.1.0-alpha.2"
|
||||||
source = "git+https://gitlab.gnome.org/sophie-h/glycin.git#2e3f9add120a4913e559729d361d6d7e5d010f2b"
|
source = "git+https://gitlab.gnome.org/sophie-h/glycin.git#c85bff97db98c311a278816fd0efbc28173a2419"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-std",
|
"async-std",
|
||||||
"futures",
|
"futures",
|
||||||
"gdk4",
|
"gdk4",
|
||||||
"gio",
|
"gio",
|
||||||
"glib",
|
|
||||||
"glycin-utils",
|
"glycin-utils",
|
||||||
"lcms2",
|
"lcms2",
|
||||||
"memfd",
|
"memfd",
|
||||||
"memmap2 0.6.2",
|
"memmap2 0.7.0",
|
||||||
"nix",
|
"nix",
|
||||||
"rgb",
|
"rgb",
|
||||||
"safe-transmute",
|
"safe-transmute",
|
||||||
|
|
@ -1102,13 +1101,13 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "glycin-utils"
|
name = "glycin-utils"
|
||||||
version = "0.0.1"
|
version = "0.1.0-alpha.2"
|
||||||
source = "git+https://gitlab.gnome.org/sophie-h/glycin.git#2e3f9add120a4913e559729d361d6d7e5d010f2b"
|
source = "git+https://gitlab.gnome.org/sophie-h/glycin.git#c85bff97db98c311a278816fd0efbc28173a2419"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-std",
|
"async-std",
|
||||||
"gettext-rs",
|
"gettext-rs",
|
||||||
"memmap2 0.6.2",
|
"memmap2 0.7.0",
|
||||||
"nix",
|
"nix",
|
||||||
"serde",
|
"serde",
|
||||||
"zbus",
|
"zbus",
|
||||||
|
|
@ -1688,9 +1687,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "memmap2"
|
name = "memmap2"
|
||||||
version = "0.6.2"
|
version = "0.7.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872"
|
checksum = "180d4b35be83d33392d1d1bfbd2ae1eca7ff5de1a94d3fc87faaa99a069e7cbd"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -466,9 +466,12 @@ impl LpWindow {
|
||||||
|
|
||||||
let filter_supported_formats = gtk::FileFilter::new();
|
let filter_supported_formats = gtk::FileFilter::new();
|
||||||
filter_supported_formats.set_name(Some(&gettext("Supported image formats")));
|
filter_supported_formats.set_name(Some(&gettext("Supported image formats")));
|
||||||
filter_supported_formats.add_mime_type("image/*");
|
for mime_type in glycin::image_formats().await {
|
||||||
// Manual support for Farbfeld since it has no mime type
|
filter_supported_formats.add_mime_type(&mime_type);
|
||||||
filter_supported_formats.add_suffix("ff");
|
}
|
||||||
|
// TODO: Update when SVG moves to glycin as well
|
||||||
|
filter_supported_formats.add_mime_type("image/svg+xml");
|
||||||
|
filter_supported_formats.add_mime_type("image/svg+xml-compressed");
|
||||||
|
|
||||||
let filter_all_files = gtk::FileFilter::new();
|
let filter_all_files = gtk::FileFilter::new();
|
||||||
filter_all_files.set_name(Some(&gettext("All files")));
|
filter_all_files.set_name(Some(&gettext("All files")));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue