QTfrontend/teamselect.h
author unc0rr
Sun, 15 Jan 2006 23:56:47 +0000
changeset 52 ae2950c5465c
parent 50 9ab4067dabec
child 61 505691a09dee
permissions -rw-r--r--
- Rename frontend to hedgewars and compile it to engine directory - Added icon for windows - Added incomplete russian translation

#ifndef _TEAM_SELECT_INCLUDED
#define _TEAM_SELECT_INCLUDED

#include <QWidget>
#include <QVBoxLayout>

#include <list>
#include <map>

using namespace std;

struct tmprop
{
  tmprop(QString nm) : teamName(nm){};
  QString teamName;
  QString pixmapFileName;
  bool operator==(const tmprop& t1) const {
    return teamName==t1.teamName;
  };
  bool operator<(const tmprop& t1) const {
    return teamName<t1.teamName;
  };
};

class TeamSelWidget : public QWidget
{
  Q_OBJECT
 
 public:
  TeamSelWidget(const vector<QString>& teams, QWidget* parent=0);
  void addTeam(tmprop team);
  void removeTeam(tmprop team);

private slots:
  void changeTeamStatus(tmprop team);

 private:
  QVBoxLayout mainLayout;
  QGridLayout playingLayout;
  QGridLayout dontPlayingLayout;

  list<tmprop> curPlayingTeams;
  list<tmprop> curDontPlayingTeams;
  map<tmprop, QWidget*> teamToWidget;
};

#endif // _TEAM_SELECT_INCLUDED