diff options
author | Michael Mann <mmann78@netscape.net> | 2017-07-21 19:12:52 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-07-22 12:16:04 +0000 |
commit | 40d158eee35c3d10858593587c6ddc999b9b9329 (patch) | |
tree | 5258020364a90cfb6fcddbae67c10e121f7494d9 | |
parent | 4107f6bca7b2bc58e6570501123f3d500ec3905b (diff) |
Have UatFrame send out proper notifications.
UatFrame was originally written for filter expressions, so it still
had some "filter expression specific" functionality in it.
Move the "filter expression notifications" to the preferences dialog
and add support for proper notification if UAT affects fields or
dissection (like expert info UAT).
Change-Id: I84cd0c7923450692916bbc6c2cdce93a9830d722
Reviewed-on: https://code.wireshark.org/review/22758
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r-- | ui/qt/preferences_dialog.cpp | 5 | ||||
-rw-r--r-- | ui/qt/uat_frame.cpp | 19 | ||||
-rw-r--r-- | ui/qt/uat_frame.h | 1 |
3 files changed, 21 insertions, 4 deletions
diff --git a/ui/qt/preferences_dialog.cpp b/ui/qt/preferences_dialog.cpp index 590dc251b9..725f9d58dd 100644 --- a/ui/qt/preferences_dialog.cpp +++ b/ui/qt/preferences_dialog.cpp @@ -917,6 +917,11 @@ void PreferencesDialog::on_buttonBox_accepted() pd_ui_->filterExpressonsFrame->acceptChanges(); pd_ui_->expertFrame->acceptChanges(); + //Filter expressions don't affect dissection, so there is no need to + //send any events to that effect. However, the app needs to know + //about any button changes. + wsApp->emitAppSignal(WiresharkApplication::FilterExpressionsChanged); + prefs_main_write(); if (save_decode_as_entries(&err) < 0) { diff --git a/ui/qt/uat_frame.cpp b/ui/qt/uat_frame.cpp index afaf6a4859..ca330082fd 100644 --- a/ui/qt/uat_frame.cpp +++ b/ui/qt/uat_frame.cpp @@ -114,6 +114,20 @@ void UatFrame::setUat(epan_uat *uat) setWindowTitle(title); } +void UatFrame::applyChanges() +{ + if (!uat_) return; + + if (uat_->flags & UAT_AFFECTS_FIELDS) { + /* Recreate list with new fields and redissect packets */ + wsApp->queueAppSignal(WiresharkApplication::FieldsChanged); + } + if (uat_->flags & UAT_AFFECTS_DISSECTION) { + /* Just redissect packets if we have any */ + wsApp->queueAppSignal(WiresharkApplication::PacketDissectionChanged); + } +} + void UatFrame::acceptChanges() { if (!uat_) return; @@ -130,10 +144,7 @@ void UatFrame::acceptChanges() uat_->post_update_cb(); } - //Filter expressions don't affect dissection, so there is no need to - //send any events to that effect. However, the app needs to know - //about any button changes. - wsApp->emitAppSignal(WiresharkApplication::FilterExpressionsChanged); + applyChanges(); } } diff --git a/ui/qt/uat_frame.h b/ui/qt/uat_frame.h index 85acb55105..2d056ef20b 100644 --- a/ui/qt/uat_frame.h +++ b/ui/qt/uat_frame.h @@ -55,6 +55,7 @@ private: void checkForErrorHint(const QModelIndex ¤t, const QModelIndex &previous); bool trySetErrorHintFromField(const QModelIndex &index); void addRecord(bool copy_from_current = false); + void applyChanges(); private slots: void modelDataChanged(const QModelIndex &topLeft); |