QTfrontend/mapContainer.cpp
changeset 3185 19d84448835f
parent 3181 5c350b6c38f4
child 3195 c6f58cff5ffc
--- a/QTfrontend/mapContainer.cpp	Tue Mar 30 20:17:12 2010 +0000
+++ b/QTfrontend/mapContainer.cpp	Tue Mar 30 20:18:04 2010 +0000
@@ -63,6 +63,9 @@
     chooseMap->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
     chooseMap->addItem(QComboBox::tr("generated map..."));
     chooseMap->addItem(QComboBox::tr("generated maze..."));
+    chooseMap->insertSeparator(chooseMap->count()); // separator between generators and missions
+
+    int missionindex = chooseMap->count();
     for (int i = 0; i < mapList->size(); ++i) {
         QString map = (*mapList)[i];
         QFile mapCfgFile(
@@ -88,10 +91,14 @@
             else
                 mapInfo.push_back(18);
             mapInfo.push_back(mapLuaFile.exists());
-            chooseMap->addItem(mapLuaFile.exists() ? (QComboBox::tr("Mission") + ": " + map) : map, mapInfo);
+            if(mapLuaFile.exists())
+                chooseMap->insertItem(missionindex++, QComboBox::tr("Mission") + ": " + map, mapInfo);
+            else
+                chooseMap->addItem(map, mapInfo);
             mapCfgFile.close();
         }
     }
+    chooseMap->insertSeparator(missionindex); // separator between missions and maps
 
     connect(chooseMap, SIGNAL(currentIndexChanged(int)), this, SLOT(mapChanged(int)));
     mainLayout.addWidget(chooseMap, 1, 1);