QTfrontend/pageeditteam.cpp
changeset 5308 c57a8878eebe
parent 5252 ded882439548
child 5545 980d44fe2d4c
equal deleted inserted replaced
5305:370989a1ddf0 5308:c57a8878eebe
   143     {
   143     {
   144         QHBoxLayout * hbox = new QHBoxLayout();
   144         QHBoxLayout * hbox = new QHBoxLayout();
   145         CBVoicepack = new QComboBox(GBoxTeam);
   145         CBVoicepack = new QComboBox(GBoxTeam);
   146         {
   146         {
   147             QDir tmpdir;
   147             QDir tmpdir;
       
   148             QStringList list;
   148             tmpdir.cd(cfgdir->absolutePath());
   149             tmpdir.cd(cfgdir->absolutePath());
   149             tmpdir.cd("Data/Sounds/voices");
   150             if (tmpdir.cd("Data/Sounds/voices")) 
   150             QStringList list = tmpdir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name);
   151             {
   151             CBVoicepack->addItems(list);
   152                 list = tmpdir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name);
       
   153                 CBVoicepack->addItems(list);
       
   154             }
   152 
   155 
   153             tmpdir.cd(datadir->absolutePath());
   156             tmpdir.cd(datadir->absolutePath());
   154             tmpdir.cd("Sounds/voices");
   157             tmpdir.cd("Sounds/voices");
   155             QStringList tmplist = tmpdir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name);
   158             QStringList tmplist = tmpdir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name);
   156             QStringList tmplist2;
   159             QStringList tmplist2;
   180     //FortPreview->setAttribute(Qt::WA_PaintOnScreen, true);
   183     //FortPreview->setAttribute(Qt::WA_PaintOnScreen, true);
   181     GBFLayout->addWidget(FortPreview, 1, 0);
   184     GBFLayout->addWidget(FortPreview, 1, 0);
   182     vbox2->addWidget(GBoxFort);
   185     vbox2->addWidget(GBoxFort);
   183 
   186 
   184     QDir tmpdir;
   187     QDir tmpdir;
       
   188     QStringList userforts;
   185     tmpdir.cd(cfgdir->absolutePath());
   189     tmpdir.cd(cfgdir->absolutePath());
   186     tmpdir.cd("Data/Forts");
   190     if (tmpdir.cd("Data/Forts"))
   187     tmpdir.setFilter(QDir::Files);
   191     {
   188 
   192         tmpdir.setFilter(QDir::Files);
   189     QStringList userforts = tmpdir.entryList(QStringList("*L.png")).replaceInStrings(QRegExp("^(.*)L\\.png"), "\\1");
   193         userforts = tmpdir.entryList(QStringList("*L.png")).replaceInStrings(QRegExp("^(.*)L\\.png"), "\\1");
   190     CBFort->addItems(userforts);
   194         CBFort->addItems(userforts);
       
   195     }
   191 
   196 
   192     tmpdir.cd("../Graphics/Graves");
   197     tmpdir.cd("../Graphics/Graves");
   193     QStringList userlist = tmpdir.entryList(QStringList("*.png"));
   198     QStringList userlist = tmpdir.entryList(QStringList("*.png"));
   194     for (QStringList::Iterator it = userlist.begin(); it != userlist.end(); ++it )
   199     for (QStringList::Iterator it = userlist.begin(); it != userlist.end(); ++it )
   195     {
   200     {
   205     QStringList tmplist = tmpdir.entryList(QStringList("*L.png")).replaceInStrings(QRegExp("^(.*)L\\.png"), "\\1");
   210     QStringList tmplist = tmpdir.entryList(QStringList("*L.png")).replaceInStrings(QRegExp("^(.*)L\\.png"), "\\1");
   206     QStringList dataforts;
   211     QStringList dataforts;
   207     for (QStringList::Iterator it = tmplist.begin(); it != tmplist.end(); ++it)
   212     for (QStringList::Iterator it = tmplist.begin(); it != tmplist.end(); ++it)
   208         if (!userforts.contains(*it,Qt::CaseInsensitive)) dataforts.append(*it);
   213         if (!userforts.contains(*it,Qt::CaseInsensitive)) dataforts.append(*it);
   209 
   214 
   210     CBVoicepack->addItems(dataforts);
   215     CBFort->addItems(dataforts);
   211     connect(CBFort, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(CBFort_activated(const QString &)));
   216     connect(CBFort, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(CBFort_activated(const QString &)));
   212 
   217 
   213     tmpdir.cd("../Graphics/Graves");
   218     tmpdir.cd("../Graphics/Graves");
   214     QStringList datalist = tmpdir.entryList(QStringList("*.png"));
   219     QStringList datalist = tmpdir.entryList(QStringList("*.png"));
   215     for (QStringList::Iterator it = datalist.begin(); it != datalist.end(); ++it )
   220     for (QStringList::Iterator it = datalist.begin(); it != datalist.end(); ++it )