openmw-tes3coop/apps/opencs/model/settings/settingsitem.hpp
graffy76 700d55f1fb Fixed / implemented missing features for RecordStatusDelegate
Implemented updating editor application from preferences menu, loading
settings when editor loads, adding Record Status Display prefernce.

Fixed multiple bugs, made changes to CSM(V)Settings classes to make
implementing new prefrences easier.

Rewrote CSMSettings::UserSettings to retain last-loaded settings.

Adjusted icon position in Record Status column

Capitalized status text

Added delegate to referenceables table
2013-06-15 06:40:18 -05:00

47 lines
1.5 KiB
C++

#ifndef SETTINGSITEM_HPP
#define SETTINGSITEM_HPP
#include <QObject>
#include "support.hpp"
#include "settingcontainer.hpp"
namespace CSMSettings
{
class SettingsItem : public SettingContainer
{
QStringPair *mValuePair;
QStringList *mValueList;
bool mIsMultiValue;
QString mDefaultValue;
public:
explicit SettingsItem(QString name, bool isMultiValue,
const QString& defaultValue, QObject *parent = 0)
: SettingContainer(defaultValue, parent),
mIsMultiValue (isMultiValue), mValueList (0),
mValuePair (0), mDefaultValue (defaultValue)
{
QObject::setObjectName(name);
}
bool updateItem (const QStringList *values);
bool updateItem (const QString &value);
bool updateItem (int valueListIndex);
inline QStringList *getValueList() { return mValueList; }
inline void setValueList (QStringList *valueList) { mValueList = valueList; }
inline QStringPair *getValuePair() { return mValuePair; }
inline void setValuePair (QStringPair valuePair) { mValuePair = new QStringPair(valuePair); }
inline bool isMultivalue () { return mIsMultiValue; }
void setDefaultValue (const QString &value);
QString getDefaultValue () const;
private:
bool validate (const QString &value);
};
}
#endif // SETTINGSITEM_HPP