mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-08 17:13:57 -07:00
use replayDock to determine if replay tab
This commit is contained in:
parent
d62a271f6a
commit
96612e2f31
1 changed files with 12 additions and 10 deletions
|
|
@ -255,13 +255,15 @@ void TabGame::emitUserEvent()
|
|||
|
||||
TabGame::~TabGame()
|
||||
{
|
||||
delete replayManager->replay;
|
||||
if (replayDock) {
|
||||
delete replayManager->replay;
|
||||
}
|
||||
}
|
||||
|
||||
void TabGame::updatePlayerListDockTitle()
|
||||
{
|
||||
QString tabText = " | " + (replayManager->replay ? tr("Replay") : tr("Game")) + " #" +
|
||||
QString::number(game->getGameMetaInfo()->gameId());
|
||||
QString type = replayDock ? tr("Replay") : tr("Game");
|
||||
QString tabText = " | " + type + " #" + QString::number(game->getGameMetaInfo()->gameId());
|
||||
QString userCountInfo =
|
||||
QString(" %1/%2").arg(game->getPlayerManager()->getPlayerCount()).arg(game->getGameMetaInfo()->maxPlayers());
|
||||
playerListDock->setWindowTitle(tr("Player List") + userCountInfo +
|
||||
|
|
@ -270,8 +272,8 @@ void TabGame::updatePlayerListDockTitle()
|
|||
|
||||
void TabGame::retranslateUi()
|
||||
{
|
||||
QString tabText = " | " + (replayManager->replay ? tr("Replay") : tr("Game")) + " #" +
|
||||
QString::number(game->getGameMetaInfo()->gameId());
|
||||
QString type = replayDock ? tr("Replay") : tr("Game");
|
||||
QString tabText = " | " + type + " #" + QString::number(game->getGameMetaInfo()->gameId());
|
||||
|
||||
updatePlayerListDockTitle();
|
||||
cardInfoDock->setWindowTitle(tr("Card Info") + (cardInfoDock->isWindow() ? tabText : QString()));
|
||||
|
|
@ -317,7 +319,7 @@ void TabGame::retranslateUi()
|
|||
}
|
||||
}
|
||||
if (aLeaveGame) {
|
||||
if (replayManager->replay) {
|
||||
if (replayDock) {
|
||||
aLeaveGame->setText(tr("C&lose replay"));
|
||||
} else {
|
||||
aLeaveGame->setText(tr("&Leave game"));
|
||||
|
|
@ -516,7 +518,7 @@ bool TabGame::leaveGame()
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!replayManager->replay)
|
||||
if (!replayDock)
|
||||
emit gameLeft();
|
||||
}
|
||||
return true;
|
||||
|
|
@ -903,7 +905,7 @@ QString TabGame::getTabText() const
|
|||
QString gameId(QString::number(game->getGameMetaInfo()->gameId()));
|
||||
|
||||
QString tabText;
|
||||
if (replayManager->replay)
|
||||
if (replayDock)
|
||||
tabText.append(tr("Replay") + " ");
|
||||
if (!gameTypeInfo.isEmpty())
|
||||
tabText.append(gameTypeInfo + " ");
|
||||
|
|
@ -1084,7 +1086,7 @@ void TabGame::createViewMenuItems()
|
|||
void TabGame::loadLayout()
|
||||
{
|
||||
LayoutsSettings &layouts = SettingsCache::instance().layouts();
|
||||
if (replayManager->replay) {
|
||||
if (replayDock) {
|
||||
restoreGeometry(layouts.getReplayPlayAreaGeometry());
|
||||
restoreState(layouts.getReplayPlayAreaLayoutState());
|
||||
|
||||
|
|
@ -1120,7 +1122,7 @@ void TabGame::loadLayout()
|
|||
aMessageLayoutDockFloating->setChecked(messageLayoutDock->isFloating());
|
||||
aPlayerListDockFloating->setChecked(playerListDock->isFloating());
|
||||
|
||||
if (replayManager->replay) {
|
||||
if (replayDock) {
|
||||
aReplayDockVisible->setChecked(replayDock->isVisible());
|
||||
aReplayDockFloating->setEnabled(aReplayDockVisible->isChecked());
|
||||
aReplayDockFloating->setChecked(replayDock->isFloating());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue