summaryrefslogtreecommitdiff
path: root/ui/qt/capture_preferences_frame.cpp
diff options
context:
space:
mode:
authorIrene Ruengeler <ruengeler@wireshark.org>2014-06-24 11:36:51 +0200
committerMichael Tüxen <tuexen@wireshark.org>2014-07-02 20:56:37 +0000
commitf3c5f14bc440f4f8d8c680c4834a59ef5ba606a4 (patch)
tree50a8f68717109ef299e00e176c4467eaf4832cce /ui/qt/capture_preferences_frame.cpp
parent2c9d2bea32238223634ae975cfd4e682ba1a0b2b (diff)
downloadwireshark-f3c5f14bc440f4f8d8c680c4834a59ef5ba606a4.tar.gz
Manage Interfaces
- Add dialog to manage interfaces - Add and delete pipes - Hide local interfaces Change-Id: I08323c306c2ea736f99e57c28e2fe3170a0c2216 Reviewed-on: https://code.wireshark.org/review/2613 Tested-by: Anders Broman <a.broman58@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Tüxen <tuexen@wireshark.org>
Diffstat (limited to 'ui/qt/capture_preferences_frame.cpp')
-rw-r--r--ui/qt/capture_preferences_frame.cpp27
1 files changed, 22 insertions, 5 deletions
diff --git a/ui/qt/capture_preferences_frame.cpp b/ui/qt/capture_preferences_frame.cpp
index 5aea33ff84..9c5643a5f8 100644
--- a/ui/qt/capture_preferences_frame.cpp
+++ b/ui/qt/capture_preferences_frame.cpp
@@ -23,6 +23,10 @@
#include <glib.h>
+#ifdef HAVE_LIBPCAP
+#include "ui/capture_globals.h"
+#endif
+
#include "capture_preferences_frame.h"
#include "ui_capture_preferences_frame.h"
@@ -73,11 +77,24 @@ void CapturePreferencesFrame::updateWidgets()
int err;
ui->defaultInterfaceComboBox->clear();
- if_list = capture_interface_list(&err, NULL,main_window_update);
- combo_list = build_capture_combo_list(if_list, FALSE);
- free_interface_list(if_list);
- for (combo_entry = combo_list; combo_entry != NULL && combo_entry->data != NULL; combo_entry = g_list_next(combo_entry)) {
- ui->defaultInterfaceComboBox->addItem(QString((const char *)combo_entry->data));
+ if (global_capture_opts.all_ifaces->len > 0) {
+ interface_t device;
+ for (guint i = 0; i < global_capture_opts.all_ifaces->len; i++) {
+ device = g_array_index(global_capture_opts.all_ifaces, interface_t, i);
+
+ /* Continue if capture device is hidden */
+ if (device.hidden) {
+ continue;
+ }
+ ui->defaultInterfaceComboBox->addItem(QString((const char *)device.display_name));
+ }
+ } else {
+ if_list = capture_interface_list(&err, NULL,main_window_update);
+ combo_list = build_capture_combo_list(if_list, FALSE);
+ free_interface_list(if_list);
+ for (combo_entry = combo_list; combo_entry != NULL && combo_entry->data != NULL; combo_entry = g_list_next(combo_entry)) {
+ ui->defaultInterfaceComboBox->addItem(QString((const char *)combo_entry->data));
+ }
}
if (pref_device_->stashed_val.string) {