mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-09 01:23: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()
|
TabGame::~TabGame()
|
||||||
{
|
{
|
||||||
delete replayManager->replay;
|
if (replayDock) {
|
||||||
|
delete replayManager->replay;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabGame::updatePlayerListDockTitle()
|
void TabGame::updatePlayerListDockTitle()
|
||||||
{
|
{
|
||||||
QString tabText = " | " + (replayManager->replay ? tr("Replay") : tr("Game")) + " #" +
|
QString type = replayDock ? tr("Replay") : tr("Game");
|
||||||
QString::number(game->getGameMetaInfo()->gameId());
|
QString tabText = " | " + type + " #" + QString::number(game->getGameMetaInfo()->gameId());
|
||||||
QString userCountInfo =
|
QString userCountInfo =
|
||||||
QString(" %1/%2").arg(game->getPlayerManager()->getPlayerCount()).arg(game->getGameMetaInfo()->maxPlayers());
|
QString(" %1/%2").arg(game->getPlayerManager()->getPlayerCount()).arg(game->getGameMetaInfo()->maxPlayers());
|
||||||
playerListDock->setWindowTitle(tr("Player List") + userCountInfo +
|
playerListDock->setWindowTitle(tr("Player List") + userCountInfo +
|
||||||
|
|
@ -270,8 +272,8 @@ void TabGame::updatePlayerListDockTitle()
|
||||||
|
|
||||||
void TabGame::retranslateUi()
|
void TabGame::retranslateUi()
|
||||||
{
|
{
|
||||||
QString tabText = " | " + (replayManager->replay ? tr("Replay") : tr("Game")) + " #" +
|
QString type = replayDock ? tr("Replay") : tr("Game");
|
||||||
QString::number(game->getGameMetaInfo()->gameId());
|
QString tabText = " | " + type + " #" + QString::number(game->getGameMetaInfo()->gameId());
|
||||||
|
|
||||||
updatePlayerListDockTitle();
|
updatePlayerListDockTitle();
|
||||||
cardInfoDock->setWindowTitle(tr("Card Info") + (cardInfoDock->isWindow() ? tabText : QString()));
|
cardInfoDock->setWindowTitle(tr("Card Info") + (cardInfoDock->isWindow() ? tabText : QString()));
|
||||||
|
|
@ -317,7 +319,7 @@ void TabGame::retranslateUi()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (aLeaveGame) {
|
if (aLeaveGame) {
|
||||||
if (replayManager->replay) {
|
if (replayDock) {
|
||||||
aLeaveGame->setText(tr("C&lose replay"));
|
aLeaveGame->setText(tr("C&lose replay"));
|
||||||
} else {
|
} else {
|
||||||
aLeaveGame->setText(tr("&Leave game"));
|
aLeaveGame->setText(tr("&Leave game"));
|
||||||
|
|
@ -516,7 +518,7 @@ bool TabGame::leaveGame()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!replayManager->replay)
|
if (!replayDock)
|
||||||
emit gameLeft();
|
emit gameLeft();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -903,7 +905,7 @@ QString TabGame::getTabText() const
|
||||||
QString gameId(QString::number(game->getGameMetaInfo()->gameId()));
|
QString gameId(QString::number(game->getGameMetaInfo()->gameId()));
|
||||||
|
|
||||||
QString tabText;
|
QString tabText;
|
||||||
if (replayManager->replay)
|
if (replayDock)
|
||||||
tabText.append(tr("Replay") + " ");
|
tabText.append(tr("Replay") + " ");
|
||||||
if (!gameTypeInfo.isEmpty())
|
if (!gameTypeInfo.isEmpty())
|
||||||
tabText.append(gameTypeInfo + " ");
|
tabText.append(gameTypeInfo + " ");
|
||||||
|
|
@ -1084,7 +1086,7 @@ void TabGame::createViewMenuItems()
|
||||||
void TabGame::loadLayout()
|
void TabGame::loadLayout()
|
||||||
{
|
{
|
||||||
LayoutsSettings &layouts = SettingsCache::instance().layouts();
|
LayoutsSettings &layouts = SettingsCache::instance().layouts();
|
||||||
if (replayManager->replay) {
|
if (replayDock) {
|
||||||
restoreGeometry(layouts.getReplayPlayAreaGeometry());
|
restoreGeometry(layouts.getReplayPlayAreaGeometry());
|
||||||
restoreState(layouts.getReplayPlayAreaLayoutState());
|
restoreState(layouts.getReplayPlayAreaLayoutState());
|
||||||
|
|
||||||
|
|
@ -1120,7 +1122,7 @@ void TabGame::loadLayout()
|
||||||
aMessageLayoutDockFloating->setChecked(messageLayoutDock->isFloating());
|
aMessageLayoutDockFloating->setChecked(messageLayoutDock->isFloating());
|
||||||
aPlayerListDockFloating->setChecked(playerListDock->isFloating());
|
aPlayerListDockFloating->setChecked(playerListDock->isFloating());
|
||||||
|
|
||||||
if (replayManager->replay) {
|
if (replayDock) {
|
||||||
aReplayDockVisible->setChecked(replayDock->isVisible());
|
aReplayDockVisible->setChecked(replayDock->isVisible());
|
||||||
aReplayDockFloating->setEnabled(aReplayDockVisible->isChecked());
|
aReplayDockFloating->setEnabled(aReplayDockVisible->isChecked());
|
||||||
aReplayDockFloating->setChecked(replayDock->isFloating());
|
aReplayDockFloating->setChecked(replayDock->isFloating());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue