fixes bug that doesn't display mission name in drop down list spacecampaign
authorPeriklis Ntanasis <pntanasis@gmail.com>
Thu, 19 Sep 2013 02:33:23 +0300
branchspacecampaign
changeset 9641 b08c8bde57e3
parent 9640 a6a903a6c2b3
child 9642 8a691e0f117a
fixes bug that doesn't display mission name in drop down list
QTfrontend/hwform.cpp
--- a/QTfrontend/hwform.cpp	Wed Sep 18 04:24:10 2013 +0300
+++ b/QTfrontend/hwform.cpp	Thu Sep 19 02:33:23 2013 +0300
@@ -1923,9 +1923,16 @@
 {
     Q_UNUSED(index);
 
-    int missionIndex = ui.pageCampaign->CBMission->currentIndex();
+    QString missionTitle = ui.pageCampaign->CBMission->currentText();
     UpdateCampaignPage(0);
-    ui.pageCampaign->CBMission->setCurrentIndex(missionIndex);
+    for(int i=0;i<ui.pageCampaign->CBMission->count();i++)
+    {
+		if (ui.pageCampaign->CBMission->itemText(i)==missionTitle)
+		{
+			ui.pageCampaign->CBMission->setCurrentIndex(i);
+			break;
+		}
+	}
 }
 
 // used for --set-everything [screen width] [screen height] [color dept] [volume] [enable music] [enable sounds] [language file] [full screen] [show FPS] [alternate damage] [timer value] [reduced quality]