Analyzer: Rework the dock widget layout generation

Decouple layout generation from widget generation and
separate analyzer action description from menu action creation.

Tool specific layouts are named "Perspective" now.

Change-Id: I774efe77a07640c4cc26e4e566662c8a673c8831
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
hjk
2016-02-26 14:14:49 +01:00
parent 04cbf8b818
commit 931ee3382c
32 changed files with 645 additions and 679 deletions

View File

@@ -135,20 +135,24 @@ bool ClangStaticAnalyzerPlugin::initialize(const QStringList &arguments, QString
const QString toolTip = tr("Clang Static Analyzer uses the analyzer from the clang project "
"to find bugs.");
auto action = new AnalyzerAction(this);
action->setRunMode(Constants::CLANGSTATICANALYZER_RUN_MODE);
action->setToolId(ClangStaticAnalyzerToolId);
action->setActionId("ClangStaticAnalyzer");
action->setWidgetCreator(widgetCreator);
action->setRunControlCreator(runControlCreator);
action->setCustomToolStarter([tool](ProjectExplorer::RunConfiguration *rc) {
Perspective perspective(ClangStaticAnalyzerPerspective);
perspective.addDock(ClangStaticAnalyzerDock, Core::Id(), Perspective::SplitVertical);
AnalyzerManager::addPerspective(perspective);
ActionDescription desc;
desc.setText(tr("Clang Static Analyzer"));
desc.setToolTip(toolTip);
desc.setEnabled(false);
desc.setRunMode(Constants::CLANGSTATICANALYZER_RUN_MODE);
desc.setPerspectiveId(ClangStaticAnalyzerPerspective);
desc.setActionId(ClangStaticAnalyzerAction);
desc.setWidgetCreator(widgetCreator);
desc.setRunControlCreator(runControlCreator);
desc.setCustomToolStarter([tool](ProjectExplorer::RunConfiguration *rc) {
tool->startTool(rc);
});
action->setText(tr("Clang Static Analyzer"));
action->setToolTip(toolTip);
action->setMenuGroup(Analyzer::Constants::G_ANALYZER_TOOLS);
action->setEnabled(false);
AnalyzerManager::addAction(action);
desc.setMenuGroup(Analyzer::Constants::G_ANALYZER_TOOLS);
AnalyzerManager::addAction(desc);
return true;
}