revert (most) changes in rev #20753, to avoid items being created on a wrong menu...
authorlego <lego@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 25 Feb 2007 18:03:05 +0000 (18:03 +0000)
committerlego <lego@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 25 Feb 2007 18:03:05 +0000 (18:03 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@20928 f5534014-38df-0310-8fa8-9805f1628bb7

gtk/Makefile.am
gtk/Makefile.common
gtk/macros_dlg.c [new file with mode: 0644]
gtk/macros_dlg.h [new file with mode: 0644]
gtk/main.c
gtk/menu.c
gtk/uat_gui.c
gtk/uat_gui.h
stat_menu.h

index 71a85f7b3b021e1ca9f55d7eb8e122a54b906341..45a733c5cbdbe2b9267bb908d3eb9a0a3d8424c5 100644 (file)
@@ -78,6 +78,7 @@ noinst_HEADERS = \
        isprint.h       \
        keys.h          \
        layout_prefs.h  \
+       macros_dlg.h    \
        main.h          \
        menu.h          \
        mtp3_stat.h     \
index 16b41261855ee30c36d15d47b6059c432b7a68b0..93d4577873d8e505b762105ed5c7a8d522c475ad 100644 (file)
@@ -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 (file)
index 0000000..70793c1
--- /dev/null
@@ -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 (file)
index 0000000..b82b23e
--- /dev/null
@@ -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
index 9513710aecc517593574b41be3814310aa1f21fc..3c3e4d32ab08bd3b9f7d10803e97cbe6799da28e 100644 (file)
@@ -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,
index 50104daf7b3c7f166f6709b48b7bd778f5736b01..0ca5df11dcf85b687d08812db49a46d023c36e66 100644 (file)
@@ -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 
 }
 
 
index 373adf209559a00bd041ca91f14feaadc31ea67e..84c46c66d079eaa241997f72c937955c722fb46d 100644 (file)
@@ -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);
-}
-
 
index 4c2700926c15bc40b77503052d2776ca3bfb88ac..641ae01a6ac78aa1cf49b57376ff3c3020db8aec 100644 (file)
@@ -31,6 +31,5 @@
 #define _UAT_GUI_H_
 
 void uat_window_cb(GtkWidget* unused, void* uat);
-void uat_init_menus(void);
 
 #endif
index 4149e8da27540e85ae60ab94d0255532d2f2f0aa..5f8fa4b1e521ec368c8a5802a6c7a99786d08c28 100644 (file)
@@ -53,8 +53,7 @@ typedef enum {
     REGISTER_STAT_GROUP_RESPONSE_TIME,
     REGISTER_STAT_GROUP_TELEPHONY,
     /* XXX - split into telephony and VoIP? */
-       REGISTER_ANALYZE_GROUP_NONE,
-       REGISTER_USER_TABLES
+       REGISTER_ANALYZE_GROUP_NONE
 #ifdef HAVE_LUA_5_1
        ,REGISTER_TOOLS_GROUP_NONE
 #endif