Add text import capability, like text2pcap, directly into the GUI.
[obnox/wireshark/wip.git] / gtk / summary_dlg.c
index 628ddf30bcf2782a5b86151f1f00ed229723c16a..192ef3e58a0bb31b05490980085045bfd11f6894 100644 (file)
@@ -44,6 +44,7 @@
 #ifdef HAVE_LIBPCAP
 #include "../capture.h"
 #include "gtk/main.h"
+#include "gtk/capture_globals.h"
 #endif
 
 #include "gtk/summary_dlg.h"
@@ -68,13 +69,18 @@ add_string_to_table_sensitive(GtkWidget *list, guint *row, const gchar *title, c
         indent = g_strdup(title);
     }
     label = gtk_label_new(indent);
+    if (strlen(value) == 0) {
+      gchar *message = g_strdup_printf("<span weight=\"bold\">%s</span>", title);
+      gtk_label_set_markup(GTK_LABEL(label), message);
+      g_free (message);
+    }
     g_free(indent);
-    gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+    gtk_misc_set_alignment(GTK_MISC(label), 0.0f, 0.5f);
     gtk_widget_set_sensitive(label, sensitive);
     gtk_table_attach_defaults(GTK_TABLE(list), label, 0, 1, *row, *row+1);
 
     label = gtk_label_new(value);
-    gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+    gtk_misc_set_alignment(GTK_MISC(label), 0.0f, 0.5f);
     gtk_widget_set_sensitive(label, sensitive);
     gtk_table_attach_defaults(GTK_TABLE(list), label, 1, 2, *row, *row+1);
 
@@ -124,7 +130,7 @@ summary_open_cb(GtkWidget *w _U_, gpointer d _U_)
   /* initial computations */
   summary_fill_in(&cfile, &summary);
 #ifdef HAVE_LIBPCAP
-  summary_fill_in_capture(capture_opts, &summary);
+  summary_fill_in_capture(&global_capture_opts, &summary);
 #endif
   seconds = summary.stop_time - summary.start_time;
   disp_seconds = summary.filtered_stop - summary.filtered_start;
@@ -134,7 +140,7 @@ summary_open_cb(GtkWidget *w _U_, gpointer d _U_)
 
   /* Container for each row of widgets */
   main_vb = gtk_vbox_new(FALSE, 12);
-  gtk_container_border_width(GTK_CONTAINER(main_vb), 12);
+  gtk_container_set_border_width(GTK_CONTAINER(main_vb), 12);
   gtk_container_add(GTK_CONTAINER(sum_open_w), main_vb);
 
   /* table */
@@ -157,9 +163,13 @@ summary_open_cb(GtkWidget *w _U_, gpointer d _U_)
   add_string_to_table(table, &row, "Length:", string_buff);
 
   /* format */
-  g_snprintf(string_buff, SUM_STR_MAX, "%s", wtap_file_type_string(summary.encap_type));
+  g_snprintf(string_buff, SUM_STR_MAX, "%s", wtap_file_type_string(summary.file_type));
   add_string_to_table(table, &row, "Format:", string_buff);
 
+  /* encapsulation */
+  g_snprintf(string_buff, SUM_STR_MAX, "%s", wtap_encap_string(summary.encap_type));
+  add_string_to_table(table, &row, "Encapsulation:", string_buff);
+
   if (summary.has_snap) {
     /* snapshot length */
     g_snprintf(string_buff, SUM_STR_MAX, "%u bytes", summary.snap);
@@ -272,6 +282,10 @@ summary_open_cb(GtkWidget *w _U_, gpointer d _U_)
     add_string_to_table(table, &row, "Display filter:", "none");
   }
 
+  /* Ignored packet count */
+  g_snprintf(string_buff, SUM_STR_MAX, "%i", summary.ignored_count);
+  add_string_to_table(table, &row, "Ignored packets:", string_buff);
+
   /* Traffic */
   list = simple_list_new(4, titles);
   gtk_container_add(GTK_CONTAINER(main_vb), list);
@@ -383,7 +397,7 @@ summary_open_cb(GtkWidget *w _U_, gpointer d _U_)
 
   /* MBit per second */
   if (seconds > 0) {
-    g_snprintf(string_buff, SUM_STR_MAX, "%.3f", 
+    g_snprintf(string_buff, SUM_STR_MAX, "%.3f",
               /* MSVC cannot convert from unsigned __int64 to float, so first convert to signed __int64 */
               ((gint64) summary.bytes) * 8.0 / (seconds * 1000.0 * 1000.0));
   } else {