equal
deleted
inserted
replaced
38 connect(framePlaying->getTeamWidget(team), SIGNAL(teamColorChanged(const HWTeam&)), |
38 connect(framePlaying->getTeamWidget(team), SIGNAL(teamColorChanged(const HWTeam&)), |
39 this, SLOT(proxyTeamColorChanged(const HWTeam&))); |
39 this, SLOT(proxyTeamColorChanged(const HWTeam&))); |
40 } else { |
40 } else { |
41 frameDontPlaying->addTeam(team, false); |
41 frameDontPlaying->addTeam(team, false); |
42 curDontPlayingTeams.push_back(team); |
42 curDontPlayingTeams.push_back(team); |
43 QObject::connect(frameDontPlaying->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)), |
43 if(m_acceptOuter) { |
44 this, SLOT(changeTeamStatus(HWTeam))); |
44 connect(frameDontPlaying->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)), |
|
45 this, SLOT(pre_changeTeamStatus(HWTeam))); |
|
46 } else { |
|
47 connect(frameDontPlaying->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)), |
|
48 this, SLOT(changeTeamStatus(HWTeam))); |
|
49 } |
45 } |
50 } |
46 } |
51 } |
47 |
52 |
48 void TeamSelWidget::setNonInteractive() |
53 void TeamSelWidget::setNonInteractive() |
49 { |
54 { |
122 } else { |
127 } else { |
123 // return if max playing teams reached |
128 // return if max playing teams reached |
124 if(framePlaying->isFullTeams()) return; |
129 if(framePlaying->isFullTeams()) return; |
125 // dont playing team => playing |
130 // dont playing team => playing |
126 curPlayingTeams.push_back(*itDontPlay); |
131 curPlayingTeams.push_back(*itDontPlay); |
127 emit teamWillPlay(*itDontPlay); |
132 if(!m_acceptOuter) emit teamWillPlay(*itDontPlay); |
128 curDontPlayingTeams.erase(itDontPlay); |
133 curDontPlayingTeams.erase(itDontPlay); |
129 } |
134 } |
130 |
135 |
131 FrameTeams* pRemoveTeams; |
136 FrameTeams* pRemoveTeams; |
132 FrameTeams* pAddTeams; |
137 FrameTeams* pAddTeams; |
166 if (maxHeight > 0) |
171 if (maxHeight > 0) |
167 area->setMaximumHeight(maxHeight); |
172 area->setMaximumHeight(maxHeight); |
168 } |
173 } |
169 |
174 |
170 TeamSelWidget::TeamSelWidget(QWidget* parent) : |
175 TeamSelWidget::TeamSelWidget(QWidget* parent) : |
171 QGroupBox(parent), mainLayout(this) |
176 QGroupBox(parent), mainLayout(this), m_acceptOuter(false) |
172 { |
177 { |
173 setTitle(QGroupBox::tr("Playing teams")); |
178 setTitle(QGroupBox::tr("Playing teams")); |
174 framePlaying=new FrameTeams(); |
179 framePlaying=new FrameTeams(); |
175 frameDontPlaying=new FrameTeams(); |
180 frameDontPlaying=new FrameTeams(); |
176 // addScrArea(framePlaying, QColor("DarkTurquoise")); |
181 // addScrArea(framePlaying, QColor("DarkTurquoise")); |
182 newTeam->setText(QPushButton::tr("New team")); |
187 newTeam->setText(QPushButton::tr("New team")); |
183 connect(newTeam, SIGNAL(clicked()), this, SLOT(newTeamClicked())); |
188 connect(newTeam, SIGNAL(clicked()), this, SLOT(newTeamClicked())); |
184 mainLayout.addWidget(newTeam); |
189 mainLayout.addWidget(newTeam); |
185 } |
190 } |
186 |
191 |
|
192 void TeamSelWidget::setAcceptOuter(bool acceptOuter) |
|
193 { |
|
194 m_acceptOuter=acceptOuter; |
|
195 } |
|
196 |
187 void TeamSelWidget::resetPlayingTeams(const QList<HWTeam>& teamslist) |
197 void TeamSelWidget::resetPlayingTeams(const QList<HWTeam>& teamslist) |
188 { |
198 { |
189 QList<HWTeam>::iterator it; |
199 QList<HWTeam>::iterator it; |
190 for(it=curPlayingTeams.begin(); it!=curPlayingTeams.end(); it++) { |
200 for(it=curPlayingTeams.begin(); it!=curPlayingTeams.end(); it++) { |
191 framePlaying->removeTeam(*it); |
201 framePlaying->removeTeam(*it); |
210 QList<HWTeam> TeamSelWidget::getPlayingTeams() const |
220 QList<HWTeam> TeamSelWidget::getPlayingTeams() const |
211 { |
221 { |
212 return curPlayingTeams; |
222 return curPlayingTeams; |
213 } |
223 } |
214 |
224 |
|
225 void TeamSelWidget::pre_changeTeamStatus(HWTeam team) |
|
226 { |
|
227 emit acceptRequested(team); |
|
228 } |
|
229 |
215 void TeamSelWidget::newTeamClicked() |
230 void TeamSelWidget::newTeamClicked() |
216 { |
231 { |
217 emit NewTeam(); |
232 emit NewTeam(); |
218 } |
233 } |