24 #include <vertScrollArea.h> |
24 #include <vertScrollArea.h> |
25 #include "teamselect.h" |
25 #include "teamselect.h" |
26 #include "teamselhelper.h" |
26 #include "teamselhelper.h" |
27 #include "frameTeam.h" |
27 #include "frameTeam.h" |
28 |
28 |
29 void TeamSelWidget::addTeam(HWTeam team) |
29 void TeamSelWidget::addTeam(HWTeam team, bool netTeam) |
30 { |
30 { |
31 frameDontPlaying->addTeam(team, false); |
31 if(netTeam) { |
32 curDontPlayingTeams.push_back(team); |
32 framePlaying->addTeam(team, true); |
33 QObject::connect(frameDontPlaying->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)), |
33 curPlayingTeams.push_back(team); |
34 this, SLOT(changeTeamStatus(HWTeam))); |
34 } else { |
|
35 frameDontPlaying->addTeam(team, false); |
|
36 curDontPlayingTeams.push_back(team); |
|
37 QObject::connect(frameDontPlaying->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)), |
|
38 this, SLOT(changeTeamStatus(HWTeam))); |
|
39 } |
35 } |
40 } |
36 |
41 |
37 //void TeamSelWidget::removeTeam(__attribute__ ((unused)) HWTeam team) |
42 //void TeamSelWidget::removeTeam(__attribute__ ((unused)) HWTeam team) |
38 //{ |
43 //{ |
39 //curDontPlayingTeams.erase(std::find(curDontPlayingTeams.begin(), curDontPlayingTeams.end(), team)); |
44 //curDontPlayingTeams.erase(std::find(curDontPlayingTeams.begin(), curDontPlayingTeams.end(), team)); |
53 } else { |
58 } else { |
54 // return if max playing teams reached |
59 // return if max playing teams reached |
55 if(framePlaying->isFullTeams()) return; |
60 if(framePlaying->isFullTeams()) return; |
56 // dont playing team => playing |
61 // dont playing team => playing |
57 curPlayingTeams.push_back(*itDontPlay); |
62 curPlayingTeams.push_back(*itDontPlay); |
|
63 emit teamWillPlay(*itDontPlay); |
58 curDontPlayingTeams.erase(itDontPlay); |
64 curDontPlayingTeams.erase(itDontPlay); |
59 } |
65 } |
60 |
66 |
61 FrameTeams* pRemoveTeams; |
67 FrameTeams* pRemoveTeams; |
62 FrameTeams* pAddTeams; |
68 FrameTeams* pAddTeams; |