QT: Enable filtering entries in 'Export Objects'

Change-Id: I5e9025545f9127d1c5c6200844f9b917af975998
Reviewed-on: https://code.wireshark.org/review/28844
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Moshe Kaplan 2018-07-24 18:09:20 -04:00 committed by Michael Mann
parent 895ad30b5a
commit 74903893d8
4 changed files with 29 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 KiB

After

Width:  |  Height:  |  Size: 151 KiB

View File

@ -788,11 +788,13 @@ Columns:
the filename differently. For example, HTTP uses the
final part of the URI and IMF uses the subject of the email.
Buttons:
Inputs:
* _Text Filter:_ Only displays objects containing the specified text string.
* _Help:_ Opens the “Export Objects” section in the users guide.
* _Save All:_ Saves all objects in the list using the filename from the
* _Save All:_ Saves all objects (including those not displayed) using the filename from the
filename column. You will be asked what directory / folder to save them in.
* _Close:_ Closes the “Export Objects” dialog.

View File

@ -37,6 +37,10 @@ ExportObjectDialog::ExportObjectDialog(QWidget &parent, CaptureFile &cf, registe
proxyModel_.setSourceModel(&model_);
eo_ui_->objectTree->setModel(&proxyModel_);
proxyModel_.setFilterFixedString("");
proxyModel_.setFilterCaseSensitivity(Qt::CaseInsensitive);
proxyModel_.setFilterKeyColumn(-1);
#if defined(Q_OS_MAC)
eo_ui_->progressLabel->setAttribute(Qt::WA_MacSmallSize, true);
eo_ui_->progressBar->setAttribute(Qt::WA_MacSmallSize, true);
@ -45,6 +49,9 @@ ExportObjectDialog::ExportObjectDialog(QWidget &parent, CaptureFile &cf, registe
connect(&model_, SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SLOT(modelDataChanged(QModelIndex)));
connect(&model_, SIGNAL(modelReset()), this, SLOT(modelRowsReset()));
connect(eo_ui_->filterLine, &QLineEdit::textChanged,
&proxyModel_, &QSortFilterProxyModel::setFilterFixedString);
save_bt_ = eo_ui_->buttonBox->button(QDialogButtonBox::Save);
save_all_bt_ = eo_ui_->buttonBox->button(QDialogButtonBox::SaveAll);

View File

@ -96,6 +96,24 @@
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="filterLayout" stretch="0,0,0">
<item alignment="Qt::AlignLeft">
<widget class="QLabel" name="label">
<property name="text">
<string>Text Filter:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="filterLine">
<property name="toolTip">
<string>Only display entries containing this string</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">