aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2010-05-16 08:14:29 +0000
committerGuy Harris <guy@alum.mit.edu>2010-05-16 08:14:29 +0000
commit342d436705e5efc668b5b2fd80c26668bff5f223 (patch)
tree8ef776971bc510bd7816d4f4ea8fab6de3ddf1f8
parent149ccb3b6863f5cab988ce7df7aba7757b1e2ac5 (diff)
If we don't know whether a device supports monitor mode, turn off
monitor mode in the checkbox before making the checkbox insensitive. svn path=/trunk/; revision=32829
-rw-r--r--gtk/capture_dlg.c6
-rw-r--r--gtk/prefs_capture.c12
2 files changed, 10 insertions, 8 deletions
diff --git a/gtk/capture_dlg.c b/gtk/capture_dlg.c
index 50d9d2b13b..72ee644e26 100644
--- a/gtk/capture_dlg.c
+++ b/gtk/capture_dlg.c
@@ -447,8 +447,12 @@ set_if_capabilities(gboolean monitor_mode_changed)
free_if_capabilities(caps);
}
#ifdef HAVE_PCAP_CREATE
- else
+ else {
+ /* We don't know whether this supports monitor mode or not;
+ don't ask for monitor mode. */
gtk_widget_set_sensitive(monitor_cb, FALSE);
+ cap_settings.monitor_mode = FALSE;
+ }
#endif
if (linktype_count == 0) {
lt_menu_item = gtk_menu_item_new_with_label("(not supported)");
diff --git a/gtk/prefs_capture.c b/gtk/prefs_capture.c
index 39f95b26be..45001d3698 100644
--- a/gtk/prefs_capture.c
+++ b/gtk/prefs_capture.c
@@ -734,9 +734,9 @@ ifopts_edit_ifsel_cb(GtkTreeSelection *selection _U_,
}
/*
- * -- set the sensitivity of the monitor-mode checkbox, and
- * build and add to the ComboBox a linktype list for the current
- * interfaces selection, based on the interface capabilities
+ * -- set the state and sensitivity of the monitor-mode checkbox,
+ * and build and add to the ComboBox a linktype list, corresponding
+ * to the interface capabilities of the selected interface
*/
#ifdef HAVE_PCAP_CREATE
caps = capture_get_if_capabilities(if_name, monitor_mode, NULL);
@@ -747,6 +747,7 @@ ifopts_edit_ifsel_cb(GtkTreeSelection *selection _U_,
#ifdef HAVE_PCAP_CREATE
gtk_widget_set_sensitive(if_monitor_lb, caps->can_set_rfmon);
gtk_widget_set_sensitive(if_monitor_cb, caps->can_set_rfmon);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(if_monitor_cb), monitor_mode);
#endif
if (caps->data_link_types != NULL) {
GList *lt_entry;
@@ -765,15 +766,12 @@ ifopts_edit_ifsel_cb(GtkTreeSelection *selection _U_,
gtk_combo_box_set_active(GTK_COMBO_BOX(if_linktype_cb), selected);
}
free_if_capabilities(caps);
-#ifdef HAVE_PCAP_CREATE
- /* display the "monitor mode" button state from current interfaces selection */
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(if_monitor_cb), monitor_mode);
-#endif
}
#ifdef HAVE_PCAP_CREATE
else {
gtk_widget_set_sensitive(if_monitor_lb, FALSE);
gtk_widget_set_sensitive(if_monitor_cb, FALSE);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(if_monitor_cb), FALSE);
}
#endif