1 #include "preferences.h"
2 #include "ui_preferences.h"
5 Preferences::Preferences(QList<QString> &packList, const QString &selectedPack, QWidget *parent) :
7 ui(new Ui::Preferences)
10 QListIterator<QString> i(packList);
13 QString packName=i.next();
14 ui->packList->addItem(packName);
16 ui->packList->setCurrentIndex(ui->packList->findText(selectedPack));
19 Preferences::~Preferences()
23 // TODO: get rid off pack loading and duplicate filename constructing
24 void Preferences::packNameSelected()
26 QString packName(ui->packList->currentText());
27 selectedPack=packName;
28 LevelPack *pack=new LevelPack(":/packs/"+packName.append(".ini"));
29 ui->packAuthor->setText(pack->getAuthor());
30 ui->packURL->setText(pack->getURL());
31 ui->packDescription->setText(pack->getDescription());