QTfrontend/teamselhelper.cpp
author unc0rr
Sun, 06 Aug 2006 15:48:48 +0000
changeset 97 e7c1df9cce2c
parent 86 664b536a1c27
child 116 00d3d6d2e699
permissions -rw-r--r--
- make the game be run from ${PREFIX}/bin with data in ${PREFIX}/share/hedgewars/Data - fix build

#include "teamselhelper.h"

#include <QPixmap>
#include <QPushButton>

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

TeamShowWidget::TeamShowWidget(tmprop team, QWidget * parent) :
  QWidget(parent), mainLayout(this), m_team(team)
{
  this->setMaximumHeight(40);
  QLabel* pixlbl=new QLabel();
  pixlbl->setPixmap(QPixmap("./Data/Graphics/thinking.png"));
  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);
}