forked from qt-creator/qt-creator
Core: Use ActionBuilder in ExternalToolManager
Change-Id: Id92e0d8788aabbe9fe7cfb93680835a2c3f55b99 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -202,16 +202,16 @@ void ExternalToolManager::setToolsByCategory(const QMap<QString, QList<ExternalT
|
||||
action = d->m_actions.value(toolId);
|
||||
command = ActionManager::command(externalToolsPrefix.withSuffix(toolId));
|
||||
} else {
|
||||
action = new QAction(tool->displayName(), m_instance);
|
||||
d->m_actions.insert(toolId, action);
|
||||
connect(action, &QAction::triggered, tool, [tool] {
|
||||
ActionBuilder external(m_instance, externalToolsPrefix.withSuffix(toolId));
|
||||
external.setCommandAttribute(Command::CA_UpdateText);
|
||||
external.addOnTriggered(tool, [tool] {
|
||||
auto runner = new ExternalToolRunner(tool);
|
||||
if (runner->hasError())
|
||||
MessageManager::writeFlashing(runner->errorString());
|
||||
});
|
||||
|
||||
command = ActionManager::registerAction(action, externalToolsPrefix.withSuffix(toolId));
|
||||
command->setAttribute(Command::CA_UpdateText);
|
||||
action = external.contextAction();
|
||||
d->m_actions.insert(toolId, action);
|
||||
command = external.command();
|
||||
}
|
||||
action->setText(tool->displayName());
|
||||
action->setToolTip(tool->description());
|
||||
|
||||
Reference in New Issue
Block a user