aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/widgets/display_filter_edit.h
diff options
context:
space:
mode:
authorRoland Knall <roland.knall@br-automation.com>2017-07-05 16:56:45 +0200
committerMichael Mann <mmann78@netscape.net>2017-07-11 21:30:29 +0000
commitee699eb7200aa4470622abe4d1b8a80c461dae0c (patch)
treeff6fbc4f0769a2b5af107ee9485943836b97e64d /ui/qt/widgets/display_filter_edit.h
parent66cc2ed39ddd28fc2d8b22ce2d07783a35a9f10d (diff)
Qt: Move all utility widgets to widgets subdirectory
Move all utility widgets to the widgets subdirectory and add separate source_group for their files Correct some alphabetization in ui/qt/CMakeLists.txt noticed during compare. Change-Id: I2d664edc2b32f126438fb673ea53a5ae94cd43d1 Reviewed-on: https://code.wireshark.org/review/22531 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'ui/qt/widgets/display_filter_edit.h')
-rw-r--r--ui/qt/widgets/display_filter_edit.h100
1 files changed, 100 insertions, 0 deletions
diff --git a/ui/qt/widgets/display_filter_edit.h b/ui/qt/widgets/display_filter_edit.h
new file mode 100644
index 0000000000..a7e57107d5
--- /dev/null
+++ b/ui/qt/widgets/display_filter_edit.h
@@ -0,0 +1,100 @@
+/* display_filter_edit.h
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef DISPLAYFILTEREDIT_H
+#define DISPLAYFILTEREDIT_H
+
+#include <ui/qt/preferences_dialog.h>
+#include <ui/qt/widgets/syntax_line_edit.h>
+
+class QEvent;
+class StockIconToolButton;
+
+typedef enum {
+ DisplayFilterToApply,
+ DisplayFilterToEnter,
+ ReadFilterToApply
+} DisplayFilterEditType;
+
+class DisplayFilterEdit : public SyntaxLineEdit
+{
+ Q_OBJECT
+public:
+ explicit DisplayFilterEdit(QWidget *parent = 0, DisplayFilterEditType type = DisplayFilterToEnter);
+
+protected:
+ void paintEvent(QPaintEvent *evt);
+ void resizeEvent(QResizeEvent *);
+ void keyPressEvent(QKeyEvent *event) { completionKeyPressEvent(event); }
+ void focusInEvent(QFocusEvent *event) { completionFocusInEvent(event); }
+ void focusOutEvent(QFocusEvent *event);
+
+public slots:
+ bool checkFilter();
+ void updateBookmarkMenu();
+ void applyDisplayFilter();
+ void displayFilterSuccess(bool success);
+
+private slots:
+ void checkFilter(const QString &filter_text);
+ void clearFilter();
+ void changeEvent(QEvent* event);
+
+ void saveFilter();
+ void removeFilter();
+ void showFilters();
+ void showExpressionPrefs();
+ void applyOrPrepareFilter();
+
+private:
+ DisplayFilterEditType type_;
+ QString placeholder_text_;
+ QAction *save_action_;
+ QAction *remove_action_;
+ StockIconToolButton *bookmark_button_;
+ StockIconToolButton *clear_button_;
+ StockIconToolButton *apply_button_;
+
+ void setDefaultPlaceholderText();
+ void buildCompletionList(const QString& field_word);
+
+signals:
+ void pushFilterSyntaxStatus(const QString&);
+ void popFilterSyntaxStatus();
+ void pushFilterSyntaxWarning(const QString&);
+ void filterPackets(QString new_filter, bool force);
+ void showPreferencesDialog(PreferencesDialog::PreferencesPane start_pane);
+};
+
+#endif // DISPLAYFILTEREDIT_H
+
+/*
+ * Editor modelines
+ *
+ * Local Variables:
+ * c-basic-offset: 4
+ * tab-width: 8
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * ex: set shiftwidth=4 tabstop=8 expandtab:
+ * :indentSize=4:tabSize=8:noTabs=true:
+ */