Wireshark-bugs: [Wireshark-bugs] [Bug 771] Capture -> Options -> Link-Layer Header Type : nothin

Date: Thu, 21 Sep 2006 12:35:27 +0000 (GMT)
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=771





------- Comment #8 from florent.drouin@xxxxxxxxxx  2006-09-21 12:35 GMT -------
Created an attachment (id=371)
 --> (http://bugs.wireshark.org/bugzilla/attachment.cgi?id=371&action=view)
svn diff gtk/capture_dlg.c in text

I did attach the patch again, without gzipping it.

~/wireshark_SVN19246$ svn diff gtk/capture_dlg.c
Index: gtk/capture_dlg.c
===================================================================
--- gtk/capture_dlg.c   (revision 19246)
+++ gtk/capture_dlg.c   (working copy)
@@ -122,6 +122,7 @@
  * one, rather than creating a new one.
  */
 static GtkWidget *cap_open_w;
+static GtkWidget * dl_hdr_menu=NULL;

 static void
 capture_prep_file_cb(GtkWidget *file_bt, GtkWidget *file_te);
@@ -193,7 +194,12 @@
   GtkWidget *advanced_bt;
 #endif

+  /* Deallocate the existing menu for Datalink header type */
+  if (dl_hdr_menu != NULL)
+    gtk_widget_destroy(dl_hdr_menu);
+  
   lt_menu = gtk_menu_new();
+  dl_hdr_menu= lt_menu;
   entry_text = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry)));
   if_text = g_strstrip(entry_text);
   if_name = get_if_name(if_text);
@@ -295,12 +301,14 @@
       gtk_widget_set_sensitive(lt_menu_item, FALSE);
     }
     gtk_menu_append(GTK_MENU(lt_menu), lt_menu_item);
+    gtk_widget_show(lt_menu_item);
   }
   if (lt_list != NULL)
     free_pcap_linktype_list(lt_list);
   gtk_option_menu_set_menu(GTK_OPTION_MENU(linktype_om), lt_menu);
   gtk_widget_set_sensitive(linktype_lb, num_supported_link_types >= 2);
   gtk_widget_set_sensitive(linktype_om, num_supported_link_types >= 2);
+  gtk_option_menu_set_history(GTK_OPTION_MENU(linktype_om),0);

   if_ip_lb = OBJECT_GET_DATA(linktype_om, E_CAP_IFACE_KEY);
   if(ips == 0) {
@@ -722,6 +730,7 @@
   /* Default to "use the default" */
   OBJECT_SET_DATA(linktype_om, E_CAP_OM_LT_VALUE_KEY, GINT_TO_POINTER(-1));
   OBJECT_SET_DATA(linktype_om, E_CAP_IFACE_KEY, if_ip_lb);
+  dl_hdr_menu=NULL;
   set_link_type_list(linktype_om, GTK_COMBO(if_cb)->entry);
   /*
    * XXX - in some cases, this is "multiple link-layer header types", e.g.
@@ -1677,7 +1686,10 @@
 static void
 capture_prep_interface_changed_cb(GtkWidget *entry, gpointer argp)
 {
-  GtkWidget *linktype_om = argp;
+  GtkWidget *linktype_om = argp; 
+
+  /* Default to "use the default" */
+  OBJECT_SET_DATA(linktype_om, E_CAP_OM_LT_VALUE_KEY, GINT_TO_POINTER(-1));
   set_link_type_list(linktype_om, entry);
 }



-- 
Configure bugmail: http://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.