ClangTools: Add "go to project settings" toolbar button

With the introduction of the "Analyze Current File" action the widget to
configure the diagnostic config was moved to the project panel (Project
mode > Project Settings > Clang Tools).

As not too many users are aware of the project settings there and
navigating there involves more user interation now (mode switch, looking
for the "Clang Tools" item), add a toolbar button as a shortcut.

Change-Id: I4c864045ef41ff501d925d3175ce604def213f29
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Nikolai Kosjar
2019-11-25 10:09:21 +01:00
parent 2ca150c097
commit b2f5ed78e1
11 changed files with 77 additions and 1 deletions

View File

@@ -67,6 +67,13 @@ using namespace ProjectExplorer;
namespace ClangTools {
namespace Internal {
static ProjectPanelFactory *m_projectPanelFactoryInstance = nullptr;
ProjectPanelFactory *projectPanelFactory()
{
return m_projectPanelFactoryInstance;
}
class ClangToolsOptionsPage : public IOptionsPage
{
public:
@@ -123,8 +130,9 @@ bool ClangToolsPlugin::initialize(const QStringList &arguments, QString *errorSt
ActionManager::registerAction(d->clangTool.startOnCurrentFileAction(),
Constants::RUN_ON_CURRENT_FILE);
auto panelFactory = new ProjectPanelFactory();
auto panelFactory = m_projectPanelFactoryInstance = new ProjectPanelFactory;
panelFactory->setPriority(100);
panelFactory->setId(Constants::PROJECT_PANEL_ID);
panelFactory->setDisplayName(tr("Clang Tools"));
panelFactory->setCreateWidgetFunction([](Project *project) { return new ProjectSettingsWidget(project); });
ProjectPanelFactory::registerFactory(panelFactory);