token creation context menu improvements (#2999)

This commit is contained in:
tooomm 2018-01-10 19:32:29 +01:00 committed by Zach H
parent d19744236e
commit 7efab80d9b

View file

@ -2674,9 +2674,9 @@ void Player::addRelatedCardActions(const CardItem *card, QMenu *cardMenu) {
cardMenu->addSeparator();
QAction *createRelatedCards;
if (relatedCards.at(0)->getDoesAttach()) {
createRelatedCards = new QAction(tr("Token: ") + tr("Attach to ") + relatedCards.at(0)->getName(), this);
createRelatedCards = new QAction(tr("Token: ") + tr("Attach to ") + "\"" + relatedCards.at(0)->getName() + "\"", this);
} else
createRelatedCards = new QAction(tr("Token: ") + (relatedCards.at(0)->getIsVariable() ? "X " : QString(relatedCards.at(0)->getDefaultCount() == 1 ? QString() : QString::number(relatedCards.at(0)->getDefaultCount()) + " ")) + relatedCards.at(0)->getName(), this);
createRelatedCards = new QAction(tr("Token: ") + (relatedCards.at(0)->getIsVariable() ? "X " : QString(relatedCards.at(0)->getDefaultCount() == 1 ? QString() : QString::number(relatedCards.at(0)->getDefaultCount()) + "x ")) + relatedCards.at(0)->getName(), this);
connect(createRelatedCards, SIGNAL(triggered()), this, SLOT(actCreateAllRelatedCards()));
if (shortcutsActive) {
createRelatedCards->setShortcut(settingsCache->shortcuts().getSingleShortcut("Player/aCreateRelatedTokens"));
@ -2692,9 +2692,9 @@ void Player::addRelatedCardActions(const CardItem *card, QMenu *cardMenu) {
QString cardName = cardRelation->getName();
QAction *createRelated;
if (cardRelation->getDoesAttach())
createRelated = new QAction(tr("Token: ") + tr("Attach to ") + cardName, this);
createRelated = new QAction(tr("Token: ") + tr("Attach to ") + "\"" + cardName + "\"", this);
else
createRelated = new QAction(tr("Token: ") + (cardRelation->getIsVariable() ? "X " : QString(cardRelation->getDefaultCount() == 1 ? QString() : QString::number(cardRelation->getDefaultCount()) + " ")) + cardName, this);
createRelated = new QAction(tr("Token: ") + (cardRelation->getIsVariable() ? "X " : QString(cardRelation->getDefaultCount() == 1 ? QString() : QString::number(cardRelation->getDefaultCount()) + "x ")) + cardName, this);
createRelated->setData(QVariant(i));
connect(createRelated, SIGNAL(triggered()), this, SLOT(actCreateRelatedCard()));
cardMenu->addAction(createRelated);
@ -2787,4 +2787,4 @@ void Player::setLastToken(CardInfo *cardInfo)
lastTokenDestroy = true;
aCreateAnotherToken->setText(tr("C&reate another %1 token").arg(lastTokenName));
aCreateAnotherToken->setEnabled(true);
}
}