equal
deleted
inserted
replaced
57 { |
57 { |
58 connect(frameDontPlaying->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)), |
58 connect(frameDontPlaying->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)), |
59 this, SLOT(changeTeamStatus(HWTeam))); |
59 this, SLOT(changeTeamStatus(HWTeam))); |
60 } |
60 } |
61 } |
61 } |
|
62 |
62 emit setEnabledGameStart(curPlayingTeams.size()>1); |
63 emit setEnabledGameStart(curPlayingTeams.size()>1); |
63 } |
64 } |
64 |
65 |
65 void TeamSelWidget::setInteractivity(bool interactive) |
66 void TeamSelWidget::setInteractivity(bool interactive) |
66 { |
67 { |
166 { |
167 { |
167 // playing team => dont playing |
168 // playing team => dont playing |
168 m_curNotPlayingTeams.push_back(*itPlay); |
169 m_curNotPlayingTeams.push_back(*itPlay); |
169 emit teamNotPlaying(*itPlay); |
170 emit teamNotPlaying(*itPlay); |
170 curPlayingTeams.erase(itPlay); |
171 curPlayingTeams.erase(itPlay); |
|
172 |
|
173 // Show team notice if less than two teams. |
|
174 if (curPlayingTeams.size() < 2) |
|
175 { |
|
176 numTeamNotice->show(); |
|
177 } |
171 } |
178 } |
172 else |
179 else |
173 { |
180 { |
174 // return if max playing teams reached |
181 // return if max playing teams reached |
175 if(framePlaying->isFullTeams()) return; |
182 if(framePlaying->isFullTeams()) return; |
177 itDontPlay->setColor(framePlaying->getNextColor()); |
184 itDontPlay->setColor(framePlaying->getNextColor()); |
178 team=*itDontPlay; // for net team info saving in framePlaying (we have only name with netID from network) |
185 team=*itDontPlay; // for net team info saving in framePlaying (we have only name with netID from network) |
179 curPlayingTeams.push_back(*itDontPlay); |
186 curPlayingTeams.push_back(*itDontPlay); |
180 if(!m_acceptOuter) emit teamWillPlay(*itDontPlay); |
187 if(!m_acceptOuter) emit teamWillPlay(*itDontPlay); |
181 m_curNotPlayingTeams.erase(itDontPlay); |
188 m_curNotPlayingTeams.erase(itDontPlay); |
|
189 |
|
190 // Hide team notice if at least two teams. |
|
191 if (curPlayingTeams.size() >= 2) |
|
192 { |
|
193 numTeamNotice->hide(); |
|
194 } |
182 } |
195 } |
183 |
196 |
184 FrameTeams* pRemoveTeams; |
197 FrameTeams* pRemoveTeams; |
185 FrameTeams* pAddTeams; |
198 FrameTeams* pAddTeams; |
186 if(!willBePlaying) |
199 if(!willBePlaying) |
251 QGroupBox(parent), mainLayout(this), m_acceptOuter(false) |
264 QGroupBox(parent), mainLayout(this), m_acceptOuter(false) |
252 { |
265 { |
253 setTitle(QGroupBox::tr("Playing teams")); |
266 setTitle(QGroupBox::tr("Playing teams")); |
254 framePlaying = new FrameTeams(); |
267 framePlaying = new FrameTeams(); |
255 frameDontPlaying = new FrameTeams(); |
268 frameDontPlaying = new FrameTeams(); |
|
269 |
|
270 // Add notice about number of required teams. |
|
271 numTeamNotice = new QLabel("Two teams are required to play!"); |
|
272 mainLayout.addWidget(numTeamNotice); |
256 |
273 |
257 QPalette p; |
274 QPalette p; |
258 p.setColor(QPalette::Window, QColor(0x00, 0x00, 0x00)); |
275 p.setColor(QPalette::Window, QColor(0x00, 0x00, 0x00)); |
259 addScrArea(framePlaying, p.color(QPalette::Window).light(105), 250); |
276 addScrArea(framePlaying, p.color(QPalette::Window).light(105), 250); |
260 addScrArea(frameDontPlaying, p.color(QPalette::Window).dark(105), 0); |
277 addScrArea(frameDontPlaying, p.color(QPalette::Window).dark(105), 0); |