QTfrontend/teamselect.h
author unc0rr
Sun, 15 Jan 2006 23:32:58 +0000
changeset 51 b6e3ae05857f
parent 50 9ab4067dabec
child 61 505691a09dee
permissions -rw-r--r--
- Get rid of hwserv and runhelper - Rename hw -> hwengine - Updated copyright info - Fixed graves not reacting on explosion - Fixed fpc warning - Fill Land by another ( hope better) way - One more land template
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
     1
#ifndef _TEAM_SELECT_INCLUDED
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
     2
#define _TEAM_SELECT_INCLUDED
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
     3
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
     4
#include <QWidget>
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
     5
#include <QVBoxLayout>
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
     6
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
     7
#include <list>
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
     8
#include <map>
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
     9
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    10
using namespace std;
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    11
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    12
struct tmprop
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    13
{
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    14
  tmprop(QString nm) : teamName(nm){};
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    15
  QString teamName;
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    16
  QString pixmapFileName;
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    17
  bool operator==(const tmprop& t1) const {
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    18
    return teamName==t1.teamName;
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    19
  };
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    20
  bool operator<(const tmprop& t1) const {
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    21
    return teamName<t1.teamName;
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    22
  };
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    23
};
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    24
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    25
class TeamSelWidget : public QWidget
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    26
{
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    27
  Q_OBJECT
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    28
 
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    29
 public:
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    30
  TeamSelWidget(const vector<QString>& teams, QWidget* parent=0);
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    31
  void addTeam(tmprop team);
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    32
  void removeTeam(tmprop team);
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    33
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    34
private slots:
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    35
  void changeTeamStatus(tmprop team);
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    36
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    37
 private:
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    38
  QVBoxLayout mainLayout;
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    39
  QGridLayout playingLayout;
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    40
  QGridLayout dontPlayingLayout;
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    41
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    42
  list<tmprop> curPlayingTeams;
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    43
  list<tmprop> curDontPlayingTeams;
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    44
  map<tmprop, QWidget*> teamToWidget;
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    45
};
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    46
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    47
#endif // _TEAM_SELECT_INCLUDED