aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorChris Maynard <Christopher.Maynard@GTECH.COM>2013-11-27 05:03:31 +0000
committerChris Maynard <Christopher.Maynard@GTECH.COM>2013-11-27 05:03:31 +0000
commit136030657baa2a8212095ea6d8b06a6b717c1e6c (patch)
tree148eb3845a23fd186fc351b219f4dee242761c57 /ui
parenta01b501445ec0bf2fce51b374c08176a3b6a119f (diff)
Make "Capture on all interfaces" toggle button behave properly, particularly when all interfaces had been selected but one of them is deselected.
#BACKPORT(1.10) svn path=/trunk/; revision=53609
Diffstat (limited to 'ui')
-rw-r--r--ui/gtk/capture_dlg.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/ui/gtk/capture_dlg.c b/ui/gtk/capture_dlg.c
index dd2295d03b..649ff3a720 100644
--- a/ui/gtk/capture_dlg.c
+++ b/ui/gtk/capture_dlg.c
@@ -246,6 +246,8 @@ static remote_options global_remote_opts;
static guint num_selected = 0;
#endif
+static gulong capture_all_handler_id;
+
static void
capture_prep_file_cb(GtkWidget *file_bt, GtkWidget *file_te);
@@ -4488,10 +4490,10 @@ update_properties_all(void)
/* If all interfaces are selected, check the "capture on all interfaces"
checkbox, otherwise un-check it. */
- if (capture_all) {
- capture_b = (GtkWidget *)g_object_get_data(G_OBJECT(cap_open_w), E_CAP_KEY_ALL);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(capture_b), TRUE);
- }
+ capture_b = (GtkWidget *)g_object_get_data(G_OBJECT(cap_open_w), E_CAP_KEY_ALL);
+ g_signal_handler_block(capture_b, capture_all_handler_id);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(capture_b), capture_all ? TRUE : FALSE);
+ g_signal_handler_unblock(capture_b, capture_all_handler_id);
/* If all selected interfaces are in promiscuous mode, check the global
"promiscuous mode" checkbox, otherwise un-check it. */
@@ -4608,7 +4610,7 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
airpcap_if_list = get_airpcap_interface_list(&err, &err_str);
/* If we don't get a list don't do any thing.
- * If the error is AIRPCAP_NOT_LOADED it avoids a unneccessay rescan of the packet list
+ * If the error is AIRPCAP_NOT_LOADED it avoids an unnecessary rescan of the packet list
* ( see airpcap_loader.h for error codes).
*/
if (airpcap_if_list == NULL) {
@@ -4618,7 +4620,7 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
}
}else{
decryption_cb = (GtkWidget *)g_object_get_data(G_OBJECT(wireless_tb),AIRPCAP_TOOLBAR_DECRYPTION_KEY);
- /* XXXX update_decryption_mode_list() trigers a rescan, should only be done if the mode is changed */
+ /* XXXX update_decryption_mode_list() triggers a rescan, should only be done if the mode is changed */
update_decryption_mode_list(decryption_cb);
/* select the first as default (THIS SHOULD BE CHANGED) */
airpcap_if_active = airpcap_get_default_if(airpcap_if_list);
@@ -4798,7 +4800,7 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
all_cb = gtk_check_button_new_with_mnemonic( "Capture on all interfaces");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(all_cb), FALSE);
- g_signal_connect(all_cb, "toggled", G_CALLBACK(capture_all_cb), NULL);
+ capture_all_handler_id = g_signal_connect(all_cb, "toggled", G_CALLBACK(capture_all_cb), NULL);
gtk_widget_set_tooltip_text(all_cb, "Activate the box to capture on all interfaces. "
"Deactivate it to capture on none and set the interfaces individually.");
gtk_box_pack_start(GTK_BOX(left_vb), all_cb, TRUE, TRUE, 0);
@@ -5712,7 +5714,7 @@ create_and_fill_model(GtkTreeView *view)
hassnap = capture_dev_user_hassnap_find(device.name);
snaplen = capture_dev_user_snaplen_find(device.name);
if(snaplen != -1 && hassnap != -1) {
- /* Default snap lenght set in preferences */
+ /* Default snap length set in preferences */
device.snaplen = snaplen;
device.has_snaplen = hassnap;
} else {