diff options
author | Michael Tüxen <tuexen@fh-muenster.de> | 2011-05-21 13:22:38 +0000 |
---|---|---|
committer | Michael Tüxen <tuexen@fh-muenster.de> | 2011-05-21 13:22:38 +0000 |
commit | c6c2577bbc97388be260fb677db3f730e1b372c3 (patch) | |
tree | 8bc7aec6442df25a052234489841db151914f247 /gtk/main_statusbar.c | |
parent | 9be282951b1490764fc226296edb65c37ee1ea05 (diff) |
Fix the capturing from the GUI. Honor the iface variable.
The next step is to retire the iface variable and use
the ifaces array only. This should simplify things and
fix the cases, where you start wireshark with command
line arguments and also use the GUI.
svn path=/trunk/; revision=37342
Diffstat (limited to 'gtk/main_statusbar.c')
-rw-r--r-- | gtk/main_statusbar.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/gtk/main_statusbar.c b/gtk/main_statusbar.c index ffaea3a928..29f184d926 100644 --- a/gtk/main_statusbar.c +++ b/gtk/main_statusbar.c @@ -695,6 +695,7 @@ statusbar_get_interface_names(capture_options *capture_opts) GString *interface_names; interface_names = g_string_new(""); + if (capture_opts->ifaces->len == 0) { g_string_append_printf(interface_names, "%s", get_iface_description(capture_opts)); #ifdef _WIN32 @@ -711,27 +712,26 @@ statusbar_get_interface_names(capture_options *capture_opts) } else { g_string_append_printf(interface_names, "%u interfaces", capture_opts->ifaces->len); } + if (strlen (interface_names->str) > 0) { + g_string_append(interface_names, ":"); + } + g_string_append(interface_names, " "); return (interface_names); } static void statusbar_capture_update_started_cb(capture_options *capture_opts) { + GString *interface_names; + statusbar_pop_file_msg(); welcome_header_pop_msg(); - if (capture_opts->ifaces->len > 0) { - GString *interface_names; - - interface_names = statusbar_get_interface_names(capture_opts); - statusbar_push_file_msg(" %s: <live capture in progress> to file: %s", - interface_names->str, - (capture_opts->save_file) ? capture_opts->save_file : ""); - g_string_free(interface_names, TRUE); - } else { - statusbar_push_file_msg(" <live capture in progress> to file: %s", - (capture_opts->save_file) ? capture_opts->save_file : ""); - } + interface_names = statusbar_get_interface_names(capture_opts); + statusbar_push_file_msg("%s<live capture in progress> to file: %s", + interface_names->str, + (capture_opts->save_file) ? capture_opts->save_file : ""); + g_string_free(interface_names, TRUE); } static void @@ -746,17 +746,17 @@ statusbar_capture_update_continue_cb(capture_options *capture_opts) interface_names = statusbar_get_interface_names(capture_opts); if (cf->f_datalen/1024/1024 > 10) { - statusbar_push_file_msg(" %s: <live capture in progress> File: %s %" G_GINT64_MODIFIER "d MB", + statusbar_push_file_msg("%s<live capture in progress> File: %s %" G_GINT64_MODIFIER "d MB", interface_names->str, capture_opts->save_file, cf->f_datalen/1024/1024); } else if (cf->f_datalen/1024 > 10) { - statusbar_push_file_msg(" %s: <live capture in progress> File: %s %" G_GINT64_MODIFIER "d KB", + statusbar_push_file_msg("%s<live capture in progress> File: %s %" G_GINT64_MODIFIER "d KB", interface_names->str, capture_opts->save_file, cf->f_datalen/1024); } else { - statusbar_push_file_msg(" %s: <live capture in progress> File: %s %" G_GINT64_MODIFIER "d Bytes", + statusbar_push_file_msg("%s<live capture in progress> File: %s %" G_GINT64_MODIFIER "d Bytes", interface_names->str, capture_opts->save_file, cf->f_datalen); @@ -783,7 +783,7 @@ statusbar_capture_fixed_started_cb(capture_options *capture_opts) statusbar_pop_file_msg(); interface_names = statusbar_get_interface_names(capture_opts); - statusbar_push_file_msg(" %s: <live capture in progress> to file: %s", + statusbar_push_file_msg("%s<live capture in progress> to file: %s", interface_names->str, (capture_opts->save_file) ? capture_opts->save_file : ""); |