equal
deleted
inserted
replaced
453 GoToPage(ID_PAGE_SCHEME); |
453 GoToPage(ID_PAGE_SCHEME); |
454 } |
454 } |
455 |
455 |
456 void HWForm::OnPageShown(quint8 id, quint8 lastid) |
456 void HWForm::OnPageShown(quint8 id, quint8 lastid) |
457 { |
457 { |
|
458 // with all those signals firing around make sure we don't switch a page |
|
459 // at the same time in different threads |
|
460 onPageShownMutex.lock(); |
|
461 |
458 #ifdef USE_XFIRE |
462 #ifdef USE_XFIRE |
459 updateXfire(); |
463 updateXfire(); |
460 #endif |
464 #endif |
461 if (id == ID_PAGE_DATADOWNLOAD) |
465 if (id == ID_PAGE_DATADOWNLOAD) |
462 { |
466 { |
475 if (lastid == ID_PAGE_DRAWMAP) { |
479 if (lastid == ID_PAGE_DRAWMAP) { |
476 if (id == ID_PAGE_MULTIPLAYER) |
480 if (id == ID_PAGE_MULTIPLAYER) |
477 ui.pageMultiplayer->gameCFG->pMapContainer->mapDrawingFinished(); |
481 ui.pageMultiplayer->gameCFG->pMapContainer->mapDrawingFinished(); |
478 else |
482 else |
479 ui.pageNetGame->pGameCFG->pMapContainer->mapDrawingFinished(); |
483 ui.pageNetGame->pGameCFG->pMapContainer->mapDrawingFinished(); |
|
484 } |
|
485 |
|
486 if (id == ID_PAGE_ROOMSLIST) { |
|
487 if (hwnet && game && game->gameState == gsStarted) { // abnormal exit - kick or room destruction - send kills. |
|
488 game->netSuspend = true; |
|
489 game->KillAllTeams(); |
|
490 } |
480 } |
491 } |
481 |
492 |
482 if (id == ID_PAGE_MULTIPLAYER || id == ID_PAGE_NETGAME) { |
493 if (id == ID_PAGE_MULTIPLAYER || id == ID_PAGE_NETGAME) { |
483 QStringList tmNames = config->GetTeamsList(); |
494 QStringList tmNames = config->GetTeamsList(); |
484 TeamSelWidget* curTeamSelWidget; |
495 TeamSelWidget* curTeamSelWidget; |
523 ui.pageRoomsList->chatWidget->saveLists(ui.pageOptions->editNetNick->text()); |
534 ui.pageRoomsList->chatWidget->saveLists(ui.pageOptions->editNetNick->text()); |
524 |
535 |
525 if (id == ID_PAGE_NETGAME) // joining a room |
536 if (id == ID_PAGE_NETGAME) // joining a room |
526 ui.pageNetGame->pChatWidget->loadLists(ui.pageOptions->editNetNick->text()); |
537 ui.pageNetGame->pChatWidget->loadLists(ui.pageOptions->editNetNick->text()); |
527 // joining the lobby |
538 // joining the lobby |
528 else if (id == ID_PAGE_ROOMSLIST) { |
539 else if (id == ID_PAGE_ROOMSLIST) |
529 if (hwnet && game && game->gameState == gsStarted) { // abnormal exit - kick or room destruction - send kills. |
|
530 game->netSuspend = true; |
|
531 game->KillAllTeams(); |
|
532 } |
|
533 ui.pageRoomsList->chatWidget->loadLists(ui.pageOptions->editNetNick->text()); |
540 ui.pageRoomsList->chatWidget->loadLists(ui.pageOptions->editNetNick->text()); |
534 } |
541 |
|
542 |
|
543 onPageShownMutex.unlock(); |
535 } |
544 } |
536 |
545 |
537 void HWForm::GoToPage(int id) |
546 void HWForm::GoToPage(int id) |
538 { |
547 { |
539 int lastid = ui.Pages->currentIndex(); |
548 int lastid = ui.Pages->currentIndex(); |