# HG changeset patch # User Bryan Dunsmore # Date 1354100259 -3600 # Node ID 98e4a60da2cac9a833833724667891367d21129d # Parent cffa2c8275e093fb648586b91103c8cd9cecc8fe GCI2012: Empty list help text (Issue 375) diff -r cffa2c8275e0 -r 98e4a60da2ca QTfrontend/ui/widget/teamselect.cpp --- a/QTfrontend/ui/widget/teamselect.cpp Wed Nov 28 00:27:30 2012 +0400 +++ b/QTfrontend/ui/widget/teamselect.cpp Wed Nov 28 11:57:39 2012 +0100 @@ -59,6 +59,7 @@ this, SLOT(changeTeamStatus(HWTeam))); } } + emit setEnabledGameStart(curPlayingTeams.size()>1); } @@ -168,6 +169,12 @@ m_curNotPlayingTeams.push_back(*itPlay); emit teamNotPlaying(*itPlay); curPlayingTeams.erase(itPlay); + + // Show team notice if less than two teams. + if (curPlayingTeams.size() < 2) + { + numTeamNotice->show(); + } } else { @@ -179,6 +186,12 @@ curPlayingTeams.push_back(*itDontPlay); if(!m_acceptOuter) emit teamWillPlay(*itDontPlay); m_curNotPlayingTeams.erase(itDontPlay); + + // Hide team notice if at least two teams. + if (curPlayingTeams.size() >= 2) + { + numTeamNotice->hide(); + } } FrameTeams* pRemoveTeams; @@ -254,6 +267,10 @@ framePlaying = new FrameTeams(); frameDontPlaying = new FrameTeams(); + // Add notice about number of required teams. + numTeamNotice = new QLabel("Two teams are required to play!"); + mainLayout.addWidget((QWidget*)numTeamNotice); + QPalette p; p.setColor(QPalette::Window, QColor(0x00, 0x00, 0x00)); addScrArea(framePlaying, p.color(QPalette::Window).light(105), 250); diff -r cffa2c8275e0 -r 98e4a60da2ca QTfrontend/ui/widget/teamselect.h --- a/QTfrontend/ui/widget/teamselect.h Wed Nov 28 00:27:30 2012 +0400 +++ b/QTfrontend/ui/widget/teamselect.h Wed Nov 28 11:57:39 2012 +0100 @@ -20,6 +20,7 @@ #ifndef _TEAM_SELECT_INCLUDED #define _TEAM_SELECT_INCLUDED +#include #include #include #include @@ -74,6 +75,7 @@ FrameTeams* framePlaying; QVBoxLayout mainLayout; + QLabel *numTeamNotice; bool m_acceptOuter; QList curPlayingTeams;