Fix "at least 2 teams" warning not updated when net team is added/removed
authorWuzzy <almikes@aol.com>
Wed, 11 Oct 2017 01:23:38 +0200
changeset 12693 e095ed002652
parent 12692 ebb32d3021a5
child 12694 5b135c26f320
Fix "at least 2 teams" warning not updated when net team is added/removed
QTfrontend/ui/widget/teamselect.cpp
--- a/QTfrontend/ui/widget/teamselect.cpp	Wed Oct 11 01:03:30 2017 +0200
+++ b/QTfrontend/ui/widget/teamselect.cpp	Wed Oct 11 01:23:38 2017 +0200
@@ -43,6 +43,12 @@
         blockSignals(false);
         connect(framePlaying->getTeamWidget(team), SIGNAL(teamColorChanged(const HWTeam&)),
                 this, SLOT(proxyTeamColorChanged(const HWTeam&)));
+
+        // Hide team notice if at least two teams.
+        if (curPlayingTeams.size() >= 2)
+        {
+            numTeamNotice->hide();
+        }
     }
     else
     {
@@ -133,6 +139,11 @@
         QObject::disconnect(framePlaying->getTeamWidget(*itPlay), SIGNAL(teamStatusChanged(HWTeam)));
         framePlaying->removeTeam(team);
         curPlayingTeams.erase(itPlay);
+        // Show team notice if less than two teams.
+        if (curPlayingTeams.size() < 2)
+        {
+            numTeamNotice->show();
+        }
     }
     else
     {
@@ -294,6 +305,8 @@
     foreach(HWTeam team, teamslist)
         addTeam(team);
 
+    numTeamNotice->show();
+
     repaint();
 }