diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-09-28 11:37:06 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-09-28 18:38:18 +0000 |
commit | 54b733ce9a0d1cd4ab9b142479368a5e696360be (patch) | |
tree | 1c98ec83c70ba99b383105516048d0254168d855 /ui | |
parent | efea8ce1c6a4331bc2ff7090dd3dadd2a80f6d86 (diff) | |
download | wireshark-54b733ce9a0d1cd4ab9b142479368a5e696360be.tar.gz |
Make the time stamp resolution per-packet.
Pcap-ng files don't have a per-file time stamp resolution, they have a
per-interface time stamp resolution. Add new time stamp resolution
types of "unknown" and "per-packet", add the time stamp resolution to
struct wtap_pkthdr, have the libwiretap core initialize it to the
per-file time stamp resolution, and have pcap-ng do the same thing with
the resolution that it does with the packet encapsulation.
Get rid of the TS_PREC_AUTO_XXX values; just have TS_PREC_AUTO, which
means "use the packet's resolution to determine how many significant
digits to display". Rename all the WTAP_FILE_TSPREC_XXX values to
WTAP_TSPREC_XXX, as they're also used for per-packet values.
Change-Id: If9fd8f799b19836a5104aaa0870a951498886c69
Reviewed-on: https://code.wireshark.org/review/4349
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gtk/main_menubar.c | 12 | ||||
-rw-r--r-- | ui/qt/main.cpp | 2 |
2 files changed, 5 insertions, 9 deletions
diff --git a/ui/gtk/main_menubar.c b/ui/gtk/main_menubar.c index fa6cab1bc4..986bf600ac 100644 --- a/ui/gtk/main_menubar.c +++ b/ui/gtk/main_menubar.c @@ -638,11 +638,7 @@ timestamp_precision_new_cb (GtkRadioAction *action, GtkRadioAction *current _U_, value = gtk_radio_action_get_current_value (action); if (recent.gui_time_precision != value) { /* the actual precision will be set in packet_list_queue_draw() below */ - if (value == TS_PREC_AUTO) { - timestamp_set_precision(TS_PREC_AUTO_SEC); - } else { - timestamp_set_precision(value); - } + timestamp_set_precision(value); recent.gui_time_precision = value; /* This call adjusts column width */ cf_timestamp_auto_precision(&cfile); @@ -1804,7 +1800,7 @@ static const GtkRadioActionEntry main_menu_bar_radio_view_time_entries [] = static const GtkRadioActionEntry main_menu_bar_radio_view_time_fileformat_prec_entries [] = { /* name, stock id, label, accel, tooltip, value */ - { "/View/TimeDisplayFormat/FileFormatPrecision-Automatic", NULL, "Automatic (File Format Precision)", NULL, NULL, TS_PREC_AUTO }, + { "/View/TimeDisplayFormat/FileFormatPrecision-Automatic", NULL, "Automatic (use precision indicated in the file)", NULL, NULL, TS_PREC_AUTO }, { "/View/TimeDisplayFormat/FileFormatPrecision-Seconds", NULL, "Seconds: 0", NULL, NULL, TS_PREC_FIXED_SEC }, { "/View/TimeDisplayFormat/FileFormatPrecision-Deciseconds", NULL, "Deciseconds: 0.1", NULL, NULL, TS_PREC_FIXED_DSEC }, { "/View/TimeDisplayFormat/FileFormatPrecision-Centiseconds", NULL, "Centiseconds: 0.12", NULL, NULL, TS_PREC_FIXED_CSEC }, @@ -4773,8 +4769,8 @@ menu_recent_read_finished(void) cf_timestamp_auto_precision(&cfile); packet_list_queue_draw(); /* the actual precision will be set in packet_list_queue_draw() below */ - if (recent.gui_time_precision == TS_PREC_AUTO) { - timestamp_set_precision(TS_PREC_AUTO_SEC); + if (recent.gui_time_precision > TS_PREC_FIXED_NSEC) { + timestamp_set_precision(TS_PREC_AUTO); } else { timestamp_set_precision(recent.gui_time_precision); } diff --git a/ui/qt/main.cpp b/ui/qt/main.cpp index efbadac64f..dce301c8f2 100644 --- a/ui/qt/main.cpp +++ b/ui/qt/main.cpp @@ -1133,7 +1133,7 @@ int main(int argc, char *argv[]) g_log(NULL, G_LOG_LEVEL_DEBUG, "FIX: timestamp types should be set elsewhere"); timestamp_set_type(TS_RELATIVE); - timestamp_set_precision(TS_PREC_AUTO_USEC); + timestamp_set_precision(TS_PREC_AUTO); timestamp_set_seconds_type(TS_SECONDS_DEFAULT); #ifdef HAVE_LIBPCAP |