More messing around with the launcher config file

actorid
Pieter van der Kloet 14 years ago
parent 5f6b4a853f
commit 4ee748552b

@ -10,9 +10,10 @@ set(LAUNCHER
maindialog.hpp
playpage.hpp
combobox.hpp
)
SET(MOC_HDRS
set(MOC_HDRS
datafilespage.hpp
lineedit.hpp
maindialog.hpp

@ -3,6 +3,7 @@
#include <QDebug> // TODO: Remove
#include <components/esm/esm_reader.hpp>
#include "../openmw/path.hpp"
#include "datafilespage.hpp"
#include "lineedit.hpp"
@ -46,10 +47,24 @@ DataFilesPage::DataFilesPage(QWidget *parent) : QWidget(parent)
QLabel *profileLabel = new QLabel(tr("Current Profile:"), this);
// TEST
QFile config("launcher.cfg");
if (config.exists())
{
mLauncherConfig = new QSettings("launcher.cfg", QSettings::IniFormat);
} else {
QString path = QString::fromStdString(OMW::Path::getPath(OMW::Path::GLOBAL_CFG_PATH,
"launcher",
"launcher.cfg"));
mLauncherConfig = new QSettings(path, QSettings::IniFormat);
}
QSettings settings("launcher.cfg", QSettings::IniFormat);
settings.beginGroup("Profiles");
mProfileModel = new QStringListModel();
QStringList profileList;
profileList << "Default" << "New" << "Yeah" << "Cool story bro!";
mProfileModel->setStringList(profileList);
mProfileModel->setStringList(settings.childGroups());
mProfileComboBox = new ComboBox(this);
@ -100,6 +115,9 @@ DataFilesPage::DataFilesPage(QWidget *parent) : QWidget(parent)
//connect(mProfileComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(profileChanged(const QString&)));
connect(mProfileComboBox, SIGNAL(textChanged(const QString&, const QString&)), this, SLOT(profileChanged(const QString&, const QString&)));
readConfig();
}
void DataFilesPage::setupDataFiles()
@ -361,6 +379,12 @@ void DataFilesPage::profileChanged(const QString &current, const QString &previo
}
void DataFilesPage::readConfig()
{
// TODO: global etc
}
void DataFilesPage::writeConfig()
{
// TODO: Testing the config here

@ -12,6 +12,7 @@ class QStandardItemModel;
class QItemSelection;
class QItemSelectionModel;
class QStringListModel;
class QSettings;
class DataFilesPage : public QWidget
{
@ -22,8 +23,10 @@ public:
ComboBox *mProfileComboBox;
QStringListModel *mProfileModel;
QSettings *mLauncherConfig;
const QStringList checkedPlugins();
void readConfig();
void writeConfig();
public slots:

Loading…
Cancel
Save