193 //QShortcut * updateData = new QShortcut(QKeySequence("F5"), this); |
193 //QShortcut * updateData = new QShortcut(QKeySequence("F5"), this); |
194 //connect (updateData, SIGNAL(activated()), &DataManager::instance(), SLOT(reload())); |
194 //connect (updateData, SIGNAL(activated()), &DataManager::instance(), SLOT(reload())); |
195 #endif |
195 #endif |
196 |
196 |
197 previousCampaignName = ""; |
197 previousCampaignName = ""; |
|
198 previousTeamName = ""; |
198 UpdateTeamsLists(); |
199 UpdateTeamsLists(); |
199 InitCampaignPage(); |
200 InitCampaignPage(); |
200 UpdateCampaignPage(0); |
201 UpdateCampaignPage(0); |
201 UpdateWeapons(); |
202 UpdateWeapons(); |
202 |
203 |
1891 |
1892 |
1892 |
1893 |
1893 void HWForm::UpdateCampaignPage(int index) |
1894 void HWForm::UpdateCampaignPage(int index) |
1894 { |
1895 { |
1895 Q_UNUSED(index); |
1896 Q_UNUSED(index); |
1896 |
1897 |
1897 HWTeam team(ui.pageCampaign->CBTeam->currentText()); |
1898 HWTeam team(ui.pageCampaign->CBTeam->currentText()); |
1898 ui.pageCampaign->CBMission->clear(); |
1899 ui.pageCampaign->CBMission->clear(); |
1899 |
1900 |
1900 QString campaignName = ui.pageCampaign->CBCampaign->currentText(); |
1901 QString campaignName = ui.pageCampaign->CBCampaign->currentText(); |
1901 QStringList missionEntries = getCampMissionList(campaignName); |
1902 QStringList missionEntries = getCampMissionList(campaignName); |
1904 unsigned int m = getCampProgress(tName, campaignName); |
1905 unsigned int m = getCampProgress(tName, campaignName); |
1905 |
1906 |
1906 // if the campaign name changes update the campaignMissionDescriptions list |
1907 // if the campaign name changes update the campaignMissionDescriptions list |
1907 // this will be used later in UpdateCampaignPageMission() to update |
1908 // this will be used later in UpdateCampaignPageMission() to update |
1908 // the mission description in the campaign page |
1909 // the mission description in the campaign page |
1909 bool updateMissionList = false; |
1910 bool updateMissionList = false; |
1910 QSettings * m_info; |
1911 QSettings * m_info; |
1911 if(previousCampaignName.compare(campaignName)!=0) |
1912 if(previousCampaignName.compare(campaignName)!=0 || |
1912 { |
1913 previousTeamName.compare(tName) != 0) |
|
1914 { |
|
1915 if (previousTeamName.compare(tName) != 0 && |
|
1916 previousTeamName.compare("") != 0) |
|
1917 index = qMin(m + 1, n); |
1913 previousCampaignName = campaignName; |
1918 previousCampaignName = campaignName; |
|
1919 previousTeamName = tName; |
1914 updateMissionList = true; |
1920 updateMissionList = true; |
1915 // the following code was based on pagetraining.cpp |
1921 // the following code was based on pagetraining.cpp |
1916 DataManager & dataMgr = DataManager::instance(); |
1922 DataManager & dataMgr = DataManager::instance(); |
1917 // get locale |
1923 // get locale |
1918 QSettings settings(dataMgr.settingsFileName(), |
1924 QSettings settings(dataMgr.settingsFileName(), |