3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
7 * SPDX-License-Identifier: GPL-2.0-or-later
11 #ifndef CAPTURE_OPTIONS_DIALOG_H
12 #define CAPTURE_OPTIONS_DIALOG_H
18 #include <ui/qt/models/interface_tree_model.h>
20 #include "geometry_state_dialog.h"
21 #include <QPushButton>
22 #include <QTreeWidget>
24 typedef struct if_stat_cache_s if_stat_cache_t
;
27 class CaptureOptionsDialog
;
30 #include <QStyledItemDelegate>
32 class InterfaceTreeDelegate
: public QStyledItemDelegate
39 InterfaceTreeDelegate(QObject
*parent
= 0);
40 ~InterfaceTreeDelegate();
42 QWidget
*createEditor(QWidget
*parent
, const QStyleOptionViewItem
&option
, const QModelIndex
&idx
) const;
43 void setTree(QTreeWidget
* tree
) { tree_
= tree
; }
44 bool eventFilter(QObject
*object
, QEvent
*event
);
47 void filterChanged(const QString filter
);
50 void linkTypeChanged(const QString selected_link_type
);
51 void snapshotLengthChanged(int value
);
52 void bufferSizeChanged(int value
);
55 class CaptureOptionsDialog
: public GeometryStateDialog
60 explicit CaptureOptionsDialog(QWidget
*parent
= 0);
61 ~CaptureOptionsDialog();
63 void updateInterfaces();
66 void interfaceSelected();
69 virtual void showEvent(QShowEvent
*);
72 void on_capturePromModeCheckBox_toggled(bool checked
);
73 void on_captureMonitorModeCheckBox_toggled(bool checked
);
74 void on_gbStopCaptureAuto_toggled(bool checked
);
75 void on_cbUpdatePacketsRT_toggled(bool checked
);
76 void on_cbAutoScroll_toggled(bool checked
);
77 void on_gbNewFileAuto_toggled(bool checked
);
78 void on_cbExtraCaptureInfo_toggled(bool checked
);
79 void on_cbResolveMacAddresses_toggled(bool checked
);
80 void on_compileBPF_clicked();
81 void on_manageButton_clicked();
82 void on_cbResolveNetworkNames_toggled(bool checked
);
83 void on_cbResolveTransportNames_toggled(bool checked
);
84 void on_buttonBox_accepted();
85 void on_buttonBox_rejected();
86 void on_buttonBox_helpRequested();
89 void updateStatistics(void);
90 void refreshInterfaceList();
91 void updateLocalInterfaces();
92 void browseButtonClicked();
93 void interfaceItemChanged(QTreeWidgetItem
*item
, int column
);
94 void itemClicked(QTreeWidgetItem
*item
, int column
);
95 void itemDoubleClicked(QTreeWidgetItem
*item
, int column
);
96 void changeEvent(QEvent
* event
);
97 void tempDirBrowseButtonClicked();
98 void MBComboBoxIndexChanged(int index
);
99 void stopMBComboBoxIndexChanged(int index
);
104 void setSelectedInterfaces();
105 void setFilterValid(bool valid
, const QString capture_filter
);
106 void interfacesChanged();
108 void interfaceListChanged();
109 void captureFilterTextEdited(const QString
& text
);
110 void showExtcapOptions(QString
&device_name
, bool startCaptureOnClose
);
113 Ui::CaptureOptionsDialog
*ui
;
115 if_stat_cache_t
*stat_cache_
;
117 InterfaceTreeDelegate interface_item_delegate_
;
119 interface_t
*getDeviceByName(const QString device_name
);
120 bool saveOptionsToPreferences();
121 void updateSelectedFilter();
123 void updateGlobalDeviceSelections();
124 void updateFromGlobalDeviceSelections();
127 #endif /* HAVE_LIBPCAP */
129 #endif // CAPTURE_OPTIONS_DIALOG_H