MainWindow: fix bugs introduced in 99e7628fed

This commit is contained in:
Olivier Teulière 2013-01-09 17:06:15 +01:00
parent c285e37354
commit b48f8c17d7

View file

@ -388,23 +388,23 @@ void MainWindow::updateForGame(PublicGame *iGame)
m_playModel.disconnect(this); m_playModel.disconnect(this);
// Destroy the players widget // Destroy the players widget
QtCommon::DestroyObject(m_playersWidget, this); QtCommon::DestroyObject(m_playersWidget, m_gameSignals);
m_playersWidget = NULL; m_playersWidget = NULL;
// Destroy the training widget // Destroy the training widget
QtCommon::DestroyObject(m_trainingWidget, this); QtCommon::DestroyObject(m_trainingWidget, m_gameSignals);
m_trainingWidget = NULL; m_trainingWidget = NULL;
// Destroy the topping widget // Destroy the topping widget
QtCommon::DestroyObject(m_toppingWidget, this); QtCommon::DestroyObject(m_toppingWidget, m_gameSignals);
m_toppingWidget = NULL; m_toppingWidget = NULL;
// Destroy the arbitration widget // Destroy the arbitration widget
QtCommon::DestroyObject(m_arbitrationWidget, this); QtCommon::DestroyObject(m_arbitrationWidget, m_gameSignals);
m_arbitrationWidget = NULL; m_arbitrationWidget = NULL;
// Destroy the scores widget // Destroy the scores widget
QtCommon::DestroyObject(m_scoresWidget, this); QtCommon::DestroyObject(m_scoresWidget, m_gameSignals);
m_scoresWidget = NULL; m_scoresWidget = NULL;
} }
else else
@ -435,7 +435,7 @@ void MainWindow::updateForGame(PublicGame *iGame)
m_trainingWidget = new TrainingWidget(NULL, m_playModel, iGame); m_trainingWidget = new TrainingWidget(NULL, m_playModel, iGame);
m_ui.groupBoxPlayers->layout()->addWidget(m_trainingWidget); m_ui.groupBoxPlayers->layout()->addWidget(m_trainingWidget);
QObject::connect(m_trainingWidget, SIGNAL(gameUpdated()), QObject::connect(m_trainingWidget, SIGNAL(gameUpdated()),
m_gameSignals, SIGNAL(gameUpdated())); m_gameSignals, SLOT(notifyGameUpdated()));
QObject::connect(m_trainingWidget, SIGNAL(notifyInfo(QString)), QObject::connect(m_trainingWidget, SIGNAL(notifyInfo(QString)),
this, SLOT(displayInfoMsg(QString))); this, SLOT(displayInfoMsg(QString)));
QObject::connect(m_trainingWidget, SIGNAL(notifyProblem(QString)), QObject::connect(m_trainingWidget, SIGNAL(notifyProblem(QString)),
@ -461,7 +461,7 @@ void MainWindow::updateForGame(PublicGame *iGame)
m_arbitrationWidget = new ArbitrationWidget(m_ui.groupBoxPlayers, iGame, m_playModel); m_arbitrationWidget = new ArbitrationWidget(m_ui.groupBoxPlayers, iGame, m_playModel);
m_ui.groupBoxPlayers->layout()->addWidget(m_arbitrationWidget); m_ui.groupBoxPlayers->layout()->addWidget(m_arbitrationWidget);
QObject::connect(m_arbitrationWidget, SIGNAL(gameUpdated()), QObject::connect(m_arbitrationWidget, SIGNAL(gameUpdated()),
m_gameSignals, SIGNAL(gameUpdated())); m_gameSignals, SLOT(notifyGameUpdated()));
QObject::connect(m_arbitrationWidget, SIGNAL(notifyInfo(QString)), QObject::connect(m_arbitrationWidget, SIGNAL(notifyInfo(QString)),
this, SLOT(displayInfoMsg(QString))); this, SLOT(displayInfoMsg(QString)));
QObject::connect(m_arbitrationWidget, SIGNAL(notifyProblem(QString)), QObject::connect(m_arbitrationWidget, SIGNAL(notifyProblem(QString)),
@ -486,7 +486,7 @@ void MainWindow::updateForGame(PublicGame *iGame)
m_toppingWidget = new ToppingWidget(NULL, m_playModel, iGame); m_toppingWidget = new ToppingWidget(NULL, m_playModel, iGame);
m_ui.groupBoxPlayers->layout()->addWidget(m_toppingWidget); m_ui.groupBoxPlayers->layout()->addWidget(m_toppingWidget);
QObject::connect(m_toppingWidget, SIGNAL(gameUpdated()), QObject::connect(m_toppingWidget, SIGNAL(gameUpdated()),
m_gameSignals, SIGNAL(gameUpdated())); m_gameSignals, SLOT(notifyGameUpdated()));
QObject::connect(m_toppingWidget, SIGNAL(notifyInfo(QString)), QObject::connect(m_toppingWidget, SIGNAL(notifyInfo(QString)),
this, SLOT(displayInfoMsg(QString))); this, SLOT(displayInfoMsg(QString)));
QObject::connect(m_toppingWidget, SIGNAL(notifyProblem(QString)), QObject::connect(m_toppingWidget, SIGNAL(notifyProblem(QString)),
@ -512,7 +512,7 @@ void MainWindow::updateForGame(PublicGame *iGame)
m_playersWidget = new PlayerTabWidget(m_playModel, NULL); m_playersWidget = new PlayerTabWidget(m_playModel, NULL);
m_ui.groupBoxPlayers->layout()->addWidget(m_playersWidget); m_ui.groupBoxPlayers->layout()->addWidget(m_playersWidget);
QObject::connect(m_playersWidget, SIGNAL(gameUpdated()), QObject::connect(m_playersWidget, SIGNAL(gameUpdated()),
m_gameSignals, SIGNAL(gameUpdated())); m_gameSignals, SLOT(notifyGameUpdated()));
QObject::connect(m_playersWidget, SIGNAL(notifyInfo(QString)), QObject::connect(m_playersWidget, SIGNAL(notifyInfo(QString)),
this, SLOT(displayInfoMsg(QString))); this, SLOT(displayInfoMsg(QString)));
QObject::connect(m_playersWidget, SIGNAL(notifyProblem(QString)), QObject::connect(m_playersWidget, SIGNAL(notifyProblem(QString)),