From 727b913bbd2b41c6ece202f240f69e2f621833ac Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 11 Feb 2004 01:23:25 +0000 Subject: 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 --- alert_box.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'alert_box.c') 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 @@ -29,12 +29,32 @@ #include +#include #include #include "alert_box.h" #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 -- cgit v1.2.3