Wireshark 5.1.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
distribution_dialog.h
Go to the documentation of this file.
1
9
10#ifndef DISTRIBUTIONDIALOG_H
11#define DISTRIBUTIONDIALOG_H
12
13#include <config.h>
14
15#include <epan/stat_tap_ui.h>
16
17#include "filter_action.h"
18#include "wireshark_dialog.h"
20
22class QCPAbstractPlottable;
23class QCPBars;
25class QLabel;
26class QPoint;
27class QPushButton;
28class QSortFilterProxyModel;
29
30namespace Ui {
31class DistributionDialog;
32}
33
43{
44 Q_OBJECT
45
46public:
54 DistributionDialog(QWidget &parent, CaptureFile &cf, const QString &fields);
55
60
61signals:
69
77 void showIOGraph(const QString &displayFilter, const QVector<QString> &filters,
78 const QVector<QString> &names);
79
80protected:
86 void updateWidgets() override;
87
91 void beginRetapPackets() override;
92
97 void endRetapPackets() override;
98
104 bool eventFilter(QObject *obj, QEvent *event) override;
105
106private:
108 enum class FlavorText {
109 SummaryOneField,
110 SummaryAllFields,
111 MultipleObservations,
112 EmptyHint,
113 ApplyToolTip
114 };
115
121 static QString flavorText(FlavorText id);
122
129 QStringList summaryTexts() const;
130
136 StatTableExporter::Table table(bool selected_only);
137
143 QList<int> sourceRows(bool selected_only) const;
144
148 void updatePercentDelegate();
149
155 void updateChart();
156
162 void chartBarClicked(QCPAbstractPlottable *plottable, int dataIndex);
163
168 static void tapReset(void *tapdata);
169
181 static tap_packet_status tapPacket(void *tapdata, struct _packet_info *pinfo,
182 struct epan_dissect *edt, const void *data,
183 tap_flags_t flags);
184
189 static void tapDraw(void *tapdata);
190
191 Ui::DistributionDialog *ui;
192 DistributionModel *model_;
193 QSortFilterProxyModel *proxy_;
194 PercentBarDelegate *percent_delegate_;
195 int percent_column_;
196 QLabel *empty_hint_label_;
197 QPushButton *copy_button_;
198 QPushButton *save_button_;
199 QPushButton *io_graph_button_;
200 QString applied_limit_;
201 QCPBars *chart_bars_;
202 QList<int> chart_rows_;
203 bool chart_sized_;
205 bool columns_sized_;
206
212 void sizeColumns();
213
215 static constexpr int chartRows = 10;
216
217private slots:
222 void checkFields();
223
228 void apply();
229
233 void updateSummary();
234
239 void showContextMenu(const QPoint &pos);
240
244 void copyTable();
245
249 void on_actionCopy_triggered();
250
254 void on_actionSaveAs_triggered();
255
260 void on_actionShowInIOGraph_triggered();
261
266 void on_resolveCheckBox_toggled(bool checked);
267
272 void on_chartCheckBox_toggled(bool checked);
273
277 void on_buttonBox_helpRequested();
278};
279
280#endif // DISTRIBUTIONDIALOG_H
Manages a capture file and its associated state and operations.
Definition capture_file.h:27
void showIOGraph(const QString &displayFilter, const QVector< QString > &filters, const QVector< QString > &names)
Emitted to open an I/O Graph with one graph per selected row.
~DistributionDialog()
Destroys the dialog.
Definition distribution_dialog.cpp:145
DistributionDialog(QWidget &parent, CaptureFile &cf, const QString &fields)
Constructs the Distribution dialog.
Definition distribution_dialog.cpp:42
void endRetapPackets() override
Publishes the final counts of a retap, also when no packet matched and therefore no draw happened.
Definition distribution_dialog.cpp:277
bool eventFilter(QObject *obj, QEvent *event) override
Relayouts the chart when the plot is resized.
Definition distribution_dialog.cpp:304
void filterAction(QString filter, FilterAction::Action action, FilterAction::ActionType type)
Emitted when a filter action of the context menu is triggered.
void updateWidgets() override
Updates the enabled state of the inputs, buttons and actions from the field list, the display filter,...
Definition distribution_dialog.cpp:246
void beginRetapPackets() override
Disables the inputs while a retap runs.
Definition distribution_dialog.cpp:271
Table model of the distinct value combinations of the counted fields.
Definition distribution_model.h:61
Action
Defines an action to be taken with a filter.
Definition filter_action.h:30
ActionType
Defines how the new filter should be combined with the existing one.
Definition filter_action.h:43
Delegate for drawing a percentage bar in an item view.
Definition percent_bar_delegate.h:40
WiresharkDialog(QWidget &parent, CaptureFile &capture_file)
Constructs a new WiresharkDialog object.
Definition wireshark_dialog.cpp:30
Represents the metadata and indexing information for a single captured frame.
Definition packet_info.h:43
A statistics table: title, headers and one list of cell values per row.
Definition stat_table_exporter.h:43
Holds all state for the dissection of a single byte array, including session, buffer,...
Definition epan_dissect.h:28
tap_packet_status
Definition tap.h:22