aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/capture_dlg.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-03-29 22:40:58 +0000
committerGuy Harris <guy@alum.mit.edu>2004-03-29 22:40:58 +0000
commit29c644691b49c655372aa355f51b4e33eaef7d99 (patch)
tree6719c44647f45c9072ae42483e919cad6d7f6046 /gtk/capture_dlg.c
parent08c04ec97398e122efff4fb3c5145716ed110525 (diff)
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
Diffstat (limited to 'gtk/capture_dlg.c')
-rw-r--r--gtk/capture_dlg.c19
1 files changed, 3 insertions, 16 deletions
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 <gerald@ethereal.com>
@@ -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);