QTfrontend/pages.h
author unc0rr
Tue, 21 Oct 2008 13:36:59 +0000
changeset 1389 6e411559cc7b
parent 1377 a9e768739345
child 1395 46fd70de89e2
permissions -rw-r--r--
Customize team select widget background
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
     1
/*
1066
1f1b3686a2b0 Update copyright headers a bit
unc0rr
parents: 788
diff changeset
     2
 * Hedgewars, a free turn based strategy game
486
7ea71cd3acd5 - Change proto version to 4
unc0rr
parents: 471
diff changeset
     3
 * Copyright (c) 2006, 2007 Andrey Korotaev <unC0Rr@gmail.com>
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
     4
 *
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
     8
 *
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    12
 * GNU General Public License for more details.
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    13
 *
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    14
 * You should have received a copy of the GNU General Public License
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    15
 * along with this program; if not, write to the Free Software
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    17
 */
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    18
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    19
#ifndef PAGES_H
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    20
#define PAGES_H
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    21
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    22
#include <QWidget>
684
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
    23
#include <QPushButton>
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
    24
#include <QFont>
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
    25
#include <QGridLayout>
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    26
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    27
#include "binds.h"
322
e7175ae57945 first new widgets added to net game
displacer
parents: 314
diff changeset
    28
#include "mapContainer.h"
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    29
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    30
class QPushButton;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    31
class QGroupBox;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    32
class QComboBox;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    33
class QLabel;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    34
class QToolBox;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    35
class QLineEdit;
665
5c7bfc8bac6a Start move from custom widgets to custom models
unc0rr
parents: 657
diff changeset
    36
class QListWidget;
5c7bfc8bac6a Start move from custom widgets to custom models
unc0rr
parents: 657
diff changeset
    37
class QCheckBox;
5c7bfc8bac6a Start move from custom widgets to custom models
unc0rr
parents: 657
diff changeset
    38
class QSpinBox;
5c7bfc8bac6a Start move from custom widgets to custom models
unc0rr
parents: 657
diff changeset
    39
class QTextEdit;
5c7bfc8bac6a Start move from custom widgets to custom models
unc0rr
parents: 657
diff changeset
    40
class QRadioButton;
5c7bfc8bac6a Start move from custom widgets to custom models
unc0rr
parents: 657
diff changeset
    41
class QTableView;
1377
a9e768739345 - Customize QTextBrowser look
unc0rr
parents: 1315
diff changeset
    42
class QTextBrowser;
665
5c7bfc8bac6a Start move from custom widgets to custom models
unc0rr
parents: 657
diff changeset
    43
5c7bfc8bac6a Start move from custom widgets to custom models
unc0rr
parents: 657
diff changeset
    44
class GameCFGWidget;
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    45
class TeamSelWidget;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    46
class DemosList;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    47
class SquareLabel;
187
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents: 184
diff changeset
    48
class About;
297
279e10ec31b4 'Show FPS' and 'FPS limit' options
unc0rr
parents: 231
diff changeset
    49
class FPSEdit;
461
105af110b0e6 chatWidget with layout
displacer
parents: 452
diff changeset
    50
class HWChatWidget;
612
333d095319de abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents: 600
diff changeset
    51
class SelWeaponWidget;
1192
63b7961f68de Add iconed groupbox class
unc0rr
parents: 1168
diff changeset
    52
class IconedGroupBox;
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
    53
684
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
    54
class AbstractPage : public QWidget
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
    55
{
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
    56
 public:
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
    57
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
    58
 protected:
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
    59
  AbstractPage(QWidget* parent = 0) {
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
    60
    font14 = new QFont("MS Shell Dlg", 14);
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
    61
  }
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
    62
  virtual ~AbstractPage() {};
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
    63
1152
c72b939c00df Make buttons border have different colors when mouse is over or it is pressed
unc0rr
parents: 1150
diff changeset
    64
  QPushButton* addButton(QString btname, QGridLayout* grid, int wy, int wx, bool iconed = false) {
684
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
    65
    QPushButton* butt = new QPushButton(this);
1152
c72b939c00df Make buttons border have different colors when mouse is over or it is pressed
unc0rr
parents: 1150
diff changeset
    66
    if (!iconed) {
1148
e44de3416af4 images at main page
displacer
parents: 1129
diff changeset
    67
      butt->setFont(*font14);
e44de3416af4 images at main page
displacer
parents: 1129
diff changeset
    68
      butt->setText(btname);
1198
b600b0d9408c Reorganize widgets on options page
unc0rr
parents: 1194
diff changeset
    69
      butt->setStyleSheet("background-color: #0d0544");
1148
e44de3416af4 images at main page
displacer
parents: 1129
diff changeset
    70
    } else {
e44de3416af4 images at main page
displacer
parents: 1129
diff changeset
    71
      const QIcon& lp=QIcon(btname);
1152
c72b939c00df Make buttons border have different colors when mouse is over or it is pressed
unc0rr
parents: 1150
diff changeset
    72
      QSize sz = lp.actualSize(QSize(65535, 65535));
1168
f3c68684ef88 Finally fix save button look
unc0rr
parents: 1162
diff changeset
    73
      if (btname == ":/res/Save.png")
f3c68684ef88 Finally fix save button look
unc0rr
parents: 1162
diff changeset
    74
      {
f3c68684ef88 Finally fix save button look
unc0rr
parents: 1162
diff changeset
    75
      	butt->setStyleSheet("QPushButton{margin: 12px 0px 12px 0px;}");
f3c68684ef88 Finally fix save button look
unc0rr
parents: 1162
diff changeset
    76
      }
1148
e44de3416af4 images at main page
displacer
parents: 1129
diff changeset
    77
      butt->setIcon(lp);
1152
c72b939c00df Make buttons border have different colors when mouse is over or it is pressed
unc0rr
parents: 1150
diff changeset
    78
      butt->setFixedSize(sz);
1148
e44de3416af4 images at main page
displacer
parents: 1129
diff changeset
    79
      butt->setIconSize(sz);
e44de3416af4 images at main page
displacer
parents: 1129
diff changeset
    80
      butt->setFlat(true);
1149
c2d3b4f71836 transparent background for buttons at main page
displacer
parents: 1148
diff changeset
    81
      butt->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
1148
e44de3416af4 images at main page
displacer
parents: 1129
diff changeset
    82
    }
684
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
    83
    grid->addWidget(butt, wy, wx);
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
    84
    return butt;
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
    85
  };
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
    86
1152
c72b939c00df Make buttons border have different colors when mouse is over or it is pressed
unc0rr
parents: 1150
diff changeset
    87
  QPushButton* addButton(QString btname, QGridLayout* grid, int wy, int wx, int rowSpan, int columnSpan, bool iconed = false) {
692
07787e748831 code size reduse
displacer
parents: 686
diff changeset
    88
    QPushButton* butt = new QPushButton(this);
1152
c72b939c00df Make buttons border have different colors when mouse is over or it is pressed
unc0rr
parents: 1150
diff changeset
    89
    if (!iconed) {
1148
e44de3416af4 images at main page
displacer
parents: 1129
diff changeset
    90
      butt->setFont(*font14);
e44de3416af4 images at main page
displacer
parents: 1129
diff changeset
    91
      butt->setText(btname);
e44de3416af4 images at main page
displacer
parents: 1129
diff changeset
    92
    } else {
e44de3416af4 images at main page
displacer
parents: 1129
diff changeset
    93
      const QIcon& lp=QIcon(btname);
1152
c72b939c00df Make buttons border have different colors when mouse is over or it is pressed
unc0rr
parents: 1150
diff changeset
    94
      QSize sz = lp.actualSize(QSize(65535, 65535));
1148
e44de3416af4 images at main page
displacer
parents: 1129
diff changeset
    95
      butt->setIcon(lp);
1152
c72b939c00df Make buttons border have different colors when mouse is over or it is pressed
unc0rr
parents: 1150
diff changeset
    96
      butt->setFixedSize(sz);
1148
e44de3416af4 images at main page
displacer
parents: 1129
diff changeset
    97
      butt->setIconSize(sz);
e44de3416af4 images at main page
displacer
parents: 1129
diff changeset
    98
      butt->setFlat(true);
1149
c2d3b4f71836 transparent background for buttons at main page
displacer
parents: 1148
diff changeset
    99
      butt->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
1148
e44de3416af4 images at main page
displacer
parents: 1129
diff changeset
   100
    }
692
07787e748831 code size reduse
displacer
parents: 686
diff changeset
   101
    grid->addWidget(butt, wy, wx, rowSpan, columnSpan);
07787e748831 code size reduse
displacer
parents: 686
diff changeset
   102
    return butt;
07787e748831 code size reduse
displacer
parents: 686
diff changeset
   103
  };
07787e748831 code size reduse
displacer
parents: 686
diff changeset
   104
728
033971bbe639 strange tr()
displacer
parents: 718
diff changeset
   105
  QPushButton* addButton(QString btname, QBoxLayout* box, int where) {
684
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
   106
    QPushButton* butt = new QPushButton(this);
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
   107
    butt->setFont(*font14);
728
033971bbe639 strange tr()
displacer
parents: 718
diff changeset
   108
    butt->setText(btname);
684
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
   109
    box->addWidget(butt, where);
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
   110
    return butt;
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
   111
  };
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
   112
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
   113
  QFont * font14;
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
   114
};
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
   115
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
   116
class PageMain : public AbstractPage
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   117
{
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   118
	Q_OBJECT
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   119
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   120
public:
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   121
	PageMain(QWidget* parent = 0);
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   122
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   123
	QPushButton *BtnSinglePlayer;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   124
	QPushButton *BtnNet;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   125
	QPushButton *BtnSetup;
187
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents: 184
diff changeset
   126
	QPushButton *BtnInfo;
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   127
	QPushButton *BtnExit;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   128
};
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   129
692
07787e748831 code size reduse
displacer
parents: 686
diff changeset
   130
class PageEditTeam : public AbstractPage
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   131
{
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   132
	Q_OBJECT
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   133
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   134
public:
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   135
	PageEditTeam(QWidget* parent = 0);
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   136
	QGroupBox *GBoxHedgehogs;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   137
	QGroupBox *GBoxTeam;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   138
	QGroupBox *GBoxFort;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   139
	QComboBox *CBFort;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   140
	SquareLabel *FortPreview;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   141
	QComboBox *CBGrave;
336
82d654db133d Team level at new place on team config page
unc0rr
parents: 329
diff changeset
   142
	QComboBox *CBTeamLvl;
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   143
	QGroupBox *GBoxBinds;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   144
	QToolBox *BindsBox;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   145
	QWidget *page_A;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   146
	QWidget *page_W;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   147
	QWidget *page_WP;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   148
	QWidget *page_O;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   149
	QPushButton *BtnTeamDiscard;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   150
	QPushButton *BtnTeamSave;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   151
	QLineEdit * TeamNameEdit;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   152
	QLineEdit * HHNameEdit[8];
1236
f9110fd03754 Add stubs for hats implementation
unc0rr
parents: 1199
diff changeset
   153
	QComboBox * HHHats[8];
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   154
	QComboBox * CBBind[BINDS_NUMBER];
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   155
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   156
public slots:
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   157
	void CBFort_activated(const QString & gravename);
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   158
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   159
private:
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   160
	QLabel * LBind[BINDS_NUMBER];
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   161
};
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   162
692
07787e748831 code size reduse
displacer
parents: 686
diff changeset
   163
class PageMultiplayer : public AbstractPage
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   164
{
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   165
	Q_OBJECT
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   166
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   167
public:
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   168
	PageMultiplayer(QWidget* parent = 0);
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   169
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   170
	QPushButton *BtnBack;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   171
	GameCFGWidget *gameCFG;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   172
	TeamSelWidget *teamsSelect;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   173
	QPushButton *BtnStartMPGame;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   174
};
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   175
692
07787e748831 code size reduse
displacer
parents: 686
diff changeset
   176
class PageOptions : public AbstractPage
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   177
{
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   178
	Q_OBJECT
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   179
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   180
public:
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   181
	PageOptions(QWidget* parent = 0);
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   182
597
ec5f057ab268 kdevelop project add, initial weapons scheme button
displacer
parents: 587
diff changeset
   183
	QPushButton* WeaponsButt;
693
32a546d1eb3e prepare weapons combo
displacer
parents: 692
diff changeset
   184
	QPushButton* WeaponEdit;
32a546d1eb3e prepare weapons combo
displacer
parents: 692
diff changeset
   185
	QComboBox* WeaponsName;
32a546d1eb3e prepare weapons combo
displacer
parents: 692
diff changeset
   186
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   187
	QPushButton *BtnBack;
1194
32e854874df2 Iconize more groupboxes
unc0rr
parents: 1193
diff changeset
   188
	IconedGroupBox *teamsBox;
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   189
	QPushButton *BtnNewTeam;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   190
	QPushButton *BtnEditTeam;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   191
	QComboBox *CBTeamName;
1193
2911384169b4 Finish iconed groupbox implementation
unc0rr
parents: 1192
diff changeset
   192
	IconedGroupBox *AGGroupBox;
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   193
	QComboBox *CBResolution;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   194
	QCheckBox *CBEnableSound;
1129
b74ffca22762 Add a checkbox in frontend to turn music off
unc0rr
parents: 1066
diff changeset
   195
	QCheckBox *CBEnableMusic;
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   196
	QCheckBox *CBFullscreen;
1162
91bf5e3e558d Frontend Fullscreen mode added
displacer
parents: 1153
diff changeset
   197
	QCheckBox *CBFrontendFullscreen;
297
279e10ec31b4 'Show FPS' and 'FPS limit' options
unc0rr
parents: 231
diff changeset
   198
	QCheckBox *CBShowFPS;
529
812682c1ab62 Option for alternative damage tags
unc0rr
parents: 486
diff changeset
   199
	QCheckBox *CBAltDamage;
297
279e10ec31b4 'Show FPS' and 'FPS limit' options
unc0rr
parents: 231
diff changeset
   200
	FPSEdit *fpsedit;
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   201
	QPushButton *BtnSaveOptions;
647
798c7dbf8bb8 Move nick edit to PageOptions
unc0rr
parents: 646
diff changeset
   202
	QLabel *labelNN;
798c7dbf8bb8 Move nick edit to PageOptions
unc0rr
parents: 646
diff changeset
   203
	QLineEdit *editNetNick;
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   204
};
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   205
1153
825931b81ad4 Iconed "Back" button everywhere
unc0rr
parents: 1152
diff changeset
   206
class PageNet : public AbstractPage
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   207
{
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   208
	Q_OBJECT
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   209
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   210
public:
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   211
	PageNet(QWidget* parent = 0);
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   212
632
5e09ae25729f Half implement possibility for different backends of servers list
unc0rr
parents: 612
diff changeset
   213
	QPushButton* BtnUpdateSList;
665
5c7bfc8bac6a Start move from custom widgets to custom models
unc0rr
parents: 657
diff changeset
   214
	QTableView * tvServersList;
653
4f44fc06ca45 Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents: 647
diff changeset
   215
	QPushButton * BtnBack;
4f44fc06ca45 Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents: 647
diff changeset
   216
	QPushButton * BtnNetConnect;
4f44fc06ca45 Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents: 647
diff changeset
   217
	QPushButton * BtnNetSvrStart;
4f44fc06ca45 Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents: 647
diff changeset
   218
	QPushButton * BtnSpecifyServer;
632
5e09ae25729f Half implement possibility for different backends of servers list
unc0rr
parents: 612
diff changeset
   219
5e09ae25729f Half implement possibility for different backends of servers list
unc0rr
parents: 612
diff changeset
   220
private:
5e09ae25729f Half implement possibility for different backends of servers list
unc0rr
parents: 612
diff changeset
   221
	QGroupBox * ConnGroupBox;
5e09ae25729f Half implement possibility for different backends of servers list
unc0rr
parents: 612
diff changeset
   222
	QGridLayout * GBClayout;
5e09ae25729f Half implement possibility for different backends of servers list
unc0rr
parents: 612
diff changeset
   223
646
ed610c2cd0a4 Some work on network widgets
unc0rr
parents: 636
diff changeset
   224
private slots:
ed610c2cd0a4 Some work on network widgets
unc0rr
parents: 636
diff changeset
   225
	void slotConnect();
ed610c2cd0a4 Some work on network widgets
unc0rr
parents: 636
diff changeset
   226
632
5e09ae25729f Half implement possibility for different backends of servers list
unc0rr
parents: 612
diff changeset
   227
public slots:
646
ed610c2cd0a4 Some work on network widgets
unc0rr
parents: 636
diff changeset
   228
	void updateServersList();
ed610c2cd0a4 Some work on network widgets
unc0rr
parents: 636
diff changeset
   229
ed610c2cd0a4 Some work on network widgets
unc0rr
parents: 636
diff changeset
   230
signals:
665
5c7bfc8bac6a Start move from custom widgets to custom models
unc0rr
parents: 657
diff changeset
   231
	void connectClicked(const QString & host, quint16 port);
646
ed610c2cd0a4 Some work on network widgets
unc0rr
parents: 636
diff changeset
   232
};
ed610c2cd0a4 Some work on network widgets
unc0rr
parents: 636
diff changeset
   233
1153
825931b81ad4 Iconed "Back" button everywhere
unc0rr
parents: 1152
diff changeset
   234
class PageNetServer : public AbstractPage
646
ed610c2cd0a4 Some work on network widgets
unc0rr
parents: 636
diff changeset
   235
{
ed610c2cd0a4 Some work on network widgets
unc0rr
parents: 636
diff changeset
   236
	Q_OBJECT
ed610c2cd0a4 Some work on network widgets
unc0rr
parents: 636
diff changeset
   237
ed610c2cd0a4 Some work on network widgets
unc0rr
parents: 636
diff changeset
   238
public:
ed610c2cd0a4 Some work on network widgets
unc0rr
parents: 636
diff changeset
   239
	PageNetServer(QWidget* parent = 0);
ed610c2cd0a4 Some work on network widgets
unc0rr
parents: 636
diff changeset
   240
ed610c2cd0a4 Some work on network widgets
unc0rr
parents: 636
diff changeset
   241
	QPushButton *BtnBack;
ed610c2cd0a4 Some work on network widgets
unc0rr
parents: 636
diff changeset
   242
	QPushButton *BtnStart;
657
b34fc518a48a Basic concept for net server options page (subject to change)
unc0rr
parents: 653
diff changeset
   243
	QPushButton *BtnDefault;
b34fc518a48a Basic concept for net server options page (subject to change)
unc0rr
parents: 653
diff changeset
   244
	QLabel *labelSD;
b34fc518a48a Basic concept for net server options page (subject to change)
unc0rr
parents: 653
diff changeset
   245
	QLineEdit *leServerDescr;
b34fc518a48a Basic concept for net server options page (subject to change)
unc0rr
parents: 653
diff changeset
   246
	QLabel *labelPort;
b34fc518a48a Basic concept for net server options page (subject to change)
unc0rr
parents: 653
diff changeset
   247
	QSpinBox *sbPort;
b34fc518a48a Basic concept for net server options page (subject to change)
unc0rr
parents: 653
diff changeset
   248
b34fc518a48a Basic concept for net server options page (subject to change)
unc0rr
parents: 653
diff changeset
   249
private slots:
b34fc518a48a Basic concept for net server options page (subject to change)
unc0rr
parents: 653
diff changeset
   250
	void setDefaultPort();
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   251
};
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   252
1153
825931b81ad4 Iconed "Back" button everywhere
unc0rr
parents: 1152
diff changeset
   253
class PageNetGame : public AbstractPage
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   254
{
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   255
	Q_OBJECT
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   256
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   257
public:
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   258
	PageNetGame(QWidget* parent = 0);
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   259
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   260
	QPushButton *BtnBack;
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   261
	QPushButton *BtnGo;
461
105af110b0e6 chatWidget with layout
displacer
parents: 452
diff changeset
   262
105af110b0e6 chatWidget with layout
displacer
parents: 452
diff changeset
   263
	HWChatWidget* pChatWidget;
322
e7175ae57945 first new widgets added to net game
displacer
parents: 314
diff changeset
   264
e7175ae57945 first new widgets added to net game
displacer
parents: 314
diff changeset
   265
	TeamSelWidget* pNetTeamsWidget;
e7175ae57945 first new widgets added to net game
displacer
parents: 314
diff changeset
   266
	GameCFGWidget* pGameCFG;
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   267
};
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   268
1153
825931b81ad4 Iconed "Back" button everywhere
unc0rr
parents: 1152
diff changeset
   269
class PageInfo : public AbstractPage
187
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents: 184
diff changeset
   270
{
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents: 184
diff changeset
   271
	Q_OBJECT
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents: 184
diff changeset
   272
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents: 184
diff changeset
   273
public:
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents: 184
diff changeset
   274
	PageInfo(QWidget* parent = 0);
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents: 184
diff changeset
   275
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents: 184
diff changeset
   276
	QPushButton *BtnBack;
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents: 184
diff changeset
   277
	About *about;
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents: 184
diff changeset
   278
};
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents: 184
diff changeset
   279
1153
825931b81ad4 Iconed "Back" button everywhere
unc0rr
parents: 1152
diff changeset
   280
class PageGameStats : public AbstractPage
306
7b61834edcf6 - Better blowtorch
unc0rr
parents: 297
diff changeset
   281
{
7b61834edcf6 - Better blowtorch
unc0rr
parents: 297
diff changeset
   282
	Q_OBJECT
7b61834edcf6 - Better blowtorch
unc0rr
parents: 297
diff changeset
   283
7b61834edcf6 - Better blowtorch
unc0rr
parents: 297
diff changeset
   284
public:
7b61834edcf6 - Better blowtorch
unc0rr
parents: 297
diff changeset
   285
	PageGameStats(QWidget* parent = 0);
7b61834edcf6 - Better blowtorch
unc0rr
parents: 297
diff changeset
   286
7b61834edcf6 - Better blowtorch
unc0rr
parents: 297
diff changeset
   287
	QPushButton *BtnBack;
307
96b428ac11f2 More statistics
unc0rr
parents: 306
diff changeset
   288
	QLabel *labelGameStats;
306
7b61834edcf6 - Better blowtorch
unc0rr
parents: 297
diff changeset
   289
};
7b61834edcf6 - Better blowtorch
unc0rr
parents: 297
diff changeset
   290
1150
ae86e36dad2e - Make look better
unc0rr
parents: 1149
diff changeset
   291
class PageSinglePlayer : public AbstractPage
586
ecb6347dfeca Prepare to new page 'Training'
unc0rr
parents: 585
diff changeset
   292
{
ecb6347dfeca Prepare to new page 'Training'
unc0rr
parents: 585
diff changeset
   293
	Q_OBJECT
ecb6347dfeca Prepare to new page 'Training'
unc0rr
parents: 585
diff changeset
   294
ecb6347dfeca Prepare to new page 'Training'
unc0rr
parents: 585
diff changeset
   295
public:
ecb6347dfeca Prepare to new page 'Training'
unc0rr
parents: 585
diff changeset
   296
	PageSinglePlayer(QWidget* parent = 0);
ecb6347dfeca Prepare to new page 'Training'
unc0rr
parents: 585
diff changeset
   297
ecb6347dfeca Prepare to new page 'Training'
unc0rr
parents: 585
diff changeset
   298
	QPushButton *BtnSimpleGamePage;
ecb6347dfeca Prepare to new page 'Training'
unc0rr
parents: 585
diff changeset
   299
	QPushButton *BtnTrainPage;
1150
ae86e36dad2e - Make look better
unc0rr
parents: 1149
diff changeset
   300
	QPushButton *BtnMultiplayer;
ae86e36dad2e - Make look better
unc0rr
parents: 1149
diff changeset
   301
	QPushButton *BtnLoad;
ae86e36dad2e - Make look better
unc0rr
parents: 1149
diff changeset
   302
	QPushButton *BtnDemos;
586
ecb6347dfeca Prepare to new page 'Training'
unc0rr
parents: 585
diff changeset
   303
	QPushButton *BtnBack;
ecb6347dfeca Prepare to new page 'Training'
unc0rr
parents: 585
diff changeset
   304
	GameCFGWidget *gameCFG;
ecb6347dfeca Prepare to new page 'Training'
unc0rr
parents: 585
diff changeset
   305
};
ecb6347dfeca Prepare to new page 'Training'
unc0rr
parents: 585
diff changeset
   306
1153
825931b81ad4 Iconed "Back" button everywhere
unc0rr
parents: 1152
diff changeset
   307
class PageTraining : public AbstractPage
587
74db4115064a More work on Training mode
unc0rr
parents: 586
diff changeset
   308
{
74db4115064a More work on Training mode
unc0rr
parents: 586
diff changeset
   309
	Q_OBJECT
74db4115064a More work on Training mode
unc0rr
parents: 586
diff changeset
   310
74db4115064a More work on Training mode
unc0rr
parents: 586
diff changeset
   311
public:
74db4115064a More work on Training mode
unc0rr
parents: 586
diff changeset
   312
	PageTraining(QWidget* parent = 0);
74db4115064a More work on Training mode
unc0rr
parents: 586
diff changeset
   313
74db4115064a More work on Training mode
unc0rr
parents: 586
diff changeset
   314
	QPushButton *BtnStartTrain;
74db4115064a More work on Training mode
unc0rr
parents: 586
diff changeset
   315
	QPushButton *BtnBack;
74db4115064a More work on Training mode
unc0rr
parents: 586
diff changeset
   316
};
74db4115064a More work on Training mode
unc0rr
parents: 586
diff changeset
   317
684
257444d8429f some copy/paste code removed
displacer
parents: 683
diff changeset
   318
class PageSelectWeapon : public AbstractPage
600
f6e5f4e122db Select weapon scheme page
unc0rr
parents: 597
diff changeset
   319
{
f6e5f4e122db Select weapon scheme page
unc0rr
parents: 597
diff changeset
   320
	Q_OBJECT
f6e5f4e122db Select weapon scheme page
unc0rr
parents: 597
diff changeset
   321
f6e5f4e122db Select weapon scheme page
unc0rr
parents: 597
diff changeset
   322
public:
f6e5f4e122db Select weapon scheme page
unc0rr
parents: 597
diff changeset
   323
	PageSelectWeapon(QWidget* parent = 0);
f6e5f4e122db Select weapon scheme page
unc0rr
parents: 597
diff changeset
   324
683
57d624f71e65 select default and save weapons added
displacer
parents: 665
diff changeset
   325
	QPushButton *BtnSave;
57d624f71e65 select default and save weapons added
displacer
parents: 665
diff changeset
   326
	QPushButton *BtnDefault;
718
f93a38d2c982 delete weapon button added
displacer
parents: 693
diff changeset
   327
	QPushButton *BtnDelete;
600
f6e5f4e122db Select weapon scheme page
unc0rr
parents: 597
diff changeset
   328
	QPushButton *BtnBack;
1312
0078e4f72d40 Create a page for rooms list
unc0rr
parents: 1311
diff changeset
   329
	SelWeaponWidget* pWeapons;
600
f6e5f4e122db Select weapon scheme page
unc0rr
parents: 597
diff changeset
   330
};
306
7b61834edcf6 - Better blowtorch
unc0rr
parents: 297
diff changeset
   331
686
494b5880989a - Header cleanup in game.cpp
unc0rr
parents: 684
diff changeset
   332
class PageInGame : public AbstractPage
494b5880989a - Header cleanup in game.cpp
unc0rr
parents: 684
diff changeset
   333
{
494b5880989a - Header cleanup in game.cpp
unc0rr
parents: 684
diff changeset
   334
	Q_OBJECT
494b5880989a - Header cleanup in game.cpp
unc0rr
parents: 684
diff changeset
   335
494b5880989a - Header cleanup in game.cpp
unc0rr
parents: 684
diff changeset
   336
public:
494b5880989a - Header cleanup in game.cpp
unc0rr
parents: 684
diff changeset
   337
	PageInGame(QWidget* parent = 0);
494b5880989a - Header cleanup in game.cpp
unc0rr
parents: 684
diff changeset
   338
};
494b5880989a - Header cleanup in game.cpp
unc0rr
parents: 684
diff changeset
   339
1311
49beb1221c0b - Add stub page for rooms list
unc0rr
parents: 1310
diff changeset
   340
class PageRoomsList : public AbstractPage
49beb1221c0b - Add stub page for rooms list
unc0rr
parents: 1310
diff changeset
   341
{
49beb1221c0b - Add stub page for rooms list
unc0rr
parents: 1310
diff changeset
   342
	Q_OBJECT
49beb1221c0b - Add stub page for rooms list
unc0rr
parents: 1310
diff changeset
   343
49beb1221c0b - Add stub page for rooms list
unc0rr
parents: 1310
diff changeset
   344
public:
49beb1221c0b - Add stub page for rooms list
unc0rr
parents: 1310
diff changeset
   345
	PageRoomsList(QWidget* parent = 0);
1312
0078e4f72d40 Create a page for rooms list
unc0rr
parents: 1311
diff changeset
   346
1314
e56b178d6d62 Implement room create and join
unc0rr
parents: 1313
diff changeset
   347
	QLineEdit * roomName;
1312
0078e4f72d40 Create a page for rooms list
unc0rr
parents: 1311
diff changeset
   348
	QListWidget * roomsList;
0078e4f72d40 Create a page for rooms list
unc0rr
parents: 1311
diff changeset
   349
	QPushButton * BtnBack;
0078e4f72d40 Create a page for rooms list
unc0rr
parents: 1311
diff changeset
   350
	QPushButton * BtnCreate;
0078e4f72d40 Create a page for rooms list
unc0rr
parents: 1311
diff changeset
   351
	QPushButton * BtnJoin;
0078e4f72d40 Create a page for rooms list
unc0rr
parents: 1311
diff changeset
   352
	QPushButton * BtnRefresh;
1377
a9e768739345 - Customize QTextBrowser look
unc0rr
parents: 1315
diff changeset
   353
	QTextBrowser * serverMessage;
1313
f4c54e9e1b8c - Introduce a bit of state miachine in client code (should be more robust and verbosive now)
unc0rr
parents: 1312
diff changeset
   354
	
f4c54e9e1b8c - Introduce a bit of state miachine in client code (should be more robust and verbosive now)
unc0rr
parents: 1312
diff changeset
   355
public slots:
f4c54e9e1b8c - Introduce a bit of state miachine in client code (should be more robust and verbosive now)
unc0rr
parents: 1312
diff changeset
   356
	void setRoomsList(const QStringList & list);
1314
e56b178d6d62 Implement room create and join
unc0rr
parents: 1313
diff changeset
   357
e56b178d6d62 Implement room create and join
unc0rr
parents: 1313
diff changeset
   358
private slots:
e56b178d6d62 Implement room create and join
unc0rr
parents: 1313
diff changeset
   359
	void onCreateClick();
e56b178d6d62 Implement room create and join
unc0rr
parents: 1313
diff changeset
   360
	void onJoinClick();
1315
c2f09811bb8c Implement rooms list refresh
unc0rr
parents: 1314
diff changeset
   361
	void onRefreshClick();
1313
f4c54e9e1b8c - Introduce a bit of state miachine in client code (should be more robust and verbosive now)
unc0rr
parents: 1312
diff changeset
   362
	
f4c54e9e1b8c - Introduce a bit of state miachine in client code (should be more robust and verbosive now)
unc0rr
parents: 1312
diff changeset
   363
signals:
f4c54e9e1b8c - Introduce a bit of state miachine in client code (should be more robust and verbosive now)
unc0rr
parents: 1312
diff changeset
   364
	void askForCreateRoom(const QString &);
f4c54e9e1b8c - Introduce a bit of state miachine in client code (should be more robust and verbosive now)
unc0rr
parents: 1312
diff changeset
   365
	void askForJoinRoom(const QString &);
1315
c2f09811bb8c Implement rooms list refresh
unc0rr
parents: 1314
diff changeset
   366
	void askForRoomList();
1311
49beb1221c0b - Add stub page for rooms list
unc0rr
parents: 1310
diff changeset
   367
};
49beb1221c0b - Add stub page for rooms list
unc0rr
parents: 1310
diff changeset
   368
184
f97a7a3dc8f6 - Update more headers
unc0rr
parents: 183
diff changeset
   369
#endif // PAGES_H