forked from qt-creator/qt-creator
Target Selector: Do not repeat kit name in context menu
Kit names can get rather unwieldy, and there is no point in repeating them in this particular context menu, where the user clicked pretty much right on the kit name. Fixes: QTCREATORBUG-24242 Change-Id: I04d96e53ece24fd6c54d8aa225d13a0c7354acd0 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -399,14 +399,14 @@ public:
|
|||||||
const QString kitName = kit->displayName();
|
const QString kitName = kit->displayName();
|
||||||
const QString projectName = m_project->displayName();
|
const QString projectName = m_project->displayName();
|
||||||
|
|
||||||
QAction *enableAction = menu->addAction(tr("Enable Kit \"%1\" for Project \"%2\"").arg(kitName, projectName));
|
QAction *enableAction = menu->addAction(tr("Enable Kit for Project \"%2\"").arg(projectName));
|
||||||
enableAction->setEnabled(isSelectable && m_kitId.isValid() && !isEnabled());
|
enableAction->setEnabled(isSelectable && m_kitId.isValid() && !isEnabled());
|
||||||
QObject::connect(enableAction, &QAction::triggered, [this, kit] {
|
QObject::connect(enableAction, &QAction::triggered, [this, kit] {
|
||||||
m_project->addTargetForKit(kit);
|
m_project->addTargetForKit(kit);
|
||||||
});
|
});
|
||||||
|
|
||||||
QAction * const enableForAllAction
|
QAction * const enableForAllAction
|
||||||
= menu->addAction(tr("Enable Kit \"%1\" for All Projects").arg(kitName));
|
= menu->addAction(tr("Enable Kit for All Projects"));
|
||||||
enableForAllAction->setEnabled(isSelectable);
|
enableForAllAction->setEnabled(isSelectable);
|
||||||
QObject::connect(enableForAllAction, &QAction::triggered, [kit] {
|
QObject::connect(enableForAllAction, &QAction::triggered, [kit] {
|
||||||
for (Project * const p : SessionManager::projects()) {
|
for (Project * const p : SessionManager::projects()) {
|
||||||
@@ -415,7 +415,7 @@ public:
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
QAction *disableAction = menu->addAction(tr("Disable Kit \"%1\" for Project \"%2\"").arg(kitName, projectName));
|
QAction *disableAction = menu->addAction(tr("Disable Kit for Project \"%2\"").arg(projectName));
|
||||||
disableAction->setEnabled(isSelectable && m_kitId.isValid() && isEnabled());
|
disableAction->setEnabled(isSelectable && m_kitId.isValid() && isEnabled());
|
||||||
QObject::connect(disableAction, &QAction::triggered, m_project, [this] {
|
QObject::connect(disableAction, &QAction::triggered, m_project, [this] {
|
||||||
Target *t = target();
|
Target *t = target();
|
||||||
@@ -440,8 +440,7 @@ public:
|
|||||||
m_project->removeTarget(t);
|
m_project->removeTarget(t);
|
||||||
});
|
});
|
||||||
|
|
||||||
QAction *disableForAllAction
|
QAction *disableForAllAction = menu->addAction(tr("Disable Kit for All Projects"));
|
||||||
= menu->addAction(tr("Disable Kit \"%1\" for All Projects").arg(kitName));
|
|
||||||
disableForAllAction->setEnabled(isSelectable);
|
disableForAllAction->setEnabled(isSelectable);
|
||||||
QObject::connect(disableForAllAction, &QAction::triggered, [kit] {
|
QObject::connect(disableForAllAction, &QAction::triggered, [kit] {
|
||||||
for (Project * const p : SessionManager::projects()) {
|
for (Project * const p : SessionManager::projects()) {
|
||||||
|
Reference in New Issue
Block a user