Prefs/Expert: disable Open Expert Info on Protocol Preferences context menu

Closes #17920
This commit is contained in:
Chuck Craft 2022-02-02 15:45:15 -06:00 committed by A Wireshark GitLab Utility
parent fb38fe8573
commit 8510013135
3 changed files with 12 additions and 10 deletions

View File

@ -20,6 +20,7 @@
#include "expert.h"
#include "uat.h"
#include "prefs.h"
#include <epan/prefs-int.h>
#include <epan/wmem_scopes.h>
#include "tap.h"
@ -221,6 +222,11 @@ expert_packet_init(void)
proto_set_cant_toggle(proto_expert);
module_expert = prefs_register_protocol(proto_expert, NULL);
//Since "expert" is really a pseudo protocol, it shouldn't be
//categorized with other "real" protocols when it comes to
//preferences. Since it's just a UAT, don't bury it in
//with the other protocols
module_expert->use_gui = FALSE;
expert_uat = uat_new("Expert Info Severity Level Configuration",
sizeof(expert_level_entry_t),

View File

@ -283,14 +283,6 @@ fill_prefs(module_t *module, gpointer root_ptr)
void PrefsModel::populate()
{
//Since "expert" is really a pseudo protocol, it shouldn't be
//categorized with other "real" protocols when it comes to
//preferences. Since it's just a UAT, don't bury it in
//with the other protocols
module_t *expert_module = prefs_find_module("_ws.expert");
if (expert_module)
expert_module->use_gui = FALSE;
prefs_modules_foreach_submodules(NULL, fill_prefs, (gpointer)root_);
//Add the "specially handled" preferences

View File

@ -189,8 +189,12 @@ void ProtocolPreferencesMenu::setModule(const QString module_name)
module_name_ = module_name;
action = addAction(tr("Open %1 preferences…").arg(long_name));
action->setData(QString(module_name));
connect(action, SIGNAL(triggered(bool)), this, SLOT(modulePreferencesTriggered()));
if (module_->use_gui) {
action->setData(QString(module_name));
connect(action, SIGNAL(triggered(bool)), this, SLOT(modulePreferencesTriggered()));
} else {
action->setDisabled(true);
}
addSeparator();
prefs_pref_foreach(module_, add_prefs_menu_item, this);