QTfrontend/mapContainer.cpp
changeset 331 6bfc326e4976
parent 329 4c3aad46baa5
child 452 45fbb9df0c99
--- a/QTfrontend/mapContainer.cpp	Sun Jan 14 15:58:18 2007 +0000
+++ b/QTfrontend/mapContainer.cpp	Sun Jan 14 18:32:44 2007 +0000
@@ -81,6 +81,13 @@
     return;
   }
 
+  loadMap(index);
+
+  emit mapChanged(chooseMap->currentText());
+}
+
+void HWMapContainer::loadMap(int index)
+{
   QPixmap mapImage;
   if(!mapImage.load(datadir->absolutePath() + "/Maps/" + chooseMap->currentText() + "/map.png")) {
     changeImage();
@@ -94,7 +101,6 @@
     input >> theme;
     mapCfgFile.close();
   }
-  emit mapChanged(chooseMap->currentText());
 }
 
 void HWMapContainer::changeImage()
@@ -134,7 +140,11 @@
 
 void HWMapContainer::setMap(const QString & map)
 {
-
+	int id = chooseMap->findText(map);
+	if(id >= 0) {
+		chooseMap->setCurrentIndex(id);
+		loadMap(id);
+	}
 }
 
 void HWMapContainer::setTheme(const QString & theme)