diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index cec08760aab..7ec66b5f109 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -428,6 +428,13 @@ static QIcon interruptIcon(bool toolBarStyle) return toolBarStyle ? iconToolBar : icon; } +static bool hideAnalyzeMenu() +{ + return Core::ICore::settings() + ->value(ProjectExplorer::Constants::SETTINGS_MENU_HIDE_ANALYZE, false) + .toBool(); +} + QAction *addAction(const QObject *parent, QMenu *menu, const QString &display, bool on, const std::function &onTriggered) { @@ -775,7 +782,8 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) ActionContainer *menubar = ActionManager::actionContainer(MENU_BAR); ActionContainer *mtools = ActionManager::actionContainer(M_TOOLS); - menubar->addMenu(mtools, m_menu); + if (!hideAnalyzeMenu()) + menubar->addMenu(mtools, m_menu); m_menu->addSeparator(G_ANALYZER_TOOLS); m_menu->addSeparator(G_ANALYZER_REMOTE_TOOLS); diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 692efcb988b..00c2ba035f3 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -314,6 +314,16 @@ static const RunConfiguration *runConfigForNode(const Target *target, const Proj return target->activeRunConfiguration(); } +static bool hideBuildMenu() +{ + return Core::ICore::settings()->value(Constants::SETTINGS_MENU_HIDE_BUILD, false).toBool(); +} + +static bool hideDebugMenu() +{ + return Core::ICore::settings()->value(Constants::SETTINGS_MENU_HIDE_DEBUG, false).toBool(); +} + static bool canOpenTerminalWithRunEnv(const Project *project, const ProjectNode *node) { if (!project) @@ -938,14 +948,17 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er // build menu ActionContainer *mbuild = ActionManager::createMenu(Constants::M_BUILDPROJECT); + mbuild->menu()->setTitle(tr("&Build")); - menubar->addMenu(mbuild, Core::Constants::G_VIEW); + if (!hideBuildMenu()) + menubar->addMenu(mbuild, Core::Constants::G_VIEW); // debug menu ActionContainer *mdebug = ActionManager::createMenu(Constants::M_DEBUG); mdebug->menu()->setTitle(tr("&Debug")); - menubar->addMenu(mdebug, Core::Constants::G_VIEW); + if (!hideDebugMenu()) + menubar->addMenu(mdebug, Core::Constants::G_VIEW); ActionContainer *mstartdebugging = ActionManager::createMenu(Constants::M_DEBUG_STARTDEBUGGING); diff --git a/src/plugins/projectexplorer/projectexplorerconstants.h b/src/plugins/projectexplorer/projectexplorerconstants.h index 871be6bc7d4..fcc2db0072b 100644 --- a/src/plugins/projectexplorer/projectexplorerconstants.h +++ b/src/plugins/projectexplorer/projectexplorerconstants.h @@ -235,6 +235,9 @@ const char ADD_FILES_DIALOG_FILTER_HISTORY_KEY[] = "ProjectExplorer.AddFilesFilt const char PROJECT_ROOT_PATH_KEY[] = "ProjectExplorer.Project.RootPath"; const char STARTUPSESSION_KEY[] = "ProjectExplorer/SessionToRestore"; const char LASTSESSION_KEY[] = "ProjectExplorer/StartupSession"; +const char SETTINGS_MENU_HIDE_BUILD[] = "Menu/HideBuild"; +const char SETTINGS_MENU_HIDE_DEBUG[] = "Menu/HideDebug"; +const char SETTINGS_MENU_HIDE_ANALYZE[] = "Menu/HideAnalyze"; // UI texts PROJECTEXPLORER_EXPORT QString msgAutoDetected();