QTfrontend/teamselhelper.cpp
author unc0rr
Fri, 18 Aug 2006 21:02:11 +0000
changeset 119 665c07365cb6
parent 118 fac200ee771c
child 120 87264c35b09a
permissions -rw-r--r--
Fix prefix issues

#include "teamselhelper.h"

#include <QPixmap>
#include <QPushButton>

void TeamLabel::teamButtonClicked()
{
  emit teamActivated(text());
}

TeamShowWidget::TeamShowWidget(HWTeam team, QWidget * parent) :
  QWidget(parent), mainLayout(this), m_team(team)
{
  this->setMaximumHeight(40);
  QLabel* pixlbl=new QLabel();
  pixlbl->setPixmap(QPixmap(QString("../share/hedgewars/Data/Forts/")+m_team.Fort+"L.png").scaledToHeight(30));
  mainLayout.addWidget(pixlbl);

  TeamLabel* lbl=new TeamLabel(team.TeamName);
  mainLayout.addWidget(lbl);

  QPushButton* butt=new QPushButton("o");
  butt->setGeometry(0, 0, 25, 25);
  butt->setMaximumWidth(30);
  mainLayout.addWidget(butt);

  QObject::connect(butt, SIGNAL(clicked()), this, SLOT(activateTeam()));
}

void TeamShowWidget::activateTeam()
{
  emit teamStatusChanged(m_team);
}