QTfrontend/gamecfgwidget.cpp
changeset 1876 b13dd4e6e98e
parent 1875 189370d394db
child 1877 1edafdb4c7a2
--- a/QTfrontend/gamecfgwidget.cpp	Mon Mar 09 10:54:44 2009 +0000
+++ b/QTfrontend/gamecfgwidget.cpp	Mon Mar 09 18:43:41 2009 +0000
@@ -109,6 +109,7 @@
 	connect(pMapContainer, SIGNAL(seedChanged(const QString &)), this, SLOT(seedChanged(const QString &)));
 	connect(pMapContainer, SIGNAL(mapChanged(const QString &)), this, SLOT(mapChanged(const QString &)));
 	connect(pMapContainer, SIGNAL(themeChanged(const QString &)), this, SLOT(themeChanged(const QString &)));
+	connect(pMapContainer, SIGNAL(newTemplateFilter(int)), this, SLOT(templateFilterChanged(int)));
 }
 
 quint32 GameCFGWidget::getGameFlags() const
@@ -176,6 +177,7 @@
 	solidChanged(CB_solid->isChecked());
 	suddenDeathTurnsChanged(SB_SuddenDeath->value());
 	teamsDivideChanged(CB_teamsDivide->isChecked());
+	templateFilterChanged(pMapContainer->getTemplateFilter());
 	themeChanged(pMapContainer->getCurrentTheme());
 	turnTimeChanged(SB_TurnTime->value());
 
@@ -234,11 +236,11 @@
 			CB_border->setChecked(value.toUInt() != 0);
 			return;
 		}
-/*		if (param == "TEMPLATE_FILTER") {
-			emit templateFilterChanged(lst[2].toUInt());
+		if (param == "TEMPLATE") {
+			pMapContainer->setTemplateFilter(value.toUInt());
 			return;
 		}
-*/	}
+	}
 
 	if (slValue.size() == 2)
 	{
@@ -283,6 +285,11 @@
 	emit paramChanged("MAP", QStringList(value));
 }
 
+void GameCFGWidget::templateFilterChanged(int value)
+{
+	emit paramChanged("TEMPLATE", QStringList(QString::number(value)));
+}
+
 void GameCFGWidget::seedChanged(const QString & value)
 {
 	emit paramChanged("SEED", QStringList(value));