switch (syntaxState()) {
case Deprecated:
{
- /*
- * We're being lazy and only printing the first "problem" token.
- * Would it be better to print all of them?
- */
- QString deprecatedMsg(tr("\"%1\" may have unexpected results (see the User's Guide)")
- .arg(deprecatedToken()));
- emit pushFilterSyntaxWarning(deprecatedMsg);
+ emit pushFilterSyntaxWarning(syntaxErrorMessage());
break;
}
case Invalid:
QPushButton *ok_bt = ui->buttonBox->button(QDialogButtonBox::Ok);
if (ok_bt) {
bool ok_enable = !ui->displayFilterLineEdit->text().isEmpty()
- && (ui->displayFilterLineEdit->syntaxState() == SyntaxLineEdit::Valid);
+ && (ui->displayFilterLineEdit->syntaxState() != SyntaxLineEdit::Invalid);
ok_bt->setEnabled(ok_enable);
}
}
return style_sheet_;
}
-QString SyntaxLineEdit::deprecatedToken()
-{
- return deprecated_token_;
-}
-
void SyntaxLineEdit::setStyleSheet(const QString &style_sheet) {
style_sheet_ = style_sheet;
QLineEdit::setStyleSheet(style_sheet_ + state_style_sheet_);
return;
}
- deprecated_token_.clear();
dfilter_t *dfp = NULL;
gchar *err_msg;
if (dfilter_compile(filter.toUtf8().constData(), &dfp, &err_msg)) {
if (depr) {
// You keep using that word. I do not think it means what you think it means.
setSyntaxState(SyntaxLineEdit::Deprecated);
- deprecated_token_ = (const char *) g_ptr_array_index(depr, 0);
+ /*
+ * We're being lazy and only printing the first "problem" token.
+ * Would it be better to print all of them?
+ */
+ syntax_error_message_ = tr("\"%1\" may have unexpected results (see the User's Guide)")
+ .arg((const char *) g_ptr_array_index(depr, 0));
} else {
setSyntaxState(SyntaxLineEdit::Valid);
}
SyntaxState syntax_state_;
QString style_sheet_;
QString state_style_sheet_;
- QString deprecated_token_;
QString syntax_error_message_;
QString token_chars_;
QColor busy_fg_;