281 { |
281 { |
282 HWGame* game = new HWGame(config, m_pGameCFGWidget, m_pTeamSelWidget); // FIXME: memory leak here (stackify it?) |
282 HWGame* game = new HWGame(config, m_pGameCFGWidget, m_pTeamSelWidget); // FIXME: memory leak here (stackify it?) |
283 connect(game, SIGNAL(SendNet(const QByteArray &)), this, SLOT(SendNet(const QByteArray &))); |
283 connect(game, SIGNAL(SendNet(const QByteArray &)), this, SLOT(SendNet(const QByteArray &))); |
284 connect(this, SIGNAL(FromNet(const QByteArray &)), game, SLOT(FromNet(const QByteArray &))); |
284 connect(this, SIGNAL(FromNet(const QByteArray &)), game, SLOT(FromNet(const QByteArray &))); |
285 connect(this, SIGNAL(LocalCFG(const QString &)), game, SLOT(LocalCFG(const QString &))); |
285 connect(this, SIGNAL(LocalCFG(const QString &)), game, SLOT(LocalCFG(const QString &))); |
|
286 connect(game, SIGNAL(ErrorMessage(const QString &)), this, SLOT(ShowErrorMessage(const QString &)), Qt::QueuedConnection); |
286 game->StartNet(); |
287 game->StartNet(); |
|
288 } |
|
289 |
|
290 void HWNewNet::ShowErrorMessage(const QString & msg) |
|
291 { |
|
292 QMessageBox::warning(0, |
|
293 "Hedgewars", |
|
294 msg); |
287 } |
295 } |
288 |
296 |
289 void HWNewNet::onHedgehogsNumChanged(const HWTeam& team) |
297 void HWNewNet::onHedgehogsNumChanged(const HWTeam& team) |
290 { |
298 { |
291 qDebug() << team.getNetID() << ":" << team.numHedgehogs; |
299 qDebug() << team.getNetID() << ":" << team.numHedgehogs; |