33 pageLayout->setRowStretch(2, 1); |
33 pageLayout->setRowStretch(2, 1); |
34 |
34 |
35 CBSelect = new QComboBox(this); |
35 CBSelect = new QComboBox(this); |
36 |
36 |
37 QDir tmpdir; |
37 QDir tmpdir; |
|
38 tmpdir.cd(cfgdir->absolutePath()); |
|
39 tmpdir.cd("Data/Missions/Training"); |
|
40 tmpdir.setFilter(QDir::Files); |
|
41 QStringList userlist = tmpdir.entryList(QStringList("*.lua")).replaceInStrings(QRegExp("^(.*)\\.lua"), "\\1"); |
|
42 CBSelect->addItems(userlist); |
|
43 |
38 tmpdir.cd(datadir->absolutePath()); |
44 tmpdir.cd(datadir->absolutePath()); |
39 tmpdir.cd("Missions/Training"); |
45 tmpdir.cd("Missions/Training"); |
40 tmpdir.setFilter(QDir::Files); |
46 tmpdir.setFilter(QDir::Files); |
41 CBSelect->addItems(tmpdir.entryList(QStringList("*.lua")).replaceInStrings(QRegExp("^(.*)\\.lua"), "\\1")); |
47 QStringList tmplist = tmpdir.entryList(QStringList("*.lua")).replaceInStrings(QRegExp("^(.*)\\.lua"), "\\1"); |
|
48 QStringList datalist; |
|
49 for (QStringList::Iterator it = tmplist.begin(); it != tmplist.end(); ++it) |
|
50 if (!userlist.contains(*it,Qt::CaseInsensitive)) datalist.append(*it); |
|
51 CBSelect->addItems(datalist); |
|
52 |
42 for(int i = 0; i < CBSelect->count(); i++) |
53 for(int i = 0; i < CBSelect->count(); i++) |
43 { |
54 { |
44 CBSelect->setItemData(i, CBSelect->itemText(i)); |
55 CBSelect->setItemData(i, CBSelect->itemText(i)); |
45 CBSelect->setItemText(i, CBSelect->itemText(i).replace("_", " ")); |
56 CBSelect->setItemText(i, CBSelect->itemText(i).replace("_", " ")); |
46 } |
57 } |