forked from osmocom/wireshark
Qt: Display filter edit - update status line only when on mainWindow.
There are many screens with a display filter edit box but they should not wallop the status line on the main window. Display syntax errors on the local window in "hints" area. Only update Status Line message when editing a display filter in the Filter toolbar or Find Packet toolbar.
This commit is contained in:
parent
2fd83ac8f8
commit
3f83a3b364
|
@ -614,6 +614,8 @@ void IOGraphDialog::syncGraphSettings(int row)
|
|||
hint_err_ = iog->configError();
|
||||
visible = false;
|
||||
retap = false;
|
||||
} else {
|
||||
hint_err_.clear();
|
||||
}
|
||||
|
||||
iog->setVisible(visible);
|
||||
|
|
|
@ -341,7 +341,7 @@ void DisplayFilterEdit::checkFilter(const QString& filter_text)
|
|||
alignActionButtons();
|
||||
}
|
||||
|
||||
if (filter_text.length() <= 0)
|
||||
if ((filter_text.length() <= 0) && mainApp->mainWindow()->isActiveWindow())
|
||||
mainApp->popStatus(MainApplication::FilterSyntax);
|
||||
|
||||
emit popFilterSyntaxStatus();
|
||||
|
@ -351,14 +351,17 @@ void DisplayFilterEdit::checkFilter(const QString& filter_text)
|
|||
switch (syntaxState()) {
|
||||
case Deprecated:
|
||||
{
|
||||
mainApp->pushStatus(MainApplication::FilterSyntax, syntaxErrorMessage());
|
||||
if (mainApp->mainWindow()->isActiveWindow())
|
||||
mainApp->pushStatus(MainApplication::FilterSyntax, syntaxErrorMessage());
|
||||
setToolTip(syntaxErrorMessage());
|
||||
break;
|
||||
}
|
||||
case Invalid:
|
||||
{
|
||||
mainApp->pushStatus(MainApplication::FilterSyntax, syntaxErrorMessage());
|
||||
setToolTip(syntaxErrorMessageFull());
|
||||
QString invalidMsg = tr("Invalid filter: ").append(syntaxErrorMessage());
|
||||
if (mainApp->mainWindow()->isActiveWindow())
|
||||
mainApp->pushStatus(MainApplication::FilterSyntax, syntaxErrorMessage());
|
||||
setToolTip(invalidMsg);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -473,14 +476,16 @@ void DisplayFilterEdit::buildCompletionList(const QString &field_word)
|
|||
{
|
||||
// Push a hint about the current field.
|
||||
if (syntaxState() == Valid) {
|
||||
mainApp->popStatus(MainApplication::FilterSyntax);
|
||||
if (mainApp->mainWindow()->isActiveWindow())
|
||||
mainApp->popStatus(MainApplication::FilterSyntax);
|
||||
|
||||
header_field_info *hfinfo = proto_registrar_get_byname(field_word.toUtf8().constData());
|
||||
if (hfinfo) {
|
||||
QString cursor_field_msg = QString("%1: %2")
|
||||
.arg(hfinfo->name)
|
||||
.arg(ftype_pretty_name(hfinfo->type));
|
||||
mainApp->pushStatus(MainApplication::FilterSyntax, cursor_field_msg);
|
||||
if (mainApp->mainWindow()->isActiveWindow())
|
||||
mainApp->pushStatus(MainApplication::FilterSyntax, cursor_field_msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue