diff --git a/gtk3/main.c b/gtk3/main.c index 4be2ff3..78e98fa 100644 --- a/gtk3/main.c +++ b/gtk3/main.c @@ -1338,6 +1338,33 @@ static void activate_open(GSimpleAction *action, GVariant *parameter, gpointer a stop(); GtkFileChooserNative *native = gtk_file_chooser_native_new("Open File", GTK_WINDOW(gui_data.main_window), GTK_FILE_CHOOSER_ACTION_OPEN, "_Open", "_Cancel"); + + GtkFileFilter *filter = gtk_file_filter_new(); + gtk_file_filter_add_pattern(filter, "*.gb"); + gtk_file_filter_add_pattern(filter, "*.gbc"); + gtk_file_filter_add_pattern(filter, "*.isx"); + gtk_file_filter_add_mime_type(filter, "application/x-gameboy-rom"); + gtk_file_filter_add_mime_type(filter, "application/x-gameboy-color-rom"); + gtk_file_filter_set_name(filter, "All Supported Files (*.gb, *.gbc, *.isx)"); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(native), filter); + + filter = gtk_file_filter_new(); + gtk_file_filter_add_pattern(filter, "*.gb"); + gtk_file_filter_add_mime_type(filter, "application/x-gameboy-rom"); + gtk_file_filter_set_name(filter, "Game Boy (*.gb)"); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(native), filter); + + filter = gtk_file_filter_new(); + gtk_file_filter_add_pattern(filter, "*.gbc"); + gtk_file_filter_add_mime_type(filter, "application/x-gameboy-color-rom"); + gtk_file_filter_set_name(filter, "Game Boy Color (*.gbc)"); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(native), filter); + + filter = gtk_file_filter_new(); + gtk_file_filter_add_pattern(filter, "*"); + gtk_file_filter_set_name(filter, "All Files"); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(native), filter); + gint res = gtk_native_dialog_run(GTK_NATIVE_DIALOG(native)); if (res == GTK_RESPONSE_ACCEPT) {