# HG changeset patch # User unc0rr # Date 1338230579 -14400 # Node ID 1d1a14b394002cfce9f0dcc538d34be4decfd90c # Parent 6e39741286315f45261dc5cdd6e32fb8bdd21f0f Fix a bug with wrong state of teams list when color isn't changed manually diff -r 6e3974128631 -r 1d1a14b39400 QTfrontend/team.cpp --- a/QTfrontend/team.cpp Mon May 28 14:20:51 2012 -0400 +++ b/QTfrontend/team.cpp Mon May 28 22:42:59 2012 +0400 @@ -54,6 +54,7 @@ m_rounds = 0; m_wins = 0; m_campaignProgress = 0; + m_color = 0; } HWTeam::HWTeam(const QStringList& strLst) : @@ -82,6 +83,7 @@ m_rounds = 0; m_wins = 0; m_campaignProgress = 0; + m_color = 0; } HWTeam::HWTeam() : @@ -112,6 +114,7 @@ m_rounds = 0; m_wins = 0; m_campaignProgress = 0; + m_color = 0; } HWTeam::HWTeam(const HWTeam & other) : @@ -157,6 +160,7 @@ m_campaignProgress = other.m_campaignProgress; m_rounds = other.m_rounds; m_wins = other.m_wins; + m_color = other.m_color; } return *this; diff -r 6e3974128631 -r 1d1a14b39400 QTfrontend/ui/widget/teamselect.cpp --- a/QTfrontend/ui/widget/teamselect.cpp Mon May 28 14:20:51 2012 -0400 +++ b/QTfrontend/ui/widget/teamselect.cpp Mon May 28 22:42:59 2012 +0400 @@ -169,8 +169,8 @@ // return if max playing teams reached if(framePlaying->isFullTeams()) return; // dont playing team => playing + itDontPlay->setColor(framePlaying->getNextColor()); team=*itDontPlay; // for net team info saving in framePlaying (we have only name with netID from network) - itDontPlay->setColor(framePlaying->getNextColor()); curPlayingTeams.push_back(*itDontPlay); if(!m_acceptOuter) emit teamWillPlay(*itDontPlay); m_curNotPlayingTeams.erase(itDontPlay); @@ -295,6 +295,6 @@ void TeamSelWidget::pre_changeTeamStatus(HWTeam team) { - team.setColor(framePlaying->getNextColor()); + //team.setColor(framePlaying->getNextColor()); emit acceptRequested(team); } diff -r 6e3974128631 -r 1d1a14b39400 QTfrontend/ui/widget/teamselhelper.cpp --- a/QTfrontend/ui/widget/teamselhelper.cpp Mon May 28 14:20:51 2012 -0400 +++ b/QTfrontend/ui/widget/teamselhelper.cpp Mon May 28 22:42:59 2012 +0400 @@ -20,6 +20,7 @@ #include #include #include +#include #include @@ -33,7 +34,7 @@ emit teamActivated(text()); } -TeamShowWidget::TeamShowWidget(HWTeam team, bool isPlaying, FrameTeams * parent) : +TeamShowWidget::TeamShowWidget(const HWTeam & team, bool isPlaying, FrameTeams * parent) : QWidget(parent), mainLayout(this), m_team(team), m_isPlaying(isPlaying), phhoger(0), colorWidget(0) { @@ -73,9 +74,8 @@ colorWidget->setMaximumWidth(26); colorWidget->setMinimumHeight(26); colorWidget->setMaximumHeight(26); - //colorWidget->setGeometry(0, 0, 26, 26); + colorWidget->setColor(team.color()); connect(colorWidget, SIGNAL(colorChanged(int)), this, SLOT(onColorChanged(int))); - colorWidget->setColor(m_parentFrameTeams->getNextColor()); mainLayout.addWidget(colorWidget); phhoger = new CHedgehogerWidget(QImage(":/res/hh25x25.png"), QImage(":/res/hh25x25grey.png"), this); diff -r 6e3974128631 -r 1d1a14b39400 QTfrontend/ui/widget/teamselhelper.h --- a/QTfrontend/ui/widget/teamselhelper.h Mon May 28 14:20:51 2012 -0400 +++ b/QTfrontend/ui/widget/teamselhelper.h Mon May 28 22:42:59 2012 +0400 @@ -58,7 +58,7 @@ void onColorChanged(int color); public: - TeamShowWidget(HWTeam team, bool isPlaying, FrameTeams * parent); + TeamShowWidget(const HWTeam &team, bool isPlaying, FrameTeams * parent); void setPlaying(bool isPlaying); void setHHNum(unsigned int num); void setInteractivity(bool interactive);