QTfrontend/gamecfgwidget.cpp
changeset 325 17c860483407
parent 320 1ee7f087195a
child 326 c6718bfdd642
equal deleted inserted replaced
324:f4c109c82a0c 325:17c860483407
    65 	SB_InitHealth->setSingleStep(25);
    65 	SB_InitHealth->setSingleStep(25);
    66 	GBoxOptionsLayout->addWidget(SB_TurnTime, 1, 1);
    66 	GBoxOptionsLayout->addWidget(SB_TurnTime, 1, 1);
    67 	GBoxOptionsLayout->addWidget(SB_InitHealth, 2, 1);
    67 	GBoxOptionsLayout->addWidget(SB_InitHealth, 2, 1);
    68 
    68 
    69 	mainLayout.addWidget(new QWidget, 100);
    69 	mainLayout.addWidget(new QWidget, 100);
       
    70 
       
    71 	connect(SB_InitHealth, SIGNAL(valueChanged(int i)), this, SLOT(onInitHealthChanged(int)));
       
    72 	connect(SB_TurnTime, SIGNAL(valueChanged(int i)), this, SLOT(onTurnTimeChanged(int time)));
       
    73 	connect(CB_mode_Forts, SIGNAL(toggled(bool)), this, SLOT(onFortsModeChanged(bool)));
       
    74 
       
    75 	connect(pMapContainer, SIGNAL(seedChanged(const QString &)), this, SLOT(onSeedChanged(const QString &)));
       
    76 	connect(pMapContainer, SIGNAL(themeChanged(const QString &)), this, SLOT(onThemeChanged(const QString &)));
       
    77 	connect(pMapContainer, SIGNAL(mapChanged(const QString &)), this, SLOT(onMapChanged(const QString &)));
    70 }
    78 }
    71 
    79 
    72 quint32 GameCFGWidget::getGameFlags() const
    80 quint32 GameCFGWidget::getGameFlags() const
    73 {
    81 {
    74 	quint32 result = 0;
    82 	quint32 result = 0;
   128 void GameCFGWidget::setTheme(const QString & theme)
   136 void GameCFGWidget::setTheme(const QString & theme)
   129 {
   137 {
   130 	pMapContainer->setTheme(theme);
   138 	pMapContainer->setTheme(theme);
   131 }
   139 }
   132 
   140 
   133 void GameCFGWidget::setInitHealth(const quint32 health)
   141 void GameCFGWidget::setInitHealth(quint32 health)
   134 {
   142 {
   135 	SB_InitHealth->setValue(health);
   143 	SB_InitHealth->setValue(health);
   136 }
   144 }
   137 
   145 
   138 void GameCFGWidget::setTurnTime(const quint32 time)
   146 void GameCFGWidget::setTurnTime(quint32 time)
   139 {
   147 {
   140 	SB_TurnTime->setValue(time);
   148 	SB_TurnTime->setValue(time);
   141 }
   149 }
   142 
   150 
   143 void GameCFGWidget::setFortsMode(const bool value)
   151 void GameCFGWidget::setFortsMode(bool value)
   144 {
   152 {
   145 	CB_mode_Forts->setChecked(value);
   153 	CB_mode_Forts->setChecked(value);
   146 }
   154 }
       
   155 
       
   156 void GameCFGWidget::onInitHealthChanged(int health)
       
   157 {
       
   158 	emit initHealthChanged(health);
       
   159 }
       
   160 
       
   161 void GameCFGWidget::onTurnTimeChanged(int time)
       
   162 {
       
   163 	emit turnTimeChanged(time);
       
   164 }
       
   165 
       
   166 void GameCFGWidget::onFortsModeChanged(bool value)
       
   167 {
       
   168 	emit fortsModeChanged(value);
       
   169 }
       
   170 
       
   171 void GameCFGWidget::onSeedChanged(const QString & seed)
       
   172 {
       
   173 	emit seedChanged(seed);
       
   174 }
       
   175 
       
   176 void GameCFGWidget::onMapChanged(const QString & map)
       
   177 {
       
   178 	emit mapChanged(map);
       
   179 }
       
   180 
       
   181 void GameCFGWidget::onThemeChanged(const QString & theme)
       
   182 {
       
   183 	emit themeChanged(theme);
       
   184 }