aboutsummaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorLuis Ontanon <luis.ontanon@gmail.com>2007-02-09 03:11:14 +0000
committerLuis Ontanon <luis.ontanon@gmail.com>2007-02-09 03:11:14 +0000
commit7c57c05ed55c1dca6a8d2a6abc34a34d8835cdb8 (patch)
tree4d69137c290e28198dee5fa24280bbb77d30222c /gtk
parent7de24ea51b4397defb37edf9744ca2f69523b3a6 (diff)
* Add a Submenu (/Views/User Tables) where UATs can be accessed.
* Remove macros_dlg, the DFMacros UAT goes in the menu with all the rest * in packet-user_encap.c WTAP_ENCAP=XXX has become useless information for the user leave just the DLT# svn path=/trunk/; revision=20753
Diffstat (limited to 'gtk')
-rw-r--r--gtk/Makefile.common1
-rw-r--r--gtk/macros_dlg.c41
-rw-r--r--gtk/macros_dlg.h26
-rw-r--r--gtk/main.c5
-rw-r--r--gtk/menu.c15
-rw-r--r--gtk/uat_gui.c28
-rw-r--r--gtk/uat_gui.h2
7 files changed, 44 insertions, 74 deletions
diff --git a/gtk/Makefile.common b/gtk/Makefile.common
index 654f2ab4fb..7edbfe58e6 100644
--- a/gtk/Makefile.common
+++ b/gtk/Makefile.common
@@ -79,7 +79,6 @@ WIRESHARK_GTK_SRC = \
help_dlg.c \
hostlist_table.c \
layout_prefs.c \
- macros_dlg.c \
main.c \
menu.c \
nameres_prefs.c \
diff --git a/gtk/macros_dlg.c b/gtk/macros_dlg.c
deleted file mode 100644
index 6050572c74..0000000000
--- a/gtk/macros_dlg.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* macros_dlg.c
- *
- * $Id$
- *
- * Wireshark - Network traffic analyzer
- * By Gerald Combs <gerald@wireshark.org>
- * Copyright 2001 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
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <gtk/gtk.h>
-
-#include <epan/dfilter/dfilter-macro.h>
-#include <stdlib.h>
-#include <epan/uat.h>
-#include "uat_gui.h"
-#include "macros_dlg.h"
-
-void macros_dialog_cb(GtkWidget *w _U_, gpointer data _U_) {
- void* dfmuat;
- dfilter_macro_get_uat(&dfmuat);
- uat_window(dfmuat);
-}
-
diff --git a/gtk/macros_dlg.h b/gtk/macros_dlg.h
deleted file mode 100644
index b82b23ea31..0000000000
--- a/gtk/macros_dlg.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* macros_dlg.h
- *
- * $Id$
- *
- * Wireshark - Network traffic analyzer
- * By Gerald Combs <gerald@wireshark.org>
- * Copyright 2001 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
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#ifndef __MACROS_DLG_H_
-#define __MACROS_DLG_H_
- void macros_dialog_cb(GtkWidget*, gpointer);
-#endif
diff --git a/gtk/main.c b/gtk/main.c
index 9e0b35becc..0861b9c0cd 100644
--- a/gtk/main.c
+++ b/gtk/main.c
@@ -96,6 +96,7 @@
#include "version_info.h"
#include "merge.h"
#include "u3.h"
+#include "uat_gui.h"
#ifdef HAVE_LIBPCAP
@@ -2373,6 +2374,10 @@ main(int argc, char *argv[])
epan_init(register_all_protocols,register_all_protocol_handoffs,
failure_alert_box,open_failure_alert_box,read_failure_alert_box);
+
+ uat_init_menus();
+
+
splash_update(splash_win, "Init tap listeners ...");
/* Register all tap listeners; we do this before we parse the arguments,
diff --git a/gtk/menu.c b/gtk/menu.c
index 867d42b9cd..1c9dcf0593 100644
--- a/gtk/menu.c
+++ b/gtk/menu.c
@@ -82,7 +82,7 @@
#include "sctp_stat.h"
#include "firewall_dlg.h"
#include "u3.h"
-#include "macros_dlg.h"
+
GtkWidget *popup_menu_object;
@@ -524,8 +524,7 @@ static GtkItemFactoryEntry menu_items[] =
ITEM_FACTORY_STOCK_ENTRY("/View/_Coloring Rules...", NULL, color_display_cb,
0, GTK_STOCK_SELECT_COLOR),
ITEM_FACTORY_ENTRY("/View/<separator>", NULL, NULL, 0, "<Separator>", NULL),
-
- ITEM_FACTORY_ENTRY("/View/Display Filter _Macros...", NULL, macros_dialog_cb, 0, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/View/User Tables", NULL, NULL, 0, "<Branch>", NULL),
ITEM_FACTORY_ENTRY("/View/<separator>", NULL, NULL, 0, "<Separator>", NULL),
@@ -891,6 +890,7 @@ menus_init(void) {
/* init with an empty recent files list */
clear_menu_recent_capture_file_cmd_cb(NULL, NULL);
+
}
}
@@ -994,6 +994,7 @@ register_stat_menu_item(
have_items_in_tools_menu = TRUE;
break;
#endif
+ case(REGISTER_USER_TABLES): toolspath = "/View/User Tables/"; break;
default:
g_assert(!"no such menu group");
toolspath = NULL;
@@ -1123,6 +1124,8 @@ static guint merge_tap_menus_layered(GList *node, gint group) {
case(REGISTER_TOOLS_GROUP_NONE):
break;
#endif
+ case(REGISTER_USER_TABLES):
+ break;
default:
g_assert_not_reached();
}
@@ -1200,7 +1203,11 @@ void merge_all_tap_menus(GList *node) {
/*gtk_item_factory_create_item(main_menu_factory, entry, NULL, 2);*/
}
#endif
-
+ if (merge_tap_menus_layered(node, REGISTER_USER_TABLES)) {
+ entry->path = "/View/";
+ /*gtk_item_factory_create_item(main_menu_factory, entry, NULL, 2);*/
+ }
+
}
diff --git a/gtk/uat_gui.c b/gtk/uat_gui.c
index de760416f1..c1c4a4a77c 100644
--- a/gtk/uat_gui.c
+++ b/gtk/uat_gui.c
@@ -51,7 +51,12 @@
#include "gui_utils.h"
#include "dlg_utils.h"
#include "help_dlg.h"
+#include "menu.h"
#include "compat_macros.h"
+#include <epan/proto.h>
+#include <epan/packet.h>
+#include "../stat_menu.h"
+#include "gui_stat_menu.h"
#include <epan/uat-int.h>
#include <epan/value_string.h>
@@ -787,7 +792,7 @@ static void uat_help_cb(GtkWidget* w _U_, gpointer u) {
}
#endif
-GtkWidget* uat_window(void* u) {
+static GtkWidget* uat_window(void* u) {
uat_t* uat = u;
uat_field_t* f = uat->fields;
uat_rep_t* rep;
@@ -957,3 +962,24 @@ GtkWidget* uat_window(void* u) {
void uat_window_cb(GtkWidget* u _U_, void* uat) {
uat_window(uat);
}
+
+
+/*
+ Add an UAT to the menu
+ */
+static void add_uat_to_menu(void* u, void* user_data _U_) {
+ uat_t* uat = u;
+ register_stat_menu_item(uat->category ? ep_strdup_printf("%s/%s",uat->category,uat->name) : uat->name,
+ REGISTER_USER_TABLES,
+ uat_window_cb,
+ NULL,
+ NULL,
+ uat);
+}
+
+
+void uat_init_menus(void) {
+ uat_foreach_table(add_uat_to_menu,NULL);
+
+}
+
diff --git a/gtk/uat_gui.h b/gtk/uat_gui.h
index 8daf274847..4c2700926c 100644
--- a/gtk/uat_gui.h
+++ b/gtk/uat_gui.h
@@ -30,7 +30,7 @@
#ifndef _UAT_GUI_H_
#define _UAT_GUI_H_
-GtkWidget* uat_window(void*);
void uat_window_cb(GtkWidget* unused, void* uat);
+void uat_init_menus(void);
#endif