Consolidate closeReplay action into leaveGame (#6239)

This commit is contained in:
RickyRister 2025-10-09 18:59:53 -07:00 committed by GitHub
parent c42e953199
commit 8ebfc40de5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 14 deletions

View file

@ -323,10 +323,11 @@ void TabGame::retranslateUi()
} }
} }
if (aLeaveGame) { if (aLeaveGame) {
aLeaveGame->setText(tr("&Leave game")); if (replayManager->replay) {
} aLeaveGame->setText(tr("C&lose replay"));
if (aCloseReplay) { } else {
aCloseReplay->setText(tr("C&lose replay")); aLeaveGame->setText(tr("&Leave game"));
}
} }
if (aFocusChat) { if (aFocusChat) {
aFocusChat->setText(tr("&Focus Chat")); aFocusChat->setText(tr("&Focus Chat"));
@ -444,9 +445,6 @@ void TabGame::refreshShortcuts()
if (aLeaveGame) { if (aLeaveGame) {
aLeaveGame->setShortcuts(shortcuts.getShortcut("Player/aLeaveGame")); aLeaveGame->setShortcuts(shortcuts.getShortcut("Player/aLeaveGame"));
} }
if (aCloseReplay) {
aCloseReplay->setShortcuts(shortcuts.getShortcut("Player/aCloseReplay"));
}
if (aResetLayout) { if (aResetLayout) {
aResetLayout->setShortcuts(shortcuts.getShortcut("Player/aResetLayout")); aResetLayout->setShortcuts(shortcuts.getShortcut("Player/aResetLayout"));
} }
@ -979,7 +977,6 @@ void TabGame::createMenuItems()
connect(aLeaveGame, &QAction::triggered, this, &TabGame::closeRequest); connect(aLeaveGame, &QAction::triggered, this, &TabGame::closeRequest);
aFocusChat = new QAction(this); aFocusChat = new QAction(this);
connect(aFocusChat, &QAction::triggered, sayEdit, qOverload<>(&LineEditCompleter::setFocus)); connect(aFocusChat, &QAction::triggered, sayEdit, qOverload<>(&LineEditCompleter::setFocus));
aCloseReplay = nullptr;
phasesMenu = new TearOffMenu(this); phasesMenu = new TearOffMenu(this);
@ -1029,13 +1026,12 @@ void TabGame::createReplayMenuItems()
aGameInfo = nullptr; aGameInfo = nullptr;
aConcede = nullptr; aConcede = nullptr;
aFocusChat = nullptr; aFocusChat = nullptr;
aLeaveGame = nullptr; aLeaveGame = new QAction(this);
aCloseReplay = new QAction(this); connect(aLeaveGame, &QAction::triggered, this, &TabGame::closeRequest);
connect(aCloseReplay, &QAction::triggered, this, &TabGame::closeRequest);
phasesMenu = nullptr; phasesMenu = nullptr;
gameMenu = new QMenu(this); gameMenu = new QMenu(this);
gameMenu->addAction(aCloseReplay); gameMenu->addAction(aLeaveGame);
aCardMenu = nullptr; aCardMenu = nullptr;

View file

@ -83,8 +83,8 @@ private:
QAction *playersSeparator; QAction *playersSeparator;
QMenu *gameMenu, *viewMenu, *cardInfoDockMenu, *messageLayoutDockMenu, *playerListDockMenu, *replayDockMenu; QMenu *gameMenu, *viewMenu, *cardInfoDockMenu, *messageLayoutDockMenu, *playerListDockMenu, *replayDockMenu;
TearOffMenu *phasesMenu; TearOffMenu *phasesMenu;
QAction *aGameInfo, *aConcede, *aLeaveGame, *aCloseReplay, *aNextPhase, *aNextPhaseAction, *aNextTurn, QAction *aGameInfo, *aConcede, *aLeaveGame, *aNextPhase, *aNextPhaseAction, *aNextTurn, *aReverseTurn,
*aReverseTurn, *aRemoveLocalArrows, *aRotateViewCW, *aRotateViewCCW, *aResetLayout, *aResetReplayLayout; *aRemoveLocalArrows, *aRotateViewCW, *aRotateViewCCW, *aResetLayout, *aResetReplayLayout;
QAction *aCardInfoDockVisible, *aCardInfoDockFloating, *aMessageLayoutDockVisible, *aMessageLayoutDockFloating, QAction *aCardInfoDockVisible, *aCardInfoDockFloating, *aMessageLayoutDockVisible, *aMessageLayoutDockFloating,
*aPlayerListDockVisible, *aPlayerListDockFloating, *aReplayDockVisible, *aReplayDockFloating; *aPlayerListDockVisible, *aPlayerListDockFloating, *aReplayDockVisible, *aReplayDockFloating;
QAction *aFocusChat; QAction *aFocusChat;