diff options
author | Hadriel Kaplan <hadrielk@yahoo.com> | 2014-03-11 00:27:50 -0400 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2014-03-12 21:28:16 +0000 |
commit | 5ae2815615d04e63c99c4636e5fdf644d7c5abc9 (patch) | |
tree | efdc012f863935f58b2bf7e85c0cc55ffdb2cc1b /ui/qt | |
parent | bc3aa5dff25b834977dec850efad4c21c10ea179 (diff) |
Fix bug 9866: Qt 'Clearing filters does not seem to affect the packet list'
Clicking the "X" clear filter button now applies the clearing to the
displayed packet list. This commit also adds tooltips for the display
filter display filter box's butons.
Change-Id: I827020a7705a32a4a9204d22e94942853e25bba6
Reviewed-on: https://code.wireshark.org/review/601
Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'ui/qt')
-rw-r--r-- | ui/qt/display_filter_combo.cpp | 3 | ||||
-rw-r--r-- | ui/qt/display_filter_edit.cpp | 19 | ||||
-rw-r--r-- | ui/qt/display_filter_edit.h | 1 |
3 files changed, 22 insertions, 1 deletions
diff --git a/ui/qt/display_filter_combo.cpp b/ui/qt/display_filter_combo.cpp index 1360f7e17b..576a9a9b2e 100644 --- a/ui/qt/display_filter_combo.cpp +++ b/ui/qt/display_filter_combo.cpp @@ -74,6 +74,9 @@ DisplayFilterCombo::DisplayFilterCombo(QWidget *parent) : "}" ); completer()->setCompletionMode(QCompleter::PopupCompletion); +#ifndef QT_NO_TOOLTIP + setToolTip(tr("Select from previously used filters")); +#endif // QT_NO_TOOLTIP connect(wsApp, SIGNAL(preferencesChanged()), this, SLOT(updateMaxCount())); } diff --git a/ui/qt/display_filter_edit.cpp b/ui/qt/display_filter_edit.cpp index 5b3c6f1766..aa6c9d9de2 100644 --- a/ui/qt/display_filter_edit.cpp +++ b/ui/qt/display_filter_edit.cpp @@ -109,6 +109,7 @@ DisplayFilterEdit::DisplayFilterEdit(QWidget *parent, bool plain) : // XXX - Use native buttons on OS X? bookmark_button_ = new QToolButton(this); + bookmark_button_->setEnabled(false); bookmark_button_->setCursor(Qt::ArrowCursor); bookmark_button_->setStyleSheet(QString( "QToolButton { /* all types of tool button */" @@ -137,6 +138,9 @@ DisplayFilterEdit::DisplayFilterEdit(QWidget *parent, bool plain) : ).arg(plain_ ? 0 : 1) ); +#ifndef QT_NO_TOOLTIP + bookmark_button_->setToolTip(tr("Bookmark this filter string")); +#endif // QT_NO_TOOLTIP connect(bookmark_button_, SIGNAL(clicked()), this, SLOT(bookmarkClicked())); clear_button_ = new QToolButton(this); @@ -154,8 +158,11 @@ DisplayFilterEdit::DisplayFilterEdit(QWidget *parent, bool plain) : " image: url(:/dfilter/dfilter_erase_selected.png) center;" "}" ); +#ifndef QT_NO_TOOLTIP + clear_button_->setToolTip(tr("Clear the filter string and update the display")); +#endif // QT_NO_TOOLTIP clear_button_->hide(); - connect(clear_button_, SIGNAL(clicked()), this, SLOT(clear())); + connect(clear_button_, SIGNAL(clicked()), this, SLOT(clearFilter())); connect(this, SIGNAL(textChanged(const QString&)), this, SLOT(checkFilter(const QString&))); if (!plain_) { @@ -181,6 +188,9 @@ DisplayFilterEdit::DisplayFilterEdit(QWidget *parent, bool plain) : " image: url(:/dfilter/dfilter_apply_disabled.png) center;" "}" ); +#ifndef QT_NO_TOOLTIP + apply_button_->setToolTip(tr("Apply this filter string to the display")); +#endif // QT_NO_TOOLTIP connect(apply_button_, SIGNAL(clicked()), this, SLOT(applyDisplayFilter())); connect(this, SIGNAL(returnPressed()), this, SLOT(applyDisplayFilter())); } @@ -306,6 +316,13 @@ void DisplayFilterEdit::bookmarkClicked() emit addBookmark(text()); } +void DisplayFilterEdit::clearFilter() +{ + clear(); + QString new_filter; + emit filterPackets(new_filter, true); +} + void DisplayFilterEdit::applyDisplayFilter() { if (syntaxState() != Valid && syntaxState() != Empty) { diff --git a/ui/qt/display_filter_edit.h b/ui/qt/display_filter_edit.h index 5b6bff99f4..b760aef597 100644 --- a/ui/qt/display_filter_edit.h +++ b/ui/qt/display_filter_edit.h @@ -44,6 +44,7 @@ public slots: private slots: void checkFilter(const QString &text); void bookmarkClicked(); + void clearFilter(); private: bool plain_; |