aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/print_dlg.c
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2005-01-24 19:33:47 +0000
committerUlf Lamping <ulf.lamping@web.de>2005-01-24 19:33:47 +0000
commit5c19161dc29278da588f0f4d3a59ca31033f6899 (patch)
tree1650b936bd67905247e151bc6f5fb4dc5318b98a /gtk/print_dlg.c
parent777f7299587b7a1c775b36f89e3571881ab2893d (diff)
if context menu item "Print" is clicked from the packet list context menu, it should use the selected range setting as default. As we currently have only one packet selectable, this will print only this one.
If we would allow selecting multiple packets in the packet list in the future, this option would print all selected packets. svn path=/trunk/; revision=13169
Diffstat (limited to 'gtk/print_dlg.c')
-rw-r--r--gtk/print_dlg.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/gtk/print_dlg.c b/gtk/print_dlg.c
index eedaeaa5f3..114917a3f9 100644
--- a/gtk/print_dlg.c
+++ b/gtk/print_dlg.c
@@ -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