diff options
author | Michael Mann <mmann78@netscape.net> | 2017-06-25 11:48:46 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-06-26 02:48:58 +0000 |
commit | 5c60b517a70cab8138312ec39946f18f3ed75f58 (patch) | |
tree | ed0882fa1aca052246d207b3dcc81b9c5839f7aa /ui/qt | |
parent | 1b7f5d9f798634770656a82aaa2df30f7f01a9b0 (diff) | |
download | wireshark-5c60b517a70cab8138312ec39946f18f3ed75f58.tar.gz |
Add support for comments for a display filter button
Add a field to the display filter button UAT to allow comments
to be displayed as part of the tooltip to the diplay filter
button
Bug: 13814
Change-Id: I74459e4102856258d31d6429e2fd924a9f798cd5
Reviewed-on: https://code.wireshark.org/review/22390
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'ui/qt')
-rw-r--r-- | ui/qt/filter_expression_frame.cpp | 3 | ||||
-rw-r--r-- | ui/qt/filter_expression_frame.ui | 25 | ||||
-rw-r--r-- | ui/qt/main_window_slots.cpp | 10 |
3 files changed, 35 insertions, 3 deletions
diff --git a/ui/qt/filter_expression_frame.cpp b/ui/qt/filter_expression_frame.cpp index 15fae7eeeb..b67eba6adf 100644 --- a/ui/qt/filter_expression_frame.cpp +++ b/ui/qt/filter_expression_frame.cpp @@ -95,8 +95,9 @@ void FilterExpressionFrame::on_buttonBox_accepted() gchar* err = NULL; QByteArray label_ba = ui->labelLineEdit->text().toUtf8(); QByteArray expr_ba = ui->displayFilterLineEdit->text().toUtf8(); + QByteArray comment_ba = ui->commentLineEdit->text().toUtf8(); - filter_expression_new(label_ba.constData(), expr_ba.constData(), TRUE); + filter_expression_new(label_ba.constData(), expr_ba.constData(), comment_ba.constData(), TRUE); on_buttonBox_rejected(); emit filterExpressionsChanged(); diff --git a/ui/qt/filter_expression_frame.ui b/ui/qt/filter_expression_frame.ui index a20b0ddddc..df9691bfd9 100644 --- a/ui/qt/filter_expression_frame.ui +++ b/ui/qt/filter_expression_frame.ui @@ -105,7 +105,30 @@ </property> </widget> </item> - <item> + <item> + <widget class="QLabel" name="commentLabel"> + <property name="text"> + <string>Comment:</string> + </property> + </widget> + </item> + <item> + <widget class="SyntaxLineEdit" name="commentLineEdit"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>1</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>0</height> + </size> + </property> + </widget> + </item> + <item> <spacer name="horizontalSpacer"> <property name="orientation"> <enum>Qt::Horizontal</enum> diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp index 8f675926d9..1b153ce19a 100644 --- a/ui/qt/main_window_slots.cpp +++ b/ui/qt/main_window_slots.cpp @@ -909,7 +909,15 @@ gboolean MainWindow::filter_expression_add_action(const void *key _U_, void *val return FALSE; QAction *dfb_action = new QAction(fe->label, data->window->filter_expression_toolbar_); - dfb_action->setToolTip(fe->expression); + if (strlen(fe->comment) > 0) + { + QString tooltip = QString("%1, %2").arg(fe->expression).arg(fe->comment); + dfb_action->setToolTip(tooltip); + } + else + { + dfb_action->setToolTip(fe->expression); + } dfb_action->setData(fe->expression); dfb_action->setProperty(dfe_property_, true); data->window->filter_expression_toolbar_->addAction(dfb_action); |