aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt
diff options
context:
space:
mode:
Diffstat (limited to 'ui/qt')
-rw-r--r--ui/qt/coloring_rules_dialog.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/ui/qt/coloring_rules_dialog.cpp b/ui/qt/coloring_rules_dialog.cpp
index 671a9c075d..fa6242f8e5 100644
--- a/ui/qt/coloring_rules_dialog.cpp
+++ b/ui/qt/coloring_rules_dialog.cpp
@@ -175,8 +175,9 @@ void ColoringRulesDialog::updateWidgets()
error_text = tr("the \"@\" symbol will be ignored.");
}
+ // Check the rule's display filter syntax only if it's checked.
QString display_filter = item->text(filter_col_);
- if (!display_filter.isEmpty()) {
+ if (!display_filter.isEmpty() && item->checkState(name_col_) == Qt::Checked) {
dfilter_t *dfilter;
bool status;
gchar *err_msg;
@@ -306,6 +307,7 @@ void ColoringRulesDialog::on_deleteToolButton_clicked()
foreach (QTreeWidgetItem *ti, selected) {
delete ti;
}
+ updateWidgets();
}
void ColoringRulesDialog::on_copyToolButton_clicked()
@@ -360,9 +362,8 @@ void ColoringRulesDialog::on_buttonBox_accepted()
QMessageBox mb;
mb.setText(tr("Your coloring rules file contains unknown rules"));
mb.setInformativeText(tr("Wireshark doesn't recognize one or more of your coloring rules. "
- "Saving will disable them."));
- mb.setStandardButtons(QMessageBox::Save | QMessageBox::Cancel);
- mb.setDefaultButton(QMessageBox::Save);
+ "They have been disabled."));
+ mb.setStandardButtons(QMessageBox::Ok);
int result = mb.exec();
if (result != QMessageBox::Save) return;
@@ -383,7 +384,6 @@ void ColoringRulesDialog::on_buttonBox_helpRequested()
wsApp->helpTopicAction(HELP_COLORING_RULES_DIALOG);
}
-
//
// ColoringRulesTreeDelegate
// Delegate for editing coloring rule names and filters.
@@ -409,6 +409,8 @@ QWidget *ColoringRulesTreeDelegate::createEditor(QWidget *parent, const QStyleOp
case filter_col_:
{
DisplayFilterEdit *dfe = new DisplayFilterEdit(parent);
+ // It's possible to have an invalid filter and an enabled OK button at this point.
+ // We might want to add a local slot for checking the filter status.
connect(dfe, SIGNAL(textChanged(QString)), dfe, SLOT(checkDisplayFilter(QString)));
dfe->setText(ti->text(filter_col_));
w = (QWidget*) dfe;