From 680d1df7a04fd7a72707ef319783984c5c148783 Mon Sep 17 00:00:00 2001 From: Roland Knall Date: Mon, 26 Jun 2017 13:02:07 +0200 Subject: Fix Filter Tooltip button and frame MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make the frame into a two-row frame to better accomodate the comments field, and reinstate the correct action for the buttons Change-Id: I171e4bc3c7f195b7179cd6b1c2ab4ab42ede9c04 Reviewed-on: https://code.wireshark.org/review/22405 Petri-Dish: Roland Knall Reviewed-by: Stig Bjørlykke Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall --- ui/qt/filter_expression_frame.cpp | 6 +- ui/qt/filter_expression_frame.h | 2 +- ui/qt/filter_expression_frame.ui | 282 ++++++++++++++----------- ui/qt/filter_expressions_preferences_frame.cpp | 3 - ui/qt/main_window_slots.cpp | 2 +- 5 files changed, 162 insertions(+), 133 deletions(-) (limited to 'ui/qt') diff --git a/ui/qt/filter_expression_frame.cpp b/ui/qt/filter_expression_frame.cpp index b67eba6adf..72e2ecf282 100644 --- a/ui/qt/filter_expression_frame.cpp +++ b/ui/qt/filter_expression_frame.cpp @@ -56,7 +56,6 @@ void FilterExpressionFrame::addExpression(const QString filter_text) return; } - ui->labelLineEdit->setText(tr("Apply this filter")); ui->displayFilterLineEdit->setText(filter_text); } @@ -79,7 +78,7 @@ void FilterExpressionFrame::updateWidgets() ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(ok_enable); } -void FilterExpressionFrame::on_filterExpressionPreferencesToolButton_clicked() +void FilterExpressionFrame::on_filterExpressionPreferencesPushButton_clicked() { on_buttonBox_rejected(); emit showPreferencesDialog(PreferencesDialog::ppFilterExpressions); @@ -97,6 +96,9 @@ void FilterExpressionFrame::on_buttonBox_accepted() QByteArray expr_ba = ui->displayFilterLineEdit->text().toUtf8(); QByteArray comment_ba = ui->commentLineEdit->text().toUtf8(); + if ( ui->labelLineEdit->text().length() == 0 ) + return; + filter_expression_new(label_ba.constData(), expr_ba.constData(), comment_ba.constData(), TRUE); on_buttonBox_rejected(); diff --git a/ui/qt/filter_expression_frame.h b/ui/qt/filter_expression_frame.h index ad3119d23b..2d65f9a596 100644 --- a/ui/qt/filter_expression_frame.h +++ b/ui/qt/filter_expression_frame.h @@ -51,7 +51,7 @@ private: private slots: void updateWidgets(); - void on_filterExpressionPreferencesToolButton_clicked(); + void on_filterExpressionPreferencesPushButton_clicked(); void on_labelLineEdit_textChanged(const QString); void on_buttonBox_accepted(); void on_buttonBox_rejected(); diff --git a/ui/qt/filter_expression_frame.ui b/ui/qt/filter_expression_frame.ui index df9691bfd9..b0d3e401f9 100644 --- a/ui/qt/filter_expression_frame.ui +++ b/ui/qt/filter_expression_frame.ui @@ -6,10 +6,22 @@ 0 0 - 745 - 34 + 796 + 82 + + + 0 + 0 + + + + + 16777215 + 82 + + Frame @@ -19,140 +31,158 @@ QFrame::Plain - - - 0 - - - 0 - + - - - Filter Expression Preferences… - - - - - - - Qt::Horizontal - - - - 88 - 5 - - - - - - - - Label: - - - - - - - - 1 - 0 - - - - - 80 - 0 - - - - - - - - Qt::Horizontal - - - - 20 - 5 - - - - - - - - Filter: - - + + + + + Filter Buttons Preferences… + + + + + + + Qt::Vertical + + + + 20 + 5 + + + + + - - - - 1 - 0 - - - - - 80 - 0 - - - - - - - + + + + + + + + + Label: + + + + + + + + 1 + 0 + + + + + 80 + 0 + + + + Enter a description for the filter button + + + + + + + + + + + Filter: + + + + + + + + 1 + 0 + + + + + 80 + 0 + + + + Enter a filter expression to be applied + + + + + + + + + + + + Comment: - - - - - - + + + + + + - 1 - 0 + 1 + 0 - - + + - 80 - 0 + 80 + 0 - - - - - - - Qt::Horizontal - - - - 20 - 5 - - - + + + Enter a comment for the filter button + + + + + + - - - - 16777215 - 27 - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - + + + + + + 0 + 0 + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + Qt::Vertical + + + + 20 + 5 + + + + + diff --git a/ui/qt/filter_expressions_preferences_frame.cpp b/ui/qt/filter_expressions_preferences_frame.cpp index 1b47225797..9de6312a4d 100644 --- a/ui/qt/filter_expressions_preferences_frame.cpp +++ b/ui/qt/filter_expressions_preferences_frame.cpp @@ -110,9 +110,6 @@ void FilterExpressionsPreferencesFrame::setUat(epan_uat *uat) this, SLOT(modelRowsRemoved())); connect(ui->uatTreeView, SIGNAL(currentItemChanged(QModelIndex,QModelIndex)), this, SLOT(viewCurrentChanged(QModelIndex,QModelIndex))); - - connect(this, SIGNAL(rejected()), this, SLOT(rejectChanges())); - connect(this, SIGNAL(accepted()), this, SLOT(acceptChanges())); } setWindowTitle(title); diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp index 02fbf3a65f..a6abdb4956 100644 --- a/ui/qt/main_window_slots.cpp +++ b/ui/qt/main_window_slots.cpp @@ -921,7 +921,7 @@ gboolean MainWindow::filter_expression_add_action(const void *key _U_, void *val dfb_action->setData(fe->expression); dfb_action->setProperty(dfe_property_, true); data->window->filter_expression_toolbar_->addAction(dfb_action); - connect(dfb_action, SIGNAL(data->window->triggered()), data->window, SLOT(data->window->displayFilterButtonClicked())); + connect(dfb_action, SIGNAL(triggered()), data->window, SLOT(displayFilterButtonClicked())); data->actions_added = true; return FALSE; } -- cgit v1.2.1