forked from teamnwah/openmw-tes3coop
700d55f1fb
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
47 lines
1.5 KiB
C++
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
|
|
|