From 4c406bce171db7086e394f69ae3cddd3b4dc8a87 Mon Sep 17 00:00:00 2001 From: TingPing Date: Fri, 30 Aug 2013 20:19:10 -0400 Subject: Improve file dialogs - Fixes #314 - Adds file extensions to sound and image browsing - Some options no longer default to our config dir - Always add a shortcut to our config dir - Remove broken 'last_dir' functionality, gtk already knows recent --- src/fe-gtk/setup.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/fe-gtk/setup.c') diff --git a/src/fe-gtk/setup.c b/src/fe-gtk/setup.c index 2d46b95f..9923f654 100644 --- a/src/fe-gtk/setup.c +++ b/src/fe-gtk/setup.c @@ -1059,7 +1059,9 @@ setup_filereq_cb (GtkWidget *entry, char *file) static void setup_browsefile_cb (GtkWidget *button, GtkWidget *entry) { - gtkutil_file_req (_("Select an Image File"), setup_filereq_cb, entry, NULL, NULL, 0); + /* used for background image only */ + gtkutil_file_req (_("Select an Image File"), setup_filereq_cb, + entry, NULL, "*.jpg;*.png;*.tif;*.gif", FRF_EXTENSIONS|FRF_RECENTLYUSED); } static void @@ -1659,7 +1661,12 @@ static void setup_snd_browse_cb (GtkWidget *button, GtkEntry *entry) { char *sounds_dir = g_build_filename (get_xdir (), HEXCHAT_SOUND_DIR, NULL); - gtkutil_file_req (_("Select a sound file"), setup_snd_filereq_cb, entry, sounds_dir, NULL, FRF_FILTERISINITIAL); + char *extensions = NULL; +#ifdef WIN32 /* win32 only supports wav, others could support anything */ + extensions = "*.wav"; +#endif + + gtkutil_file_req (_("Select a sound file"), setup_snd_filereq_cb, entry, sounds_dir, extensions, FRF_FILTERISINITIAL|FRF_EXTENSIONS); g_free (sounds_dir); } -- cgit 1.4.1