aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/widgets
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2017-12-19 08:32:23 -0500
committerMichael Mann <mmann78@netscape.net>2017-12-19 21:00:24 +0000
commit8521dbbe67ddc7947e6e16b69c7fb4430abbc938 (patch)
tree87026fc767582cb035e6eaa9950956320080a1bc /ui/qt/widgets
parentc781cc38fd9fd76ab4b46940fd7c3f250c7bb591 (diff)
Convert Dissector Tables dialog to use model
Now with searchability! Change-Id: I6ab4e89d4080d3599d522807d39de80cc46e7360 Reviewed-on: https://code.wireshark.org/review/24898 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'ui/qt/widgets')
-rw-r--r--ui/qt/widgets/dissector_tables_view.cpp38
-rw-r--r--ui/qt/widgets/dissector_tables_view.h39
2 files changed, 77 insertions, 0 deletions
diff --git a/ui/qt/widgets/dissector_tables_view.cpp b/ui/qt/widgets/dissector_tables_view.cpp
new file mode 100644
index 0000000000..c3b383b0f0
--- /dev/null
+++ b/ui/qt/widgets/dissector_tables_view.cpp
@@ -0,0 +1,38 @@
+/* dissector_tables_view.cpp
+ * Tree view of Dissector Table data.
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include "dissector_tables_view.h"
+#include <ui/qt/models/dissector_tables_model.h>
+
+DissectorTablesTreeView::DissectorTablesTreeView(QWidget *parent) : QTreeView(parent)
+{
+}
+
+void DissectorTablesTreeView::currentChanged(const QModelIndex &current, const QModelIndex &previous)
+{
+ if (current.isValid())
+ {
+ ((DissectorTablesProxyModel*)model())->adjustHeader(current);
+ }
+
+ QTreeView::currentChanged(current, previous);
+}
+
+/* * 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:
+ */
diff --git a/ui/qt/widgets/dissector_tables_view.h b/ui/qt/widgets/dissector_tables_view.h
new file mode 100644
index 0000000000..446268a0c2
--- /dev/null
+++ b/ui/qt/widgets/dissector_tables_view.h
@@ -0,0 +1,39 @@
+/* dissector_tables_view.h
+ * Tree view of Dissector Table data.
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef DISSECTOR_TABLES_VIEW_H
+#define DISSECTOR_TABLES_VIEW_H
+
+#include <config.h>
+#include <QTreeView>
+
+class DissectorTablesTreeView : public QTreeView
+{
+ Q_OBJECT
+public:
+ DissectorTablesTreeView(QWidget *parent = 0);
+
+protected slots:
+ void currentChanged(const QModelIndex &current, const QModelIndex &previous);
+};
+#endif // DISSECTOR_TABLES_VIEW_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:
+ */