diff options
-rw-r--r-- | gtk/menu.c | 19 | ||||
-rw-r--r-- | prefs.c | 6 | ||||
-rw-r--r-- | prefs.h | 6 |
3 files changed, 14 insertions, 17 deletions
diff --git a/gtk/menu.c b/gtk/menu.c index 94f575f8c3..d77d6290d1 100644 --- a/gtk/menu.c +++ b/gtk/menu.c @@ -1,7 +1,7 @@ /* menu.c * Menu routines * - * $Id: menu.c,v 1.129 2003/12/28 21:10:26 sharpe Exp $ + * $Id: menu.c,v 1.130 2003/12/29 19:59:05 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -669,9 +669,6 @@ set_menu_object_data (gchar *path, gchar *key, gpointer data) { * of the current path. * They are only stored inside the labels of the submenu (no separate list). */ -/* the maximum number of entries in the recent capture files list */ -static guint recent_files_count_max = 10; - #define MENU_RECENT_FILES_PATH "/File/Open Recent" /* remove the capture filename from the "Recent Files" menu */ @@ -703,12 +700,12 @@ menu_open_recent_file_cmd_cb(GtkWidget *w, gpointer data _U_) gtk_label_get(GTK_LABEL(menu_item_child), &cf_name); /* open and read the capture file (this will close an existing file) */ - if ((err = cf_open(cf_name, FALSE, &cfile)) == 0) { + if ((err = cf_open(cf_name, FALSE, &cfile)) == 0) { cf_read(&cfile, &err); - } else { - /* the capture file isn't existing any longer, remove menu item */ - /* XXX: ask user to remove item, it's maybe only a temporary problem */ - remove_menu_recent_capture_file(w); + } else { + /* the capture file isn't existing any longer, remove menu item */ + /* XXX: ask user to remove item, it's maybe only a temporary problem */ + remove_menu_recent_capture_file(w); } } @@ -733,7 +730,7 @@ add_menu_recent_capture_file_absolute(gchar *cf_name) { /* iterate through list items of menu_item_list, * removing a maybe duplicate entry and every item above count_max */ li = g_list_first(menu_item_list); - for (cnt = 1; li; li = li->next, cnt++) { + for (cnt = 1; li; li = li->next, cnt++) { /* get capture filename from the menu item label */ menu_item = (GtkWidget *) li->data; gtk_label_get(GTK_LABEL(GTK_BIN(menu_item)->child), &widget_cf_name); @@ -742,7 +739,7 @@ add_menu_recent_capture_file_absolute(gchar *cf_name) { * this element is above maximum count (too old), remove it */ if (strncmp(widget_cf_name, cf_name, 1000) == 0 || cnt >= prefs.gui_recent_files_count_max) { - remove_menu_recent_capture_file(li->data); + remove_menu_recent_capture_file(li->data); cnt--; } } @@ -1,7 +1,7 @@ /* prefs.c * Routines for handling preferences * - * $Id: prefs.c,v 1.117 2003/12/28 23:20:08 sharpe Exp $ + * $Id: prefs.c,v 1.118 2003/12/29 19:56:24 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1580,8 +1580,8 @@ set_pref(gchar *pref_name, gchar *value) find_index_from_string_array(value, gui_fileopen_style_text, FO_STYLE_LAST_OPENED); } else if (strcmp(pref_name, PRS_GUI_RECENT_COUNT_MAX) == 0) { - prefs.gui_recent_files_count_max = strtol(value, NULL, 10); - if (prefs.gui_recent_files_count_max <= 0) { + prefs.gui_recent_files_count_max = strtoul(value, NULL, 10); + if (prefs.gui_recent_files_count_max == 0) { /* We really should put up a dialog box here ... */ prefs.gui_recent_files_count_max = 10; } @@ -1,7 +1,7 @@ /* prefs.h * Definitions for preference handling routines * - * $Id: prefs.h,v 1.52 2003/12/28 21:10:26 sharpe Exp $ + * $Id: prefs.h,v 1.53 2003/12/29 19:56:24 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -85,8 +85,8 @@ typedef struct _e_prefs { gint gui_geometry_main_y; gint gui_geometry_main_width; gint gui_geometry_main_height; - guint gui_fileopen_style; - gint gui_recent_files_count_max; + guint gui_fileopen_style; + guint gui_recent_files_count_max; gchar *gui_fileopen_dir; gchar *gui_fileopen_remembered_dir; guint32 name_resolve; |