Wireshark 5.1.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
capture_options_dialog.h
Go to the documentation of this file.
1
9
10
11#pragma once
12
13#include <config.h>
14
15#ifdef HAVE_LIBPCAP
16
20
22#include <QPushButton>
23#include <QTreeView>
24
25namespace Ui {
26class CaptureOptionsDialog;
27}
28
29#include <QStyledItemDelegate>
30
41class InterfaceTreeDelegate : public QStyledItemDelegate
42{
43 Q_OBJECT
44public:
45 InterfaceTreeDelegate(InterfaceTreeCacheModel *cache_model, InterfaceSortFilterModel *proxy_model, QObject *parent = nullptr);
46
47 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &idx) const override;
48 void setEditorData(QWidget *editor, const QModelIndex &idx) const override;
49 void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &idx) const override;
50 bool eventFilter(QObject *object, QEvent *event) override;
51
52signals:
53 void filterChanged(const QString filter);
54
55private:
56 InterfaceTreeCacheModel *cache_model_;
57 InterfaceSortFilterModel *proxy_model_;
58};
59
60class CaptureOptionsDialog : public GeometryStateDialog
61{
62 Q_OBJECT
63
64public:
65 explicit CaptureOptionsDialog(QWidget *parent = 0);
66 ~CaptureOptionsDialog();
67
68 void updateInterfaces(capture_options* capture_opts);
69
70public slots:
71 void interfaceSelected();
72
73protected:
74 virtual void showEvent(QShowEvent *) override;
75
76private slots:
78 void connectInterfaceListManager();
79 void on_capturePromModeCheckBox_toggled(bool checked);
80 void on_captureMonitorModeCheckBox_toggled(bool checked);
81 void on_gbStopCaptureAuto_toggled(bool checked);
82 void on_cbUpdatePacketsRT_toggled(bool checked);
83 void on_cbAutoScroll_toggled(bool checked);
84 void on_gbNewFileAuto_toggled(bool checked);
85 void on_cbExtraCaptureInfo_toggled(bool checked);
86 void on_cbResolveMacAddresses_toggled(bool checked);
87 void on_compileBPF_clicked();
88 void on_manageButton_clicked();
89 void on_newToolButton_clicked();
90 void on_deleteToolButton_clicked();
91 void on_cbResolveNetworkNames_toggled(bool checked);
92 void on_cbResolveTransportNames_toggled(bool checked);
93 void on_buttonBox_accepted();
94 void on_buttonBox_rejected();
95 void on_buttonBox_helpRequested();
99 void updateProcessInfoWidgets();
100 void filterEdited();
101 void updateWidgets();
102 void refreshInterfaceList();
103 void browseButtonClicked();
104 void itemClicked(const QModelIndex &index);
105 void itemDoubleClicked(const QModelIndex &index);
106 void changeEvent(QEvent* event) override;
107 void tempDirBrowseButtonClicked();
108 void MBComboBoxIndexChanged(int index);
109 void stopMBComboBoxIndexChanged(int index);
110
111signals:
112 void startCapture();
113 void stopCapture();
114 void setSelectedInterfaces();
115 void setFilterValid(bool valid, const QString capture_filter);
116 void interfacesChanged();
117 void captureFilterTextEdited(const QString & text);
118 void showExtcapOptions(QString &device_name, bool startCaptureOnClose);
119
120private:
121 Ui::CaptureOptionsDialog *ui;
122
123 InterfaceTreeCacheModel *cache_model_;
124 InterfaceSortFilterModel *proxy_model_;
125 InterfaceTreeModel *source_model_;
126 InterfaceTreeDelegate *interface_item_delegate_;
127
128 /* The temporary directory the dialog opened with, which may have come
129 * from --temp-dir rather than from the preferences. */
130 QString initial_temp_dir_;
131
132 /* Proxy model column indices. Fixed for the dialog's lifetime. */
133 int col_extcap_;
134 int col_interface_;
135 int col_traffic_;
136 int col_link_;
137 int col_pmode_;
138 int col_snaplen_;
139 int col_buffer_;
140 int col_monitor_;
141 int col_optimize_;
142 int col_filter_;
143
144 bool saveOptionsToPreferences(capture_options* capture_opts);
145 void updateSelectedFilter();
146
147 void updateGlobalDeviceSelections();
148 void updateFromGlobalDeviceSelections();
149};
150
151#endif /* HAVE_LIBPCAP */
struct capture_options_tag capture_options
A dialog that remembers its geometry and splitter state.
Definition geometry_state_dialog.h:20