7 #include <vertScrollArea.h> |
7 #include <vertScrollArea.h> |
8 #include "teamselect.h" |
8 #include "teamselect.h" |
9 #include "teamselhelper.h" |
9 #include "teamselhelper.h" |
10 #include "frameTeam.h" |
10 #include "frameTeam.h" |
11 |
11 |
12 void TeamSelWidget::addTeam(tmprop team) |
12 void TeamSelWidget::addTeam(HWTeam team) |
13 { |
13 { |
14 frameDontPlaying->addTeam(team); |
14 frameDontPlaying->addTeam(team); |
15 curDontPlayingTeams.push_back(team); |
15 curDontPlayingTeams.push_back(team); |
16 QObject::connect(frameDontPlaying->getTeamWidget(team), SIGNAL(teamStatusChanged(tmprop)), |
16 QObject::connect(frameDontPlaying->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)), |
17 this, SLOT(changeTeamStatus(tmprop))); |
17 this, SLOT(changeTeamStatus(HWTeam))); |
18 } |
18 } |
19 |
19 |
20 void TeamSelWidget::removeTeam(tmprop team) |
20 //void TeamSelWidget::removeTeam(__attribute__ ((unused)) HWTeam team) |
|
21 //{ |
|
22 //curDontPlayingTeams.erase(std::find(curDontPlayingTeams.begin(), curDontPlayingTeams.end(), team)); |
|
23 //} |
|
24 |
|
25 void TeamSelWidget::changeTeamStatus(HWTeam team) |
21 { |
26 { |
22 //curDontPlayingTeams.erase(std::find(curDontPlayingTeams.begin(), curDontPlayingTeams.end(), team)); |
27 list<HWTeam>::iterator itDontPlay=std::find(curDontPlayingTeams.begin(), curDontPlayingTeams.end(), team); |
23 } |
28 list<HWTeam>::iterator itPlay=std::find(curPlayingTeams.begin(), curPlayingTeams.end(), team); |
24 |
|
25 void TeamSelWidget::changeTeamStatus(tmprop team) |
|
26 { |
|
27 list<tmprop>::iterator itDontPlay=std::find(curDontPlayingTeams.begin(), curDontPlayingTeams.end(), team); |
|
28 list<tmprop>::iterator itPlay=std::find(curPlayingTeams.begin(), curPlayingTeams.end(), team); |
|
29 |
29 |
30 if(itDontPlay==curDontPlayingTeams.end()) { |
30 if(itDontPlay==curDontPlayingTeams.end()) { |
31 // playing team => dont playing |
31 // playing team => dont playing |
32 curDontPlayingTeams.push_back(*itPlay); |
32 curDontPlayingTeams.push_back(*itPlay); |
33 curPlayingTeams.erase(itPlay); |
33 curPlayingTeams.erase(itPlay); |
47 pAddTeams=framePlaying; |
47 pAddTeams=framePlaying; |
48 } |
48 } |
49 |
49 |
50 pAddTeams->addTeam(team); |
50 pAddTeams->addTeam(team); |
51 pRemoveTeams->removeTeam(team); |
51 pRemoveTeams->removeTeam(team); |
52 QObject::connect(pAddTeams->getTeamWidget(team), SIGNAL(teamStatusChanged(tmprop)), |
52 QObject::connect(pAddTeams->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)), |
53 this, SLOT(changeTeamStatus(tmprop))); |
53 this, SLOT(changeTeamStatus(HWTeam))); |
54 } |
54 } |
55 |
55 |
56 void TeamSelWidget::addScrArea(FrameTeams* pfteams, QColor color) |
56 void TeamSelWidget::addScrArea(FrameTeams* pfteams, QColor color) |
57 { |
57 { |
58 VertScrArea* area=new VertScrArea(color); |
58 VertScrArea* area=new VertScrArea(color); |