summaryrefslogtreecommitdiffstats
path: root/ui/qt/dissector_tables_dialog.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:34:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:34:10 +0000
commite4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc (patch)
tree68cb5ef9081156392f1dd62a00c6ccc1451b93df /ui/qt/dissector_tables_dialog.cpp
parentInitial commit. (diff)
downloadwireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.tar.xz
wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.zip
Adding upstream version 4.2.2.upstream/4.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ui/qt/dissector_tables_dialog.cpp')
-rw-r--r--ui/qt/dissector_tables_dialog.cpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/ui/qt/dissector_tables_dialog.cpp b/ui/qt/dissector_tables_dialog.cpp
new file mode 100644
index 0000000..51e5cf7
--- /dev/null
+++ b/ui/qt/dissector_tables_dialog.cpp
@@ -0,0 +1,54 @@
+/* dissector_tables_dialog.cpp
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+ #include "config.h"
+
+#include <ui/qt/dissector_tables_dialog.h>
+#include <ui_dissector_tables_dialog.h>
+
+#include "main_application.h"
+
+DissectorTablesDialog::DissectorTablesDialog(QWidget *parent) :
+ GeometryStateDialog(parent),
+ ui(new Ui::DissectorTablesDialog)
+{
+ ui->setupUi(this);
+
+ if (parent)
+ loadGeometry(parent->width() * 3 / 4, parent->height() * 3 / 4);
+
+ setAttribute(Qt::WA_DeleteOnClose, true);
+ setWindowTitle(mainApp->windowTitleString(tr("Dissector Tables")));
+
+ proxyModel_ = new DissectorTablesProxyModel(this);
+ proxyModel_->setSourceModel(new DissectorTablesModel(this));
+ //it's recommended to sort after list is populated
+ proxyModel_->sort(DissectorTablesModel::colTableName);
+
+ ui->tableTree->setModel(proxyModel_);
+
+ //expand the "type" tables
+ ui->tableTree->expandToDepth(0);
+ ui->tableTree->resizeColumnToContents(DissectorTablesModel::colTableName);
+
+ ui->txtSearchLine->setFocus();
+}
+
+DissectorTablesDialog::~DissectorTablesDialog()
+{
+ delete ui;
+}
+
+void DissectorTablesDialog::on_txtSearchLine_textChanged(const QString &search_re)
+{
+ proxyModel_->setFilter(search_re);
+ /* If items are filtered out, then filtered back in, the tree remains collapsed
+ Force an expansion */
+ ui->tableTree->expandToDepth(0);
+}