aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/main_statusbar.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2010-07-05 22:09:10 +0000
committerAnders Broman <anders.broman@ericsson.com>2010-07-05 22:09:10 +0000
commitb722b193a64c7c33e6df587dd0e864a61d791946 (patch)
treebfb64ecd44803ed93536f26078d06279abb42d49 /gtk/main_statusbar.c
parent7e2f42090d838a7658729199872104f25b78ce87 (diff)
- Show droped packets counter after stopping a live capture.
- Don't show "Load time" during live capture. - Fix indentation and minor changes to comments. Should ignored packets be shown also when drops is known? svn path=/trunk/; revision=33440
Diffstat (limited to 'gtk/main_statusbar.c')
-rw-r--r--gtk/main_statusbar.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/gtk/main_statusbar.c b/gtk/main_statusbar.c
index cca3a653a0..818b4c4929 100644
--- a/gtk/main_statusbar.c
+++ b/gtk/main_statusbar.c
@@ -422,34 +422,41 @@ profile_bar_new(void)
/*
- * update the packets statusbar to the current values
+ * Update the packets statusbar to the current values
*/
void
packets_bar_update(void)
{
if(packets_bar) {
- /* remove old status */
+ /* Remove old status */
if(packets_str) {
g_free(packets_str);
gtk_statusbar_pop(GTK_STATUSBAR(packets_bar), packets_ctx);
}
- /* do we have any packets? */
+ /* Do we have any packets? */
if(cfile.count) {
if(cfile.drops_known) {
packets_str = g_strdup_printf(" Packets: %u Displayed: %u Marked: %u Dropped: %u",
cfile.count, cfile.displayed_count, cfile.marked_count, cfile.drops);
- } else if (cfile.ignored_count > 0) {
+ } else if (cfile.ignored_count > 0) {
packets_str = g_strdup_printf(" Packets: %u Displayed: %u Marked: %u Ignored: %u",
cfile.count, cfile.displayed_count, cfile.marked_count, cfile.ignored_count);
} else {
- gulong computed_elapsed = cf_get_computed_elapsed();
-
- packets_str = g_strdup_printf(" Packets: %u Displayed: %u Marked: %u Load time: %lu:%02lu.%03lu",
- cfile.count, cfile.displayed_count, cfile.marked_count,
- computed_elapsed/60000,
- computed_elapsed%60000/1000,
- computed_elapsed%1000);
+ if(cfile.is_tempfile){
+ /* Live capture */
+ packets_str = g_strdup_printf(" Packets: %u Displayed: %u Marked: %u",
+ cfile.count, cfile.displayed_count, cfile.marked_count);
+ }else{
+ /* Loading an existing file */
+ gulong computed_elapsed = cf_get_computed_elapsed();
+
+ packets_str = g_strdup_printf(" Packets: %u Displayed: %u Marked: %u Load time: %lu:%02lu.%03lu",
+ cfile.count, cfile.displayed_count, cfile.marked_count,
+ computed_elapsed/60000,
+ computed_elapsed%60000/1000,
+ computed_elapsed%1000);
+ }
}
} else {
packets_str = g_strdup(" No Packets");
@@ -459,7 +466,7 @@ packets_bar_update(void)
}
/*
- * update the packets statusbar to the current values
+ * Update the packets statusbar to the current values
*/
void
profile_bar_update(void)
@@ -706,6 +713,7 @@ statusbar_capture_update_finished_cb(capture_options *capture_opts)
/* Pop the "<live capture in progress>" message off the status bar. */
statusbar_pop_file_msg();
statusbar_set_filename(cf->filename, cf->f_datalen, &(cf->elapsed_time));
+ packets_bar_update();
}
static void