summaryrefslogtreecommitdiff
path: root/ui/qt/display_filter_edit.cpp
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2012-01-14 00:16:16 +0000
committerGerald Combs <gerald@wireshark.org>2012-01-14 00:16:16 +0000
commitbc957229f87bff3567fafbe2718c1e138905ce9a (patch)
treeb36ab499e746917f11c07e799ad306b88ab82b9e /ui/qt/display_filter_edit.cpp
parentc7857a522bc45bd2858211eaec8e7881d71c8169 (diff)
downloadwireshark-bc957229f87bff3567fafbe2718c1e138905ce9a.tar.gz
Initial status bar functionality. Promote the main window's status bar
to a MainStatusBar. Add a "LabelStack" widget, which MainStatusBar uses to duplicate features in GtkStatusbar. Make the protocol tree a full-blown ProtoTree widget. Move main_cf_callback from main to WiresharkApplication. Duplicate a lot of the cf callbacks as signals and slots. Use Q_UNUSED in a few places. svn path=/trunk/; revision=40488
Diffstat (limited to 'ui/qt/display_filter_edit.cpp')
-rw-r--r--ui/qt/display_filter_edit.cpp33
1 files changed, 14 insertions, 19 deletions
diff --git a/ui/qt/display_filter_edit.cpp b/ui/qt/display_filter_edit.cpp
index ab76014124..84a1b55a48 100644
--- a/ui/qt/display_filter_edit.cpp
+++ b/ui/qt/display_filter_edit.cpp
@@ -254,11 +254,11 @@ void DisplayFilterEdit::checkFilter(const QString& text)
clearButton->setVisible(!text.isEmpty());
+ popFilterSyntaxStatus();
+
if (fieldNameOnly && (c = proto_check_field_name(text.toUtf8().constData()))) {
m_syntaxState = Invalid;
-// if (use_statusbar) {
-// statusbar_push_filter_msg(" Illegal character in field name: '%c'", c);
-// }
+ emit pushFilterSyntaxStatus(QString().sprintf("Illegal character in field name: '%c'", c));
} else if (dfilter_compile(text.toUtf8().constData(), &dfp)) {
if (dfp != NULL) {
depr = dfilter_deprecated_tokens(dfp);
@@ -268,30 +268,25 @@ void DisplayFilterEdit::checkFilter(const QString& text)
} else if (depr) {
/* You keep using that word. I do not think it means what you think it means. */
m_syntaxState = Deprecated;
-// if (use_statusbar) {
-// /*
-// * We're being lazy and only printing the first "problem" token.
-// * Would it be better to print all of them?
-// */
-// statusbar_push_temporary_msg(" \"%s\" may have unexpected results (see the User's Guide)",
-// (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?
+ */
+ emit pushFilterSyntaxWarning(QString().sprintf("\"%s\" may have unexpected results (see the User's Guide)",
+ (const char *) g_ptr_array_index(depr, 0)));
} else {
m_syntaxState = Valid;
}
dfilter_free(dfp);
} else {
m_syntaxState = Invalid;
-// if (use_statusbar) {
-// if (dfilter_error_msg) {
-// statusbar_push_filter_msg(" Invalid filter: %s", dfilter_error_msg);
-// } else {
-// statusbar_push_filter_msg(" Invalid filter");
-// }
-// }
+ QString invalidMsg("Invalid filter");
+ if (dfilter_error_msg) {
+ invalidMsg.append(QString().sprintf(": %s", dfilter_error_msg));
+ }
+ emit pushFilterSyntaxStatus(invalidMsg);
}
- g_log(NULL, G_LOG_LEVEL_DEBUG, "FIX: show display filter syntax status in statusbar");
setStyleSheet(syntaxStyleSheet);
applyButton->setEnabled(m_syntaxState == Empty || m_syntaxState == Valid);