From a2fa9062e06230121c9f20f3d4b97278a2376c49 Mon Sep 17 00:00:00 2001 From: punkrockguy318 Date: Fri, 26 Feb 2010 03:28:02 +0000 Subject: [PATCH] GTK: updated file filters in load game to include zip archives --- src/drivers/sdl/gui.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/drivers/sdl/gui.cpp b/src/drivers/sdl/gui.cpp index 52dfc72f..149c8d09 100644 --- a/src/drivers/sdl/gui.cpp +++ b/src/drivers/sdl/gui.cpp @@ -957,19 +957,35 @@ void loadFdsBios () void loadGame () { GtkWidget* fileChooser; + GtkFileFilter* filterFCEU; GtkFileFilter* filterNes; GtkFileFilter* filterFds; + GtkFileFilter* filterZip; GtkFileFilter* filterAll; - + filterFCEU = gtk_file_filter_new(); filterNes = gtk_file_filter_new(); filterFds = gtk_file_filter_new(); + filterZip = gtk_file_filter_new(); + gtk_file_filter_add_pattern(filterFCEU, "*.nes"); + gtk_file_filter_add_pattern(filterFCEU, "*.NES"); + gtk_file_filter_add_pattern(filterFCEU, "*.fds"); + gtk_file_filter_add_pattern(filterFCEU, "*.FDS"); + gtk_file_filter_add_pattern(filterFCEU, "*.zip"); + gtk_file_filter_add_pattern(filterFCEU, "*.ZIP"); + gtk_file_filter_add_pattern(filterFCEU, "*.Nes"); + gtk_file_filter_add_pattern(filterFCEU, "*.Fds"); + gtk_file_filter_add_pattern(filterFCEU, "*.Zip"); gtk_file_filter_add_pattern(filterNes, "*.nes"); gtk_file_filter_add_pattern(filterNes, "*.NES"); gtk_file_filter_add_pattern(filterFds, "*.fds"); - gtk_file_filter_add_pattern(filterFds, "*.FDS"); + gtk_file_filter_add_pattern(filterZip, "*.FDS"); + gtk_file_filter_add_pattern(filterZip, "*.zip"); + gtk_file_filter_add_pattern(filterZip, "*.zip"); + gtk_file_filter_set_name(filterFCEU, "*.nes;*.fds;*.zip"); gtk_file_filter_set_name(filterNes, "NES ROM files"); gtk_file_filter_set_name(filterFds, "FDS ROM files"); + gtk_file_filter_set_name(filterZip, "Zip archives"); filterAll = gtk_file_filter_new(); gtk_file_filter_add_pattern(filterAll, "*"); @@ -979,8 +995,10 @@ void loadGame () GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(fileChooser), filterFCEU); gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(fileChooser), filterNes); gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(fileChooser), filterFds); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(fileChooser), filterZip); gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(fileChooser), filterAll); if (gtk_dialog_run (GTK_DIALOG (fileChooser)) ==GTK_RESPONSE_ACCEPT)