diff options
author | Stephen Fisher <steve@stephen-fisher.com> | 2006-12-05 03:19:51 +0000 |
---|---|---|
committer | Stephen Fisher <steve@stephen-fisher.com> | 2006-12-05 03:19:51 +0000 |
commit | 75acf34518617ddb64be049e13393f477a15d0dd (patch) | |
tree | 66912a037dc8a2b4910cfa0fdc8b9d85f01e1c2b /gtk | |
parent | d11958ec6fdafc3305b9e3239783db00078e03ba (diff) | |
download | wireshark-75acf34518617ddb64be049e13393f477a15d0dd.tar.gz wireshark-75acf34518617ddb64be049e13393f477a15d0dd.tar.bz2 wireshark-75acf34518617ddb64be049e13393f477a15d0dd.zip |
From Douglas Pratley with trivial changes and documentation changes
by myself:
Corrected patch; epan/column.c and epan/column_utils.c were not included. This
one has now been properly tested against a clean checkout of today's code.
- New menu option available under view\time display format
- New sub-option (e) to -t switch for both wireshark and tshark
- Extended recent settings code to handle new value
- Did NOT add new explicit epoch time column
svn path=/trunk/; revision=20040
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/main.c | 4 | ||||
-rw-r--r-- | gtk/menu.c | 19 | ||||
-rw-r--r-- | gtk/packet_list.c | 1 | ||||
-rw-r--r-- | gtk/recent.c | 4 |
4 files changed, 25 insertions, 3 deletions
diff --git a/gtk/main.c b/gtk/main.c index 736a997a5e..08905fb5d2 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1243,7 +1243,7 @@ print_usage(gboolean print_ver) { fprintf(output, "User interface:\n"); fprintf(output, " -g <packet number> go to specified packet number after \"-r\"\n"); fprintf(output, " -m <font> set the font name used for most text\n"); - fprintf(output, " -t ad|a|r|d output format of time stamps (def: r: rel. to first)\n"); + fprintf(output, " -t ad|a|r|d|e output format of time stamps (def: r: rel. to first)\n"); fprintf(output, " -X <key>:<value> eXtension options, see man page for details\n"); fprintf(output, " -z <statistics> show various statistics, see man page for details\n"); @@ -2622,6 +2622,8 @@ main(int argc, char *argv[]) timestamp_set_type(TS_ABSOLUTE_WITH_DATE); else if (strcmp(optarg, "d") == 0) timestamp_set_type(TS_DELTA); + else if (strcmp(optarg, "e") == 0) + timestamp_set_type(TS_EPOCH); else { cmdarg_err("Invalid time stamp type \"%s\"", optarg); cmdarg_err_cont("It must be \"r\" for relative, \"a\" for absolute,"); diff --git a/gtk/menu.c b/gtk/menu.c index 86e0e5a2b6..9558836d94 100644 --- a/gtk/menu.c +++ b/gtk/menu.c @@ -120,6 +120,7 @@ static void timestamp_absolute_cb(GtkWidget *w _U_, gpointer d _U_); static void timestamp_absolute_date_cb(GtkWidget *w _U_, gpointer d _U_); static void timestamp_relative_cb(GtkWidget *w _U_, gpointer d _U_); static void timestamp_delta_cb(GtkWidget *w _U_, gpointer d _U_); +static void timestamp_epoch_cb(GtkWidget *w _U_, gpointer d _U_); static void timestamp_auto_cb(GtkWidget *w _U_, gpointer d _U_); static void timestamp_sec_cb(GtkWidget *w _U_, gpointer d _U_); static void timestamp_dsec_cb(GtkWidget *w _U_, gpointer d _U_); @@ -475,6 +476,8 @@ static GtkItemFactoryEntry menu_items[] = 0, "/View/Time Display Format/Date and Time of Day: 1970-01-01 01:02:03.123456", NULL), ITEM_FACTORY_ENTRY("/View/Time Display Format/Seconds Since Previous Packet: 1.123456", NULL, timestamp_delta_cb, 0, "/View/Time Display Format/Date and Time of Day: 1970-01-01 01:02:03.123456", NULL), + ITEM_FACTORY_ENTRY("/View/Time Display Format/Seconds Since Epoch Time: 123.123456", NULL, timestamp_epoch_cb, + 0, "/View/Time Display Format/Date and Time of Day: 1970-01-01 01:02:03.123456", NULL), ITEM_FACTORY_ENTRY("/View/Time Display Format/<separator>", NULL, NULL, 0, "<Separator>", NULL), ITEM_FACTORY_ENTRY("/View/Time Display Format/Automatic (File Format Precision)", NULL, timestamp_auto_cb, 0, "<RadioItem>", NULL), @@ -1646,6 +1649,16 @@ timestamp_delta_cb(GtkWidget *w _U_, gpointer d _U_) } static void +timestamp_epoch_cb(GtkWidget *w _U_, gpointer d _U_) +{ + if (recent.gui_time_format != TS_EPOCH) { + timestamp_set_type(TS_EPOCH); + recent.gui_time_format = TS_EPOCH; + cf_change_time_formats(&cfile); + } +} + +static void timestamp_auto_cb(GtkWidget *w _U_, gpointer d _U_) { if (recent.gui_time_precision != TS_PREC_AUTO) { @@ -1893,6 +1906,12 @@ menu_recent_read_finished(void) { recent.gui_time_format = -1; gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE); break; + case(TS_EPOCH): + menu = gtk_item_factory_get_widget(main_menu_factory, + "/View/Time Display Format/Seconds Since Epoch Time: 123.123456"); + recent.gui_time_format = -1; + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE); + break; default: g_assert_not_reached(); } diff --git a/gtk/packet_list.c b/gtk/packet_list.c index eee491639b..34c9725778 100644 --- a/gtk/packet_list.c +++ b/gtk/packet_list.c @@ -162,6 +162,7 @@ packet_list_compare(EthCList *clist, gconstpointer ptr1, gconstpointer ptr2) case TS_ABSOLUTE: case TS_ABSOLUTE_WITH_DATE: + case TS_EPOCH: return COMPARE_TS(abs_ts); case TS_RELATIVE: diff --git a/gtk/recent.c b/gtk/recent.c index ab0d25a5b8..0bfba44e7b 100644 --- a/gtk/recent.c +++ b/gtk/recent.c @@ -76,7 +76,7 @@ recent_settings_t recent; static const char *ts_type_text[] = - { "RELATIVE", "ABSOLUTE", "ABSOLUTE_WITH_DATE", "DELTA", NULL }; + { "RELATIVE", "ABSOLUTE", "ABSOLUTE_WITH_DATE", "DELTA", "EPOCH", NULL }; static const char *ts_precision_text[] = { "AUTO", "SEC", "DSEC", "CSEC", "MSEC", "USEC", "NSEC", NULL }; @@ -207,7 +207,7 @@ write_recent(void) recent.packet_list_colorize == TRUE ? "TRUE" : "FALSE"); fprintf(rf, "\n# Timestamp display format.\n"); - fprintf(rf, "# One of: RELATIVE, ABSOLUTE, ABSOLUTE_WITH_DATE, DELTA\n"); + fprintf(rf, "# One of: RELATIVE, ABSOLUTE, ABSOLUTE_WITH_DATE, DELTA, EPOCH\n"); fprintf(rf, RECENT_GUI_TIME_FORMAT ": %s\n", ts_type_text[recent.gui_time_format]); |