aboutsummaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-01-19 23:03:20 +0000
committerGuy Harris <guy@alum.mit.edu>2004-01-19 23:03:20 +0000
commitd4ab584f0fd1a82cbd0f5aba36be863fc219868d (patch)
treee8877f13235bce4ddd52cb7e56a510db8e6faf34 /gtk
parent439159f73da4deff6aa2adbafa5be34f3617c333 (diff)
Move "ts_type_text" out of "epan/timestamp.h into "gtk/recent.c", as
it's only used in the latter; that avoids lots of warnings about "ts_type_text" being defined but not used in other source files that include "epan/timestamp.h". (If it's going to be used in more than one file, make it non-static and declare it "extern" in "epan/timestamp.h".) Define TS_NOT_SET as ((ts_type)-1), and use that when initializing "timestamp_type" in Ethereal and when checking to see whether "timestamp_type" was set, to avoid signed vs. unsigned comparison warnings. Clean up indentation. svn path=/trunk/; revision=9740
Diffstat (limited to 'gtk')
-rw-r--r--gtk/main.c4
-rw-r--r--gtk/menu.c14
-rw-r--r--gtk/recent.c9
3 files changed, 12 insertions, 15 deletions
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 <gerald@ethereal.com>
@@ -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 <gerald@ethereal.com>
@@ -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 <ulf.lamping@web.de>
*
- * $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 <gerald@ethereal.com>
@@ -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. */