register action for menu

This commit is contained in:
Paul Carroll 2025-07-29 15:36:06 -04:00
parent 36cf24cdbc
commit 448aa5ce15

View file

@ -417,6 +417,9 @@ Player::Player(const ServerInfo_User &info, int _id, bool _local, bool _judge, T
connect(aCreateAnotherToken, &QAction::triggered, this, &Player::actCreateAnotherToken); connect(aCreateAnotherToken, &QAction::triggered, this, &Player::actCreateAnotherToken);
aCreateAnotherToken->setEnabled(false); aCreateAnotherToken->setEnabled(false);
aIncrementAllCardCountersOnTable = new QAction(this);
connect(aIncrementAllCardCountersOnTable, &QAction::triggered, this, &Player::incrementAllCardCountersOnTable);
createPredefinedTokenMenu = new QMenu(QString()); createPredefinedTokenMenu = new QMenu(QString());
createPredefinedTokenMenu->setEnabled(false); createPredefinedTokenMenu->setEnabled(false);
@ -424,6 +427,7 @@ Player::Player(const ServerInfo_User &info, int _id, bool _local, bool _judge, T
playerMenu->addSeparator(); playerMenu->addSeparator();
countersMenu = playerMenu->addMenu(QString()); countersMenu = playerMenu->addMenu(QString());
playerMenu->addAction(aIncrementAllCardCountersOnTable);
playerMenu->addSeparator(); playerMenu->addSeparator();
playerMenu->addAction(aUntapAll); playerMenu->addAction(aUntapAll);
playerMenu->addSeparator(); playerMenu->addSeparator();
@ -465,6 +469,7 @@ Player::Player(const ServerInfo_User &info, int _id, bool _local, bool _judge, T
aCreateAnotherToken = nullptr; aCreateAnotherToken = nullptr;
createPredefinedTokenMenu = nullptr; createPredefinedTokenMenu = nullptr;
mCardCounters = nullptr; mCardCounters = nullptr;
aIncrementAllCardCountersOnTable = nullptr;
} }
aTap = new QAction(this); aTap = new QAction(this);
@ -910,6 +915,7 @@ void Player::retranslateUi()
aSetCounter[i]->setText(tr("&Set counters (%1)...").arg(cardCounterSettings.displayName(i))); aSetCounter[i]->setText(tr("&Set counters (%1)...").arg(cardCounterSettings.displayName(i)));
} }
aIncrementAllCardCountersOnTable->setText(tr("Increment all counters on permanents you control"));
aMoveToTopLibrary->setText(tr("&Top of library in random order")); aMoveToTopLibrary->setText(tr("&Top of library in random order"));
aMoveToXfromTopOfLibrary->setText(tr("X cards from the top of library...")); aMoveToXfromTopOfLibrary->setText(tr("X cards from the top of library..."));
aMoveToBottomLibrary->setText(tr("&Bottom of library in random order")); aMoveToBottomLibrary->setText(tr("&Bottom of library in random order"));
@ -997,7 +1003,8 @@ void Player::setShortcutsActive()
while (counterIterator.hasNext()) { while (counterIterator.hasNext()) {
counterIterator.next().value()->setShortcutsActive(); counterIterator.next().value()->setShortcutsActive();
} }
aIncrementAllCardCountersOnTable->setShortcut(
shortcuts.getSingleShortcut("Player/aIncrementAllCardCountersOnTable"));
aViewSideboard->setShortcut(shortcuts.getSingleShortcut("Player/aViewSideboard")); aViewSideboard->setShortcut(shortcuts.getSingleShortcut("Player/aViewSideboard"));
aViewLibrary->setShortcut(shortcuts.getSingleShortcut("Player/aViewLibrary")); aViewLibrary->setShortcut(shortcuts.getSingleShortcut("Player/aViewLibrary"));
aViewHand->setShortcut(shortcuts.getSingleShortcut("Player/aViewHand")); aViewHand->setShortcut(shortcuts.getSingleShortcut("Player/aViewHand"));
@ -1084,6 +1091,7 @@ void Player::setShortcutsInactive()
aMoveBottomCardsToGraveyard->setShortcut(QKeySequence()); aMoveBottomCardsToGraveyard->setShortcut(QKeySequence());
aMoveBottomCardToExile->setShortcut(QKeySequence()); aMoveBottomCardToExile->setShortcut(QKeySequence());
aMoveBottomCardsToExile->setShortcut(QKeySequence()); aMoveBottomCardsToExile->setShortcut(QKeySequence());
aIncrementAllCardCountersOnTable->setShortcut(QKeySequence());
QMapIterator<int, AbstractCounter *> counterIterator(counters); QMapIterator<int, AbstractCounter *> counterIterator(counters);
while (counterIterator.hasNext()) { while (counterIterator.hasNext()) {