diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2015-06-23 10:31:58 -0700 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2015-06-23 18:27:44 +0000 |
commit | 0901e26505ca57b8331aa3edc9e43f1f087a3d77 (patch) | |
tree | 24041180d51ece259a881064569e77fae8fdd6e1 /ui/qt/decode_as_dialog.cpp | |
parent | 8bc294c0d12e742d8c539177a683eff16653b31b (diff) |
Qt: change default behavior of 'Decode As' window
Up to know Qt 'Decode As' window was saving manual configuration automatically, contrary to GTK UI.
This can be misleading when decoding protocols without a fixed identifier (port number, USB bus/device id, ...).
Opening a new trace might lead to previous and now irrelevant settings being applied.
Make this optional and add a Save button to permanently store the current configuration.
Change-Id: I077c560f9e71cab16a74247e2e9d87523c0ed85e
Reviewed-on: https://code.wireshark.org/review/9058
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'ui/qt/decode_as_dialog.cpp')
-rw-r--r-- | ui/qt/decode_as_dialog.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/ui/qt/decode_as_dialog.cpp b/ui/qt/decode_as_dialog.cpp index 17e958309c..39e75651f5 100644 --- a/ui/qt/decode_as_dialog.cpp +++ b/ui/qt/decode_as_dialog.cpp @@ -537,7 +537,7 @@ void DecodeAsDialog::resetChangedList(const gchar *table_name, } } -void DecodeAsDialog::on_buttonBox_accepted() +void DecodeAsDialog::applyChanges() { /* Reset all dissector tables, then apply all rules from GUI */ @@ -592,13 +592,25 @@ void DecodeAsDialog::on_buttonBox_accepted() delete(dissector_info); } - save_decode_as_entries(); wsApp->emitAppSignal(WiresharkApplication::PacketDissectionChanged); } -void DecodeAsDialog::on_buttonBox_helpRequested() +void DecodeAsDialog::on_buttonBox_clicked(QAbstractButton *button) { - wsApp->helpTopicAction(HELP_DECODE_AS_SHOW_DIALOG); + switch (ui->buttonBox->standardButton(button)) { + case QDialogButtonBox::Ok: + applyChanges(); + break; + case QDialogButtonBox::Save: + applyChanges(); + save_decode_as_entries(); + break; + case QDialogButtonBox::Help: + wsApp->helpTopicAction(HELP_DECODE_AS_SHOW_DIALOG); + break; + default: + break; + } } /* |