446 } |
446 } |
447 |
447 |
448 ui.pageRoomsList->chatWidget->clear(); |
448 ui.pageRoomsList->chatWidget->clear(); |
449 |
449 |
450 hwnet = new HWNewNet(config, ui.pageNetGame->pGameCFG, ui.pageNetGame->pNetTeamsWidget); |
450 hwnet = new HWNewNet(config, ui.pageNetGame->pGameCFG, ui.pageNetGame->pNetTeamsWidget); |
|
451 |
|
452 { |
|
453 GoToPage(ID_PAGE_CONNECTING); |
|
454 connect(hwnet, SIGNAL(Connected()), this, SLOT(GoBack())); |
|
455 connect(hwnet, SIGNAL(Disconnected()), this, SLOT(GoBack())); |
|
456 } |
451 |
457 |
452 connect(hwnet, SIGNAL(showMessage(const QString &)), this, SLOT(ShowErrorMessage(const QString &)), Qt::QueuedConnection); |
458 connect(hwnet, SIGNAL(showMessage(const QString &)), this, SLOT(ShowErrorMessage(const QString &)), Qt::QueuedConnection); |
453 |
459 |
454 connect(hwnet, SIGNAL(AskForRunGame()), this, SLOT(CreateNetGame())); |
460 connect(hwnet, SIGNAL(AskForRunGame()), this, SLOT(CreateNetGame())); |
455 connect(hwnet, SIGNAL(Connected()), this, SLOT(NetConnected())); |
461 connect(hwnet, SIGNAL(Connected()), this, SLOT(NetConnected())); |
531 connect(ui.pageNetGame->pGameCFG, SIGNAL(borderChanged(bool)), hwnet, SLOT(onBorderChanged(bool))); |
537 connect(ui.pageNetGame->pGameCFG, SIGNAL(borderChanged(bool)), hwnet, SLOT(onBorderChanged(bool))); |
532 connect(ui.pageNetGame->pGameCFG, SIGNAL(newWeaponScheme(const QString &, const QString &)), |
538 connect(ui.pageNetGame->pGameCFG, SIGNAL(newWeaponScheme(const QString &, const QString &)), |
533 hwnet, SLOT(onWeaponsNameChanged(const QString &, const QString &))); |
539 hwnet, SLOT(onWeaponsNameChanged(const QString &, const QString &))); |
534 connect(ui.pageNetGame->pGameCFG, SIGNAL(newTemplateFilter(int)), hwnet, SLOT(onTemplateFilterChanged(int))); |
540 connect(ui.pageNetGame->pGameCFG, SIGNAL(newTemplateFilter(int)), hwnet, SLOT(onTemplateFilterChanged(int))); |
535 |
541 |
536 connect(hwnet, SIGNAL(Disconnected()), this, SLOT(ForcedDisconnect())); |
542 connect(hwnet, SIGNAL(Disconnected()), this, SLOT(ForcedDisconnect()), Qt::QueuedConnection); |
537 connect(hwnet, SIGNAL(seedChanged(const QString &)), ui.pageNetGame->pGameCFG, SLOT(setSeed(const QString &))); |
543 connect(hwnet, SIGNAL(seedChanged(const QString &)), ui.pageNetGame->pGameCFG, SLOT(setSeed(const QString &))); |
538 connect(hwnet, SIGNAL(mapChanged(const QString &)), ui.pageNetGame->pGameCFG, SLOT(setMap(const QString &))); |
544 connect(hwnet, SIGNAL(mapChanged(const QString &)), ui.pageNetGame->pGameCFG, SLOT(setMap(const QString &))); |
539 connect(hwnet, SIGNAL(themeChanged(const QString &)), ui.pageNetGame->pGameCFG, SLOT(setTheme(const QString &))); |
545 connect(hwnet, SIGNAL(themeChanged(const QString &)), ui.pageNetGame->pGameCFG, SLOT(setTheme(const QString &))); |
540 connect(hwnet, SIGNAL(initHealthChanged(int)), ui.pageNetGame->pGameCFG, SLOT(setInitHealth(int))); |
546 connect(hwnet, SIGNAL(initHealthChanged(int)), ui.pageNetGame->pGameCFG, SLOT(setInitHealth(int))); |
541 connect(hwnet, SIGNAL(turnTimeChanged(int)), ui.pageNetGame->pGameCFG, SLOT(setTurnTime(int))); |
547 connect(hwnet, SIGNAL(turnTimeChanged(int)), ui.pageNetGame->pGameCFG, SLOT(setTurnTime(int))); |
623 if (hwnet) { |
630 if (hwnet) { |
624 hwnet->deleteLater(); |
631 hwnet->deleteLater(); |
625 hwnet = 0; |
632 hwnet = 0; |
626 QMessageBox::warning(this, QMessageBox::tr("Network"), |
633 QMessageBox::warning(this, QMessageBox::tr("Network"), |
627 QMessageBox::tr("Connection to server is lost")); |
634 QMessageBox::tr("Connection to server is lost")); |
628 } |
635 |
629 GoBack(); |
636 } |
|
637 if (ui.Pages->currentIndex() != ID_PAGE_NET) GoBack(); |
630 } |
638 } |
631 |
639 |
632 void HWForm::NetConnected() |
640 void HWForm::NetConnected() |
633 { |
641 { |
634 GoToPage(ID_PAGE_ROOMSLIST); |
642 GoToPage(ID_PAGE_ROOMSLIST); |