1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 15:49:55 +00:00
openmw-tes3mp/apps/opencs/model/settings/usersettings.hpp
graffy76 475214ab62 Implmented QSettings for loading / saving file definitions. Also
renamed opencs.cfg to opencs.ini to follow Ini format standards
2014-05-05 05:56:03 -05:00

66 lines
1.5 KiB
C++

#ifndef USERSETTINGS_HPP
#define USERSETTINGS_HPP
#include <QTextStream>
#include <QStringList>
#include <QString>
#include <QMap>
#include <boost/filesystem/path.hpp>
#include "settingmanager.hpp"
#ifndef Q_MOC_RUN
#include <components/files/configurationmanager.hpp>
#endif
namespace Files { typedef std::vector<boost::filesystem::path> PathContainer;
struct ConfigurationManager;}
class QFile;
class QSettings;
namespace CSMSettings {
class UserSettings: public SettingManager
{
Q_OBJECT
static UserSettings *mUserSettingsInstance;
QString mUserFilePath;
Files::ConfigurationManager mCfgMgr;
QString mReadOnlyMessage;
QString mReadWriteMessage;
QSettings *mSettings;
public:
/// Singleton implementation
static UserSettings& instance();
UserSettings();
~UserSettings();
UserSettings (UserSettings const &); //not implemented
void operator= (UserSettings const &); //not implemented
/// Writes settings to the last loaded settings file
bool writeSettings();
/// Retrieves the settings file at all three levels (global, local and user).
void loadSettings (const QString &fileName);
/// Writes settings to the user's config file path
void saveSettings (const QMap <QString, QStringList > &settingMap);
QString settingValue (const QString &settingKey);
private:
void buildSettingModelDefaults();
};
}
#endif // USERSETTINGS_HPP