}
#endif /* HAVE_LIBPCAP */
+
+/*
+ * Editor modelines - http://www.wireshark.org/tools/modelines.html
+ *
+ * Local variables:
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: tabs
+ * End:
+ *
+ * ex: set shiftwidth=4 tabstop=4 noexpandtab
+ * :indentSize=4:tabSize=4:noTabs=false:
+ */
\ No newline at end of file
void
airpcap_update_channel_combo(GtkWidget* channel_cb, airpcap_if_info_t* if_info)
{
- if(!if_info || airpcap_if_is_any(if_info))
+ if(!if_info || airpcap_if_is_any(if_info) || !airpcap_if_selected)
{
gtk_combo_box_set_active(GTK_COMBO_BOX(channel_cb), -1);
change_airpcap_settings = FALSE;
/* open the network adapter */
adapter = wpcap_packet_open(iface);
if(adapter == NULL) {
+ /*
+ * We have an adapter that is not exposed through normal APIs (e.g. TurboCap)
+ * or an adapter that isn't plugged in.
+ *
+ * XXX - We should use the TurboCap API to get info about TurboCap adapters.
+ */
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
- "%sCould not open adapter: %s!%s"
- "\n\nThe adapter might be removed from the system in the meantime!",
+ "%sCould not open adapter %s!%s"
+ "\n\nHas it been unplugged?",
simple_dialog_primary_start(), iface, simple_dialog_primary_end());
return;
}
}
}
+gboolean
+capture_if_has_details(char *iface) {
+ LPADAPTER adapter;
+
+ if (!iface) {
+ return FALSE;
+ }
+
+ adapter = wpcap_packet_open(iface);
+ if (adapter) {
+ wpcap_packet_close(adapter);
+ return TRUE;
+ }
+
+ return FALSE;
+}
#endif /* HAVE_LIBPCAP && _WIN32 */
*/
extern void capture_if_details_open(char *iface);
+/** See if we have a detail-able interface.
+ *
+ * @param iface the interface name to test
+ */
+extern gboolean capture_if_has_details(char *iface);
/* details button */
#ifdef _WIN32
if_dlg_data->details_bt = gtk_button_new_from_stock(WIRESHARK_STOCK_CAPTURE_DETAILS);
- g_signal_connect(if_dlg_data->details_bt, "clicked", G_CALLBACK(capture_details_cb), if_dlg_data);
gtk_tooltips_set_tip(tooltips, if_dlg_data->details_bt,
"Open the capture details dialog of this interface.", NULL);
gtk_table_attach_defaults(GTK_TABLE(if_tb), if_dlg_data->details_bt, 8, 9, row, row+1);
+ if (capture_if_has_details(if_dlg_data->device)) {
+ g_signal_connect(if_dlg_data->details_bt, "clicked", G_CALLBACK(capture_details_cb), if_dlg_data);
+ } else {
+ gtk_widget_set_sensitive(if_dlg_data->details_bt, FALSE);
+ }
#endif
if_data = g_list_append(if_data, if_dlg_data);