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
10 #ifndef COLORING_RULES_DIALOG_H
11 #define COLORING_RULES_DIALOG_H
13 #include "geometry_state_dialog.h"
14 #include "filter_action.h"
16 #include <ui/qt/models/coloring_rules_model.h>
17 #include <ui/qt/models/coloring_rules_delegate.h>
21 class QAbstractButton
;
24 class ColoringRulesDialog
;
27 class ColoringRulesDialog
: public GeometryStateDialog
32 explicit ColoringRulesDialog(QWidget
*parent
= 0, QString add_filter
= QString());
33 ~ColoringRulesDialog();
36 void filterAction(QString filter
, FilterAction::Action action
, FilterAction::ActionType type
);
39 void showEvent(QShowEvent
*);
42 void copyFromProfile(QString fileName
);
43 void colorRuleSelectionChanged(const QItemSelection
&selected
, const QItemSelection
&deselected
);
44 void colorChanged(bool foreground
, const QColor
&cc
);
45 void on_fGPushButton_clicked();
46 void on_bGPushButton_clicked();
47 void on_displayFilterPushButton_clicked();
48 void on_newToolButton_clicked();
49 void on_deleteToolButton_clicked();
50 void on_copyToolButton_clicked();
51 void on_clearToolButton_clicked();
52 void on_buttonBox_clicked(QAbstractButton
*button
);
53 void on_buttonBox_accepted();
54 void on_buttonBox_helpRequested();
55 void rowCountChanged();
56 void invalidField(const QModelIndex
&index
, const QString
& errMessage
);
57 void validField(const QModelIndex
&index
);
58 void treeItemClicked(const QModelIndex
&index
);
61 Ui::ColoringRulesDialog
*ui
;
62 QPushButton
*import_button_
;
63 QPushButton
*export_button_
;
64 ColoringRulesModel colorRuleModel_
;
65 ColoringRulesDelegate colorRuleDelegate_
;
67 QMap
<QModelIndex
, QString
> errors_
;
69 void checkUnknownColorfilters();
70 void setColorButtons(QModelIndex
&index
);
71 void updateHint(QModelIndex idx
= QModelIndex());
73 void addRule(bool copy_from_current
= false);
74 void changeColor(bool foreground
= true);
76 bool isValidFilter(QString filter
, QString
*error
);
79 #endif // COLORING_RULES_DIALOG_H