QTfrontend/pages.cpp
changeset 1885 75489216b5b0
parent 1884 40e59e9f82ce
child 1887 d68939b3f7f0
equal deleted inserted replaced
1884:40e59e9f82ce 1885:75489216b5b0
    36 #include <QTextBrowser>
    36 #include <QTextBrowser>
    37 #include <QTableWidget>
    37 #include <QTableWidget>
    38 #include <QAction>
    38 #include <QAction>
    39 #include <QMenu>
    39 #include <QMenu>
    40 #include <QSound>
    40 #include <QSound>
       
    41 #include <QDataWidgetMapper>
       
    42 
    41 
    43 
    42 #include "pages.h"
    44 #include "pages.h"
    43 #include "sdlkeys.h"
    45 #include "sdlkeys.h"
    44 #include "hwconsts.h"
    46 #include "hwconsts.h"
    45 #include "gamecfgwidget.h"
    47 #include "gamecfgwidget.h"
    54 #include "chatwidget.h"
    56 #include "chatwidget.h"
    55 #include "playrecordpage.h"
    57 #include "playrecordpage.h"
    56 #include "selectWeapon.h"
    58 #include "selectWeapon.h"
    57 #include "igbox.h"
    59 #include "igbox.h"
    58 #include "hats.h"
    60 #include "hats.h"
       
    61 #include "misc.h"
    59 
    62 
    60 PageMain::PageMain(QWidget* parent) : 
    63 PageMain::PageMain(QWidget* parent) : 
    61   AbstractPage(parent)
    64   AbstractPage(parent)
    62 {
    65 {
    63 	QGridLayout * pageLayout = new QGridLayout(this);
    66 	QGridLayout * pageLayout = new QGridLayout(this);
   846 
   849 
   847 PageScheme::PageScheme(QWidget* parent) :
   850 PageScheme::PageScheme(QWidget* parent) :
   848 	AbstractPage(parent)
   851 	AbstractPage(parent)
   849 {
   852 {
   850 	QGridLayout * pageLayout = new QGridLayout(this);
   853 	QGridLayout * pageLayout = new QGridLayout(this);
   851 }
   854 
       
   855 	CB_mode_Forts = new QCheckBox(this);
       
   856 	CB_mode_Forts->setText(QCheckBox::tr("Forts mode"));
       
   857 	pageLayout->addWidget(CB_mode_Forts, 0, 0, 1, 2);
       
   858 
       
   859 	CB_teamsDivide = new QCheckBox(this);
       
   860 	CB_teamsDivide->setText(QCheckBox::tr("Divide teams"));
       
   861 	pageLayout->addWidget(CB_teamsDivide, 1, 0, 1, 2);
       
   862 
       
   863 	CB_solid = new QCheckBox(this);
       
   864 	CB_solid->setText(QCheckBox::tr("Solid land"));
       
   865 	pageLayout->addWidget(CB_solid, 2, 0, 1, 2);
       
   866 
       
   867 	CB_border = new QCheckBox(this);
       
   868 	CB_border->setText(QCheckBox::tr("Add Border"));
       
   869 	pageLayout->addWidget(CB_border, 3, 0, 1, 2);
       
   870 
       
   871 	SB_TurnTime = new QSpinBox(this);
       
   872 	SB_TurnTime->setRange(1, 99);
       
   873 	SB_TurnTime->setValue(45);
       
   874 	SB_TurnTime->setSingleStep(15);
       
   875 	
       
   876 	SB_InitHealth = new QSpinBox(this);
       
   877 	SB_InitHealth->setRange(50, 200);
       
   878 	SB_InitHealth->setValue(100);
       
   879 	SB_InitHealth->setSingleStep(25);
       
   880 	
       
   881 	SB_SuddenDeath = new QSpinBox(this);
       
   882 	SB_SuddenDeath->setRange(0, 50);
       
   883 	SB_SuddenDeath->setValue(15);
       
   884 	SB_SuddenDeath->setSingleStep(3);
       
   885 	
       
   886 	SB_CaseProb = new FreqSpinBox(this);
       
   887 	SB_CaseProb->setRange(0, 9);
       
   888 	SB_CaseProb->setValue(5);
       
   889 
       
   890 	LE_name = new QLineEdit(this);
       
   891 
       
   892 	pageLayout->addWidget(SB_TurnTime, 4, 1);
       
   893 	pageLayout->addWidget(SB_InitHealth, 5, 1);
       
   894 	pageLayout->addWidget(SB_SuddenDeath, 6, 1);
       
   895 	pageLayout->addWidget(SB_CaseProb, 7, 1);
       
   896 	pageLayout->addWidget(LE_name, 8, 1);
       
   897 
       
   898 	mapper = new QDataWidgetMapper(this);
       
   899 	mapper->addMapping(LE_name, 0);
       
   900 	mapper->addMapping(CB_mode_Forts, 1);
       
   901 	mapper->addMapping(CB_teamsDivide, 2);
       
   902 	mapper->addMapping(CB_solid, 3);
       
   903 	mapper->addMapping(CB_border, 4);
       
   904 	mapper->addMapping(SB_TurnTime, 5);
       
   905 	mapper->addMapping(SB_InitHealth, 6);
       
   906 	mapper->addMapping(SB_SuddenDeath, 7);
       
   907 	mapper->addMapping(SB_CaseProb, 8);
       
   908 }