diff -r 57c2ef19f719 -r f97a7a3dc8f6 QTfrontend/teamselhelper.cpp --- a/QTfrontend/teamselhelper.cpp Thu Oct 05 16:33:18 2006 +0000 +++ b/QTfrontend/teamselhelper.cpp Thu Oct 05 17:02:09 2006 +0000 @@ -1,72 +1,72 @@ -/* - * Hedgewars, a worms-like game - * Copyright (c) 2006 Ulyanov Igor - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - */ - -#include "teamselhelper.h" -#include "hwconsts.h" - -#include -#include -#include - -void TeamLabel::teamButtonClicked() -{ - emit teamActivated(text()); -} - -TeamShowWidget::TeamShowWidget(HWTeam team, bool isPlaying, QWidget * parent) : - QWidget(parent), mainLayout(this), m_team(team), m_isPlaying(isPlaying), phhoger(0) -{ - mainLayout.setSpacing(1); - mainLayout.setMargin(2); - this->setMaximumHeight(35); - QPixmap* px=new QPixmap(QPixmap(datadir->absolutePath() + "/Forts/" + m_team.Fort + "L.png").scaled(40, 40)); - - QPalette newPalette = palette(); - newPalette.setColor(QPalette::Button, palette().color(backgroundRole())); - - QPushButton* butt=new QPushButton(*px, "", this); - butt->setFlat(true); - butt->setGeometry(0, 0, 30, 30); - butt->setMaximumWidth(30); - butt->setPalette(newPalette); - mainLayout.addWidget(butt); - butt->setIconSize(butt->size()); - - QPushButton* bText=new QPushButton(team.TeamName, this); - bText->setPalette(newPalette); - bText->setFlat(true); - mainLayout.addWidget(bText); - - if(m_isPlaying) { - phhoger=new CHedgehogerWidget(this); - mainLayout.addWidget(phhoger); - } - - QObject::connect(butt, SIGNAL(clicked()), this, SLOT(activateTeam())); - QObject::connect(bText, SIGNAL(clicked()), this, SLOT(activateTeam())); -} - -void TeamShowWidget::activateTeam() -{ - emit teamStatusChanged(m_team); -} - -unsigned char TeamShowWidget::getHedgehogsNum() const -{ - return phhoger ? phhoger->getHedgehogsNum() : 0; -} +/* + * Hedgewars, a worms-like game + * Copyright (c) 2006 Ulyanov Igor + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +#include "teamselhelper.h" +#include "hwconsts.h" + +#include +#include +#include + +void TeamLabel::teamButtonClicked() +{ + emit teamActivated(text()); +} + +TeamShowWidget::TeamShowWidget(HWTeam team, bool isPlaying, QWidget * parent) : + QWidget(parent), mainLayout(this), m_team(team), m_isPlaying(isPlaying), phhoger(0) +{ + mainLayout.setSpacing(1); + mainLayout.setMargin(2); + this->setMaximumHeight(35); + QPixmap* px=new QPixmap(QPixmap(datadir->absolutePath() + "/Forts/" + m_team.Fort + "L.png").scaled(40, 40)); + + QPalette newPalette = palette(); + newPalette.setColor(QPalette::Button, palette().color(backgroundRole())); + + QPushButton* butt=new QPushButton(*px, "", this); + butt->setFlat(true); + butt->setGeometry(0, 0, 30, 30); + butt->setMaximumWidth(30); + butt->setPalette(newPalette); + mainLayout.addWidget(butt); + butt->setIconSize(butt->size()); + + QPushButton* bText=new QPushButton(team.TeamName, this); + bText->setPalette(newPalette); + bText->setFlat(true); + mainLayout.addWidget(bText); + + if(m_isPlaying) { + phhoger=new CHedgehogerWidget(this); + mainLayout.addWidget(phhoger); + } + + QObject::connect(butt, SIGNAL(clicked()), this, SLOT(activateTeam())); + QObject::connect(bText, SIGNAL(clicked()), this, SLOT(activateTeam())); +} + +void TeamShowWidget::activateTeam() +{ + emit teamStatusChanged(m_team); +} + +unsigned char TeamShowWidget::getHedgehogsNum() const +{ + return phhoger ? phhoger->getHedgehogsNum() : 0; +}