/* 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 Wireshark user is, but....  */
void write_failure_alert_box(const char *filename, int err)
/* 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 Wireshark user is, but....  */
void write_failure_alert_box(const char *filename, int err)
{
    gchar *display_basename;
    display_basename = g_filename_display_basename(filename);
    if (err < 0) {
        switch (err) {
        case WTAP_ERR_SHORT_WRITE:
            simple_message_box(ESD_TYPE_ERROR, NULL, NULL,
                              "A full write couldn't be done to the file \"%s\".",
                              display_basename);
        break;
        default:
            simple_message_box(ESD_TYPE_ERROR, NULL, NULL,
                              "An error occurred while writing to the file \"%s\": %s.",
                              display_basename, wtap_strerror(err));
        break;
        }
    } else {
        simple_message_box(ESD_TYPE_ERROR, NULL, NULL,
                           file_write_error_message(err), display_basename);
    }
    g_free(display_basename);
}