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
*/
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)
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)
};
void
-file_print_cmd_cb(GtkWidget *widget _U_, gpointer data _U_)
+file_print_cmd(gboolean print_selected)
{
print_args_t *args = &print_args;
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