summaryrefslogtreecommitdiff
path: root/ui/qt/filter_expression_frame.cpp
diff options
context:
space:
mode:
authorRoland Knall <roland.knall@br-automation.com>2015-12-01 15:41:44 +0100
committerGerald Combs <gerald@wireshark.org>2015-12-01 23:33:57 +0000
commitb932ee8f136ffeb3e78ce0f03e08df81fd18d9d4 (patch)
tree2826b2e104b2894ae3a47c840cc1f3efce2d5420 /ui/qt/filter_expression_frame.cpp
parent96bf82ced0b58c7a4c2a6c300efeebe4f05c0ff4 (diff)
downloadwireshark-b932ee8f136ffeb3e78ce0f03e08df81fd18d9d4.tar.gz
Qt Frames: Use ButtonBox instead of buttons
In these frames the Ok and Close buttons are implemented as standalone buttons. This leads to the scenario, that they break plattform-ui preferences on the one hand, as well as not being the same order throughout. This patch replaces all Ok/Close buttons with the Qt button box, which handles the plattform-ui internally, and additionally allways enforces the same order. Change-Id: If62b90016b222322f60c0962da04c8277589a57f Reviewed-on: https://code.wireshark.org/review/12335 Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt/filter_expression_frame.cpp')
-rw-r--r--ui/qt/filter_expression_frame.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/ui/qt/filter_expression_frame.cpp b/ui/qt/filter_expression_frame.cpp
index ce99fe0fcd..c876a85c66 100644
--- a/ui/qt/filter_expression_frame.cpp
+++ b/ui/qt/filter_expression_frame.cpp
@@ -25,6 +25,8 @@
#include <epan/filter_expressions.h>
#include <ui/preference_utils.h>
+#include <QPushButton>
+
// To do:
// - Add the ability to edit current expressions.
@@ -43,7 +45,7 @@ FilterExpressionFrame::~FilterExpressionFrame()
void FilterExpressionFrame::addExpression(const QString filter_text)
{
if (isVisible()) {
- on_cancelButton_clicked();
+ on_buttonBox_rejected();
return;
}
@@ -67,12 +69,12 @@ void FilterExpressionFrame::updateWidgets()
ok_enable = true;
}
- ui->okButton->setEnabled(ok_enable);
+ ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(ok_enable);
}
void FilterExpressionFrame::on_filterExpressionPreferencesToolButton_clicked()
{
- on_cancelButton_clicked();
+ on_buttonBox_rejected();
emit showPreferencesDialog(PreferencesDialog::ppFilterExpressions);
}
@@ -81,19 +83,19 @@ void FilterExpressionFrame::on_labelLineEdit_textChanged(const QString)
updateWidgets();
}
-void FilterExpressionFrame::on_okButton_clicked()
+void FilterExpressionFrame::on_buttonBox_accepted()
{
QByteArray label_ba = ui->labelLineEdit->text().toUtf8();
QByteArray expr_ba = ui->displayFilterLineEdit->text().toUtf8();
filter_expression_new(label_ba.constData(), expr_ba.constData(), TRUE);
- on_cancelButton_clicked();
+ on_buttonBox_rejected();
emit filterExpressionsChanged();
prefs_main_write();
}
-void FilterExpressionFrame::on_cancelButton_clicked()
+void FilterExpressionFrame::on_buttonBox_rejected()
{
ui->labelLineEdit->clear();
ui->displayFilterLineEdit->clear();