MainWindow: do not show the visual rack until a game is started

This commit is contained in:
Olivier Teulière 2013-01-20 11:45:46 +01:00
parent b37a4059ce
commit ff4b91459e
2 changed files with 14 additions and 8 deletions

View file

@ -164,17 +164,18 @@ MainWindow::MainWindow(QWidget *iParent)
vSplitter->addWidget(boardWidget);
#endif
// Rack widget below the board
RackWidget *rackWidget = new RackWidget;
rackWidget->setPlayModel(&m_playModel);
rackWidget->setFrameStyle(QFrame::WinPanel | QFrame::Raised);
QObject::connect(rackWidget, SIGNAL(gameUpdated()),
// Rack widget below the board (hidden until there is a game)
m_rackWidget = new RackWidget;
m_rackWidget->setPlayModel(&m_playModel);
m_rackWidget->setFrameStyle(QFrame::WinPanel | QFrame::Raised);
QObject::connect(m_rackWidget, SIGNAL(gameUpdated()),
m_gameSignals, SLOT(notifyGameUpdated()));
QObject::connect(m_gameSignals, SIGNAL(gameChanged(const PublicGame*)),
rackWidget, SLOT(setGame(const PublicGame*)));
m_rackWidget, SLOT(setGame(const PublicGame*)));
QObject::connect(m_gameSignals, SIGNAL(currPlayerRackChanged(const PlayedRack&)),
rackWidget, SLOT(setRack(const PlayedRack&)));
vSplitter->addWidget(rackWidget);
m_rackWidget, SLOT(setRack(const PlayedRack&)));
m_rackWidget->hide();
vSplitter->addWidget(m_rackWidget);
hlayout->addWidget(vSplitter);
m_ui.groupBoxTest->setLayout(hlayout);
@ -425,6 +426,7 @@ void MainWindow::updateForGame(PublicGame *iGame)
m_actionGamePrint->setEnabled(true);
m_actionGameSaveAs->setEnabled(true);
m_actionSettingsDefineTables->setEnabled(iGame->getMode() == PublicGame::kARBITRATION);
m_rackWidget->show();
statusBar()->addWidget(m_lettersLabel);
m_lettersLabel->show();
statusBar()->addWidget(m_turnLabel);

View file

@ -39,6 +39,7 @@ class Board;
class History;
class PublicGame;
class HistoryTabWidget;
class RackWidget;
class PlayerTabWidget;
class ScoreWidget;
class TrainingWidget;
@ -147,6 +148,9 @@ private:
/// Widget for the game history
HistoryTabWidget *m_historyTabWidget;
/// Widget for the visual rack
RackWidget *m_rackWidget;
/// Widget for the players
PlayerTabWidget *m_playersWidget;