forked from osmocom/wireshark
Prefs/Expert: disable Open Expert Info on Protocol Preferences context menu
Closes #17920
This commit is contained in:
parent
fb38fe8573
commit
8510013135
|
@ -20,6 +20,7 @@
|
||||||
#include "expert.h"
|
#include "expert.h"
|
||||||
#include "uat.h"
|
#include "uat.h"
|
||||||
#include "prefs.h"
|
#include "prefs.h"
|
||||||
|
#include <epan/prefs-int.h>
|
||||||
#include <epan/wmem_scopes.h>
|
#include <epan/wmem_scopes.h>
|
||||||
#include "tap.h"
|
#include "tap.h"
|
||||||
|
|
||||||
|
@ -221,6 +222,11 @@ expert_packet_init(void)
|
||||||
proto_set_cant_toggle(proto_expert);
|
proto_set_cant_toggle(proto_expert);
|
||||||
|
|
||||||
module_expert = prefs_register_protocol(proto_expert, NULL);
|
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",
|
expert_uat = uat_new("Expert Info Severity Level Configuration",
|
||||||
sizeof(expert_level_entry_t),
|
sizeof(expert_level_entry_t),
|
||||||
|
|
|
@ -283,14 +283,6 @@ fill_prefs(module_t *module, gpointer root_ptr)
|
||||||
|
|
||||||
void PrefsModel::populate()
|
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_);
|
prefs_modules_foreach_submodules(NULL, fill_prefs, (gpointer)root_);
|
||||||
|
|
||||||
//Add the "specially handled" preferences
|
//Add the "specially handled" preferences
|
||||||
|
|
|
@ -189,8 +189,12 @@ void ProtocolPreferencesMenu::setModule(const QString module_name)
|
||||||
module_name_ = module_name;
|
module_name_ = module_name;
|
||||||
|
|
||||||
action = addAction(tr("Open %1 preferences…").arg(long_name));
|
action = addAction(tr("Open %1 preferences…").arg(long_name));
|
||||||
action->setData(QString(module_name));
|
if (module_->use_gui) {
|
||||||
connect(action, SIGNAL(triggered(bool)), this, SLOT(modulePreferencesTriggered()));
|
action->setData(QString(module_name));
|
||||||
|
connect(action, SIGNAL(triggered(bool)), this, SLOT(modulePreferencesTriggered()));
|
||||||
|
} else {
|
||||||
|
action->setDisabled(true);
|
||||||
|
}
|
||||||
addSeparator();
|
addSeparator();
|
||||||
|
|
||||||
prefs_pref_foreach(module_, add_prefs_menu_item, this);
|
prefs_pref_foreach(module_, add_prefs_menu_item, this);
|
||||||
|
|
Loading…
Reference in New Issue