if context menu item "Print" is clicked from the packet list context menu, it should...
authorulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 24 Jan 2005 19:33:47 +0000 (19:33 +0000)
committerulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 24 Jan 2005 19:33:47 +0000 (19:33 +0000)
If we would allow selecting multiple packets in the packet list in the future, this option would print all selected packets.

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

gtk/main.h
gtk/menu.c
gtk/print_dlg.c

index 75db92e69e5eb14170ed3c5481d5dc73200bf77f..4d58bb7534c8da4e9428cf1799408d693ca66397 100644 (file)
@@ -145,6 +145,13 @@ extern void file_quit_cmd_cb(GtkWidget *widget, gpointer data);
  */
 extern void file_print_cmd_cb(GtkWidget *widget, gpointer data);
 
+/** User requested "Print" by packet list context menu.
+ *
+ * @param widget parent widget (unused)
+ * @param data unused
+ */
+extern void file_print_selected_cmd_cb(GtkWidget *widget _U_, gpointer data _U_);
+
 /** User requested "Export as Plain Text" by menu.
  *
  * @param widget parent widget (unused)
index 1ccf053c87f7262e315cba70481e79a61089b1d5..4b538015081f962668742abddce93f75ae3faa28 100644 (file)
@@ -420,7 +420,7 @@ static GtkItemFactoryEntry packet_list_menu_items[] =
     ITEM_FACTORY_ENTRY("/<separator>", NULL, NULL, 0, "<Separator>", NULL),
 
     ITEM_FACTORY_ENTRY("/Decode As...", NULL, decode_as_cb, 0, NULL, NULL),
-    ITEM_FACTORY_ENTRY("/Print...", NULL, file_print_cmd_cb, 0, NULL, NULL),
+    ITEM_FACTORY_ENTRY("/Print...", NULL, file_print_selected_cmd_cb, 0, NULL, NULL),
     ITEM_FACTORY_ENTRY("/Show Packet in New Window", NULL, new_window_cb,
                        0, NULL, NULL)
 };
index eedaeaa5f331189f6838ec46961ef20a67f75176..114917a3f9358e4686eaac27888d780cd754e7ae 100644 (file)
@@ -112,7 +112,7 @@ static gboolean print_prefs_init = FALSE;
 
 
 void
-file_print_cmd_cb(GtkWidget *widget _U_, gpointer data _U_)
+file_print_cmd(gboolean print_selected)
 {
   print_args_t *args = &print_args;
 
@@ -134,14 +134,29 @@ file_print_cmd_cb(GtkWidget *widget _U_, gpointer data _U_)
       args->print_hex           = FALSE;
       args->print_formfeed      = FALSE;
   }
-  
+
   /* init the printing range */
   packet_range_init(&args->range);
 
+  if(print_selected) {
+      args->range.process = range_process_selected;
+  }
+  
   print_win = open_print_dialog("Ethereal: Print", output_action_print, args);
   SIGNAL_CONNECT(print_win, "destroy", print_destroy_cb, &print_win);
 }
 
+void
+file_print_cmd_cb(GtkWidget *widget _U_, gpointer data _U_)
+{
+    file_print_cmd(FALSE);
+}
+
+void
+file_print_selected_cmd_cb(GtkWidget *widget _U_, gpointer data _U_)
+{
+    file_print_cmd(TRUE);
+}
 
 /*
  * Keep a static pointer to the current "Export text" window, if any, so that if