diff --git a/epan/timestamp.h b/epan/timestamp.h index 291b71feb2..38f28ac507 100644 --- a/epan/timestamp.h +++ b/epan/timestamp.h @@ -1,13 +1,12 @@ /* timestamp.h * Defines for packet timestamps * - * $Id: timestamp.h,v 1.3 2004/01/19 03:46:42 ulfl Exp $ + * $Id: timestamp.h,v 1.4 2004/01/19 23:03:19 guy Exp $ * * Ethereal - Network traffic analyzer - * By Gerald Combs + * By Gerald Combs * Copyright 1998 Gerald Combs * - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -26,7 +25,6 @@ #ifndef __TIMESTAMP_H__ #define __TIMESTAMP_H__ - /* * Type of time-stamp shown in the summary display. */ @@ -37,10 +35,12 @@ typedef enum { TS_DELTA } ts_type; +/* + * Special value used for the command-line setting in Ethereal, to indicate + * that no value has been set from the command line. + */ +#define TS_NOT_SET ((ts_type)-1) + extern ts_type timestamp_type; -static char *ts_type_text[] = - { "RELATIVE", "ABSOLUTE", "ABSOLUTE_WITH_DATE", "DELTA", NULL }; - - #endif /* timestamp.h */ diff --git a/gtk/main.c b/gtk/main.c index 3002de7149..5fb9beb42d 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1,6 +1,6 @@ /* main.c * - * $Id: main.c,v 1.360 2004/01/19 18:21:18 jmayer Exp $ + * $Id: main.c,v 1.361 2004/01/19 23:03:20 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -157,7 +157,7 @@ static gboolean updated_geometry = FALSE; /* init with an invalid value, so that "recent" can detect this and */ /* distinguish it from a command line value */ -ts_type timestamp_type = -1; +ts_type timestamp_type = TS_NOT_SET; #if GTK_MAJOR_VERSION < 2 GtkStyle *item_style; diff --git a/gtk/menu.c b/gtk/menu.c index 7a44d49e8b..204d36d54b 100644 --- a/gtk/menu.c +++ b/gtk/menu.c @@ -1,7 +1,7 @@ /* menu.c * Menu routines * - * $Id: menu.c,v 1.138 2004/01/19 03:46:42 ulfl Exp $ + * $Id: menu.c,v 1.139 2004/01/19 23:03:20 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -1014,18 +1014,18 @@ timestamp_delta_cb(GtkWidget *w _U_, gpointer d _U_) /* the recent file read has finished, update the menu corresponding */ void menu_recent_read_finished(void) { - GtkWidget *menu = NULL; + GtkWidget *menu = NULL; - menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Show/Main Toolbar"); + menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Show/Main Toolbar"); gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.main_toolbar_show); - menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Show/Filter Toolbar"); + menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Show/Filter Toolbar"); gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.filter_toolbar_show); - menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Show/Packet List"); + menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Show/Packet List"); gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.packet_list_show); - menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Show/Packet Dissection"); + menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Show/Packet Dissection"); gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), recent.tree_view_show); menu = gtk_item_factory_get_widget(main_menu_factory, "/View/Show/Packet Data"); @@ -1037,7 +1037,7 @@ menu_recent_read_finished(void) { main_widgets_rearrange(); /* don't change the time format, if we had a command line value */ - if (timestamp_type != -1) { + if (timestamp_type != TS_NOT_SET) { recent.gui_time_format = timestamp_type; } diff --git a/gtk/recent.c b/gtk/recent.c index 26830c8ed4..871aed1ed8 100644 --- a/gtk/recent.c +++ b/gtk/recent.c @@ -2,7 +2,7 @@ * Recent "preference" handling routines * Copyright 2004, Ulf Lamping * - * $Id: recent.c,v 1.3 2004/01/19 03:46:43 ulfl Exp $ + * $Id: recent.c,v 1.4 2004/01/19 23:03:20 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -45,11 +45,10 @@ extern void add_menu_recent_capture_file(gchar *file); extern void menu_recent_read_finished(void); - recent_settings_t recent; - - +static char *ts_type_text[] = + { "RELATIVE", "ABSOLUTE", "ABSOLUTE_WITH_DATE", "DELTA", NULL }; /* Takes an string and a pointer to an array of strings, and a default int value. * The array must be terminated by a NULL string. If the string is found in the array @@ -70,8 +69,6 @@ find_index_from_string_array(char *needle, char **haystack, int default_value) return default_value; } - - /* Write out "recent" to the user's recent file, and return 0. If we got an error, stuff a pointer to the path of the recent file into "*pf_path_return", and return the errno. */