diff options
author | Guy Harris <guy@alum.mit.edu> | 2004-02-11 01:23:25 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2004-02-11 01:23:25 +0000 |
commit | 727b913bbd2b41c6ece202f240f69e2f621833ac (patch) | |
tree | a51e826d510cce43db5779afb98d8e2a705da366 /alert_box.c | |
parent | c7fd1b2b1357cf491eeb57d8313e5d33fd766094 (diff) |
Add an "open_failure_alert_box()" routine to pop up an alert box for a
failed attempt to open/create a file.
Fix one call to pass the right value for the "for_writing" flag.
svn path=/trunk/; revision=10026
Diffstat (limited to 'alert_box.c')
-rw-r--r-- | alert_box.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/alert_box.c b/alert_box.c index c2f8784acc..ecd0f734d7 100644 --- a/alert_box.c +++ b/alert_box.c @@ -2,7 +2,7 @@ * Routines to put up various "standard" alert boxes used in multiple * places * - * $Id: alert_box.c,v 1.1 2004/02/11 00:55:26 guy Exp $ + * $Id: alert_box.c,v 1.2 2004/02/11 01:23:23 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -29,6 +29,7 @@ #include <glib.h> +#include <epan/filesystem.h> #include <epan/dfilter/dfilter.h> #include "alert_box.h" @@ -36,6 +37,25 @@ #include "simple_dialog.h" /* + * Alert box for a failed attempt to open or create a file. + * "err" is assumed to be a UNIX-style errno; "for_writing" is TRUE if + * the file is being opened for writing and FALSE if it's being opened + * for reading. + * + * XXX - add explanatory secondary text for at least some of the errors; + * various HIGs suggest that you should, for example, suggest that the + * user remove files if the file system is full. Perhaps that's because + * they're providing guidelines for people less sophisticated than the + * typical Ethereal user is, but.... + */ +void +open_failure_alert_box(const char *filename, int err, gboolean for_writing) +{ + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, + file_open_error_message(err, for_writing), filename); +} + +/* * Alert box for an invalid display filter expression. * Assumes "dfilter_error_msg" has been set by "dfilter_compile()" to the * error message for the filter. |