QTfrontend/gamecfgwidget.h
changeset 1885 75489216b5b0
parent 1878 b3b277d2b891
child 1887 d68939b3f7f0
equal deleted inserted replaced
1884:40e59e9f82ce 1885:75489216b5b0
    27 #include "mapContainer.h"
    27 #include "mapContainer.h"
    28 
    28 
    29 class QCheckBox;
    29 class QCheckBox;
    30 class QVBoxLayout;
    30 class QVBoxLayout;
    31 class QLabel;
    31 class QLabel;
    32 class FreqSpinBox;
       
    33 
       
    34 class FreqSpinBox : public QSpinBox
       
    35 {
       
    36 	Q_OBJECT
       
    37 
       
    38 public:
       
    39 	FreqSpinBox(QWidget* parent) : QSpinBox(parent)
       
    40 	{
       
    41 
       
    42 	}
       
    43 
       
    44 	QString textFromValue ( int value ) const
       
    45 	{
       
    46 		switch (value)
       
    47 		{
       
    48 			case 0 : return tr("Never");
       
    49 			case 1 : return tr("Every turn");
       
    50 			default : return tr("Each %1 turn").arg(value);
       
    51 		}
       
    52 	}
       
    53 };
       
    54 
    32 
    55 class GameCFGWidget : public QGroupBox
    33 class GameCFGWidget : public QGroupBox
    56 {
    34 {
    57 	Q_OBJECT
    35 	Q_OBJECT
    58 
    36 
    68 	void setParam(const QString & param, const QStringList & value);
    46 	void setParam(const QString & param, const QStringList & value);
    69 	void fullNetConfig();
    47 	void fullNetConfig();
    70 
    48 
    71 signals:
    49 signals:
    72 	void paramChanged(const QString & param, const QStringList & value);
    50 	void paramChanged(const QString & param, const QStringList & value);
       
    51 	void goToSchemes();
    73 
    52 
    74 private slots:
    53 private slots:
    75 	void ammoChanged(int index);
    54 	void ammoChanged(int index);
    76 	void borderChanged(bool);
       
    77 	void caseProbabilityChanged(int);
       
    78 	void fortsModeChanged(bool);
       
    79 	void initHealthChanged(int);
       
    80 	void mapChanged(const QString &);
    55 	void mapChanged(const QString &);
    81 	void templateFilterChanged(int);
    56 	void templateFilterChanged(int);
    82 	void seedChanged(const QString &);
    57 	void seedChanged(const QString &);
    83 	void solidChanged(bool);
       
    84 	void suddenDeathTurnsChanged(int);
       
    85 	void teamsDivideChanged(bool);
       
    86 	void themeChanged(const QString &);
    58 	void themeChanged(const QString &);
    87 	void turnTimeChanged(int);
       
    88 
    59 
    89 private:
    60 private:
    90 	QCheckBox * CB_mode_Forts;
       
    91 	QCheckBox * CB_teamsDivide;
       
    92 	QCheckBox * CB_solid;
       
    93 	QCheckBox * CB_border;
       
    94 	QGridLayout mainLayout;
    61 	QGridLayout mainLayout;
    95 	QSpinBox * SB_TurnTime;
       
    96 	QSpinBox * SB_InitHealth;
       
    97 	QSpinBox * SB_SuddenDeath;
       
    98 	FreqSpinBox * SB_CaseProb;
       
    99 	QLabel * L_TurnTime;
       
   100 	QLabel * L_InitHealth;
       
   101 	QLabel * L_SuddenDeath;
       
   102 	QLabel * L_CaseProb;
       
   103 
    62 
   104 	QString curNetAmmoName;
    63 	QString curNetAmmoName;
   105 	QString curNetAmmo;
    64 	QString curNetAmmo;
   106 
    65 
   107 	void setNetAmmo(const QString& name, const QString& ammo);
    66 	void setNetAmmo(const QString& name, const QString& ammo);