aboutsummaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorLuis Ontanon <luis.ontanon@gmail.com>2007-02-25 18:03:05 +0000
committerLuis Ontanon <luis.ontanon@gmail.com>2007-02-25 18:03:05 +0000
commita2a25e7586330877fb1a59c9176d11d1b7ec9120 (patch)
tree354a6404d8487764139aa5262d25d22faa537912 /gtk
parentcd08e6448f317b9791f32c22494a8d2b346d6f87 (diff)
revert (most) changes in rev #20753, to avoid items being created on a wrong menu on windows.
svn path=/trunk/; revision=20928
Diffstat (limited to 'gtk')
-rw-r--r--gtk/Makefile.am1
-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.c4
-rw-r--r--gtk/menu.c14
-rw-r--r--gtk/uat_gui.c20
-rw-r--r--gtk/uat_gui.h1
8 files changed, 72 insertions, 36 deletions
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 71a85f7b3b..45a733c5cb 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -78,6 +78,7 @@ noinst_HEADERS = \
isprint.h \
keys.h \
layout_prefs.h \
+ macros_dlg.h \
main.h \
menu.h \
mtp3_stat.h \
diff --git a/gtk/Makefile.common b/gtk/Makefile.common
index 16b4126185..93d4577873 100644
--- a/gtk/Makefile.common
+++ b/gtk/Makefile.common
@@ -79,6 +79,7 @@ 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
new file mode 100644
index 0000000000..70793c1e1a
--- /dev/null
+++ b/gtk/macros_dlg.c
@@ -0,0 +1,41 @@
+/* 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_cb(NULL,dfmuat);
+}
+
diff --git a/gtk/macros_dlg.h b/gtk/macros_dlg.h
new file mode 100644
index 0000000000..b82b23ea31
--- /dev/null
+++ b/gtk/macros_dlg.h
@@ -0,0 +1,26 @@
+/* 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 9513710aec..3c3e4d32ab 100644
--- a/gtk/main.c
+++ b/gtk/main.c
@@ -2376,10 +2376,6 @@ 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 50104daf7b..0ca5df11dc 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,7 +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/User Tables", NULL, NULL, 0, "<Branch>", NULL),
+ ITEM_FACTORY_ENTRY("/View/Display Filter _Macros...", NULL, macros_dialog_cb, 0, NULL, NULL),
ITEM_FACTORY_ENTRY("/View/<separator>", NULL, NULL, 0, "<Separator>", NULL),
@@ -998,7 +998,6 @@ 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;
@@ -1134,8 +1133,6 @@ 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();
}
@@ -1217,12 +1214,7 @@ void merge_all_tap_menus(GList *node) {
if (merge_tap_menus_layered(node, REGISTER_TOOLS_GROUP_NONE)) {
/*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);*/
- }
-
+#endif
}
diff --git a/gtk/uat_gui.c b/gtk/uat_gui.c
index 373adf2095..84c46c66d0 100644
--- a/gtk/uat_gui.c
+++ b/gtk/uat_gui.c
@@ -1027,24 +1027,4 @@ void uat_window_cb(GtkWidget* u _U_, void* 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) :
- ep_strdup_printf(" %s",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 4c2700926c..641ae01a6a 100644
--- a/gtk/uat_gui.h
+++ b/gtk/uat_gui.h
@@ -31,6 +31,5 @@
#define _UAT_GUI_H_
void uat_window_cb(GtkWidget* unused, void* uat);
-void uat_init_menus(void);
#endif