diff options
44 files changed, 304 insertions, 275 deletions
@@ -1,7 +1,7 @@ /* capture.c * Routines for packet capture windows * - * $Id: capture.c,v 1.231 2004/01/31 02:29:19 guy Exp $ + * $Id: capture.c,v 1.232 2004/01/31 03:22:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -315,14 +315,14 @@ do_capture(const char *save_file) } if (cfile.save_file_fd == -1) { if (is_tempfile) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "The temporary file to which the capture would be saved (\"%s\")" "could not be opened: %s.", capfile_name, strerror(errno)); } else { if (capture_opts.ringbuffer_on) { ringbuf_error_cleanup(); } - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_open_error_message(errno, TRUE), capfile_name); } g_free(capfile_name); @@ -413,7 +413,7 @@ do_capture(const char *save_file) unlink(cfile.save_file); g_free(cfile.save_file); cfile.save_file = NULL; - simple_dialog(ESD_TYPE_ERROR, NULL, "Couldn't create sync pipe: %s", + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Couldn't create sync pipe: %s", strerror(error)); return FALSE; } @@ -449,7 +449,7 @@ do_capture(const char *save_file) unlink(cfile.save_file); g_free(cfile.save_file); cfile.save_file = NULL; - simple_dialog(ESD_TYPE_ERROR, NULL, "Couldn't create sync pipe: %s", + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Couldn't create sync pipe: %s", strerror(error)); return FALSE; } @@ -513,8 +513,8 @@ do_capture(const char *save_file) unlink(cfile.save_file); g_free(cfile.save_file); cfile.save_file = NULL; - simple_dialog(ESD_TYPE_ERROR, NULL, "Couldn't create child process: %s", - strerror(error)); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, + "Couldn't create child process: %s", strerror(error)); return FALSE; } @@ -547,7 +547,7 @@ do_capture(const char *save_file) unlink(cfile.save_file); g_free(cfile.save_file); cfile.save_file = NULL; - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Capture child process sent us a bad message"); return FALSE; } @@ -558,26 +558,26 @@ do_capture(const char *save_file) what the problem was. */ if (byte_count == 0) { /* Zero-length message? */ - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Capture child process failed, but its error message was empty."); } else { msg = g_malloc(byte_count + 1); if (msg == NULL) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Capture child process failed, but its error message was too big."); } else { i = read(sync_pipe[READ], msg, byte_count); msg[byte_count] = '\0'; if (i < 0) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Capture child process failed: Error %s reading its error message.", strerror(errno)); } else if (i == 0) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Capture child process failed: EOF reading its error message."); wait_for_child(FALSE); } else - simple_dialog(ESD_TYPE_ERROR, NULL, msg); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, msg); g_free(msg); } @@ -797,7 +797,7 @@ cap_pipe_input_cb(gint source, gpointer user_data) msglen -= chars_to_copy; } *r = '\0'; - simple_dialog(ESD_TYPE_ERROR, NULL, msg); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, msg); g_free(msg); break; default : @@ -841,7 +841,8 @@ wait_for_child(gboolean always_report) in the dialog box? XXX - set "fork_child" to -1 if we find it exited? */ if (_cwait(&wstatus, fork_child, _WAIT_CHILD) == -1) { - simple_dialog(ESD_TYPE_WARN, NULL, "Child capture process stopped unexpectedly"); + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, + "Child capture process stopped unexpectedly"); } #else if (wait(&wstatus) != -1) { @@ -849,25 +850,25 @@ wait_for_child(gboolean always_report) /* The child exited; display its exit status, if it's not zero, and even if it's zero if "always_report" is true. */ if (always_report || WEXITSTATUS(wstatus) != 0) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Child capture process exited: exit status %d", WEXITSTATUS(wstatus)); } } else if (WIFSTOPPED(wstatus)) { /* It stopped, rather than exiting. "Should not happen." */ - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Child capture process stopped: %s", signame(WSTOPSIG(wstatus))); } else if (WIFSIGNALED(wstatus)) { /* It died with a signal. */ - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Child capture process died: %s%s", signame(WTERMSIG(wstatus)), WCOREDUMP(wstatus) ? " - core dumped" : ""); } else { /* What? It had to either have exited, or stopped, or died with a signal; what happened here? */ - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Child capture process died: wait status %#o", wstatus); } } @@ -2025,7 +2026,7 @@ popup_errmsg(const char *errmsg) send_errmsg_to_parent(errmsg); } else { /* Display the dialog box ourselves; there's no parent. */ - simple_dialog(ESD_TYPE_ERROR, NULL, "%s", errmsg); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", errmsg); } } @@ -1,7 +1,7 @@ /* file.c * File I/O routines * - * $Id: file.c,v 1.352 2004/01/31 02:25:43 ulfl Exp $ + * $Id: file.c,v 1.353 2004/01/31 03:22:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -213,7 +213,7 @@ cf_open(char *fname, gboolean is_tempfile, capture_file *cf) return (0); fail: - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, cf_open_error_message(err, err_info, FALSE, 0), fname); return (err); } @@ -506,7 +506,7 @@ cf_read(capture_file *cf) break; } snprintf(err_str, sizeof err_str, errmsg); - simple_dialog(ESD_TYPE_ERROR, NULL, err_str); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, err_str); return (READ_ERROR); } else return (READ_SUCCESS); @@ -960,7 +960,7 @@ filter_packets(capture_file *cf, gchar *dftext) dftext = g_strdup(dftext); if (!dfilter_compile(dftext, &dfcode)) { /* The attempt failed; report an error. */ - simple_dialog(ESD_TYPE_ERROR, NULL, dfilter_error_msg); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, dfilter_error_msg); g_free(dftext); return 0; } @@ -1165,7 +1165,7 @@ rescan_packets(capture_file *cf, const char *action, const char *action_item, if (!wtap_seek_read (cf->wth, fdata->file_off, &cf->pseudo_header, cf->pd, fdata->cap_len, &err, &err_info)) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, cf_read_error_message(err, err_info), cf->filename); break; } @@ -1377,8 +1377,8 @@ process_specified_packets(capture_file *cf, packet_range_t *range, if (!wtap_seek_read(cf->wth, fdata->file_off, &pseudo_header, pd, fdata->cap_len, &err, &err_info)) { /* Attempt to get the packet failed. */ - simple_dialog(ESD_TYPE_ERROR, NULL, cf_read_error_message(err, err_info), - cf->filename); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, + cf_read_error_message(err, err_info), cf->filename); ret = PSP_FAILED; break; } @@ -2237,7 +2237,7 @@ find_packet(capture_file *cf, cf->pd, fdata->cap_len, &err, &err_info)) { /* Read error. Report the error, and go back to the frame where we started. */ - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, cf_read_error_message(err, err_info), cf->filename); new_fd = start_fd; break; @@ -2286,14 +2286,14 @@ goto_frame(capture_file *cf, guint fnumber) if (fdata == NULL) { /* we didn't find a packet with that packet number */ - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "There is no packet with that packet number."); return FALSE; /* we failed to go to that packet */ } if (!fdata->flags.passed_dfilter) { /* that packet currently isn't displayed */ /* XXX - add it to the set of displayed packets? */ - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "That packet is not currently being displayed."); return FALSE; /* we failed to go to that packet */ } @@ -2408,7 +2408,7 @@ select_packet(capture_file *cf, int row) /* Get the data in that frame. */ if (!wtap_seek_read (cf->wth, fdata->file_off, &cf->pseudo_header, cf->pd, fdata->cap_len, &err, &err_info)) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, cf_read_error_message(err, err_info), cf->filename); return; } @@ -2516,7 +2516,7 @@ save_packet(capture_file *cf _U_, frame_data *fdata, /* and save the packet */ if (!wtap_dump(args->pdh, &hdr, pseudo_header, pd, &err)) { - simple_dialog(ESD_TYPE_ERROR, NULL, cf_write_error_message(err), + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, cf_write_error_message(err), args->fname); return FALSE; } @@ -2554,7 +2554,7 @@ cf_save(char *fname, capture_file *cf, packet_range_t *range, guint save_format) stat(cf->filename, &infile); stat(fname, &outfile); if (infile.st_ino == outfile.st_ino) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Can't save over current capture file: %s!", cf->filename); goto fail; @@ -2594,7 +2594,7 @@ cf_save(char *fname, capture_file *cf, packet_range_t *range, guint save_format) be if we didn't have permission to remove the file from the temporary directory, and that might be fixable - but is it worth requiring the user to go off and fix it?) */ - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_rename_error_message(errno), fname); goto fail; } @@ -2621,7 +2621,7 @@ cf_save(char *fname, capture_file *cf, packet_range_t *range, guint save_format) we have to do it by writing the packets out in Wiretap. */ pdh = wtap_dump_open(fname, save_format, cf->lnk_t, cf->snap, &err); if (pdh == NULL) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, cf_open_error_message(err, NULL, TRUE, save_format), fname); goto fail; } @@ -2661,7 +2661,8 @@ cf_save(char *fname, capture_file *cf, packet_range_t *range, guint save_format) } if (!wtap_dump_close(pdh, &err)) { - simple_dialog(ESD_TYPE_WARN, NULL, cf_close_error_message(err), fname); + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, cf_close_error_message(err), + fname); goto fail; } } @@ -2937,7 +2938,7 @@ copy_binary_file(char *from_filename, char *to_filename) from_fd = open(from_filename, O_RDONLY | O_BINARY); if (from_fd < 0) { err = errno; - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_open_error_message(err, TRUE), from_filename); goto done; } @@ -2950,7 +2951,7 @@ copy_binary_file(char *from_filename, char *to_filename) to_fd = open(to_filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644); if (to_fd < 0) { err = errno; - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_open_error_message(err, TRUE), to_filename); close(from_fd); goto done; @@ -2963,7 +2964,7 @@ copy_binary_file(char *from_filename, char *to_filename) err = errno; else err = WTAP_ERR_SHORT_WRITE; - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_write_error_message(err), to_filename); close(from_fd); close(to_fd); @@ -2972,7 +2973,7 @@ copy_binary_file(char *from_filename, char *to_filename) } if (nread < 0) { err = errno; - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "An error occurred while reading from the file \"%s\": %s.", from_filename, strerror(err)); close(from_fd); @@ -2982,7 +2983,7 @@ copy_binary_file(char *from_filename, char *to_filename) close(from_fd); if (close(to_fd) < 0) { err = errno; - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_write_error_message(err), to_filename); goto done; } diff --git a/gtk/ansi_a_stat.c b/gtk/ansi_a_stat.c index 383f08726d..1a1ff04710 100644 --- a/gtk/ansi_a_stat.c +++ b/gtk/ansi_a_stat.c @@ -5,7 +5,7 @@ * * MUCH code modified from service_response_time_table.c. * - * $Id: ansi_a_stat.c,v 1.9 2004/01/21 21:19:31 ulfl Exp $ + * $Id: ansi_a_stat.c,v 1.10 2004/01/31 03:22:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -531,7 +531,7 @@ register_tap_listener_gtkansi_a_stat(void) if (err_p != NULL) { - simple_dialog(ESD_TYPE_WARN, NULL, err_p->str); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, err_p->str); g_string_free(err_p, TRUE); exit(1); diff --git a/gtk/ansi_map_stat.c b/gtk/ansi_map_stat.c index a6db667b93..00bfb54669 100644 --- a/gtk/ansi_map_stat.c +++ b/gtk/ansi_map_stat.c @@ -5,7 +5,7 @@ * * MUCH code modified from service_response_time_table.c. * - * $Id: ansi_map_stat.c,v 1.12 2004/01/21 21:19:31 ulfl Exp $ + * $Id: ansi_map_stat.c,v 1.13 2004/01/31 03:22:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -464,7 +464,7 @@ register_tap_listener_gtkansi_map_stat(void) if (err_p != NULL) { - simple_dialog(ESD_TYPE_WARN, NULL, err_p->str); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, err_p->str); g_string_free(err_p, TRUE); exit(1); diff --git a/gtk/bootp_stat.c b/gtk/bootp_stat.c index 4ee74a86d1..97bb778c91 100644 --- a/gtk/bootp_stat.c +++ b/gtk/bootp_stat.c @@ -1,7 +1,7 @@ /* bootp_stat.c * boop_stat 2003 Jean-Michel FAYARD * - * $Id: bootp_stat.c,v 1.14 2004/01/21 21:19:31 ulfl Exp $ + * $Id: bootp_stat.c,v 1.15 2004/01/31 03:22:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -243,7 +243,7 @@ gtk_dhcpstat_init(char *optarg) dhcpstat_draw); if (error_string){ /* error, we failed to attach to the tap. clean up */ - simple_dialog( ESD_TYPE_WARN, NULL, error_string->str ); + simple_dialog( ESD_TYPE_ERROR, ESD_BTN_OK, error_string->str ); g_free(sp->filter); g_free(sp); g_string_free(error_string, TRUE); diff --git a/gtk/capture_dlg.c b/gtk/capture_dlg.c index 241b84ba61..90de6fcf8d 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.99 2004/01/31 02:25:43 ulfl Exp $ + * $Id: capture_dlg.c,v 1.100 2004/01/31 03:22:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -302,7 +302,7 @@ capture_prep(void) #ifdef _WIN32 /* Is WPcap loaded? */ if (!has_wpcap) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Unable to load WinPcap (wpcap.dll); Ethereal will not be able\n" "to capture packets.\n\n" "In order to capture packets, WinPcap must be installed; see\n" @@ -325,7 +325,7 @@ capture_prep(void) if_list = get_interface_list(&err, err_str); if (if_list == NULL && err == CANT_GET_INTERFACE_LIST) { - simple_dialog(ESD_TYPE_WARN, NULL, "Can't get list of interfaces: %s", + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Can't get list of interfaces: %s", err_str); } @@ -779,7 +779,7 @@ capture_prep_answered_cb(gpointer dialog _U_, gint btn, gpointer data) } void -capture_prep_cb(GtkWidget *w, gpointer d _U_) +capture_prep_cb(GtkWidget *w _U_, gpointer d _U_) { gpointer dialog; @@ -956,7 +956,7 @@ capture_prep_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w) { if_text = g_strstrip(entry_text); if_name = get_if_name(if_text); if (*if_name == '\0') { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "You didn't specify an interface on which to capture packets."); g_free(entry_text); return; @@ -1048,11 +1048,11 @@ capture_prep_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w) { !(capture_opts.sync_mode); if (capture_opts.ringbuffer_on) { if (save_file == NULL) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "You must specify a save file if you want to use the ring buffer."); return; } else if (!capture_opts.has_autostop_filesize) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "You must specify a file size at which to rotate the capture files\n" "if you want to use the ring buffer."); g_free(save_file); diff --git a/gtk/capture_prefs.c b/gtk/capture_prefs.c index 3575db971d..13497c56ba 100644 --- a/gtk/capture_prefs.c +++ b/gtk/capture_prefs.c @@ -1,7 +1,7 @@ /* capture_prefs.c * Dialog box for capture preferences * - * $Id: capture_prefs.c,v 1.27 2004/01/21 21:19:32 ulfl Exp $ + * $Id: capture_prefs.c,v 1.28 2004/01/31 03:22:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -667,8 +667,8 @@ ifopts_if_clist_add(GtkCList *clist) if_list = get_interface_list(&err, err_str); if (if_list == NULL && err == CANT_GET_INTERFACE_LIST) { - simple_dialog(ESD_TYPE_WARN, NULL, "Can't get list of interfaces: %s", - err_str); + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, + "Can't get list of interfaces: %s", err_str); return; } @@ -711,7 +711,8 @@ ifopts_write_new_descr(void) /* new preferences interfaces description string */ new_descr = g_malloc0(MAX_VAL_LEN); if (new_descr == NULL) { - simple_dialog(ESD_TYPE_WARN, NULL, "Error (1) saving interface " + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, + "Error (1) saving interface " "descriptions: malloc failure"); return; } @@ -725,7 +726,8 @@ ifopts_write_new_descr(void) */ tmp_descr = g_malloc0(IFOPTS_MAX_DESCR_LEN + MAX_WIN_IF_NAME_LEN + 4); if (tmp_descr == NULL) { - simple_dialog(ESD_TYPE_WARN, NULL, "Error (2) saving interface " + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, + "Error (2) saving interface " "descriptions: malloc failure"); g_free(new_descr); return; @@ -760,8 +762,10 @@ ifopts_write_new_descr(void) } /* interface name + description is too large */ else { - simple_dialog(ESD_TYPE_WARN, NULL, "Error saving interface " - "description for:\n%s\n(too long)", ifnm); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, + "Error saving interface " + "description for:\n%s\n(too long)", + ifnm); continue; } } @@ -795,7 +799,8 @@ ifopts_write_new_hide(void) /* new preferences "hidden" interfaces string */ new_hide = g_malloc0(MAX_VAL_LEN); if (new_hide == NULL) { - simple_dialog(ESD_TYPE_WARN, NULL, "Error (1) saving \"hidden\" " + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, + "Error (1) saving \"hidden\" " "interfaces: malloc failure"); return; } @@ -809,7 +814,8 @@ ifopts_write_new_hide(void) */ tmp_hide = g_malloc0(MAX_WIN_IF_NAME_LEN + 2); if (tmp_hide == NULL) { - simple_dialog(ESD_TYPE_WARN, NULL, "Error (2) saving \"hidden\" " + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, + "Error (2) saving \"hidden\" " "interfaces: malloc failure"); g_free(new_hide); return; @@ -841,7 +847,8 @@ ifopts_write_new_hide(void) } /* interface name is too large */ else { - simple_dialog(ESD_TYPE_WARN, NULL, "Error saving \"hidden\" " + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, + "Error saving \"hidden\" " "interface for:\n%s\n(too long)", ifnm); continue; } diff --git a/gtk/color_dlg.c b/gtk/color_dlg.c index 5fe875a61b..115f2e07ea 100644 --- a/gtk/color_dlg.c +++ b/gtk/color_dlg.c @@ -1,7 +1,7 @@ /* color_dlg.c * Definitions for dialog boxes for color filters * - * $Id: color_dlg.c,v 1.37 2004/01/31 02:25:44 ulfl Exp $ + * $Id: color_dlg.c,v 1.38 2004/01/31 03:22:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1084,9 +1084,8 @@ static void color_save_cb(GtkButton *button _U_, gpointer user_data _U_) { if (!write_filters()) - simple_dialog(ESD_TYPE_ERROR, NULL, "Could not open filter file: %s", - strerror(errno)); - + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, + "Could not open filter file: %s", strerror(errno)); } /* Remove all user defined color filters and revert to the global file. */ @@ -1103,8 +1102,8 @@ color_clear_cb(GtkWidget *widget, gpointer user_data _U_) } if (!revert_filters()) - simple_dialog(ESD_TYPE_ERROR, NULL, "Could not delete filter file: %s", - strerror(errno)); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, + "Could not delete filter file: %s", strerror(errno)); /* colorize list */ colorize_packets(&cfile); @@ -1462,7 +1461,8 @@ edit_color_filter_ok_cb (GtkButton *button, filter_text = g_strdup(gtk_entry_get_text(GTK_ENTRY(filt_text_entry))); if(strchr(filter_name,'@') || strchr(filter_text,'@')){ - simple_dialog(ESD_TYPE_ERROR, NULL, "Filter names and strings must not" + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, + "Filter names and strings must not" " use the '@' character. Filter unchanged."); g_free(filter_name); g_free(filter_text); @@ -1470,7 +1470,8 @@ edit_color_filter_ok_cb (GtkButton *button, } if(!dfilter_compile(filter_text, &compiled_filter)) { - simple_dialog(ESD_TYPE_ERROR, NULL, "Filter \"%s\" did not compile correctly.\n" + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, + "Filter \"%s\" did not compile correctly.\n" " Please try again. Filter unchanged.\n%s\n", filter_name, dfilter_error_msg); } else { @@ -1662,7 +1663,8 @@ color_sel_ok_cb (GtkButton *button _U_, #endif if ( ! get_color(&new_color) ){ - simple_dialog(ESD_TYPE_ERROR, NULL, "Could not allocate color. Try again."); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, + "Could not allocate color. Try again."); } else { /* Find the "Edit color filter" dialog box with which this is associated. */ diff --git a/gtk/color_filters.c b/gtk/color_filters.c index f65c23ed56..2841a8f4e9 100644 --- a/gtk/color_filters.c +++ b/gtk/color_filters.c @@ -1,7 +1,7 @@ /* color_filters.c * Routines for color filters * - * $Id: color_filters.c,v 1.6 2004/01/31 02:25:44 ulfl Exp $ + * $Id: color_filters.c,v 1.7 2004/01/31 03:22:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -180,14 +180,14 @@ read_filters_file(FILE *f, gpointer arg) /* we got a filter */ if (!dfilter_compile(filter_exp, &temp_dfilter)) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Could not compile color filter %s from saved filters.\n%s", name, dfilter_error_msg); continue; } if (!get_color(&fg_color)) { /* oops */ - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Could not allocate foreground color " "specified in input file for %s.", name); dfilter_free(temp_dfilter); @@ -195,7 +195,7 @@ read_filters_file(FILE *f, gpointer arg) } if (!get_color(&bg_color)) { /* oops */ - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Could not allocate background color " "specified in input file for %s.", name); dfilter_free(temp_dfilter); @@ -238,7 +238,7 @@ read_filters(void) path = get_persconffile_path("colorfilters", FALSE); if ((f = fopen(path, "r")) == NULL) { if (errno != ENOENT) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Could not open filter file\n\"%s\": %s.", path, strerror(errno)); } @@ -265,7 +265,7 @@ read_global_filters(void) path = get_datafile_path("colorfilters"); if ((f = fopen(path, "r")) == NULL) { if (errno != ENOENT) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Could not open global filter file\n\"%s\": %s.", path, strerror(errno)); } @@ -289,7 +289,7 @@ read_other_filters(gchar *path, gpointer arg) gboolean ret; if ((f = fopen(path, "r")) == NULL) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Could not open\n%s\nfor reading: %s.", path, strerror(errno)); return FALSE; @@ -352,7 +352,7 @@ write_filters(void) /* Create the directory that holds personal configuration files, if necessary. */ if (create_persconffile_dir(&pf_dir_path) == -1) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Can't create directory\n\"%s\"\nfor color files: %s.", pf_dir_path, strerror(errno)); g_free(pf_dir_path); @@ -361,7 +361,7 @@ write_filters(void) path = get_persconffile_path("colorfilters", TRUE); if ((f = fopen(path, "w+")) == NULL) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Could not open\n%s\nfor writing: %s.", path, strerror(errno)); return FALSE; @@ -382,7 +382,7 @@ revert_filters(void) /* Create the directory that holds personal configuration files, if necessary. */ if (create_persconffile_dir(&pf_dir_path) == -1) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Can't create directory\n\"%s\"\nfor color files: %s.", pf_dir_path, strerror(errno)); g_free(pf_dir_path); @@ -407,7 +407,7 @@ write_other_filters(gchar *path, gboolean only_marked) FILE *f; if ((f = fopen(path, "w+")) == NULL) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Could not open\n%s\nfor writing: %s.", path, strerror(errno)); return FALSE; diff --git a/gtk/colors.c b/gtk/colors.c index 37cfc1f157..23ad9d81af 100644 --- a/gtk/colors.c +++ b/gtk/colors.c @@ -1,7 +1,7 @@ /* colors.c * Routines for colors * - * $Id: colors.c,v 1.27 2003/01/08 01:59:42 guy Exp $ + * $Id: colors.c,v 1.28 2004/01/31 03:22:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -54,14 +54,14 @@ colors_init(void) /* Got milk? */ if (!got_white) { if (!got_black) - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Could not allocate colors black or white."); else - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Could not allocate color white."); } else { if (!got_black) - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Could not allocate color black."); } } @@ -77,7 +77,7 @@ get_color(GdkColor *new_color) TRUE)) { pv = gdk_visual_get_best(); if (!(our_cmap = gdk_colormap_new(pv, TRUE))) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Could not create new colormap"); } } else diff --git a/gtk/dcerpc_stat.c b/gtk/dcerpc_stat.c index aa4511f0eb..2a18d14483 100644 --- a/gtk/dcerpc_stat.c +++ b/gtk/dcerpc_stat.c @@ -1,7 +1,7 @@ /* dcerpc_stat.c * dcerpc_stat 2002 Ronnie Sahlberg * - * $Id: dcerpc_stat.c,v 1.45 2004/01/25 18:39:55 ulfl Exp $ + * $Id: dcerpc_stat.c,v 1.46 2004/01/31 03:22:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -313,7 +313,7 @@ gtk_dcerpcstat_init(char *optarg) error_string=register_tap_listener("dcerpc", rs, filter, dcerpcstat_reset, dcerpcstat_packet, dcerpcstat_draw); if(error_string){ /* error, we failed to attach to the tap. clean up */ - simple_dialog(ESD_TYPE_WARN, NULL, error_string->str); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, error_string->str); g_string_free(error_string, TRUE); free_srt_table_data(&rs->srt_table); g_free(rs); diff --git a/gtk/decode_as_dlg.c b/gtk/decode_as_dlg.c index a57d4d23c2..adb1b8fe9c 100644 --- a/gtk/decode_as_dlg.c +++ b/gtk/decode_as_dlg.c @@ -1,6 +1,6 @@ /* decode_as_dlg.c * - * $Id: decode_as_dlg.c,v 1.35 2004/01/21 21:19:32 ulfl Exp $ + * $Id: decode_as_dlg.c,v 1.36 2004/01/31 03:22:39 guy Exp $ * * Routines to modify dissector tables on the fly. * @@ -672,7 +672,7 @@ decode_debug (GtkCList *clist, gchar *leadin) } else { sprintf(string, "%s clist row (none), aka do not decode", leadin); } - simple_dialog(ESD_TYPE_INFO, NULL, string); + simple_dialog(ESD_TYPE_INFO, ESD_BTN_OK, string); g_free(string); } #endif diff --git a/gtk/dfilter_expr_dlg.c b/gtk/dfilter_expr_dlg.c index 8c2472615f..c4d935e92e 100644 --- a/gtk/dfilter_expr_dlg.c +++ b/gtk/dfilter_expr_dlg.c @@ -7,7 +7,7 @@ * Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com> and * Guy Harris <guy@alum.mit.edu> * - * $Id: dfilter_expr_dlg.c,v 1.48 2004/01/31 02:25:44 ulfl Exp $ + * $Id: dfilter_expr_dlg.c,v 1.49 2004/01/31 03:22:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -778,7 +778,7 @@ dfilter_report_bad_value(char *format, ...) vsnprintf(error_msg_buf, sizeof error_msg_buf, format, args); va_end(args); - simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, NULL, + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, ESD_BTN_OK, "%s", error_msg_buf); } @@ -900,11 +900,11 @@ dfilter_expr_dlg_accept_cb(GtkWidget *w, gpointer filter_te_arg) can_compare = TRUE; /* not a comparison */ if (!can_compare) { if (range_str == NULL) { - simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, NULL, + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, ESD_BTN_OK, "That field cannot be tested with \"%s\".", item_str); } else { - simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, NULL, + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, ESD_BTN_OK, "Ranges of that field cannot be tested with \"%s\".", item_str); } @@ -924,7 +924,7 @@ dfilter_expr_dlg_accept_cb(GtkWidget *w, gpointer filter_te_arg) * This field takes a value, but they didn't supply * one. */ - simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, NULL, + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, ESD_BTN_OK, "That field must be compared with a value, " "but you didn't specify a value with which to " "compare it."); diff --git a/gtk/endpoint_talkers_table.c b/gtk/endpoint_talkers_table.c index 0b9c3f63f3..9030803564 100644 --- a/gtk/endpoint_talkers_table.c +++ b/gtk/endpoint_talkers_table.c @@ -4,7 +4,7 @@ * endpoint_talkers_table 2003 Ronnie Sahlberg * Helper routines common to all endpoint talkers tap. * - * $Id: endpoint_talkers_table.c,v 1.28 2004/01/25 18:51:25 ulfl Exp $ + * $Id: endpoint_talkers_table.c,v 1.29 2004/01/31 03:22:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -357,7 +357,7 @@ ett_select_filter_cb(GtkWidget *widget _U_, gpointer callback_data, guint callba selection=GPOINTER_TO_INT(g_list_nth_data(GTK_CLIST(et->table)->selection, 0)); if(selection>=(int)et->num_endpoints){ - simple_dialog(ESD_TYPE_WARN, NULL, "No conversation selected"); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "No conversation selected"); return; } /* translate it back from row index to index in enndpoint array */ @@ -1061,7 +1061,7 @@ init_ett_table(gboolean hide_ports, char *table_name, char *tap_name, char *filt /* register the tap and rerun the taps on the packet list */ error_string=register_tap_listener(tap_name, talkers, filter, (void *)reset_ett_table_data, packet_func, (void *)draw_ett_table_data); if(error_string){ - simple_dialog(ESD_TYPE_WARN, NULL, error_string->str); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, error_string->str); g_string_free(error_string, TRUE); g_free(talkers); return; diff --git a/gtk/fc_stat.c b/gtk/fc_stat.c index f27a96e753..0eb4b297b7 100644 --- a/gtk/fc_stat.c +++ b/gtk/fc_stat.c @@ -1,7 +1,7 @@ /* fc_stat.c * fc_stat 2003 Ronnie Sahlberg * - * $Id: fc_stat.c,v 1.21 2004/01/21 21:19:32 ulfl Exp $ + * $Id: fc_stat.c,v 1.22 2004/01/31 03:22:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -179,7 +179,7 @@ gtk_fcstat_init(char *optarg) error_string=register_tap_listener("fc", fc, filter, fcstat_reset, fcstat_packet, fcstat_draw); if(error_string){ - simple_dialog(ESD_TYPE_WARN, NULL, error_string->str); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, error_string->str); g_string_free(error_string, TRUE); g_free(fc); return; diff --git a/gtk/file_dlg.c b/gtk/file_dlg.c index af423b85b5..3caf32c528 100644 --- a/gtk/file_dlg.c +++ b/gtk/file_dlg.c @@ -1,7 +1,7 @@ /* file_dlg.c * Dialog boxes for handling files * - * $Id: file_dlg.c,v 1.86 2004/01/31 02:25:44 ulfl Exp $ + * $Id: file_dlg.c,v 1.87 2004/01/31 03:22:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -383,7 +383,7 @@ file_open_ok_cb(GtkWidget *w, GtkFileSelection *fs) { rfilter = (gchar *)gtk_entry_get_text(GTK_ENTRY(filter_te)); if (!dfilter_compile(rfilter, &rfcode)) { g_free(cf_name); - simple_dialog(ESD_TYPE_ERROR, NULL, dfilter_error_msg); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, dfilter_error_msg); return; } diff --git a/gtk/filter_prefs.c b/gtk/filter_prefs.c index b25fe75a12..8e859d5012 100644 --- a/gtk/filter_prefs.c +++ b/gtk/filter_prefs.c @@ -3,7 +3,7 @@ * (This used to be a notebook page under "Preferences", hence the * "prefs" in the file name.) * - * $Id: filter_prefs.c,v 1.58 2004/01/31 02:25:45 ulfl Exp $ + * $Id: filter_prefs.c,v 1.59 2004/01/31 03:22:40 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -819,7 +819,7 @@ filter_dlg_save_cb(GtkWidget *save_bt _U_, gpointer data) /* Create the directory that holds personal configuration files, if necessary. */ if (create_persconffile_dir(&pf_dir_path) == -1) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Can't create directory\n\"%s\"\nfor filter files: %s.", pf_dir_path, strerror(errno)); g_free(pf_dir_path); @@ -844,7 +844,7 @@ filter_dlg_save_cb(GtkWidget *save_bt _U_, gpointer data) filter_type = NULL; break; } - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Could not save to your %s filter file\n\"%s\": %s.", filter_type, f_path, strerror(f_save_errno)); g_free(f_path); diff --git a/gtk/find_dlg.c b/gtk/find_dlg.c index 313e2f6efb..47a3682385 100644 --- a/gtk/find_dlg.c +++ b/gtk/find_dlg.c @@ -1,7 +1,7 @@ /* find_dlg.c * Routines for "find frame" window * - * $Id: find_dlg.c,v 1.44 2004/01/31 02:25:45 ulfl Exp $ + * $Id: find_dlg.c,v 1.45 2004/01/31 03:22:40 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -548,7 +548,7 @@ find_frame_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w) */ bytes = convert_string_to_hex(filter_text, &nbytes); if (bytes == NULL) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "You didn't specify a valid hex string."); return; } @@ -564,7 +564,7 @@ find_frame_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w) else if (strcmp(string_type, "ASCII Unicode") == 0) scs_type = SCS_UNICODE; else { - simple_dialog(ESD_TYPE_ERROR, NULL, "You didn't choose a valid character set."); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "You didn't choose a valid character set."); return; } string = convert_string_case(filter_text, case_type); @@ -574,14 +574,14 @@ find_frame_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w) */ if (!dfilter_compile(filter_text, &sfcode)) { /* The attempt failed; report an error. */ - simple_dialog(ESD_TYPE_ERROR, NULL, dfilter_error_msg); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, dfilter_error_msg); return; } /* Was it empty? */ if (sfcode == NULL) { /* Yes - complain. */ - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "You didn't specify a valid filter expression."); return; } @@ -606,7 +606,7 @@ find_frame_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w) g_free(bytes); if (!found_packet) { /* We didn't find a packet */ - simple_dialog(ESD_TYPE_ERROR, NULL, "No packet contained those bytes."); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "No packet contained those bytes."); g_free(bytes); return; } @@ -618,7 +618,7 @@ find_frame_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w) g_free(string); if (!found_packet) { /* We didn't find the packet. */ - simple_dialog(ESD_TYPE_ERROR, NULL, "No packet contained that string in its dissected display."); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "No packet contained that string in its dissected display."); return; } } else if (cfile.summary_data) { @@ -627,7 +627,7 @@ find_frame_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w) g_free(string); if (!found_packet) { /* We didn't find the packet. */ - simple_dialog(ESD_TYPE_ERROR, NULL, "No packet contained that string in its Info column."); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "No packet contained that string in its Info column."); return; } } else { @@ -636,7 +636,7 @@ find_frame_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w) g_free(string); if (!found_packet) { /* We didn't find the packet. */ - simple_dialog(ESD_TYPE_ERROR, NULL, "No packet contained that string in its data."); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "No packet contained that string in its data."); return; } } @@ -645,7 +645,7 @@ find_frame_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w) dfilter_free(sfcode); if (!found_packet) { /* We didn't find a packet */ - simple_dialog(ESD_TYPE_ERROR, NULL, "No packet matched that filter."); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "No packet matched that filter."); g_free(bytes); return; } diff --git a/gtk/follow_dlg.c b/gtk/follow_dlg.c index 976aba6b9e..5f5c2cbb59 100644 --- a/gtk/follow_dlg.c +++ b/gtk/follow_dlg.c @@ -1,6 +1,6 @@ /* follow_dlg.c * - * $Id: follow_dlg.c,v 1.41 2004/01/31 02:25:45 ulfl Exp $ + * $Id: follow_dlg.c,v 1.42 2004/01/31 03:22:40 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -164,7 +164,7 @@ follow_stream_cb(GtkWidget * w, gpointer data _U_) /* we got tcp so we can follow */ if (cfile.edt->pi.ipproto != 6) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Error following stream. Please make\n" "sure you have a TCP packet selected."); return; @@ -184,7 +184,7 @@ follow_stream_cb(GtkWidget * w, gpointer data _U_) sizeof follow_info->data_out_filename, "follow"); if (tmp_fd == -1) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Could not create temporary file %s: %s", follow_info->data_out_filename, strerror(errno)); g_free(follow_info); @@ -193,7 +193,7 @@ follow_stream_cb(GtkWidget * w, gpointer data _U_) data_out_file = fdopen(tmp_fd, "wb"); if (data_out_file == NULL) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Could not create temporary file %s: %s", follow_info->data_out_filename, strerror(errno)); close(tmp_fd); @@ -525,7 +525,7 @@ follow_read_stream(follow_info_t *follow_info, data_out_file = fopen(follow_info->data_out_filename, "rb"); if (data_out_file == NULL) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Could not open temporary file %s: %s", follow_info->data_out_filename, strerror(errno)); return FRS_OPEN_ERROR; @@ -682,7 +682,7 @@ follow_read_stream(follow_info_t *follow_info, } } if (ferror(data_out_file)) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Error reading temporary file %s: %s", follow_info->data_out_filename, strerror(errno)); fclose(data_out_file); @@ -756,7 +756,7 @@ follow_print_stream(GtkWidget * w _U_, gpointer data) to_file = TRUE; break; default: /* "Can't happen" */ - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Couldn't figure out where to send the print " "job. Check your preferences."); return; @@ -765,10 +765,10 @@ follow_print_stream(GtkWidget * w _U_, gpointer data) fh = open_print_dest(to_file, print_dest); if (fh == NULL) { if (to_file) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_open_error_message(errno, TRUE), prefs.pr_file); } else { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Couldn't run print command %s.", prefs.pr_cmd); } return; @@ -796,10 +796,10 @@ follow_print_stream(GtkWidget * w _U_, gpointer data) goto print_error; if (!close_print_dest(to_file, fh)) { if (to_file) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_write_error_message(errno), prefs.pr_file); } else { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Error closing print destination."); } } @@ -807,10 +807,10 @@ follow_print_stream(GtkWidget * w _U_, gpointer data) print_error: if (to_file) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_write_error_message(errno), prefs.pr_file); } else { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Error writing to print command: %s", strerror(errno)); } /* XXX - cancel printing? */ @@ -976,7 +976,7 @@ follow_save_as_ok_cb(GtkWidget * w _U_, GtkFileSelection * fs) fh = fopen(to_name, "wb"); if (fh == NULL) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_open_error_message(errno, TRUE), to_name); g_free(to_name); return; @@ -990,7 +990,7 @@ follow_save_as_ok_cb(GtkWidget * w _U_, GtkFileSelection * fs) case FRS_OK: if (fclose(fh) == EOF) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_write_error_message(errno), to_name); } break; @@ -1001,7 +1001,7 @@ follow_save_as_ok_cb(GtkWidget * w _U_, GtkFileSelection * fs) break; case FRS_PRINT_ERROR: - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_write_error_message(errno), to_name); fclose(fh); break; diff --git a/gtk/goto_dlg.c b/gtk/goto_dlg.c index 1f9fab9d8c..bd6ccadc07 100644 --- a/gtk/goto_dlg.c +++ b/gtk/goto_dlg.c @@ -1,7 +1,7 @@ /* goto_dlg.c * Routines for "go to packet" window * - * $Id: goto_dlg.c,v 1.24 2004/01/31 02:25:45 ulfl Exp $ + * $Id: goto_dlg.c,v 1.25 2004/01/31 03:22:40 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -122,7 +122,7 @@ goto_frame_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w) XXX - what about negative numbers (which "strtoul()" allows)? Can we hack up signal handlers for the widget to make it reject attempts to type in characters other than digits? */ - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "The packet number you entered isn't a valid number."); return; } diff --git a/gtk/gsm_a_stat.c b/gtk/gsm_a_stat.c index 979fa01080..ab778e5378 100644 --- a/gtk/gsm_a_stat.c +++ b/gtk/gsm_a_stat.c @@ -5,7 +5,7 @@ * * MUCH code modified from service_response_time_table.c. * - * $Id: gsm_a_stat.c,v 1.9 2004/01/21 21:19:33 ulfl Exp $ + * $Id: gsm_a_stat.c,v 1.10 2004/01/31 03:22:40 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -687,7 +687,7 @@ register_tap_listener_gtkgsm_a_stat(void) if (err_p != NULL) { - simple_dialog(ESD_TYPE_WARN, NULL, err_p->str); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, err_p->str); g_string_free(err_p, TRUE); exit(1); diff --git a/gtk/gui_prefs.c b/gtk/gui_prefs.c index 444e3d14c2..83ceac28ed 100644 --- a/gtk/gui_prefs.c +++ b/gtk/gui_prefs.c @@ -1,7 +1,7 @@ /* gui_prefs.c * Dialog box for GUI preferences * - * $Id: gui_prefs.c,v 1.61 2004/01/31 02:25:45 ulfl Exp $ + * $Id: gui_prefs.c,v 1.62 2004/01/31 03:22:40 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -336,7 +336,7 @@ font_fetch(void) /* No font was selected; let the user know, but don't tear down the font selection dialog, so they can try again. */ - simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, NULL, + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, ESD_BTN_OK, "You have not selected a font."); return FALSE; } @@ -354,7 +354,7 @@ font_fetch(void) /* Oops, that font didn't work. Tell the user, but don't tear down the font selection dialog, so that they can try again. */ - simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, NULL, + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, ESD_BTN_OK, "The font you selected cannot be loaded."); g_free(font_name); @@ -374,7 +374,7 @@ font_fetch(void) /* Oops, that font didn't work. Tell the user, but don't tear down the font selection dialog, so that they can try again. */ - simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, NULL, + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, ESD_BTN_OK, "The font you selected doesn't have a boldface version."); g_free(font_name); @@ -474,7 +474,7 @@ gui_prefs_apply(GtkWidget *w _U_) case FA_FONT_NOT_AVAILABLE: /* We assume this means that the specified size isn't available. */ - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "That font font isn't available at the specified zoom level;\n" "turning zooming off."); recent.gui_zoom_level = 0; diff --git a/gtk/h225_counter.c b/gtk/h225_counter.c index eb023d5bb0..968efb63d3 100644 --- a/gtk/h225_counter.c +++ b/gtk/h225_counter.c @@ -2,7 +2,7 @@ * h225 message counter for ethereal * Copyright 2003 Lars Roland * - * $Id: h225_counter.c,v 1.7 2004/01/03 18:05:56 sharpe Exp $ + * $Id: h225_counter.c,v 1.8 2004/01/31 03:22:41 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -501,7 +501,7 @@ gtk_h225counter_init(char *optarg) error_string=register_tap_listener("h225", hs, filter, h225counter_reset, h225counter_packet, h225counter_draw); if(error_string){ - simple_dialog(ESD_TYPE_WARN, NULL, error_string->str); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, error_string->str); g_string_free(error_string, TRUE); g_free(hs->filter); g_free(hs); diff --git a/gtk/h225_ras_srt.c b/gtk/h225_ras_srt.c index c215b25e22..382ebe9726 100644 --- a/gtk/h225_ras_srt.c +++ b/gtk/h225_ras_srt.c @@ -2,7 +2,7 @@ * h225 RAS Service Response Time statistics for ethereal * Copyright 2003 Lars Roland * - * $Id: h225_ras_srt.c,v 1.6 2004/01/03 18:05:56 sharpe Exp $ + * $Id: h225_ras_srt.c,v 1.7 2004/01/31 03:22:41 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -298,7 +298,7 @@ gtk_h225rassrt_init(char *optarg) error_string=register_tap_listener("h225", hs, filter, h225rassrt_reset, h225rassrt_packet, h225rassrt_draw); if(error_string){ - simple_dialog(ESD_TYPE_WARN, NULL, error_string->str); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, error_string->str); g_string_free(error_string, TRUE); g_free(hs->filter); g_free(hs); diff --git a/gtk/help_dlg.c b/gtk/help_dlg.c index 1ad6fc081d..465650b8d9 100644 --- a/gtk/help_dlg.c +++ b/gtk/help_dlg.c @@ -1,6 +1,6 @@ /* help_dlg.c * - * $Id: help_dlg.c,v 1.44 2004/01/31 02:25:45 ulfl Exp $ + * $Id: help_dlg.c,v 1.45 2004/01/31 03:22:41 guy Exp $ * * Laurent Deniel <laurent.deniel@free.fr> * @@ -185,7 +185,7 @@ void help_cb(GtkWidget *w _U_, gpointer data _U_) } } if(ferror(help_toc_file)) { - simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Error reading file \"%s\": %s", + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Error reading file \"%s\": %s", help_toc_file_path, strerror(errno)); } fclose(help_toc_file); @@ -320,12 +320,12 @@ static void set_help_text(GtkWidget *w, const char *help_file_path) insert_text(w, line, strlen(line)); } if(ferror(help_file)) { - simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Error reading file \"%s\": %s", + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Error reading file \"%s\": %s", help_file_path, strerror(errno)); } fclose(help_file); } else { - simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Could not open file \"%s\": %s", + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Could not open file \"%s\": %s", help_file_path, strerror(errno)); } #if GTK_MAJOR_VERSION < 2 diff --git a/gtk/http_stat.c b/gtk/http_stat.c index e8d8d7a296..02b8c4730c 100644 --- a/gtk/http_stat.c +++ b/gtk/http_stat.c @@ -1,7 +1,7 @@ /* http_stat.c * http_stat 2003 Jean-Michel FAYARD * - * $Id: http_stat.c,v 1.16 2004/01/21 21:19:33 ulfl Exp $ + * $Id: http_stat.c,v 1.17 2004/01/31 03:22:41 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -485,7 +485,7 @@ gtk_httpstat_init(char *optarg) httpstat_draw); if (error_string){ /* error, we failed to attach to the tap. clean up */ - simple_dialog( ESD_TYPE_WARN, NULL, error_string->str ); + simple_dialog( ESD_TYPE_ERROR, ESD_BTN_OK, error_string->str ); g_free(sp->filter); g_free(sp); g_string_free(error_string, TRUE); diff --git a/gtk/io_stat.c b/gtk/io_stat.c index 342d767644..0ce3abbeb0 100644 --- a/gtk/io_stat.c +++ b/gtk/io_stat.c @@ -1,7 +1,7 @@ /* io_stat.c * io_stat 2002 Ronnie Sahlberg * - * $Id: io_stat.c,v 1.58 2004/01/21 03:54:30 ulfl Exp $ + * $Id: io_stat.c,v 1.59 2004/01/31 03:22:41 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -546,7 +546,7 @@ io_stat_draw(io_stat_t *io) num_time_intervals+=1; /* XXX move this check to _packet() */ if(num_time_intervals>NUM_IO_ITEMS){ - simple_dialog(ESD_TYPE_WARN, NULL, "IO-Stat error. There are too many entries, bailing out"); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "IO-Stat error. There are too many entries, bailing out"); return; } @@ -1397,7 +1397,7 @@ filter_callback(GtkWidget *widget _U_, io_stat_graph_t *gio) field=(char *)gtk_entry_get_text(GTK_ENTRY(gio->calc_field)); /* warn and bail out if there was no field specified */ if(field==NULL || field[0]==0){ - simple_dialog(ESD_TYPE_WARN, NULL, "You did not specify a field name."); + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "You did not specify a field name."); disable_graph(gio); io_stat_redraw(gio->io); return 0; @@ -1405,7 +1405,7 @@ filter_callback(GtkWidget *widget _U_, io_stat_graph_t *gio) /* warn and bail out if the field could not be found */ hfi=proto_registrar_get_byname(field); if(hfi==NULL){ - simple_dialog(ESD_TYPE_WARN, NULL, "'%s' is not a valid field name.", field); + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "'%s' is not a valid field name.", field); disable_graph(gio); io_stat_redraw(gio->io); return 0; @@ -1424,7 +1424,7 @@ filter_callback(GtkWidget *widget _U_, io_stat_graph_t *gio) /* these values support all calculations except LOAD */ switch(gio->calc_type){ case CALC_TYPE_LOAD: - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "LOAD(*) is only supported for relative-time fields."); disable_graph(gio); io_stat_redraw(gio->io); @@ -1442,7 +1442,7 @@ filter_callback(GtkWidget *widget _U_, io_stat_graph_t *gio) case CALC_TYPE_LOAD: break; default: - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "%s is a relative-time field, so %s calculations are not supported on it.", field, calc_type_names[gio->calc_type]); @@ -1458,7 +1458,7 @@ filter_callback(GtkWidget *widget _U_, io_stat_graph_t *gio) * available? */ if(gio->calc_type!=CALC_TYPE_COUNT){ - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "%s is a 64-bit integer, so %s calculations are not supported on it.", field, calc_type_names[gio->calc_type]); @@ -1473,7 +1473,7 @@ filter_callback(GtkWidget *widget _U_, io_stat_graph_t *gio) * numbers? */ if(gio->calc_type!=CALC_TYPE_COUNT){ - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "%s doesn't have integral values, so %s calculations are not supported on it.", field, calc_type_names[gio->calc_type]); @@ -1488,7 +1488,7 @@ filter_callback(GtkWidget *widget _U_, io_stat_graph_t *gio) /* first check if the filter string is valid. */ filter=(char *)gtk_entry_get_text(GTK_ENTRY(gio->filter_field)); if(!dfilter_compile(filter, &dfilter)) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Filter \"%s\" is invalid - %s", filter, dfilter_error_msg); disable_graph(gio); io_stat_redraw(gio->io); diff --git a/gtk/isup_stat.c b/gtk/isup_stat.c index 330e613ea6..bcc650b8c7 100644 --- a/gtk/isup_stat.c +++ b/gtk/isup_stat.c @@ -5,7 +5,7 @@ * * MUCH code modified from service_response_time_table.c. * - * $Id: isup_stat.c,v 1.12 2004/01/21 21:19:33 ulfl Exp $ + * $Id: isup_stat.c,v 1.13 2004/01/31 03:22:41 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -469,7 +469,7 @@ register_tap_listener_gtkisup_stat(void) if (err_p != NULL) { - simple_dialog(ESD_TYPE_WARN, NULL, err_p->str); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, err_p->str); g_string_free(err_p, TRUE); exit(1); diff --git a/gtk/ldap_stat.c b/gtk/ldap_stat.c index 6e9c0e891d..0b97bd3f03 100644 --- a/gtk/ldap_stat.c +++ b/gtk/ldap_stat.c @@ -1,7 +1,7 @@ /* ldap_stat.c * ldap_stat 2003 Ronnie Sahlberg * - * $Id: ldap_stat.c,v 1.9 2004/01/21 21:19:33 ulfl Exp $ + * $Id: ldap_stat.c,v 1.10 2004/01/31 03:22:41 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -214,7 +214,7 @@ gtk_ldapstat_init(char *optarg) error_string=register_tap_listener("ldap", ldap, filter, ldapstat_reset, ldapstat_packet, ldapstat_draw); if(error_string){ - simple_dialog(ESD_TYPE_WARN, NULL, error_string->str); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, error_string->str); g_string_free(error_string, TRUE); g_free(ldap); return; diff --git a/gtk/main.c b/gtk/main.c index 5b83794d49..f3caa00f79 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1,6 +1,6 @@ /* main.c * - * $Id: main.c,v 1.380 2004/01/31 02:25:45 ulfl Exp $ + * $Id: main.c,v 1.381 2004/01/31 03:22:41 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -325,7 +325,7 @@ view_zoom_in_cb(GtkWidget *w _U_, gpointer d _U_) case FA_FONT_NOT_AVAILABLE: /* We assume this means that the specified size isn't available. */ - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Your current font isn't available in the next larger size.\n"); recent.gui_zoom_level = save_gui_zoom_level; /* undo zoom */ break; @@ -351,7 +351,7 @@ view_zoom_out_cb(GtkWidget *w _U_, gpointer d _U_) case FA_FONT_NOT_AVAILABLE: /* We assume this means that the specified size isn't available. */ - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Your current font isn't available in the next smaller size.\n"); recent.gui_zoom_level = save_gui_zoom_level; /* undo zoom */ break; @@ -378,7 +378,7 @@ view_zoom_100_cb(GtkWidget *w _U_, gpointer d _U_) case FA_FONT_NOT_AVAILABLE: /* We assume this means that the specified size isn't available. XXX - this "shouldn't happen". */ - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Your current font couldn't be reloaded at the size you selected.\n"); recent.gui_zoom_level = save_gui_zoom_level; /* undo zoom */ break; @@ -585,7 +585,7 @@ get_text_from_packet_list(gpointer data) if (fdata != NULL) { if (!wtap_seek_read(cfile.wth, fdata->file_off, &cfile.pseudo_header, cfile.pd, fdata->cap_len, &err, &err_info)) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, cf_read_error_message(err, err_info), cfile.filename); return NULL; } @@ -2402,7 +2402,7 @@ main(int argc, char *argv[]) if (cf_name) { if (rfilter != NULL) { if (!dfilter_compile(rfilter, &rfcode)) { - simple_dialog(ESD_TYPE_ERROR, NULL, dfilter_error_msg); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, dfilter_error_msg); rfilter_parse_failed = TRUE; } } @@ -2461,12 +2461,12 @@ main(int argc, char *argv[]) the main window. */ if (gpf_path != NULL) { if (gpf_open_errno != 0) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Could not open global preferences file\n\"%s\": %s.", gpf_path, strerror(gpf_open_errno)); } if (gpf_read_errno != 0) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "I/O error reading global preferences file\n\"%s\": %s.", gpf_path, strerror(gpf_read_errno)); } @@ -2478,12 +2478,12 @@ main(int argc, char *argv[]) the main window. */ if (pf_path != NULL) { if (pf_open_errno != 0) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Could not open your preferences file\n\"%s\": %s.", pf_path, strerror(pf_open_errno)); } if (pf_read_errno != 0) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "I/O error reading your preferences file\n\"%s\": %s.", pf_path, strerror(pf_read_errno)); } @@ -2495,7 +2495,7 @@ main(int argc, char *argv[]) pop up an alert box; we defer that until now, so that the alert box is more likely to come up on top of the main window. */ if (cf_path != NULL) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Could not open your capture filter file\n\"%s\": %s.", cf_path, strerror(cf_open_errno)); g_free(cf_path); @@ -2505,7 +2505,7 @@ main(int argc, char *argv[]) pop up an alert box; we defer that until now, so that the alert box is more likely to come up on top of the main window. */ if (df_path != NULL) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Could not open your display filter file\n\"%s\": %s.", df_path, strerror(df_open_errno)); g_free(df_path); @@ -2517,12 +2517,12 @@ main(int argc, char *argv[]) window. */ if (gdp_path != NULL) { if (gdp_open_errno != 0) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Could not open global disabled protocols file\n\"%s\": %s.", gdp_path, strerror(gdp_open_errno)); } if (gdp_read_errno != 0) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "I/O error reading global disabled protocols file\n\"%s\": %s.", gdp_path, strerror(gdp_read_errno)); } @@ -2535,12 +2535,12 @@ main(int argc, char *argv[]) window. */ if (dp_path != NULL) { if (dp_open_errno != 0) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Could not open your disabled protocols file\n\"%s\": %s.", dp_path, strerror(dp_open_errno)); } if (dp_read_errno != 0) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "I/O error reading your disabled protocols file\n\"%s\": %s.", dp_path, strerror(dp_read_errno)); } @@ -3027,7 +3027,7 @@ font_apply(void) { * We just report that for now as a font not available in * multiple sizes. */ - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Your current font isn't available in any other sizes.\n"); return FA_FONT_NOT_RESIZEABLE; } diff --git a/gtk/mgcp_stat.c b/gtk/mgcp_stat.c index 376d689697..72fd08a89c 100644 --- a/gtk/mgcp_stat.c +++ b/gtk/mgcp_stat.c @@ -2,7 +2,7 @@ * mgcp-statistics for ethereal * Copyright 2003 Lars Roland * - * $Id: mgcp_stat.c,v 1.23 2004/01/13 22:49:14 guy Exp $ + * $Id: mgcp_stat.c,v 1.24 2004/01/31 03:22:41 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -290,7 +290,7 @@ gtk_mgcpstat_init(char *optarg) error_string=register_tap_listener("mgcp", ms, filter, mgcpstat_reset, mgcpstat_packet, mgcpstat_draw); if(error_string){ - simple_dialog(ESD_TYPE_WARN, NULL, error_string->str); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, error_string->str); g_string_free(error_string, TRUE); g_free(ms->filter); g_free(ms); diff --git a/gtk/prefs_dlg.c b/gtk/prefs_dlg.c index 2b0fefacb7..b67d66d029 100644 --- a/gtk/prefs_dlg.c +++ b/gtk/prefs_dlg.c @@ -1,7 +1,7 @@ /* prefs_dlg.c * Routines for handling preferences * - * $Id: prefs_dlg.c,v 1.77 2004/01/25 12:22:20 ulfl Exp $ + * $Id: prefs_dlg.c,v 1.78 2004/01/31 03:22:41 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1123,7 +1123,7 @@ prefs_main_save_cb(GtkWidget *save_bt _U_, gpointer parent_w) /* Create the directory that holds personal configuration files, if necessary. */ if (create_persconffile_dir(&pf_dir_path) == -1) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Can't create directory\n\"%s\"\nfor preferences file: %s.", pf_dir_path, strerror(errno)); g_free(pf_dir_path); @@ -1131,7 +1131,7 @@ prefs_main_save_cb(GtkWidget *save_bt _U_, gpointer parent_w) /* Write the preferencs out. */ err = write_prefs(&pf_path); if (err != 0) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Can't open preferences file\n\"%s\": %s.", pf_path, strerror(err)); g_free(pf_path); diff --git a/gtk/print_dlg.c b/gtk/print_dlg.c index aad57ad399..4c7724733b 100644 --- a/gtk/print_dlg.c +++ b/gtk/print_dlg.c @@ -1,7 +1,7 @@ /* print_dlg.c * Dialog boxes for printing * - * $Id: print_dlg.c,v 1.58 2004/01/31 02:25:46 ulfl Exp $ + * $Id: print_dlg.c,v 1.59 2004/01/31 03:22:41 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -786,7 +786,7 @@ print_ok_cb(GtkWidget *ok_bt, gpointer parent_w) g_dest = gtk_entry_get_text(GTK_ENTRY(OBJECT_GET_DATA(ok_bt, PRINT_FILE_TE_KEY))); if (!g_dest[0]) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Printing to file, but no file specified."); return; } @@ -842,19 +842,19 @@ print_ok_cb(GtkWidget *ok_bt, gpointer parent_w) case PP_OPEN_ERROR: if (print_args.to_file) - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_open_error_message(errno, TRUE), print_args.dest); else - simple_dialog(ESD_TYPE_ERROR, NULL, "Couldn't run print command %s.", + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Couldn't run print command %s.", print_args.dest); break; case PP_WRITE_ERROR: if (print_args.to_file) - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_write_error_message(errno), print_args.dest); else - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Error writing to print command: %s", strerror(errno)); break; } diff --git a/gtk/proto_dlg.c b/gtk/proto_dlg.c index 3f7fa24ea5..bca706f678 100644 --- a/gtk/proto_dlg.c +++ b/gtk/proto_dlg.c @@ -1,6 +1,6 @@ /* proto_dlg.c * - * $Id: proto_dlg.c,v 1.30 2004/01/21 21:19:33 ulfl Exp $ + * $Id: proto_dlg.c,v 1.31 2004/01/31 03:22:41 guy Exp $ * * Laurent Deniel <laurent.deniel@free.fr> * @@ -426,7 +426,7 @@ proto_save_cb(GtkWidget *save_bt _U_, gpointer parent_w) /* Create the directory that holds personal configuration files, if necessary. */ if (create_persconffile_dir(&pf_dir_path) == -1) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Can't create directory\n\"%s\"\nfor disabled protocols file: %s.", pf_dir_path, strerror(errno)); g_free(pf_dir_path); @@ -438,7 +438,7 @@ proto_save_cb(GtkWidget *save_bt _U_, gpointer parent_w) save_disabled_protos_list(&pf_path, &pf_save_errno); if (pf_path != NULL) { - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Could not save to your disabled protocols file\n\"%s\": %s.", pf_path, strerror(pf_save_errno)); g_free(pf_path); diff --git a/gtk/proto_draw.c b/gtk/proto_draw.c index 4bc936603b..51726744c4 100644 --- a/gtk/proto_draw.c +++ b/gtk/proto_draw.c @@ -1,7 +1,7 @@ /* proto_draw.c * Routines for GTK+ packet display * - * $Id: proto_draw.c,v 1.84 2004/01/27 20:58:19 ulfl Exp $ + * $Id: proto_draw.c,v 1.85 2004/01/31 03:22:41 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -61,6 +61,7 @@ #include "ui_util.h" #include "gtkglobals.h" #include "compat_macros.h" +#include <epan/filesystem.h> #include "simple_dialog.h" #define BYTE_VIEW_WIDTH 16 @@ -776,16 +777,16 @@ void savehex_cb(GtkWidget * w _U_, gpointer data _U_) /* don't show up the dialog, if no data has to be saved */ bv = get_notebook_bv_ptr(byte_nb_ptr); if (bv == NULL) { - /* shouldn't happen */ - simple_dialog(ESD_TYPE_WARN, NULL, "Could not find the corresponding text window!"); - return; + /* shouldn't happen */ + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Could not find the corresponding text window!"); + return; } end = GPOINTER_TO_INT(OBJECT_GET_DATA(bv, E_BYTE_VIEW_START_KEY)); start = GPOINTER_TO_INT(OBJECT_GET_DATA(bv, E_BYTE_VIEW_END_KEY)); data_p = get_byte_view_data_and_length(GTK_WIDGET(bv), &len); if (data_p == NULL || start == -1 || start > end) { - simple_dialog(ESD_TYPE_WARN, NULL, "No data selected to save!"); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "No data selected to save!"); return; } @@ -889,17 +890,17 @@ savehex_save_clicked_cb(GtkWidget * w _U_, gpointer data _U_) file = (char *)gtk_entry_get_text(GTK_ENTRY(file_entry)); if (!file ||! *file) { - simple_dialog(ESD_TYPE_WARN, NULL, "Please enter a filename!"); - return; + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Please enter a filename!"); + return; } /* Must check if file name exists first */ bv = get_notebook_bv_ptr(byte_nb_ptr); if (bv == NULL) { - /* shouldn't happen */ - simple_dialog(ESD_TYPE_WARN, NULL, "Could not find the corresponding text window!"); - return; + /* shouldn't happen */ + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Could not find the corresponding text window!"); + return; } /* * Retrieve the info we need @@ -909,17 +910,28 @@ savehex_save_clicked_cb(GtkWidget * w _U_, gpointer data _U_) data_p = get_byte_view_data_and_length(GTK_WIDGET(bv), &len); if (data_p == NULL || start == -1 || start > end) { - simple_dialog(ESD_TYPE_WARN, NULL, "No data selected to save!"); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, + "No data selected to save!"); return; } fd = open(file, O_WRONLY|O_CREAT|O_TRUNC, 0666); if (fd == -1) { - simple_dialog(ESD_TYPE_WARN, NULL, "Could not open file: \"%s\" - %s!", file, strerror(errno)); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, + file_open_error_message(errno, TRUE), file); + return; + } + if (write(fd, data_p + start, end - start) < 0) { + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, + file_write_error_message(errno), file); + close(fd); + return; + } + if (close(fd) < 0) { + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, + file_write_error_message(errno), file); return; } - write(fd, data_p + start, end - start); - close(fd); /* Get rid of the dialog box */ gtk_widget_destroy(GTK_WIDGET(savehex_dlg)); diff --git a/gtk/rpc_stat.c b/gtk/rpc_stat.c index 9e869ce045..cf548730a6 100644 --- a/gtk/rpc_stat.c +++ b/gtk/rpc_stat.c @@ -1,7 +1,7 @@ /* rpc_stat.c * rpc_stat 2002 Ronnie Sahlberg * - * $Id: rpc_stat.c,v 1.34 2004/01/21 21:19:34 ulfl Exp $ + * $Id: rpc_stat.c,v 1.35 2004/01/31 03:22:42 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -269,7 +269,7 @@ gtk_rpcstat_init(char *optarg) error_string=register_tap_listener("rpc", rs, filter, (void*)rpcstat_reset, (void*)rpcstat_packet, (void*)rpcstat_draw); if(error_string){ - simple_dialog(ESD_TYPE_WARN, NULL, error_string->str); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, error_string->str); g_string_free(error_string, TRUE); free_srt_table_data(&rs->srt_table); g_free(rs); diff --git a/gtk/rtp_analysis.c b/gtk/rtp_analysis.c index 6d2c48a9d1..b075519a16 100644 --- a/gtk/rtp_analysis.c +++ b/gtk/rtp_analysis.c @@ -1,7 +1,7 @@ /* rtp_analysis.c * RTP analysis addition for ethereal * - * $Id: rtp_analysis.c,v 1.29 2004/01/31 02:25:46 ulfl Exp $ + * $Id: rtp_analysis.c,v 1.30 2004/01/31 03:22:42 guy Exp $ * * Copyright 2003, Alcatel Business Systems * By Lars Ruoff <lars.ruoff@gmx.net> @@ -854,7 +854,7 @@ static void on_refresh_bt_clicked(GtkWidget *bt _U_, user_data_t *user_data _U_) /* try to compile the filter. */ strcpy(filter_text,"rtp && ip"); if (!dfilter_compile(filter_text, &sfcode)) { - simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, NULL, dfilter_error_msg); + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, ESD_BTN_OK, dfilter_error_msg); return; } @@ -873,7 +873,7 @@ static void on_refresh_bt_clicked(GtkWidget *bt _U_, user_data_t *user_data _U_) error_string = register_tap_listener("rtp", user_data, filter_text, rtp_reset, rtp_packet, rtp_draw); if (error_string != NULL) { - simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, NULL, error_string->str); + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, ESD_BTN_OK, error_string->str); g_string_free(error_string, TRUE); return; } @@ -966,7 +966,7 @@ static void save_csv_as_ok_cb(GtkWidget *bt _U_, gpointer fs /*user_data_t *user if (GTK_TOGGLE_BUTTON(forw)->active || GTK_TOGGLE_BUTTON(both)->active) { fp = fopen(g_dest, "w"); if (fp == NULL) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_open_error_message(errno, TRUE), g_dest); return; } @@ -974,7 +974,7 @@ static void save_csv_as_ok_cb(GtkWidget *bt _U_, gpointer fs /*user_data_t *user if (GTK_TOGGLE_BUTTON(both)->active) { fprintf(fp, "Forward\n"); if (ferror(fp)) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_write_error_message(errno), g_dest); fclose(fp); return; @@ -990,7 +990,7 @@ static void save_csv_as_ok_cb(GtkWidget *bt _U_, gpointer fs /*user_data_t *user } fprintf(fp,"\n"); if (ferror(fp)) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_write_error_message(errno), g_dest); fclose(fp); return; @@ -1006,7 +1006,7 @@ static void save_csv_as_ok_cb(GtkWidget *bt _U_, gpointer fs /*user_data_t *user } fprintf(fp,"\n"); if (ferror(fp)) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_write_error_message(errno), g_dest); fclose(fp); return; @@ -1014,7 +1014,7 @@ static void save_csv_as_ok_cb(GtkWidget *bt _U_, gpointer fs /*user_data_t *user } if (fclose(fp) == EOF) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_write_error_message(errno), g_dest); return; } @@ -1025,14 +1025,14 @@ static void save_csv_as_ok_cb(GtkWidget *bt _U_, gpointer fs /*user_data_t *user if (GTK_TOGGLE_BUTTON(both)->active) { fp = fopen(g_dest, "a"); if (fp == NULL) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_open_error_message(errno, TRUE), g_dest); return; } fprintf(fp, "\nReverse\n"); if (ferror(fp)) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_write_error_message(errno), g_dest); fclose(fp); return; @@ -1040,7 +1040,7 @@ static void save_csv_as_ok_cb(GtkWidget *bt _U_, gpointer fs /*user_data_t *user } else { fp = fopen(g_dest, "w"); if (fp == NULL) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_open_error_message(errno, TRUE), g_dest); return; @@ -1055,7 +1055,7 @@ static void save_csv_as_ok_cb(GtkWidget *bt _U_, gpointer fs /*user_data_t *user } fprintf(fp,"\n"); if (ferror(fp)) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_write_error_message(errno), g_dest); fclose(fp); return; @@ -1071,14 +1071,14 @@ static void save_csv_as_ok_cb(GtkWidget *bt _U_, gpointer fs /*user_data_t *user } fprintf(fp,"\n"); if (ferror(fp)) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_write_error_message(errno), g_dest); fclose(fp); return; } } if (fclose(fp) == EOF) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_write_error_message(errno), g_dest); return; } @@ -1419,18 +1419,18 @@ static void save_voice_as_ok_cb(GtkWidget *ok_bt _U_, gpointer fs _U_) /* there are many combinations here, we just exit when first matches */ if ((user_data->forward.saveinfo.error_type == TAP_RTP_WRONG_CODEC) || (user_data->reversed.saveinfo.error_type == TAP_RTP_WRONG_CODEC)) - simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, NULL, + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, ESD_BTN_OK, "Can't save in a file: Unsupported codec!"); else if ((user_data->forward.saveinfo.error_type == TAP_RTP_WRONG_LENGTH) || (user_data->reversed.saveinfo.error_type == TAP_RTP_WRONG_LENGTH)) - simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, NULL, + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, ESD_BTN_OK, "Can't save in a file: Wrong length of captured packets!"); else if ((user_data->forward.saveinfo.error_type == TAP_RTP_PADDING_ERROR) || (user_data->reversed.saveinfo.error_type == TAP_RTP_PADDING_ERROR)) - simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, NULL, + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, ESD_BTN_OK, "Can't save in a file: RTP data with padding!"); else - simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, NULL, + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, ESD_BTN_OK, "Can't save in a file: File I/O problem!"); return; } @@ -1438,16 +1438,16 @@ static void save_voice_as_ok_cb(GtkWidget *ok_bt _U_, gpointer fs _U_) else if ((user_data->forward.saveinfo.saved == FALSE) && ((GTK_TOGGLE_BUTTON (forw)->active) || (GTK_TOGGLE_BUTTON (both)->active))) { if (user_data->forward.saveinfo.error_type == TAP_RTP_WRONG_CODEC) - simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, NULL, + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, ESD_BTN_OK, "Can't save forward direction in a file: Unsupported codec!"); else if (user_data->forward.saveinfo.error_type == TAP_RTP_WRONG_LENGTH) - simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, NULL, + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, ESD_BTN_OK, "Can't save forward direction in a file: Wrong length of captured packets!"); else if (user_data->forward.saveinfo.error_type == TAP_RTP_PADDING_ERROR) - simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, NULL, + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, ESD_BTN_OK, "Can't save forward direction in a file: RTP data with padding!"); else - simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, NULL, + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, ESD_BTN_OK, "Can't save forward direction in a file: File I/O problem!"); return; } @@ -1455,19 +1455,19 @@ static void save_voice_as_ok_cb(GtkWidget *ok_bt _U_, gpointer fs _U_) else if ((user_data->reversed.saveinfo.saved == FALSE) && ((GTK_TOGGLE_BUTTON (rev)->active) || (GTK_TOGGLE_BUTTON (both)->active))) { if (user_data->reversed.saveinfo.error_type == TAP_RTP_WRONG_CODEC) - simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, NULL, + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, ESD_BTN_OK, "Can't save reversed direction in a file: Unsupported codec!"); else if (user_data->reversed.saveinfo.error_type == TAP_RTP_WRONG_LENGTH) - simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, NULL, + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, ESD_BTN_OK, "Can't save reversed direction in a file: Wrong length of captured packets!"); else if (user_data->reversed.saveinfo.error_type == TAP_RTP_PADDING_ERROR) - simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, NULL, + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, ESD_BTN_OK, "Can't save reversed direction in a file: RTP data with padding!"); else if (user_data->reversed.saveinfo.error_type == TAP_RTP_NO_DATA) - simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, NULL, + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, ESD_BTN_OK, "Can't save reversed direction in a file: No RTP data!"); else - simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, NULL, + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, ESD_BTN_OK, "Can't save reversed direction in a file: File I/O problem!"); return; } @@ -1487,7 +1487,8 @@ static void save_voice_as_ok_cb(GtkWidget *ok_bt _U_, gpointer fs _U_) channels = 1; if(!copy_file(g_dest, channels/*, format*/, user_data)) { - simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, NULL, + /* XXX - report the error type! */ + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, ESD_BTN_OK, "An error occured while saving voice in a file!"); return; } @@ -2217,7 +2218,8 @@ void rtp_analysis_cb(GtkWidget *w _U_, gpointer data _U_) /* Try to compile the filter. */ strcpy(filter_text,"rtp && ip"); if (!dfilter_compile(filter_text, &sfcode)) { - simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, NULL, dfilter_error_msg); + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, ESD_BTN_OK, + dfilter_error_msg); return; } /* we load the current file into cf variable */ @@ -2231,7 +2233,7 @@ void rtp_analysis_cb(GtkWidget *w _U_, gpointer data _U_) /* dissect the current frame */ if (!wtap_seek_read(cf->wth, fdata->file_off, &cf->pseudo_header, cf->pd, fdata->cap_len, &err, &err_info)) { - simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, NULL, + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, ESD_BTN_OK, cf_read_error_message(err, err_info), cf->filename); return; } @@ -2244,7 +2246,8 @@ void rtp_analysis_cb(GtkWidget *w _U_, gpointer data _U_) frame_matched = dfilter_apply_edt(sfcode, edt); if (frame_matched != 1) { epan_dissect_free(edt); - simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, NULL, "You didn't choose a RTP packet!"); + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, ESD_BTN_OK, + "You didn't choose a RTP packet!"); return; } @@ -2262,7 +2265,8 @@ void rtp_analysis_cb(GtkWidget *w _U_, gpointer data _U_) /* now we need the SSRC value of the current frame */ if (!get_int_value_from_proto_tree(edt->tree, "rtp", "rtp.ssrc", &ssrc_fwd)) { - simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, NULL, "SSRC value couldn't be found!"); + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, ESD_BTN_OK, + "SSRC value couldn't be found!"); return; } diff --git a/gtk/rtp_stream.c b/gtk/rtp_stream.c index 2b641e550b..a6628f1430 100644 --- a/gtk/rtp_stream.c +++ b/gtk/rtp_stream.c @@ -1,7 +1,7 @@ /* rtp_stream.c * RTP streams summary addition for ethereal * - * $Id: rtp_stream.c,v 1.9 2004/01/31 02:25:46 ulfl Exp $ + * $Id: rtp_stream.c,v 1.10 2004/01/31 03:22:42 guy Exp $ * * Copyright 2003, Alcatel Business Systems * By Lars Ruoff <lars.ruoff@gmx.net> @@ -283,14 +283,14 @@ gboolean rtpstream_save(rtp_stream_info_t* stream, const gchar *filename) /* open file for saving */ the_tapinfo_struct.save_file = fopen(filename, "wb"); if (the_tapinfo_struct.save_file==NULL) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_open_error_message(errno, TRUE), filename); return FALSE; } rtp_write_header(stream, the_tapinfo_struct.save_file); if (ferror(the_tapinfo_struct.save_file)) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_write_error_message(errno), filename); fclose(the_tapinfo_struct.save_file); return FALSE; @@ -308,14 +308,14 @@ gboolean rtpstream_save(rtp_stream_info_t* stream, const gchar *filename) remove_tap_listener_rtp_stream(); if (ferror(the_tapinfo_struct.save_file)) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_write_error_message(errno), filename); fclose(the_tapinfo_struct.save_file); return FALSE; } if (fclose(the_tapinfo_struct.save_file) == EOF) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, file_write_error_message(errno), filename); return FALSE; } @@ -393,7 +393,8 @@ register_tap_listener_rtp_stream(void) (void*)rtpstream_reset, (void*)rtpstream_packet, (void*)rtpstream_draw); if (error_string != NULL) { - simple_dialog(ESD_TYPE_WARN | ESD_TYPE_MODAL, NULL, error_string->str); + simple_dialog(ESD_TYPE_ERROR | ESD_TYPE_MODAL, + ESD_BTN_OK, error_string->str); g_string_free(error_string, TRUE); exit(1); } diff --git a/gtk/service_response_time_table.c b/gtk/service_response_time_table.c index b0bb89f8fd..54b3051e49 100644 --- a/gtk/service_response_time_table.c +++ b/gtk/service_response_time_table.c @@ -3,7 +3,7 @@ * Helper routines common to all service response time statistics * tap. * - * $Id: service_response_time_table.c,v 1.12 2004/01/25 18:51:26 ulfl Exp $ + * $Id: service_response_time_table.c,v 1.13 2004/01/31 03:22:42 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -171,7 +171,7 @@ srt_select_filter_cb(GtkWidget *widget _U_, gpointer callback_data, guint callba selection=GPOINTER_TO_INT(g_list_nth_data(GTK_CLIST(rst->table)->selection, 0)); if(selection>=(int)rst->num_procs){ - simple_dialog(ESD_TYPE_WARN, NULL, "No procedure selected"); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "No procedure selected"); return; } /* translate it back from row index to index in procedures array */ diff --git a/gtk/simple_dialog.c b/gtk/simple_dialog.c index 256d63f1c2..ca115cb867 100644 --- a/gtk/simple_dialog.c +++ b/gtk/simple_dialog.c @@ -1,7 +1,7 @@ /* simple_dialog.c * Simple message dialog box routines. * - * $Id: simple_dialog.c,v 1.19 2004/01/31 02:25:46 ulfl Exp $ + * $Id: simple_dialog.c,v 1.20 2004/01/31 03:22:42 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -133,7 +133,6 @@ simple_dialog(gint type, gint btn_mask, gchar *msg_format, ...) { /* Button row */ switch(btn_mask) { - case(0): case(ESD_BTN_OK): bbox = dlg_button_row_new(GTK_STOCK_OK, NULL); break; @@ -145,6 +144,8 @@ simple_dialog(gint type, gint btn_mask, gchar *msg_format, ...) { break; default: g_assert_not_reached(); + bbox = NULL; + break; } gtk_container_add(GTK_CONTAINER(main_vb), bbox); gtk_widget_show(bbox); diff --git a/gtk/smb_stat.c b/gtk/smb_stat.c index c0a485249f..2867cfbb69 100644 --- a/gtk/smb_stat.c +++ b/gtk/smb_stat.c @@ -1,7 +1,7 @@ /* smb_stat.c * smb_stat 2003 Ronnie Sahlberg * - * $Id: smb_stat.c,v 1.32 2004/01/21 21:19:34 ulfl Exp $ + * $Id: smb_stat.c,v 1.33 2004/01/31 03:22:42 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -219,7 +219,7 @@ gtk_smbstat_init(char *optarg) error_string=register_tap_listener("smb", ss, filter, smbstat_reset, smbstat_packet, smbstat_draw); if(error_string){ - simple_dialog(ESD_TYPE_WARN, NULL, error_string->str); + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, error_string->str); g_string_free(error_string, TRUE); g_free(ss); return; diff --git a/gtk/tcp_graph.c b/gtk/tcp_graph.c index 2c0a2c4f1a..0f8dbfa9ea 100644 --- a/gtk/tcp_graph.c +++ b/gtk/tcp_graph.c @@ -3,7 +3,7 @@ * By Pavel Mores <pvl@uh.cz> * Win32 port: rwh@unifiedtech.com * - * $Id: tcp_graph.c,v 1.48 2004/01/31 02:25:46 ulfl Exp $ + * $Id: tcp_graph.c,v 1.49 2004/01/31 03:22:42 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -558,7 +558,7 @@ void tcp_graph_cb (GtkWidget *w _U_, gpointer data _U_, guint graph_type) /* currently selected packet is neither TCP over IP over Ethernet II/PPP * nor TCP over IP alone - should display some * kind of warning dialog */ - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Selected packet is not a TCP segment"); return; } @@ -627,7 +627,7 @@ static void display_text (struct graph *g) /* * XXX - do more than just warn. */ - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Could not parse color SlateGray."); } #if GTK_MAJOR_VERSION < 2 @@ -791,14 +791,14 @@ static void create_drawing_area (struct graph *g) /* * XXX - do more than just warn. */ - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Could not parse color gray15."); } if (!gdk_colormap_alloc_color (colormap, &color, FALSE, TRUE)) { /* * XXX - do more than just warn. */ - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Could not allocate color gray15."); } gdk_gc_set_foreground (xor_gc, &color); @@ -809,14 +809,14 @@ static void create_drawing_area (struct graph *g) /* * XXX - do more than just warn. */ - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Could not parse color white."); } if (!gdk_colormap_alloc_color (colormap, &color, FALSE, TRUE)) { /* * XXX - do more than just warn. */ - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Could not allocate color white."); } gdk_gc_set_foreground (g->bg_gc, &color); @@ -1795,7 +1795,7 @@ static void graph_segment_list_get (struct graph *g) for (ptr=cfile.plist; ptr; ptr=ptr->next) { if (!wtap_seek_read (cfile.wth, ptr->file_off, &pseudo_header, pd, ptr->cap_len, &err, &err_info)) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, cf_read_error_message(err, err_info), cfile.filename); break; @@ -3411,14 +3411,14 @@ static void tseq_tcptrace_read_config (struct graph *g) /* * XXX - do more than just warn. */ - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Could not parse color black."); } if (!gdk_colormap_alloc_color (colormap, &color, FALSE, TRUE)) { /* * XXX - do more than just warn. */ - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Could not allocate color black."); } gdk_gc_set_foreground (g->s.tseq_tcptrace.gc_seq, &color); @@ -3426,14 +3426,14 @@ static void tseq_tcptrace_read_config (struct graph *g) /* * XXX - do more than just warn. */ - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Could not parse color LightSlateGray."); } if (!gdk_colormap_alloc_color (colormap, &color, FALSE, TRUE)) { /* * XXX - do more than just warn. */ - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Could not allocate color LightSlateGray."); } gdk_gc_set_foreground (g->s.tseq_tcptrace.gc_ack[0], &color); @@ -3441,14 +3441,14 @@ static void tseq_tcptrace_read_config (struct graph *g) /* * XXX - do more than just warn. */ - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Could not parse color LightGray."); } if (!gdk_colormap_alloc_color (colormap, &color, FALSE, TRUE)) { /* * XXX - do more than just warn. */ - simple_dialog(ESD_TYPE_WARN, NULL, + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "Could not allocate color LightGray."); } gdk_gc_set_foreground (g->s.tseq_tcptrace.gc_ack[1], &color); diff --git a/gtk/wsp_stat.c b/gtk/wsp_stat.c index 5e3be3bc4a..663edb1815 100644 --- a/gtk/wsp_stat.c +++ b/gtk/wsp_stat.c @@ -1,7 +1,7 @@ /* wsp_stat.c * wsp_stat 2003 Jean-Michel FAYARD * - * $Id: wsp_stat.c,v 1.14 2004/01/21 21:19:34 ulfl Exp $ + * $Id: wsp_stat.c,v 1.15 2004/01/31 03:22:42 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -394,7 +394,7 @@ gtk_wspstat_init(char *optarg) wspstat_draw); if (error_string){ /* error, we failed to attach to the tap. clean up */ - simple_dialog( ESD_TYPE_WARN, NULL, error_string->str ); + simple_dialog( ESD_TYPE_ERROR, ESD_BTN_OK, error_string->str ); g_free(sp->pdu_stats); g_free(sp->filter); g_free(sp); diff --git a/proto_hier_stats.c b/proto_hier_stats.c index f98d8d75a6..11c1993b36 100644 --- a/proto_hier_stats.c +++ b/proto_hier_stats.c @@ -1,7 +1,7 @@ /* proto_hier_stats.c * Routines for calculating statistics based on protocol. * - * $Id: proto_hier_stats.c,v 1.24 2004/01/31 02:25:43 ulfl Exp $ + * $Id: proto_hier_stats.c,v 1.25 2004/01/31 03:22:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -133,7 +133,7 @@ process_frame(frame_data *frame, column_info *cinfo, ph_stats_t* ps) /* Load the frame from the capture file */ if (!wtap_seek_read(cfile.wth, frame->file_off, &phdr, pd, frame->cap_len, &err, &err_info)) { - simple_dialog(ESD_TYPE_ERROR, NULL, + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, cf_read_error_message(err, err_info), cfile.filename); return FALSE; /* failure */ } |