"main_menu.[ch]" -> "menus.[ch]"; it handles not only the main menu, but
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 21 Jun 2009 19:16:37 +0000 (19:16 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 21 Jun 2009 19:16:37 +0000 (19:16 +0000)
context menus.

Note why we have an empty hex dump pane context menu.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@28794 f5534014-38df-0310-8fa8-9805f1628bb7

18 files changed:
gtk/Makefile.common
gtk/capture_dlg.c
gtk/capture_file_dlg.c
gtk/drag_and_drop.c
gtk/file_dlg_win32.c
gtk/fileset_dlg.c
gtk/main.c
gtk/main.h
gtk/main_filter_toolbar.c
gtk/main_packet_list.c
gtk/main_proto_draw.c
gtk/main_toolbar.c
gtk/main_welcome.c
gtk/menus.c [moved from gtk/main_menu.c with 99% similarity]
gtk/menus.h [moved from gtk/main_menu.h with 99% similarity]
gtk/packet_history.c
gtk/prefs_nameres.c
gtk/recent.c

index b1ed8913cdd9a93e6d79cc0a30f2e4010a520c5c..4ff9b3c291bf56d0e4d5fbc56e771e1476cd6bbc 100644 (file)
@@ -80,7 +80,7 @@ WIRESHARK_GTK_SRC = \
        main.c          \
        main_airpcap_toolbar.c  \
        main_filter_toolbar.c   \
-       main_menu.c             \
+       menus.c         \
        main_packet_list.c      \
        main_proto_draw.c       \
        main_statusbar.c                \
@@ -257,7 +257,7 @@ noinst_HEADERS = \
        main.h          \
        main_airpcap_toolbar.h  \
        main_filter_toolbar.h   \
-       main_menu.h             \
+       menus.h         \
        main_packet_list.h      \
        main_proto_draw.h       \
        main_statusbar.h                \
index 7d7d008826f08058d29b660205ad5c7725750f7d..1d1a1ce9eeb542c473be083a457c560a36fd8dcc 100644 (file)
@@ -35,8 +35,8 @@
 #include <string.h>
 #if 0
 /*
- * main_menu.h uses FILE, but I guess <stdio.h> is included by
- * something else before main_menu.h is included.
+ * menus.h uses FILE, but I guess <stdio.h> is included by
+ * something else before menus.h is included.
  */
 #include <stdio.h>
 #endif
@@ -57,7 +57,7 @@
 #include "../ringbuffer.h"
 
 #include "gtk/main.h"
-#include "gtk/main_menu.h"
+#include "gtk/menus.h"
 #include "gtk/gui_utils.h"
 #include "gtk/capture_dlg.h"
 #include "gtk/filter_dlg.h"
index 81a7873070524ebb09732ec9b18b4c00446318e2..b4b472ecffaecce7c278f7dc0e2f169224ac8d9f 100644 (file)
@@ -58,7 +58,7 @@
 #include "gtk/capture_file_dlg.h"
 #include "gtk/drag_and_drop.h"
 #include "gtk/main.h"
-#include "gtk/main_menu.h"
+#include "gtk/menus.h"
 #include "gtk/recent.h"
 #include "gtk/color_dlg.h"
 #ifdef HAVE_LIBPCAP
index 8353232c45a2e7a8b58e476bc7a0a727922b5681..1e43326aa330fa1ce86b34be2a7854bb9e8c2d94 100644 (file)
@@ -48,7 +48,7 @@
 #include "gtk/capture_file_dlg.h"
 #include "gtk/drag_and_drop.h"
 #include "gtk/main.h"
-#include "gtk/main_menu.h"
+#include "gtk/menus.h"
 #ifdef HAVE_LIBPCAP
 #include "gtk/capture_globals.h"
 #endif
index 0a8d6db606f2a35919111c19bb868968d8993d07..fbe2f64577f5e1144c8a1fc163e640857f3aa10d 100644 (file)
@@ -60,7 +60,7 @@
 #include "gtk/file_dlg.h"
 #include "gtk/capture_file_dlg.h"
 #include "gtk/main.h"
-#include "gtk/main_menu.h"
+#include "gtk/menus.h"
 #include "gtk/drag_and_drop.h"
 #include "gtk/capture_dlg.h"
 #include "gtk/file_dlg_win32.h"
index 3f51939e8819f47a2e7abbe0f54a67dd25dee530..07ba5e961112bc3caba9109d69c5f45dbfa9e333 100644 (file)
@@ -43,7 +43,7 @@
 #include "gtk/gui_utils.h"
 #include "gtk/dlg_utils.h"
 #include "gtk/main.h"
-#include "gtk/main_menu.h"
+#include "gtk/menus.h"
 #include "gtk/help_dlg.h"
 #include "gtk/fileset_dlg.h"
 
index 825f220df92446fb94c4efed12413f8cd492057e..bb4eab8891a468992ddc13b2e59916a8dac9fab7 100644 (file)
 #include "gtk/main.h"
 #include "gtk/main_airpcap_toolbar.h"
 #include "gtk/main_filter_toolbar.h"
-#include "gtk/main_menu.h"
+#include "gtk/menus.h"
 #include "gtk/main_packet_list.h"
 #include "gtk/main_statusbar.h"
 #include "gtk/main_statusbar_private.h"
index af9d01c9fbc41c50d60ccb8bb34e2c92139012a2..5dafbf2e195fdcd3f250967153d6f378cb82f1f6 100644 (file)
@@ -37,7 +37,7 @@
   digraph main_dependencies {
       node [shape=record, fontname=Helvetica, fontsize=10];
       main [ label="main window" URL="\ref main.h"];
-      menu [ label="menubar" URL="\ref main_menu.h"];
+      menu [ label="menubar" URL="\ref menus.h"];
       toolbar [ label="toolbar" URL="\ref toolbar.h"];
       packet_list [ label="packet list pane" URL="\ref main_packet_list.h"];
       proto_draw [ label="packet details & bytes panes" URL="\ref main_proto_draw.h"];
index ee941eed37b3c87e3cb3401cbf28ad0910c856dc..c6c5f51406b0e1dc82a0005f2a7eb0dc07598608 100644 (file)
@@ -45,7 +45,7 @@
 #include "recent.h"
 
 #include "main.h"
-#include "main_menu.h"
+#include "menus.h"
 #include "main_toolbar.h"
 #include "main_filter_toolbar.h"
 
index bc585ce254c8af65e0675a860db83d6a204cb1f0..ab41c902f0bb78809564b050bcac8fc986d099de 100644 (file)
@@ -50,7 +50,7 @@
 #include "gtk/packet_history.h"
 #include "gtk/recent.h"
 #include "gtk/main.h"
-#include "gtk/main_menu.h"
+#include "gtk/menus.h"
 #include "gtk/main_packet_list.h"
 #include "gtk/main_statusbar.h"
 #include "gtk/packet_win.h"
index ba7d66861576a2dd17cff5667080d91ada113467..83f29145c5ea47b82ab8bc6fdf07d81a84391fe9 100644 (file)
@@ -68,7 +68,7 @@
 #include "gtk/font_utils.h"
 #include "gtk/webbrowser.h"
 #include "gtk/main.h"
-#include "gtk/main_menu.h"
+#include "gtk/menus.h"
 #include "gtk/main_proto_draw.h"
 
 #if _WIN32
index 7a2e45809de63a640897fb702b42b632cbc75262..0994171995f3872fb33a7c1428d8be634c5c94f1 100644 (file)
@@ -50,7 +50,7 @@
 #include "gtk/color_dlg.h"
 #include "gtk/prefs_dlg.h"
 #include "gtk/main.h"
-#include "gtk/main_menu.h"
+#include "gtk/menus.h"
 #include "gtk/main_packet_list.h"
 #include "gtk/main_toolbar.h"
 #include "gtk/help_dlg.h"
index f49f7df6dd963c626e93013e626894f7a8a049ec..4a8523141c097e3fbb96b01859794c184268916e 100644 (file)
@@ -47,7 +47,7 @@
 #include "gtk/recent.h"
 #include "gtk/gtkglobals.h"
 #include "gtk/main.h"
-#include "gtk/main_menu.h"
+#include "gtk/menus.h"
 #include "gtk/main_welcome.h"
 #include "gtk/capture_dlg.h"
 #include "gtk/capture_if_dlg.h"
similarity index 99%
rename from gtk/main_menu.c
rename to gtk/menus.c
index 187cf492c7cbf167f20ed6c59552218dcfc77d91..4cdb10c9a786de3c089bbd93ba089ca47e220d6e 100644 (file)
@@ -1,5 +1,5 @@
-/* main_menu.c
- * Main menu routines
+/* menus.c
+ * Menu routines
  *
  * $Id$
  *
@@ -87,7 +87,7 @@
 #include "gtk/export_object.h"
 #include "gtk/gui_stat_menu.h"
 #include "gtk/main.h"
-#include "gtk/main_menu.h"
+#include "gtk/menus.h"
 #include "gtk/main_packet_list.h"
 #include "gtk/main_toolbar.h"
 #include "gtk/main_welcome.h"
@@ -1155,7 +1155,7 @@ menus_init(void) {
     if (initialize) {
         initialize = FALSE;
 
-    /* popup */
+    /* packet list pop-up menu */
     packet_list_menu_factory = gtk_item_factory_new(GTK_TYPE_MENU, "<main>", NULL);
     popup_menu_object = gtk_menu_new();
     gtk_item_factory_create_items_ac(packet_list_menu_factory, sizeof(packet_list_menu_items)/sizeof(packet_list_menu_items[0]), packet_list_menu_items, popup_menu_object, 2);
@@ -1163,16 +1163,23 @@ menus_init(void) {
                     packet_list_menu_factory->widget);
     popup_menu_list = g_slist_append((GSList *)popup_menu_list, packet_list_menu_factory);
 
+    /* packet detail pop-up menu */
     tree_view_menu_factory = gtk_item_factory_new(GTK_TYPE_MENU, "<main>", NULL);
     gtk_item_factory_create_items_ac(tree_view_menu_factory, sizeof(tree_view_menu_items)/sizeof(tree_view_menu_items[0]), tree_view_menu_items, popup_menu_object, 2);
     g_object_set_data(G_OBJECT(popup_menu_object), PM_TREE_VIEW_KEY,
                     tree_view_menu_factory->widget);
     popup_menu_list = g_slist_append((GSList *)popup_menu_list, tree_view_menu_factory);
 
+    /*
+     * Hex dump pop-up menu.
+     * We provide our own empty menu to suppress the default pop-up menu
+     * for text widgets.
+     */
     hexdump_menu_factory = gtk_item_factory_new(GTK_TYPE_MENU, "<main>", NULL);
     g_object_set_data(G_OBJECT(popup_menu_object), PM_HEXDUMP_KEY,
                     hexdump_menu_factory->widget);
     popup_menu_list = g_slist_append((GSList *)popup_menu_list, hexdump_menu_factory);
+
     /* main */
     main_menu_factory = gtk_item_factory_new(GTK_TYPE_MENU_BAR, "<main>", grp);
     gtk_item_factory_create_items_ac(main_menu_factory, nmenu_items, menu_items, NULL, 2);
similarity index 99%
rename from gtk/main_menu.h
rename to gtk/menus.h
index 359941cce8ec43172058396db1ad2df2fd0d32d3..8a4d990b2c97871ba41eb5419f790896b6ab8f18 100644 (file)
@@ -1,5 +1,5 @@
-/* main_menu.h
- * Main menu definitions
+/* menus.h
+ * Menu definitions
  *
  * $Id$
  *
index b26d460c0ababe54e9e4e5725d756b503145c91e..c558fcfca1870b8eb47ba61bc1e29c3c591f0a90 100644 (file)
@@ -33,7 +33,7 @@
 #include "../file.h"
 #include "../globals.h"
 
-#include "gtk/main_menu.h"
+#include "gtk/menus.h"
 #include "gtk/packet_history.h"
 
 
index 7131c08d007cd3002c45ca9f24b15e19c43f67c7..b3f8aaa28ef188c88c1757dfbc21d76ca30d61df 100644 (file)
@@ -39,7 +39,7 @@
 #include "gtk/prefs_dlg.h"
 #include "gtk/gui_utils.h"
 #include "gtk/main.h"
-#include "gtk/main_menu.h"
+#include "gtk/menus.h"
 
 
 #define M_RESOLVE_KEY  "m_resolve"
index 917fb29bb5bbb2d51d293e98c9c3d22fea24fbd3..1ac34d5fbe61e566e948136f2b454a68e5ee43d2 100644 (file)
@@ -44,7 +44,7 @@
 
 #include "gtk/recent.h"
 #include "gtk/main.h"
-#include "gtk/main_menu.h"
+#include "gtk/menus.h"
 #include "gtk/gui_utils.h"
 #include "gtk/main_packet_list.h"
 #include "gtk/file_dlg.h"