diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-10-23 05:01:02 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-10-23 05:01:02 +0000 |
commit | cf5a1d86e7280ec6b26a258238dd3fb3d6b31f59 (patch) | |
tree | 6b6ced95b0d95cc2f7243f2ff7546552b12f4dfa /gtk/filter_prefs.c | |
parent | 04147b7dcf4e435dab2f6aa141e0e8dec7b88b06 (diff) |
Add a new routine to create the ".ethereal" directory for a user.
Use that routine rather than duplicating that code in the routines to
write out the preference file and filter files.
Use it in the code for the color filter dialog, so that the directory in
question is created if necessary.
As that routine returns an error indication, have the code that calls
that routine put up a message box if the attempt fails.
svn path=/trunk/; revision=4065
Diffstat (limited to 'gtk/filter_prefs.c')
-rw-r--r-- | gtk/filter_prefs.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/gtk/filter_prefs.c b/gtk/filter_prefs.c index 3f23d9103b..50f645035d 100644 --- a/gtk/filter_prefs.c +++ b/gtk/filter_prefs.c @@ -3,12 +3,11 @@ * (This used to be a notebook page under "Preferences", hence the * "prefs" in the file name.) * - * $Id: filter_prefs.c,v 1.30 2001/06/27 10:00:14 guy Exp $ + * $Id: filter_prefs.c,v 1.31 2001/10/23 05:01:02 guy Exp $ * * Ethereal - Network traffic analyzer - * By Gerald Combs <gerald@zing.org> + * By Gerald Combs <gerald@ethereal.com> * Copyright 1998 Gerald Combs - * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -33,7 +32,7 @@ #include <gtk/gtk.h> -#include <epan.h> +#include <epan/filesystem.h> #include "filters.h" #include "gtk/main.h" @@ -709,10 +708,20 @@ static void filter_dlg_save_cb(GtkWidget *save_bt, gpointer data) { filter_list_type_t list = *(filter_list_type_t *)data; + const char *pf_dir_path; char *f_path; int f_save_errno; char *filter_type; + /* Create the directory that holds personal configuration files, + if necessary. */ + if (create_persconffile_dir(&pf_dir_path) == -1) { + simple_dialog(ESD_TYPE_WARN, NULL, + "Can't create directory\n\"%s\"\nfor filter files: %s.", + pf_dir_path, strerror(errno)); + return; + } + save_filter_list(list, &f_path, &f_save_errno); if (f_path != NULL) { /* We had an error saving the filter. */ |