From 29c644691b49c655372aa355f51b4e33eaef7d99 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 29 Mar 2004 22:40:58 +0000 Subject: Make "file_selection_new()" take as its second argument an Ethereal-defined indication of the action (open vs. save), regardless of whether we're building for GTK+ >= 2.4 or not; we just ignore the argument in pre-2.4 GTK+. Use "file_selection_new()" rather than #if'ed code to use it or "gtk_file_chooser_dialog_new()" for GTK+ >= 2.4 and "gtk_file_selection_new()" or it for pre-2.4 GTK+. Add a "file_selection_set_current_folder()" routine that does the appropriate thing depending on whether we're GTK+ >= 2.4 or not, and use that rather than #if'ed code to use "gtk_file_chooser_set_current_folder()" or "gtk_file_selection_set_filename()". svn path=/trunk/; revision=10511 --- gtk/capture_dlg.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'gtk/capture_dlg.c') diff --git a/gtk/capture_dlg.c b/gtk/capture_dlg.c index 44b4f3ded8..c373199f38 100644 --- a/gtk/capture_dlg.c +++ b/gtk/capture_dlg.c @@ -1,7 +1,7 @@ /* capture_dlg.c * Routines for packet capture windows * - * $Id: capture_dlg.c,v 1.123 2004/03/27 12:18:40 ulfl Exp $ + * $Id: capture_dlg.c,v 1.124 2004/03/29 22:40:57 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -1043,25 +1043,12 @@ capture_prep_file_cb(GtkWidget *w, gpointer file_te) return; } -#if (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 4) || GTK_MAJOR_VERSION > 2 - fs = gtk_file_chooser_dialog_new("Ethereal: Capture File", - GTK_WINDOW(top_level), - GTK_FILE_CHOOSER_ACTION_SAVE, - GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - NULL); -#else - fs = file_selection_new ("Ethereal: Capture File"); -#endif + fs = file_selection_new("Ethereal: Capture File", FILE_SELECTION_SAVE); /* If we've opened a file, start out by showing the files in the directory in which that file resided. */ if (last_open_dir) -#if (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 4) || GTK_MAJOR_VERSION > 2 - gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(fs), last_open_dir); -#else - gtk_file_selection_set_filename(GTK_FILE_SELECTION(fs), last_open_dir); -#endif + file_selection_set_current_folder(fs, last_open_dir); OBJECT_SET_DATA(fs, E_CAP_FILE_TE_KEY, file_te); -- cgit v1.2.3