summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2017-01-25 10:38:49 +0100
committerStig Bjørlykke <stig@bjorlykke.org>2017-01-25 18:36:30 +0000
commit0385a09739d24f1b7b47ee07ee26fd91d18b7d55 (patch)
tree05a6c235e5a7a2cfa585bf5cc31ad938d776b5ed /ui
parent53c7f0a25ee5b1419c1a87045e25ca11ec12f9b1 (diff)
downloadwireshark-0385a09739d24f1b7b47ee07ee26fd91d18b7d55.tar.gz
Qt: Use preference editor for port number entries
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 <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/preference_editor_frame.cpp4
-rw-r--r--ui/qt/protocol_preferences_menu.cpp2
2 files changed, 6 insertions, 0 deletions
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);