aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/capture_info_dlg.c
diff options
context:
space:
mode:
authorSake Blok <sake@euronet.nl>2008-08-09 08:17:53 +0000
committerSake Blok <sake@euronet.nl>2008-08-09 08:17:53 +0000
commitb08d70271d03dceb680f708ae3eb2dc4115a5563 (patch)
treee06d1d4ea518ca43b15bc9019aa3c5b1886ad41d /gtk/capture_info_dlg.c
parentf9792481d2b6b5be1ebba6e154a794a1229cc094 (diff)
From Alexey Neyman (Bug 2786):
Make "stop" button in the capture info dialog work svn path=/trunk/; revision=25966
Diffstat (limited to 'gtk/capture_info_dlg.c')
-rw-r--r--gtk/capture_info_dlg.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/gtk/capture_info_dlg.c b/gtk/capture_info_dlg.c
index f6b12d4366..8f223a2b7e 100644
--- a/gtk/capture_info_dlg.c
+++ b/gtk/capture_info_dlg.c
@@ -89,17 +89,28 @@ pct(gint num, gint denom) {
}
}
-static gboolean
-capture_info_delete_cb(GtkWidget *w _U_, GdkEvent *event _U_, gpointer data) {
- capture_options *capture_opts = data;
+/* Workhorse for stopping capture */
+static void
+capture_info_stop(capture_options *capture_opts)
+{
#ifdef HAVE_AIRPCAP
airpcap_set_toolbar_stop_capture(airpcap_if_active);
#endif
-
capture_stop(capture_opts);
+}
+
+/* GTK signals for "delete" and "clicked" events. Note they have different signatures */
+static gboolean
+capture_info_delete_cb(GtkWidget *w _U_, GdkEvent *event _U_, gpointer data) {
+ capture_info_stop(data);
return TRUE;
}
+static void
+capture_info_stop_clicked_cb(GtkButton *w _U_, gpointer data) {
+ capture_info_stop(data);
+}
+
static gboolean
capture_info_ui_update_cb(gpointer data)
{
@@ -264,7 +275,7 @@ capture_options *capture_opts)
stop_bt = g_object_get_data(G_OBJECT(bbox), WIRESHARK_STOCK_CAPTURE_STOP);
window_set_cancel_button(info->cap_w, stop_bt, NULL);
- g_signal_connect(stop_bt, "clicked", G_CALLBACK(capture_info_delete_cb), capture_opts);
+ g_signal_connect(stop_bt, "clicked", G_CALLBACK(capture_info_stop_clicked_cb), capture_opts);
g_signal_connect(info->cap_w, "delete_event", G_CALLBACK(capture_info_delete_cb), capture_opts);
ci_help = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_HELP);