QTfrontend/teamselect.h
author unc0rr
Sat, 21 Jan 2006 16:18:19 +0000
changeset 55 e09f7c952a40
parent 50 9ab4067dabec
child 61 505691a09dee
permissions -rw-r--r--
Send run parameters by cmd line, game parameters by IPC... breaks network game
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