2013-05-08 01:33:42 +00:00
|
|
|
#ifndef USERSETTINGS_HPP
|
|
|
|
#define USERSETTINGS_HPP
|
|
|
|
|
|
|
|
#include <QTextStream>
|
|
|
|
#include <QStringList>
|
|
|
|
#include <QString>
|
|
|
|
#include <QMap>
|
|
|
|
|
|
|
|
#include <boost/filesystem/path.hpp>
|
|
|
|
|
|
|
|
#include "support.hpp"
|
|
|
|
|
|
|
|
namespace Files { typedef std::vector<boost::filesystem::path> PathContainer;
|
|
|
|
struct ConfigurationManager;}
|
|
|
|
|
|
|
|
class QFile;
|
|
|
|
|
2013-05-11 10:55:46 +00:00
|
|
|
namespace CSMSettings {
|
2013-05-08 01:33:42 +00:00
|
|
|
|
2013-05-12 20:15:57 +00:00
|
|
|
struct UserSettings: public QObject
|
2013-05-08 01:33:42 +00:00
|
|
|
{
|
2013-05-12 20:15:57 +00:00
|
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
2013-05-08 01:33:42 +00:00
|
|
|
public:
|
2013-05-12 01:55:36 +00:00
|
|
|
|
|
|
|
static UserSettings &instance()
|
|
|
|
{
|
|
|
|
static UserSettings instance;
|
|
|
|
|
|
|
|
return instance;
|
|
|
|
}
|
2013-05-08 01:33:42 +00:00
|
|
|
|
|
|
|
QFile *openFile (const QString &);
|
|
|
|
bool writeFile(QFile *file, QMap<QString, SettingList *> §ions);
|
|
|
|
void getSettings (QTextStream &stream, SectionMap &settings);
|
2013-06-08 22:34:27 +00:00
|
|
|
QString getSettingValue(QString section, QString setting);
|
2013-05-08 01:33:42 +00:00
|
|
|
|
|
|
|
private:
|
2013-05-12 01:55:36 +00:00
|
|
|
|
|
|
|
UserSettings *mUserSettingsInstance;
|
|
|
|
UserSettings();
|
|
|
|
~UserSettings();
|
|
|
|
|
|
|
|
UserSettings (UserSettings const &); //not implemented
|
|
|
|
void operator= (UserSettings const &); //not implemented
|
2013-05-08 01:33:42 +00:00
|
|
|
|
2013-05-12 20:15:57 +00:00
|
|
|
signals:
|
|
|
|
void signalUpdateEditorSetting (const QString &settingName, const QString &settingValue);
|
|
|
|
|
2013-05-08 01:33:42 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif // USERSETTINGS_HPP
|