1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-22 14:53:52 +00:00
openmw/apps/opencs/model/settings/usersettings.hpp

65 lines
1.6 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;
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
/// 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();
void displayFileErrorMessage(const QString &userpath,
const QString &globalpath,
const QString &localpath) const;
};
}
#endif // USERSETTINGS_HPP