Fix compilation when compiling without libpcap (configure script parameter
authorsfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 29 Aug 2011 19:47:50 +0000 (19:47 +0000)
committersfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 29 Aug 2011 19:47:50 +0000 (19:47 +0000)
"--without-pcap")

Note: Generates run-time warnings still:

(wireshark:66065): Gtk-WARNING **: CaptureFilters: missing action /Capture/CaptureFilters

(wireshark:66065): Gtk-WARNING **: Interfaces: missing action /Capture/Interfaces

(wireshark:66065): Gtk-WARNING **: Options: missing action /Capture/Options

(wireshark:66065): Gtk-WARNING **: Start: missing action /Capture/Start

(wireshark:66065): Gtk-WARNING **: Stop: missing action /Capture/Stop

(wireshark:66065): Gtk-WARNING **: Restart: missing action /Capture/Restart

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

gtk/main_menubar.c
gtk/stock_icons.c

index c4a6f60bfd6fddeefa711b9e90d1a4b42017c8e4..a36152f4a1eaa03d992cedfdad4e348a31ad731d 100644 (file)
@@ -1576,13 +1576,14 @@ static const GtkActionEntry main_menu_bar_entries[] = {
    { "/Go/LastPacket",                         GTK_STOCK_GOTO_BOTTOM,  "_Last Packet",                                         "<control>End",                                 NULL,                           G_CALLBACK(goto_bottom_frame_cb) },
    { "/Go/PreviousPacketInConversation",                       GTK_STOCK_GO_UP,                "Previous Packet In Conversation",                                      "<control>comma",                                       NULL,                           G_CALLBACK(goto_previous_frame_conversation_cb) },
    { "/Go/NextPacketInConversation",                           GTK_STOCK_GO_DOWN,              "Next Packet In Conversation",                                          "<control>period",                              NULL,                           G_CALLBACK(goto_next_frame_conversation_cb) },
-
+#ifdef HAVE_LIBPCAP
    { "/Capture/Interfaces",                    WIRESHARK_STOCK_CAPTURE_INTERFACES,     "_Interfaces...",               "<control>I",                                   NULL,                           G_CALLBACK(capture_if_cb) },
    { "/Capture/Options",                       WIRESHARK_STOCK_CAPTURE_OPTIONS,        "_Options...",                  "<control>K",                                   NULL,                           G_CALLBACK(capture_prep_cb) },
    { "/Capture/Start",                         WIRESHARK_STOCK_CAPTURE_START,          "_Start",                               "<control>E",                                   NULL,                           G_CALLBACK(capture_start_cb) },
    { "/Capture/Stop",                          WIRESHARK_STOCK_CAPTURE_STOP,           "S_top",                                "<control>E",                                   NULL,                           G_CALLBACK(capture_stop_cb) },
    { "/Capture/Restart",                       WIRESHARK_STOCK_CAPTURE_RESTART,        "_Restart",                             "<control>R",                                   NULL,                           G_CALLBACK(capture_restart_cb) },
    { "/Capture/CaptureFilters",                WIRESHARK_STOCK_CAPTURE_FILTER,         "Capture _Filters...",  NULL,                                                   NULL,                           G_CALLBACK(cfilter_dialog_cb) },
+#endif /* HAVE_LIBPCAP */
 
    { "/Analyze/DisplayFilters",                WIRESHARK_STOCK_DISPLAY_FILTER,         "_Display Filters...",  NULL,                                                   NULL,                           G_CALLBACK(dfilter_dialog_cb) },
 
@@ -4283,12 +4284,12 @@ menu_auto_scroll_live_changed(gboolean auto_scroll_live_in) {
 #ifdef HAVE_LIBPCAP
     /* tell toolbar about it */
     toolbar_auto_scroll_live_changed(auto_scroll_live_in);
-#endif /*HAVE_LIBPCAP */
 
     /* change auto scroll */
     if(auto_scroll_live_in != auto_scroll_live) {
         auto_scroll_live  = auto_scroll_live_in;
     }
+#endif /*HAVE_LIBPCAP */
 }
 
 
@@ -4390,12 +4391,15 @@ menu_recent_read_finished(void) {
 
     menu_name_resolution_changed();
 
+
+#ifdef HAVE_LIBPCAP
     menu = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/ViewMenu/AutoScrollinLiveCapture");
     if(!menu){
         g_warning("menu_recent_read_finished: No menu found, path= /Menubar/ViewMenu/AutoScrollinLiveCapture");
     }else{
         gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), auto_scroll_live);
     }
+#endif /* HAVE_LIBPCAP */
 
     main_widgets_rearrange();
 
index 7a825e3daf2418da18dd36db90e6c5534e03f896..27338c089b0fab6dae2a4644eca6c47c25b9bb19 100644 (file)
@@ -32,6 +32,7 @@
 #include "gtk/stock_icons.h"
 
 /* these icons are derived from the original stock icons */
+#ifdef HAVE_LIBPCAP
 #include "../image/toolbar/capture_interfaces_24.xpm"
 #include "../image/toolbar/capture_options_24.xpm"
 #include "../image/toolbar/capture_start_24.xpm"
@@ -39,6 +40,7 @@
 #include "../image/toolbar/capture_restart_24.xpm"
 #include "../image/toolbar/capture_filter_24.xpm"
 #include "../image/toolbar/capture_details_24.xpm"
+#endif /* HAVE_LIBICAP */
 #include "../image/toolbar/display_filter_24.xpm"
 #include "../image/wsicon16.xpm"
 #include "../image/toolbar/colorize_24.xpm"
@@ -91,6 +93,7 @@ void stock_icons_init(void) {
 
     /* register non-standard pixmaps with the gtk-stock engine */
     static const GtkStockItem stock_items[] = {
+#ifdef HAVE_LIBPCAP
         { WIRESHARK_STOCK_CAPTURE_INTERFACES,    "_Interfaces",    0, 0, NULL },
         { WIRESHARK_STOCK_CAPTURE_OPTIONS,       "_Options",       0, 0, NULL },
         { WIRESHARK_STOCK_CAPTURE_START,         "_Start",         0, 0, NULL },
@@ -99,6 +102,7 @@ void stock_icons_init(void) {
         { WIRESHARK_STOCK_CAPTURE_FILTER,        "_Capture Filter",   0, 0, NULL },
         { WIRESHARK_STOCK_CAPTURE_FILTER_ENTRY,  "_Capture Filter:",  0, 0, NULL },
         { WIRESHARK_STOCK_CAPTURE_DETAILS,       "_Details",       0, 0, NULL },
+#endif /* HAVE_LIBPCAP */
 #ifdef HAVE_GEOIP
         { WIRESHARK_STOCK_MAP,                   "Map",                   0, 0, NULL },
 #endif
@@ -158,6 +162,7 @@ void stock_icons_init(void) {
     };
 
     static const stock_pixmap_t pixmaps[] = {
+#ifdef HAVE_LIBPCAP
         { WIRESHARK_STOCK_CAPTURE_INTERFACES,    capture_interfaces_24_xpm },
         { WIRESHARK_STOCK_CAPTURE_OPTIONS,       capture_options_24_xpm },
         { WIRESHARK_STOCK_CAPTURE_START,         capture_start_24_xpm },
@@ -166,6 +171,7 @@ void stock_icons_init(void) {
         { WIRESHARK_STOCK_CAPTURE_FILTER,        capture_filter_24_xpm },
         { WIRESHARK_STOCK_CAPTURE_FILTER_ENTRY,  capture_filter_24_xpm },
         { WIRESHARK_STOCK_CAPTURE_DETAILS,       capture_details_24_xpm },
+#endif /* HAVE_LIBPCAP */
 #ifdef HAVE_GEOIP
         { WIRESHARK_STOCK_MAP,                   internet_24_xpm},
 #endif