aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/widgets/capture_filter_combo.h
blob: 6e08f4b0fb8d585640ad58fde4048f584e3c96cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/** @file
 *
 * Wireshark - Network traffic analyzer
 * By Gerald Combs <gerald@wireshark.org>
 * Copyright 1998 Gerald Combs
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef CAPTURE_FILTER_COMBO_H
#define CAPTURE_FILTER_COMBO_H

#include <ui/qt/widgets/capture_filter_edit.h>

#include <QComboBox>
#include <QList>

class CaptureFilterCombo : public QComboBox
{
    Q_OBJECT
public:
    explicit CaptureFilterCombo(QWidget *parent = 0, bool plain = false);
    bool addRecentCapture(const char *filter);
    void writeRecent(FILE *rf);
    void setConflict(bool conflict = false) { cf_edit_->setConflict(conflict); }

signals:
    void interfacesChanged();
    void captureFilterSyntaxChanged(bool valid);
    void startCapture();

protected:
    virtual bool event(QEvent *event);

private:
    void updateStyleSheet();
    CaptureFilterEdit *cf_edit_;

private slots:
    void saveAndRebuildFilterList();
    void rebuildFilterList();
};

#endif // CAPTURE_FILTER_COMBO_H