From 0385a09739d24f1b7b47ee07ee26fd91d18b7d55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Bj=C3=B8rlykke?= Date: Wed, 25 Jan 2017 10:38:49 +0100 Subject: Qt: Use preference editor for port number entries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After converting port preferences to use Decode As entries the preference editor was no longer used when changing port number pereferences from the Packet Details popup menu. Change-Id: Ifeff3b88bfd96a122b6a58d8917304eb69cf0c38 Reviewed-on: https://code.wireshark.org/review/19781 Petri-Dish: Stig Bjørlykke Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann Reviewed-by: Stig Bjørlykke --- ui/qt/preference_editor_frame.cpp | 4 ++++ ui/qt/protocol_preferences_menu.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/ui/qt/preference_editor_frame.cpp b/ui/qt/preference_editor_frame.cpp index 429d4aea12..e9c008ea1c 100644 --- a/ui/qt/preference_editor_frame.cpp +++ b/ui/qt/preference_editor_frame.cpp @@ -96,6 +96,7 @@ void PreferenceEditorFrame::editPreference(preference *pref, pref_module *module switch (prefs_get_type(pref_)) { case PREF_UINT: + case PREF_DECODE_AS_UINT: new_uint_ = prefs_get_uint_value_real(pref_, pref_stashed); connect(ui->preferenceLineEdit, SIGNAL(textEdited(QString)), this, SLOT(uintLineEditTextEdited(QString))); @@ -108,6 +109,7 @@ void PreferenceEditorFrame::editPreference(preference *pref, pref_module *module show = true; break; case PREF_RANGE: + case PREF_DECODE_AS_RANGE: wmem_free(NULL, new_range_); new_range_ = range_copy(NULL, prefs_get_range_value_real(pref_, pref_stashed)); connect(ui->preferenceLineEdit, SIGNAL(textEdited(QString)), @@ -190,12 +192,14 @@ void PreferenceEditorFrame::on_buttonBox_accepted() bool apply = false; switch(prefs_get_type(pref_)) { case PREF_UINT: + case PREF_DECODE_AS_UINT: apply = prefs_set_uint_value(pref_, new_uint_, pref_stashed); break; case PREF_STRING: apply = prefs_set_string_value(pref_, new_str_.toStdString().c_str(), pref_stashed); break; case PREF_RANGE: + case PREF_DECODE_AS_RANGE: apply = prefs_set_range_value(pref_, new_range_, pref_stashed); break; default: diff --git a/ui/qt/protocol_preferences_menu.cpp b/ui/qt/protocol_preferences_menu.cpp index a2e30ef503..4e3c6e207f 100644 --- a/ui/qt/protocol_preferences_menu.cpp +++ b/ui/qt/protocol_preferences_menu.cpp @@ -224,6 +224,8 @@ void ProtocolPreferencesMenu::addMenuItem(preference *pref) case PREF_UINT: case PREF_STRING: case PREF_RANGE: + case PREF_DECODE_AS_UINT: + case PREF_DECODE_AS_RANGE: { EditorPreferenceAction *epa = new EditorPreferenceAction(pref); addAction(epa); -- cgit v1.2.1