5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
35 #include <epan/epan.h>
36 #include <epan/filesystem.h>
37 #include <epan/epan_dissect.h>
38 #include <epan/expert.h>
39 #include <epan/prefs.h>
44 #include "../capture_opts.h"
45 #include "../capture_ui_utils.h"
46 #include "../capture.h"
49 #include "gtk/recent.h"
51 #include "gtk/main_statusbar.h"
52 #include "gtk/main_statusbar_private.h"
53 #include "gtk/gui_utils.h"
54 #include "gtk/gtkglobals.h"
55 #include "gtk/expert_comp_dlg.h"
56 #include "gtk/profile_dlg.h"
57 #include "gtk/main_welcome.h"
58 #include "gtk/expert_indicators.h"
60 #include "gtk/menus.h"
63 * The order below defines the priority of info bar contexts.
75 #define DEF_READY_MESSAGE " Ready to load or capture"
77 #define DEF_READY_MESSAGE " Ready to load file"
81 static GtkWidget *status_pane_left, *status_pane_right;
82 static GtkWidget *info_bar, *info_bar_event, *packets_bar, *profile_bar, *profile_bar_event;
83 static GtkWidget *expert_info_error, *expert_info_warn, *expert_info_note;
84 static GtkWidget *expert_info_chat, *expert_info_none;
86 static guint main_ctx, file_ctx, help_ctx, filter_ctx, packets_ctx, profile_ctx;
87 static guint status_levels[NUM_STATUS_LEVELS];
88 static gchar *packets_str = NULL;
89 static gchar *profile_str = NULL;
92 static void info_bar_new(void);
93 static void packets_bar_new(void);
94 static void profile_bar_new(void);
95 static void status_expert_new(void);
97 /* Temporary message timeouts */
98 #define TEMPORARY_MSG_TIMEOUT (7 * 1000)
99 #define TEMPORARY_FLASH_TIMEOUT (1 * 1000)
100 #define TEMPORARY_FLASH_INTERVAL (TEMPORARY_FLASH_TIMEOUT / 4)
101 static gint flash_time;
102 static gboolean flash_highlight = FALSE;
105 * Push a message referring to file access onto the statusbar.
108 statusbar_push_file_msg(const gchar *msg)
112 /*g_warning("statusbar_push: %s", msg);*/
113 for (i = STATUS_LEVEL_FILE + 1; i < NUM_STATUS_LEVELS; i++) {
114 if (status_levels[i])
117 status_levels[STATUS_LEVEL_FILE]++;
119 gtk_statusbar_push(GTK_STATUSBAR(info_bar), file_ctx, msg);
123 * Pop a message referring to file access off the statusbar.
126 statusbar_pop_file_msg(void)
128 /*g_warning("statusbar_pop");*/
129 if (status_levels[STATUS_LEVEL_FILE] > 0) {
130 status_levels[STATUS_LEVEL_FILE]--;
132 gtk_statusbar_pop(GTK_STATUSBAR(info_bar), file_ctx);
136 * Push a message referring to the currently-selected field onto the statusbar.
139 statusbar_push_field_msg(const gchar *msg)
143 for (i = STATUS_LEVEL_HELP + 1; i < NUM_STATUS_LEVELS; i++) {
144 if (status_levels[i])
147 status_levels[STATUS_LEVEL_HELP]++;
149 gtk_statusbar_push(GTK_STATUSBAR(info_bar), help_ctx, msg);
153 * Pop a message referring to the currently-selected field off the statusbar.
156 statusbar_pop_field_msg(void)
158 if (status_levels[STATUS_LEVEL_HELP] > 0) {
159 status_levels[STATUS_LEVEL_HELP]--;
161 gtk_statusbar_pop(GTK_STATUSBAR(info_bar), help_ctx);
165 * Push a message referring to the current filter onto the statusbar.
168 statusbar_push_filter_msg(const gchar *msg)
172 for (i = STATUS_LEVEL_FILTER + 1; i < NUM_STATUS_LEVELS; i++) {
173 if (status_levels[i])
176 status_levels[STATUS_LEVEL_FILTER]++;
178 gtk_statusbar_push(GTK_STATUSBAR(info_bar), filter_ctx, msg);
182 * Pop a message referring to the current filter off the statusbar.
185 statusbar_pop_filter_msg(void)
187 if (status_levels[STATUS_LEVEL_FILTER] > 0) {
188 status_levels[STATUS_LEVEL_FILTER]--;
190 gtk_statusbar_pop(GTK_STATUSBAR(info_bar), filter_ctx);
194 * Timeout callbacks for statusbar_push_temporary_msg
197 statusbar_remove_temporary_msg(gpointer data)
199 guint msg_id = GPOINTER_TO_UINT(data);
201 gtk_statusbar_remove(GTK_STATUSBAR(info_bar), main_ctx, msg_id);
207 statusbar_flash_temporary_msg(gpointer data _U_)
209 gboolean retval = TRUE;
211 if (flash_time > 0) {
212 flash_highlight = !flash_highlight;
214 flash_highlight = FALSE;
219 * As of 2.18.3 gtk_drag_highlight just draws a border around the widget
220 * so we can abuse it here.
222 if (flash_highlight) {
223 gtk_drag_highlight(info_bar);
225 gtk_drag_unhighlight(info_bar);
228 flash_time -= TEMPORARY_FLASH_INTERVAL;
234 * Push a temporary message onto the statusbar.
237 statusbar_push_temporary_msg(const gchar *msg)
241 msg_id = gtk_statusbar_push(GTK_STATUSBAR(info_bar), main_ctx, msg);
243 flash_time = TEMPORARY_FLASH_TIMEOUT - 1;
244 g_timeout_add(TEMPORARY_FLASH_INTERVAL, statusbar_flash_temporary_msg, NULL);
246 g_timeout_add(TEMPORARY_MSG_TIMEOUT, statusbar_remove_temporary_msg, GUINT_TO_POINTER(msg_id));
253 GtkWidget *status_hbox;
256 status_hbox = gtk_hbox_new(FALSE, 1);
257 gtk_container_set_border_width(GTK_CONTAINER(status_hbox), 0);
259 /* info (main) statusbar */
262 /* packets statusbar */
265 /* profile statusbar */
268 /* expert info indicator */
271 /* Pane for the statusbar */
272 status_pane_left = gtk_hpaned_new();
273 gtk_widget_show(status_pane_left);
274 status_pane_right = gtk_hpaned_new();
275 gtk_widget_show(status_pane_right);
281 statusbar_load_window_geometry(void)
283 if (recent.has_gui_geometry_status_pane && recent.gui_geometry_status_pane_left)
284 gtk_paned_set_position(GTK_PANED(status_pane_left), recent.gui_geometry_status_pane_left);
285 if (recent.has_gui_geometry_status_pane && recent.gui_geometry_status_pane_right)
286 gtk_paned_set_position(GTK_PANED(status_pane_right), recent.gui_geometry_status_pane_right);
290 statusbar_save_window_geometry(void)
292 recent.gui_geometry_status_pane_left = gtk_paned_get_position(GTK_PANED(status_pane_left));
293 recent.gui_geometry_status_pane_right = gtk_paned_get_position(GTK_PANED(status_pane_right));
298 * Helper for statusbar_widgets_emptying()
301 foreach_remove_a_child(GtkWidget *widget, gpointer data) {
302 gtk_container_remove(GTK_CONTAINER(data), widget);
306 statusbar_widgets_emptying(GtkWidget *statusbar)
308 g_object_ref(G_OBJECT(info_bar));
309 g_object_ref(G_OBJECT(info_bar_event));
310 g_object_ref(G_OBJECT(packets_bar));
311 g_object_ref(G_OBJECT(profile_bar));
312 g_object_ref(G_OBJECT(profile_bar_event));
313 g_object_ref(G_OBJECT(status_pane_left));
314 g_object_ref(G_OBJECT(status_pane_right));
315 g_object_ref(G_OBJECT(expert_info_error));
316 g_object_ref(G_OBJECT(expert_info_warn));
317 g_object_ref(G_OBJECT(expert_info_note));
318 g_object_ref(G_OBJECT(expert_info_chat));
319 g_object_ref(G_OBJECT(expert_info_none));
321 /* empty all containers participating */
322 gtk_container_foreach(GTK_CONTAINER(statusbar), foreach_remove_a_child, statusbar);
323 gtk_container_foreach(GTK_CONTAINER(status_pane_left), foreach_remove_a_child, status_pane_left);
324 gtk_container_foreach(GTK_CONTAINER(status_pane_right), foreach_remove_a_child, status_pane_right);
328 statusbar_widgets_pack(GtkWidget *statusbar)
330 gtk_box_pack_start(GTK_BOX(statusbar), expert_info_error, FALSE, FALSE, 2);
331 gtk_box_pack_start(GTK_BOX(statusbar), expert_info_warn, FALSE, FALSE, 2);
332 gtk_box_pack_start(GTK_BOX(statusbar), expert_info_note, FALSE, FALSE, 2);
333 gtk_box_pack_start(GTK_BOX(statusbar), expert_info_chat, FALSE, FALSE, 2);
334 gtk_box_pack_start(GTK_BOX(statusbar), expert_info_none, FALSE, FALSE, 2);
335 gtk_box_pack_start(GTK_BOX(statusbar), status_pane_left, TRUE, TRUE, 0);
336 gtk_paned_pack1(GTK_PANED(status_pane_left), info_bar_event, FALSE, FALSE);
337 gtk_paned_pack2(GTK_PANED(status_pane_left), status_pane_right, TRUE, FALSE);
338 gtk_paned_pack1(GTK_PANED(status_pane_right), packets_bar, TRUE, FALSE);
339 gtk_paned_pack2(GTK_PANED(status_pane_right), profile_bar_event, FALSE, FALSE);
343 statusbar_widgets_show_or_hide(GtkWidget *statusbar)
346 * Show the status hbox if either:
348 * 1) we're showing the filter toolbar and we want it in the status
353 * 2) we're showing the status bar.
355 if ((recent.filter_toolbar_show && prefs.filter_toolbar_show_in_statusbar) ||
356 recent.statusbar_show) {
357 gtk_widget_show(statusbar);
359 gtk_widget_hide(statusbar);
362 if (recent.statusbar_show) {
363 gtk_widget_show(status_pane_left);
365 gtk_widget_hide(status_pane_left);
375 info_bar_event = gtk_event_box_new();
376 info_bar = gtk_statusbar_new();
377 gtk_container_add(GTK_CONTAINER(info_bar_event), info_bar);
378 main_ctx = gtk_statusbar_get_context_id(GTK_STATUSBAR(info_bar), "main");
379 file_ctx = gtk_statusbar_get_context_id(GTK_STATUSBAR(info_bar), "file");
380 help_ctx = gtk_statusbar_get_context_id(GTK_STATUSBAR(info_bar), "help");
381 filter_ctx = gtk_statusbar_get_context_id(GTK_STATUSBAR(info_bar), "filter");
382 gtk_statusbar_set_has_resize_grip(GTK_STATUSBAR(info_bar), FALSE);
383 gtk_statusbar_push(GTK_STATUSBAR(info_bar), main_ctx, DEF_READY_MESSAGE);
385 for (i = 0; i < NUM_STATUS_LEVELS; i++) {
386 status_levels[i] = 0;
389 gtk_widget_show(info_bar);
390 gtk_widget_show(info_bar_event);
394 packets_bar_new(void)
396 /* tip: tooltips don't work on statusbars! */
397 packets_bar = gtk_statusbar_new();
398 packets_ctx = gtk_statusbar_get_context_id(GTK_STATUSBAR(packets_bar), "packets");
399 packets_bar_update();
400 gtk_statusbar_set_has_resize_grip(GTK_STATUSBAR(packets_bar), FALSE);
402 gtk_widget_show(packets_bar);
406 profile_bar_new(void)
408 GtkTooltips *tooltips;
410 tooltips = gtk_tooltips_new();
412 profile_bar_event = gtk_event_box_new();
413 profile_bar = gtk_statusbar_new();
414 gtk_container_add(GTK_CONTAINER(profile_bar_event), profile_bar);
415 g_signal_connect(profile_bar_event, "button_press_event", G_CALLBACK(profile_show_popup_cb), NULL);
416 g_signal_connect(profile_bar_event, "button_press_event", G_CALLBACK(popup_menu_handler),
417 g_object_get_data(G_OBJECT(popup_menu_object), PM_STATUSBAR_PROFILES_KEY));
418 profile_ctx = gtk_statusbar_get_context_id(GTK_STATUSBAR(profile_bar), "profile");
419 gtk_tooltips_set_tip (tooltips, profile_bar_event,
420 "Click to change configuration profile", NULL);
421 profile_bar_update();
423 gtk_widget_show(profile_bar);
424 gtk_widget_show(profile_bar_event);
429 * Update the packets statusbar to the current values
432 packets_bar_update(void)
435 /* Remove old status */
438 gtk_statusbar_pop(GTK_STATUSBAR(packets_bar), packets_ctx);
441 /* Do we have any packets? */
443 if(cfile.drops_known) {
444 packets_str = g_strdup_printf(" Packets: %u Displayed: %u Marked: %u Dropped: %u",
445 cfile.count, cfile.displayed_count, cfile.marked_count, cfile.drops);
446 } else if (cfile.ignored_count > 0) {
447 packets_str = g_strdup_printf(" Packets: %u Displayed: %u Marked: %u Ignored: %u",
448 cfile.count, cfile.displayed_count, cfile.marked_count, cfile.ignored_count);
450 if(cfile.is_tempfile){
452 packets_str = g_strdup_printf(" Packets: %u Displayed: %u Marked: %u",
453 cfile.count, cfile.displayed_count, cfile.marked_count);
455 /* Loading an existing file */
456 gulong computed_elapsed = cf_get_computed_elapsed();
457 packets_str = g_strdup_printf(" Packets: %u Displayed: %u Marked: %u Load time: %lu:%02lu.%03lu",
458 cfile.count, cfile.displayed_count, cfile.marked_count,
459 computed_elapsed/60000,
460 computed_elapsed%60000/1000,
461 computed_elapsed%1000);
465 packets_str = g_strdup(" No Packets");
467 gtk_statusbar_push(GTK_STATUSBAR(packets_bar), packets_ctx, packets_str);
472 * Update the packets statusbar to the current values
475 profile_bar_update(void)
478 /* remove old status */
481 gtk_statusbar_pop(GTK_STATUSBAR(profile_bar), profile_ctx);
484 profile_str = g_strdup_printf (" Profile: %s", get_profile_name ());
485 gtk_statusbar_push(GTK_STATUSBAR(profile_bar), profile_ctx, profile_str);
487 set_menus_for_profiles(is_default_profile());
492 expert_comp_dlg_event_cb(GtkWidget *w _U_, GdkEventButton *event _U_, gpointer user_data _U_)
494 expert_comp_dlg_launch();
499 status_expert_new(void)
501 GtkWidget *expert_image;
502 GtkTooltips *tooltips;
504 tooltips = gtk_tooltips_new();
506 expert_image = pixbuf_to_widget(expert_error_pb_data);
507 gtk_tooltips_set_tip(tooltips, expert_image, "ERROR is the highest expert info level", NULL);
508 gtk_widget_show(expert_image);
509 expert_info_error = gtk_event_box_new();
510 gtk_container_add(GTK_CONTAINER(expert_info_error), expert_image);
511 g_signal_connect(expert_info_error, "button_press_event", G_CALLBACK(expert_comp_dlg_event_cb), NULL);
513 expert_image = pixbuf_to_widget(expert_warn_pb_data);
514 gtk_tooltips_set_tip(tooltips, expert_image, "WARNING is the highest expert info level", NULL);
515 gtk_widget_show(expert_image);
516 expert_info_warn = gtk_event_box_new();
517 gtk_container_add(GTK_CONTAINER(expert_info_warn), expert_image);
518 g_signal_connect(expert_info_warn, "button_press_event", G_CALLBACK(expert_comp_dlg_event_cb), NULL);
520 expert_image = pixbuf_to_widget(expert_note_pb_data);
521 gtk_tooltips_set_tip(tooltips, expert_image, "NOTE is the highest expert info level", NULL);
522 gtk_widget_show(expert_image);
523 expert_info_note = gtk_event_box_new();
524 gtk_container_add(GTK_CONTAINER(expert_info_note), expert_image);
525 g_signal_connect(expert_info_note, "button_press_event", G_CALLBACK(expert_comp_dlg_event_cb), NULL);
527 expert_image = pixbuf_to_widget(expert_chat_pb_data);
528 gtk_tooltips_set_tip(tooltips, expert_image, "CHAT is the highest expert info level", NULL);
529 gtk_widget_show(expert_image);
530 expert_info_chat = gtk_event_box_new();
531 gtk_container_add(GTK_CONTAINER(expert_info_chat), expert_image);
532 g_signal_connect(expert_info_chat, "button_press_event", G_CALLBACK(expert_comp_dlg_event_cb), NULL);
534 expert_image = pixbuf_to_widget(expert_none_pb_data);
535 gtk_tooltips_set_tip(tooltips, expert_image, "No expert info", NULL);
536 gtk_widget_show(expert_image);
537 expert_info_none = gtk_event_box_new();
538 gtk_container_add(GTK_CONTAINER(expert_info_none), expert_image);
539 g_signal_connect(expert_info_none, "button_press_event", G_CALLBACK(expert_comp_dlg_event_cb), NULL);
540 gtk_widget_show(expert_info_none);
544 status_expert_hide(void)
546 /* reset expert info indicator */
547 gtk_widget_hide(expert_info_error);
548 gtk_widget_hide(expert_info_warn);
549 gtk_widget_hide(expert_info_note);
550 gtk_widget_hide(expert_info_chat);
551 gtk_widget_hide(expert_info_none);
555 status_expert_update(void)
557 status_expert_hide();
559 switch(expert_get_highest_severity()) {
561 gtk_widget_show(expert_info_error);
564 gtk_widget_show(expert_info_warn);
567 gtk_widget_show(expert_info_note);
570 gtk_widget_show(expert_info_chat);
573 gtk_widget_show(expert_info_none);
579 statusbar_set_filename(const char *file_name, gint64 file_length, nstime_t *file_elapsed_time)
584 /* expert info indicator */
585 status_expert_update();
588 /* convert file size */
589 if (file_length/1024/1024 > 10) {
590 size_str = g_strdup_printf("%" G_GINT64_MODIFIER "d MB", file_length/1024/1024);
591 } else if (file_length/1024 > 10) {
592 size_str = g_strdup_printf("%" G_GINT64_MODIFIER "d KB", file_length/1024);
594 size_str = g_strdup_printf("%" G_GINT64_MODIFIER "d Bytes", file_length);
597 status_msg = g_strdup_printf(" File: \"%s\" %s %02lu:%02lu:%02lu",
598 (file_name) ? file_name : "", size_str,
599 (long)file_elapsed_time->secs/3600,
600 (long)file_elapsed_time->secs%3600/60,
601 (long)file_elapsed_time->secs%60);
603 statusbar_push_file_msg(status_msg);
609 statusbar_cf_file_closing_cb(capture_file *cf _U_)
611 /* Clear any file-related status bar messages.
612 XXX - should be "clear *ALL* file-related status bar messages;
613 will there ever be more than one on the stack? */
614 statusbar_pop_file_msg();
616 /* reset expert info indicator */
617 status_expert_hide();
618 gtk_widget_show(expert_info_none);
623 statusbar_cf_file_closed_cb(capture_file *cf _U_)
625 /* go back to "No packets" */
626 packets_bar_update();
631 statusbar_cf_file_read_started_cb(capture_file *cf)
633 const gchar *name_ptr;
636 /* Ensure we pop any previous loaded filename */
637 statusbar_pop_file_msg();
639 name_ptr = get_basename(cf->filename);
641 load_msg = g_strdup_printf(" Loading: %s", name_ptr);
642 statusbar_push_file_msg(load_msg);
648 statusbar_cf_file_read_finished_cb(capture_file *cf)
650 statusbar_pop_file_msg();
651 statusbar_set_filename(cf->filename, cf->f_datalen, &(cf->elapsed_time));
657 statusbar_capture_prepared_cb(capture_options *capture_opts _U_)
659 gchar *msg = " Waiting for capture input data ...";
660 statusbar_push_file_msg(msg);
661 welcome_header_push_msg(msg);
665 statusbar_capture_update_started_cb(capture_options *capture_opts)
670 statusbar_pop_file_msg();
671 welcome_header_pop_msg();
673 if(capture_opts->iface) {
674 capture_msg = g_strdup_printf(" %s: <live capture in progress> to file: %s",
675 get_iface_description(capture_opts),
676 (capture_opts->save_file) ? capture_opts->save_file : "");
678 capture_msg = g_strdup_printf(" <live capture in progress> to file: %s",
679 (capture_opts->save_file) ? capture_opts->save_file : "");
682 statusbar_push_file_msg(capture_msg);
688 statusbar_capture_update_continue_cb(capture_options *capture_opts)
690 capture_file *cf = capture_opts->cf;
694 status_expert_update();
696 statusbar_pop_file_msg();
698 if (cf->f_datalen/1024/1024 > 10) {
699 capture_msg = g_strdup_printf(" %s: <live capture in progress> File: %s %" G_GINT64_MODIFIER "d MB",
700 get_iface_description(capture_opts),
701 capture_opts->save_file,
702 cf->f_datalen/1024/1024);
703 } else if (cf->f_datalen/1024 > 10) {
704 capture_msg = g_strdup_printf(" %s: <live capture in progress> File: %s %" G_GINT64_MODIFIER "d KB",
705 get_iface_description(capture_opts),
706 capture_opts->save_file,
709 capture_msg = g_strdup_printf(" %s: <live capture in progress> File: %s %" G_GINT64_MODIFIER "d Bytes",
710 get_iface_description(capture_opts),
711 capture_opts->save_file,
715 statusbar_push_file_msg(capture_msg);
719 statusbar_capture_update_finished_cb(capture_options *capture_opts)
721 capture_file *cf = capture_opts->cf;
723 /* Pop the "<live capture in progress>" message off the status bar. */
724 statusbar_pop_file_msg();
725 statusbar_set_filename(cf->filename, cf->f_datalen, &(cf->elapsed_time));
726 packets_bar_update();
730 statusbar_capture_fixed_started_cb(capture_options *capture_opts)
735 statusbar_pop_file_msg();
737 capture_msg = g_strdup_printf(" %s: <live capture in progress> to file: %s",
738 get_iface_description(capture_opts),
739 (capture_opts->save_file) ? capture_opts->save_file : "");
741 statusbar_push_file_msg(capture_msg);
742 gtk_statusbar_push(GTK_STATUSBAR(packets_bar), packets_ctx, " Packets: 0");
748 statusbar_capture_fixed_continue_cb(capture_options *capture_opts)
750 capture_file *cf = capture_opts->cf;
754 gtk_statusbar_pop(GTK_STATUSBAR(packets_bar), packets_ctx);
755 capture_msg = g_strdup_printf(" Packets: %u", cf_get_packet_count(cf));
756 gtk_statusbar_push(GTK_STATUSBAR(packets_bar), packets_ctx, capture_msg);
762 statusbar_capture_fixed_finished_cb(capture_options *capture_opts _U_)
765 capture_file *cf = capture_opts->cf;
768 /* Pop the "<live capture in progress>" message off the status bar. */
769 statusbar_pop_file_msg();
770 welcome_header_pop_msg();
772 /* Pop the "<capturing>" message off the status bar */
773 gtk_statusbar_pop(GTK_STATUSBAR(packets_bar), packets_ctx);
776 #endif /* HAVE_LIBPCAP */
780 statusbar_cf_field_unselected_cb(capture_file *cf _U_)
782 statusbar_pop_field_msg();
786 statusbar_cf_file_save_started_cb(gchar *filename)
790 statusbar_pop_file_msg();
791 save_msg = g_strdup_printf(" Saving: %s...", get_basename(filename));
792 statusbar_push_file_msg(save_msg);
797 statusbar_cf_file_save_finished_cb(gpointer data _U_)
799 /* Pop the "Saving:" message off the status bar. */
800 statusbar_pop_file_msg();
804 statusbar_cf_file_reload_finished_cb(capture_file *cf)
806 statusbar_pop_file_msg();
807 statusbar_set_filename(cf->filename, cf->f_datalen, &(cf->elapsed_time));
812 statusbar_cf_file_save_failed_cb(gpointer data _U_)
814 /* Pop the "Saving:" message off the status bar. */
815 statusbar_pop_file_msg();
821 statusbar_cf_callback(gint event, gpointer data, gpointer user_data _U_)
824 case(cf_cb_file_closing):
825 statusbar_cf_file_closing_cb(data);
827 case(cf_cb_file_closed):
828 statusbar_cf_file_closed_cb(data);
830 case(cf_cb_file_read_started):
831 statusbar_cf_file_read_started_cb(data);
833 case(cf_cb_file_read_finished):
834 statusbar_cf_file_read_finished_cb(data);
836 case(cf_cb_packet_selected):
838 case(cf_cb_packet_unselected):
840 case(cf_cb_field_unselected):
841 statusbar_cf_field_unselected_cb(data);
843 case(cf_cb_file_save_started):
844 statusbar_cf_file_save_started_cb(data);
846 case(cf_cb_file_save_finished):
847 statusbar_cf_file_save_finished_cb(data);
849 case(cf_cb_file_save_reload_finished):
850 statusbar_cf_file_reload_finished_cb(data);
852 case(cf_cb_file_save_failed):
853 statusbar_cf_file_save_failed_cb(data);
856 g_warning("statusbar_cf_callback: event %u unknown", event);
857 g_assert_not_reached();
863 statusbar_capture_callback(gint event, capture_options *capture_opts,
864 gpointer user_data _U_)
867 case(capture_cb_capture_prepared):
868 statusbar_capture_prepared_cb(capture_opts);
870 case(capture_cb_capture_update_started):
871 statusbar_capture_update_started_cb(capture_opts);
873 case(capture_cb_capture_update_continue):
874 statusbar_capture_update_continue_cb(capture_opts);
876 case(capture_cb_capture_update_finished):
877 statusbar_capture_update_finished_cb(capture_opts);
879 case(capture_cb_capture_fixed_started):
880 statusbar_capture_fixed_started_cb(capture_opts);
882 case(capture_cb_capture_fixed_continue):
883 statusbar_capture_fixed_continue_cb(capture_opts);
885 case(capture_cb_capture_fixed_finished):
886 statusbar_capture_fixed_finished_cb(capture_opts);
888 case(capture_cb_capture_stopping):
889 /* Beware: this state won't be called, if the capture child
890 * closes the capturing on it's own! */
893 g_warning("statusbar_capture_callback: event %u unknown", event);
894 g_assert_not_reached();