diff --git a/src/boxes.rs b/src/boxes.rs index 900334c..62d183c 100644 --- a/src/boxes.rs +++ b/src/boxes.rs @@ -1,6 +1,6 @@ use std::rc::Rc; -use gtk4::{prelude::*, Window}; +use gtk4::{prelude::*, Window, FileFilter}; use gtk4::{ glib::*, ApplicationWindow, @@ -73,6 +73,14 @@ impl RomBox { // here's to set the dialog to be modal dialog.set_modal(true); + + // add a filter! + let rom_filter = FileFilter::new(); + rom_filter.add_mime_type("application/vnd.nintendo.snes.rom"); + rom_filter.set_name(Some("SNES ROMs")); + dialog.add_filter(&rom_filter); + + // run the dialog dialog.run_async(|d, r| { match r { ResponseType::Accept => d.close(), @@ -142,6 +150,14 @@ impl PatchBox { // here's to set the dialog to be modal dialog.set_modal(true); + + let patch_filter = FileFilter::new(); + patch_filter.add_mime_type("application/x-bps-patch"); + patch_filter.add_mime_type("application/x-ips-patch"); + patch_filter.set_name(Some("Patches")); + dialog.add_filter(&patch_filter); + + // run the dialog dialog.run_async(|d, r| { match r { ResponseType::Accept => d.close(),