Trying out new LLCachedControl implementation.
This commit is contained in:
@@ -89,7 +89,8 @@ LLCrashLogger::LLCrashLogger() :
|
||||
mCrashBehavior(CRASH_BEHAVIOR_ASK),
|
||||
mCrashInPreviousExec(false),
|
||||
mSentCrashLogs(false),
|
||||
mCrashHost("")
|
||||
mCrashHost(""),
|
||||
mCrashSettings("CrashSettings")
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -817,7 +817,7 @@ void LLMenuItemCallGL::setEnabledControl(std::string enabled_control, LLView *co
|
||||
control = context->findControl(enabled_control);
|
||||
llassert_always(control);
|
||||
}
|
||||
control->getSignal()->connect(boost::bind(&LLView::controlListener, _1, getHandle(), std::string("enabled")));
|
||||
control->getSignal()->connect(boost::bind(&LLView::controlListener, _2, getHandle(), std::string("enabled")));
|
||||
setEnabled(control->getValue());
|
||||
}
|
||||
}
|
||||
@@ -834,7 +834,7 @@ void LLMenuItemCallGL::setVisibleControl(std::string visible_control, LLView *co
|
||||
control = context->findControl(visible_control);
|
||||
llassert_always(control);
|
||||
}
|
||||
control->getSignal()->connect(boost::bind(&LLView::controlListener, _1, getHandle(), std::string("visible")));
|
||||
control->getSignal()->connect(boost::bind(&LLView::controlListener, _2, getHandle(), std::string("visible")));
|
||||
setVisible(control->getValue());
|
||||
}
|
||||
}
|
||||
@@ -990,7 +990,7 @@ void LLMenuItemCheckGL::setCheckedControl(std::string checked_control, LLView *c
|
||||
control = context->findControl(checked_control);
|
||||
llassert_always(control);
|
||||
}
|
||||
control->getSignal()->connect(boost::bind(&LLView::controlListener, _1, getHandle(), std::string("value")));
|
||||
control->getSignal()->connect(boost::bind(&LLView::controlListener, _2, getHandle(), std::string("value")));
|
||||
mChecked = control->getValue();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1344,7 +1344,7 @@ bool LLNotifications::loadTemplates()
|
||||
if (!sound.empty())
|
||||
{
|
||||
// TODO: test for bad sound effect name / missing effect
|
||||
pTemplate->mSoundEffect = LLUUID(LLUI::sConfigGroup->getString(sound.c_str()));
|
||||
pTemplate->mSoundEffect = LLUUID(LLUI::sConfigGroup->findString(sound.c_str()));
|
||||
}
|
||||
|
||||
for (LLXMLNodePtr child = item->getFirstChild();
|
||||
|
||||
@@ -1579,7 +1579,7 @@ void LLUI::initClass(LLControlGroup* config,
|
||||
LLFontGL::sShadowColor = colors->getColor("ColorDropShadow");
|
||||
|
||||
LLUI::sShowXUINames = LLUI::sConfigGroup->getBOOL("ShowXUINames");
|
||||
LLUI::sConfigGroup->getControl("ShowXUINames")->getSignal()->connect(&handleShowXUINamesChanged);
|
||||
LLUI::sConfigGroup->getControl("ShowXUINames")->getSignal()->connect(boost::bind(&handleShowXUINamesChanged,_2));
|
||||
}
|
||||
|
||||
void LLUI::cleanupClass()
|
||||
|
||||
@@ -2820,7 +2820,7 @@ bool LLView::setControlValue(const LLSD& value)
|
||||
std::string ctrlname = getControlName();
|
||||
if (!ctrlname.empty())
|
||||
{
|
||||
LLUI::sConfigGroup->setValue(ctrlname, value);
|
||||
LLUI::sConfigGroup->setUntypedValue(ctrlname, value);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -2848,7 +2848,7 @@ void LLView::setControlName(const std::string& control_name, LLView *context)
|
||||
if (control)
|
||||
{
|
||||
mControlName = control_name;
|
||||
mControlConnection = control->getSignal()->connect(boost::bind(&controlListener, _1, getHandle(), std::string("value")));
|
||||
mControlConnection = control->getSignal()->connect(boost::bind(&controlListener, _2, getHandle(), std::string("value")));
|
||||
setValue(control->getValue());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,9 +53,47 @@
|
||||
#if LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG
|
||||
#define CONTROL_ERRS LL_ERRS("ControlErrors")
|
||||
#else
|
||||
#define CONTROL_ERRS LL_WARNS("ControlErrors")
|
||||
#define CONTROL_ERRS LL_ERRS("ControlErrors")
|
||||
#endif
|
||||
|
||||
|
||||
template <> eControlType get_control_type<U32>();
|
||||
template <> eControlType get_control_type<S32>();
|
||||
template <> eControlType get_control_type<F32>();
|
||||
template <> eControlType get_control_type<bool>();
|
||||
// Yay BOOL, its really an S32.
|
||||
//template <> eControlType get_control_type<BOOL> () ;
|
||||
template <> eControlType get_control_type<std::string>();
|
||||
|
||||
template <> eControlType get_control_type<LLVector3>();
|
||||
template <> eControlType get_control_type<LLVector3d>();
|
||||
template <> eControlType get_control_type<LLRect>();
|
||||
template <> eControlType get_control_type<LLColor4>();
|
||||
template <> eControlType get_control_type<LLColor3>();
|
||||
template <> eControlType get_control_type<LLColor4U>();
|
||||
template <> eControlType get_control_type<LLSD>();
|
||||
|
||||
template <> LLSD convert_to_llsd<U32>(const U32& in);
|
||||
template <> LLSD convert_to_llsd<LLVector3>(const LLVector3& in);
|
||||
template <> LLSD convert_to_llsd<LLVector3d>(const LLVector3d& in);
|
||||
template <> LLSD convert_to_llsd<LLRect>(const LLRect& in);
|
||||
template <> LLSD convert_to_llsd<LLColor4>(const LLColor4& in);
|
||||
template <> LLSD convert_to_llsd<LLColor3>(const LLColor3& in);
|
||||
template <> LLSD convert_to_llsd<LLColor4U>(const LLColor4U& in);
|
||||
|
||||
template <> bool convert_from_llsd<bool>(const LLSD& sd, eControlType type, const std::string& control_name);
|
||||
template <> S32 convert_from_llsd<S32>(const LLSD& sd, eControlType type, const std::string& control_name);
|
||||
template <> U32 convert_from_llsd<U32>(const LLSD& sd, eControlType type, const std::string& control_name);
|
||||
template <> F32 convert_from_llsd<F32>(const LLSD& sd, eControlType type, const std::string& control_name);
|
||||
template <> std::string convert_from_llsd<std::string>(const LLSD& sd, eControlType type, const std::string& control_name);
|
||||
template <> LLWString convert_from_llsd<LLWString>(const LLSD& sd, eControlType type, const std::string& control_name);
|
||||
template <> LLVector3 convert_from_llsd<LLVector3>(const LLSD& sd, eControlType type, const std::string& control_name);
|
||||
template <> LLVector3d convert_from_llsd<LLVector3d>(const LLSD& sd, eControlType type, const std::string& control_name);
|
||||
template <> LLRect convert_from_llsd<LLRect>(const LLSD& sd, eControlType type, const std::string& control_name);
|
||||
template <> LLColor4 convert_from_llsd<LLColor4>(const LLSD& sd, eControlType type, const std::string& control_name);
|
||||
template <> LLColor4U convert_from_llsd<LLColor4U>(const LLSD& sd, eControlType type, const std::string& control_name);
|
||||
template <> LLColor3 convert_from_llsd<LLColor3>(const LLSD& sd, eControlType type, const std::string& control_name);
|
||||
template <> LLSD convert_from_llsd<LLSD>(const LLSD& sd, eControlType type, const std::string& control_name);
|
||||
//this defines the current version of the settings file
|
||||
const S32 CURRENT_VERSION = 101;
|
||||
|
||||
@@ -120,9 +158,6 @@ bool LLControlVariable::llsd_compare(const LLSD& a, const LLSD & b)
|
||||
case TYPE_COL3:
|
||||
result = LLColor3(a) == LLColor3(b);
|
||||
break;
|
||||
case TYPE_COL4U:
|
||||
result = LLColor4U(a) == LLColor4U(b);
|
||||
break;
|
||||
case TYPE_STRING:
|
||||
result = a.asString() == b.asString();
|
||||
break;
|
||||
@@ -141,7 +176,8 @@ LLControlVariable::LLControlVariable(const std::string& name, eControlType type,
|
||||
mType(type),
|
||||
mPersist(persist),
|
||||
mHideFromSettingsEditor(hidefromsettingseditor),
|
||||
mSignal(new signal_t),
|
||||
mCommitSignal(new commit_signal_t),
|
||||
mValidateSignal(new validate_signal_t),
|
||||
mIsCOA(IsCOA),
|
||||
mIsCOAParent(false),
|
||||
mCOAConnectedVar(NULL)
|
||||
@@ -177,6 +213,20 @@ LLSD LLControlVariable::getComparableValue(const LLSD& value)
|
||||
storable_value = false;
|
||||
}
|
||||
}
|
||||
else if (TYPE_LLSD == type() && value.isString())
|
||||
{
|
||||
LLPointer<LLSDNotationParser> parser = new LLSDNotationParser;
|
||||
LLSD result;
|
||||
std::stringstream value_stream(value.asString());
|
||||
if (parser->parse(value_stream, result, LLSDSerialize::SIZE_UNLIMITED) != LLSDParser::PARSE_FAILURE)
|
||||
{
|
||||
storable_value = result;
|
||||
}
|
||||
else
|
||||
{
|
||||
storable_value = value;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
storable_value = value;
|
||||
@@ -185,9 +235,15 @@ LLSD LLControlVariable::getComparableValue(const LLSD& value)
|
||||
return storable_value;
|
||||
}
|
||||
|
||||
void LLControlVariable::setValue(const LLSD& value, bool saved_value)
|
||||
void LLControlVariable::setValue(const LLSD& new_value, bool saved_value)
|
||||
{
|
||||
LLSD storable_value = getComparableValue(value);
|
||||
if ((*mValidateSignal)(this, new_value) == false)
|
||||
{
|
||||
// can not set new value, exit
|
||||
return;
|
||||
}
|
||||
|
||||
LLSD storable_value = getComparableValue(new_value);
|
||||
bool value_changed = llsd_compare(getValue(), storable_value) == FALSE;
|
||||
if(saved_value)
|
||||
{
|
||||
@@ -226,7 +282,7 @@ void LLControlVariable::setValue(const LLSD& value, bool saved_value)
|
||||
if(value_changed)
|
||||
{
|
||||
if(getCOAActive() == this)
|
||||
(*mSignal)(storable_value);
|
||||
(*mCommitSignal)(this,storable_value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -342,7 +398,8 @@ LLControlVariable const* LLControlGroup::getControl(std::string const& name) con
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
LLControlGroup::LLControlGroup()
|
||||
LLControlGroup::LLControlGroup(const std::string& name)
|
||||
: LLInstanceTracker<LLControlGroup, std::string>(name)
|
||||
{
|
||||
mTypeString[TYPE_U32] = "U32";
|
||||
mTypeString[TYPE_S32] = "S32";
|
||||
@@ -354,7 +411,6 @@ LLControlGroup::LLControlGroup()
|
||||
mTypeString[TYPE_RECT] = "Rect";
|
||||
mTypeString[TYPE_COL4] = "Color4";
|
||||
mTypeString[TYPE_COL3] = "Color3";
|
||||
mTypeString[TYPE_COL4U] = "Color4u";
|
||||
mTypeString[TYPE_LLSD] = "LLSD";
|
||||
}
|
||||
|
||||
@@ -451,11 +507,6 @@ BOOL LLControlGroup::declareRect(const std::string& name, const LLRect &initial_
|
||||
return declareControl(name, TYPE_RECT, initial_val.getValue(), comment, persist);
|
||||
}
|
||||
|
||||
BOOL LLControlGroup::declareColor4U(const std::string& name, const LLColor4U &initial_val, const std::string& comment, BOOL persist )
|
||||
{
|
||||
return declareControl(name, TYPE_COL4U, initial_val.getValue(), comment, persist);
|
||||
}
|
||||
|
||||
BOOL LLControlGroup::declareColor4(const std::string& name, const LLColor4 &initial_val, const std::string& comment, BOOL persist )
|
||||
{
|
||||
return declareControl(name, TYPE_COL4, initial_val.getValue(), comment, persist);
|
||||
@@ -473,54 +524,22 @@ BOOL LLControlGroup::declareLLSD(const std::string& name, const LLSD &initial_va
|
||||
|
||||
BOOL LLControlGroup::getBOOL(const std::string& name)
|
||||
{
|
||||
LLControlVariable* control = getControl(name);
|
||||
|
||||
if (control && control->isType(TYPE_BOOLEAN))
|
||||
return control->get().asBoolean();
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid BOOL control " << name << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
return (BOOL)get<bool>(name);
|
||||
}
|
||||
|
||||
S32 LLControlGroup::getS32(const std::string& name)
|
||||
{
|
||||
LLControlVariable* control = getControl(name);
|
||||
|
||||
if (control && control->isType(TYPE_S32))
|
||||
return control->get().asInteger();
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid S32 control " << name << llendl;
|
||||
return 0;
|
||||
}
|
||||
return get<S32>(name);
|
||||
}
|
||||
|
||||
U32 LLControlGroup::getU32(const std::string& name)
|
||||
{
|
||||
LLControlVariable* control = getControl(name);
|
||||
|
||||
if (control && control->isType(TYPE_U32))
|
||||
return control->get().asInteger();
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid U32 control " << name << llendl;
|
||||
return 0;
|
||||
}
|
||||
return get<U32>(name);
|
||||
}
|
||||
|
||||
F32 LLControlGroup::getF32(const std::string& name)
|
||||
{
|
||||
LLControlVariable* control = getControl(name);
|
||||
|
||||
if (control && control->isType(TYPE_F32))
|
||||
return (F32) control->get().asReal();
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid F32 control " << name << llendl;
|
||||
return 0.0f;
|
||||
}
|
||||
return get<F32>(name);
|
||||
}
|
||||
|
||||
std::string LLControlGroup::findString(const std::string& name)
|
||||
@@ -534,20 +553,12 @@ std::string LLControlGroup::findString(const std::string& name)
|
||||
|
||||
std::string LLControlGroup::getString(const std::string& name) const
|
||||
{
|
||||
LLControlVariable const* control = getControl(name);
|
||||
|
||||
if (control && control->isType(TYPE_STRING))
|
||||
return control->get().asString();
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid string control " << name << llendl;
|
||||
return LLStringUtil::null;
|
||||
}
|
||||
return get<std::string>(name);
|
||||
}
|
||||
|
||||
LLWString LLControlGroup::getWString(const std::string& name)
|
||||
{
|
||||
return utf8str_to_wstring(getString(name));
|
||||
return get<LLWString>(name);
|
||||
}
|
||||
|
||||
std::string LLControlGroup::getText(const std::string& name)
|
||||
@@ -560,123 +571,38 @@ std::string LLControlGroup::getText(const std::string& name)
|
||||
|
||||
LLVector3 LLControlGroup::getVector3(const std::string& name)
|
||||
{
|
||||
LLControlVariable* control = getControl(name);
|
||||
|
||||
if (control && control->isType(TYPE_VEC3))
|
||||
return control->get();
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid LLVector3 control " << name << llendl;
|
||||
return LLVector3::zero;
|
||||
}
|
||||
return get<LLVector3>(name);
|
||||
}
|
||||
|
||||
LLVector3d LLControlGroup::getVector3d(const std::string& name)
|
||||
{
|
||||
LLControlVariable* control = getControl(name);
|
||||
|
||||
if (control && control->isType(TYPE_VEC3D))
|
||||
return control->get();
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid LLVector3d control " << name << llendl;
|
||||
return LLVector3d::zero;
|
||||
}
|
||||
return get<LLVector3d>(name);
|
||||
}
|
||||
|
||||
LLRect LLControlGroup::getRect(const std::string& name)
|
||||
{
|
||||
LLControlVariable* control = getControl(name);
|
||||
|
||||
if (control && control->isType(TYPE_RECT))
|
||||
return control->get();
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid rect control " << name << llendl;
|
||||
return LLRect::null;
|
||||
}
|
||||
return get<LLRect>(name);
|
||||
}
|
||||
|
||||
|
||||
LLColor4 LLControlGroup::getColor(const std::string& name)
|
||||
{
|
||||
ctrl_name_table_t::const_iterator i = mNameTable.find(name);
|
||||
|
||||
if (i != mNameTable.end())
|
||||
{
|
||||
LLControlVariable* control = i->second;
|
||||
|
||||
switch(control->mType)
|
||||
{
|
||||
case TYPE_COL4:
|
||||
{
|
||||
return LLColor4(control->get());
|
||||
}
|
||||
case TYPE_COL4U:
|
||||
{
|
||||
return LLColor4(LLColor4U(control->get()));
|
||||
}
|
||||
default:
|
||||
{
|
||||
CONTROL_ERRS << "Control " << name << " not a color" << llendl;
|
||||
return LLColor4::white;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid getColor control " << name << llendl;
|
||||
return LLColor4::white;
|
||||
}
|
||||
}
|
||||
|
||||
LLColor4U LLControlGroup::getColor4U(const std::string& name)
|
||||
{
|
||||
LLControlVariable* control = getControl(name);
|
||||
|
||||
if (control && control->isType(TYPE_COL4U))
|
||||
return control->get();
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid LLColor4 control " << name << llendl;
|
||||
return LLColor4U::white;
|
||||
}
|
||||
return get<LLColor4>(name);
|
||||
}
|
||||
|
||||
LLColor4 LLControlGroup::getColor4(const std::string& name)
|
||||
{
|
||||
LLControlVariable* control = getControl(name);
|
||||
|
||||
if (control && control->isType(TYPE_COL4))
|
||||
return control->get();
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid LLColor4 control " << name << llendl;
|
||||
return LLColor4::white;
|
||||
}
|
||||
return get<LLColor4>(name);
|
||||
}
|
||||
|
||||
LLColor3 LLControlGroup::getColor3(const std::string& name)
|
||||
{
|
||||
LLControlVariable* control = getControl(name);
|
||||
|
||||
if (control && control->isType(TYPE_COL3))
|
||||
return control->get();
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid LLColor3 control " << name << llendl;
|
||||
return LLColor3::white;
|
||||
}
|
||||
return get<LLColor3>(name);
|
||||
}
|
||||
|
||||
LLSD LLControlGroup::getLLSD(const std::string& name)
|
||||
{
|
||||
LLControlVariable* control = getControl(name);
|
||||
|
||||
if (control && control->isType(TYPE_LLSD))
|
||||
return control->getValue();
|
||||
CONTROL_ERRS << "Invalid LLSD control " << name << llendl;
|
||||
return LLSD();
|
||||
return get<LLSD>(name);
|
||||
}
|
||||
|
||||
BOOL LLControlGroup::controlExists(const std::string& name) const
|
||||
@@ -691,164 +617,65 @@ BOOL LLControlGroup::controlExists(const std::string& name) const
|
||||
|
||||
void LLControlGroup::setBOOL(const std::string& name, BOOL val)
|
||||
{
|
||||
LLControlVariable* control = getControl(name);
|
||||
|
||||
if (control && control->isType(TYPE_BOOLEAN))
|
||||
{
|
||||
control->set(val);
|
||||
}
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid control " << name << llendl;
|
||||
}
|
||||
set<bool>(name, val);
|
||||
}
|
||||
|
||||
|
||||
void LLControlGroup::setS32(const std::string& name, S32 val)
|
||||
{
|
||||
LLControlVariable* control = getControl(name);
|
||||
|
||||
if (control && control->isType(TYPE_S32))
|
||||
{
|
||||
control->set(val);
|
||||
}
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid control " << name << llendl;
|
||||
}
|
||||
set(name, val);
|
||||
}
|
||||
|
||||
|
||||
void LLControlGroup::setF32(const std::string& name, F32 val)
|
||||
{
|
||||
LLControlVariable* control = getControl(name);
|
||||
|
||||
if (control && control->isType(TYPE_F32))
|
||||
{
|
||||
control->set(val);
|
||||
}
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid control " << name << llendl;
|
||||
}
|
||||
set(name, val);
|
||||
}
|
||||
|
||||
|
||||
void LLControlGroup::setU32(const std::string& name, U32 val)
|
||||
{
|
||||
LLControlVariable* control = getControl(name);
|
||||
|
||||
if (control && control->isType(TYPE_U32))
|
||||
{
|
||||
control->set((LLSD::Integer) val);
|
||||
}
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid control " << name << llendl;
|
||||
}
|
||||
set(name, val);
|
||||
}
|
||||
|
||||
|
||||
void LLControlGroup::setString(const std::string& name, const std::string &val)
|
||||
{
|
||||
LLControlVariable* control = getControl(name);
|
||||
|
||||
if (control && control->isType(TYPE_STRING))
|
||||
{
|
||||
control->set(val);
|
||||
}
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid control " << name << llendl;
|
||||
}
|
||||
set(name, val);
|
||||
}
|
||||
|
||||
|
||||
void LLControlGroup::setVector3(const std::string& name, const LLVector3 &val)
|
||||
{
|
||||
LLControlVariable* control = getControl(name);
|
||||
|
||||
if (control && control->isType(TYPE_VEC3))
|
||||
{
|
||||
control->set(val.getValue());
|
||||
}
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid control " << name << llendl;
|
||||
}
|
||||
set(name, val);
|
||||
}
|
||||
|
||||
void LLControlGroup::setVector3d(const std::string& name, const LLVector3d &val)
|
||||
{
|
||||
LLControlVariable* control = getControl(name);
|
||||
|
||||
if (control && control->isType(TYPE_VEC3D))
|
||||
{
|
||||
control->set(val.getValue());
|
||||
}
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid control " << name << llendl;
|
||||
}
|
||||
set(name, val);
|
||||
}
|
||||
|
||||
void LLControlGroup::setRect(const std::string& name, const LLRect &val)
|
||||
{
|
||||
LLControlVariable* control = getControl(name);
|
||||
|
||||
if (control && control->isType(TYPE_RECT))
|
||||
{
|
||||
control->set(val.getValue());
|
||||
}
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid rect control " << name << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
void LLControlGroup::setColor4U(const std::string& name, const LLColor4U &val)
|
||||
{
|
||||
LLControlVariable* control = getControl(name);
|
||||
|
||||
if (control && control->isType(TYPE_COL4U))
|
||||
{
|
||||
control->set(val.getValue());
|
||||
}
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid LLColor4 control " << name << llendl;
|
||||
}
|
||||
set(name, val);
|
||||
}
|
||||
|
||||
void LLControlGroup::setColor4(const std::string& name, const LLColor4 &val)
|
||||
{
|
||||
LLControlVariable* control = getControl(name);
|
||||
|
||||
if (control && control->isType(TYPE_COL4))
|
||||
{
|
||||
control->set(val.getValue());
|
||||
}
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid LLColor4 control " << name << llendl;
|
||||
}
|
||||
set(name, val);
|
||||
}
|
||||
|
||||
void LLControlGroup::setColor3(const std::string& name, const LLColor3 &val)
|
||||
{
|
||||
set(name, val);
|
||||
}
|
||||
|
||||
void LLControlGroup::setLLSD(const std::string& name, const LLSD& val)
|
||||
{
|
||||
LLControlVariable* control = getControl(name);
|
||||
|
||||
if (control && control->isType(TYPE_LLSD))
|
||||
{
|
||||
setValue(name, val);
|
||||
}
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid LLSD control " << name << llendl;
|
||||
}
|
||||
set(name, val);
|
||||
}
|
||||
|
||||
void LLControlGroup::setValue(const std::string& name, const LLSD& val)
|
||||
void LLControlGroup::setUntypedValue(const std::string& name, const LLSD& val)
|
||||
{
|
||||
if (name.empty())
|
||||
{
|
||||
@@ -859,7 +686,7 @@ void LLControlGroup::setValue(const std::string& name, const LLSD& val)
|
||||
|
||||
if (control)
|
||||
{
|
||||
control->set(val);
|
||||
control->setValue(val);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -867,6 +694,7 @@ void LLControlGroup::setValue(const std::string& name, const LLSD& val)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Load and save
|
||||
//---------------------------------------------------------------
|
||||
@@ -932,12 +760,10 @@ U32 LLControlGroup::loadFromFileLegacy(const std::string& filename, BOOL require
|
||||
{
|
||||
switch(declare_as)
|
||||
{
|
||||
case TYPE_COL4U:
|
||||
case TYPE_COL4:
|
||||
declareColor4(name, LLColor4::white, LLStringUtil::null, NO_PERSIST);
|
||||
break;
|
||||
case TYPE_COL4U:
|
||||
declareColor4U(name, LLColor4U::white, LLStringUtil::null, NO_PERSIST);
|
||||
break;
|
||||
case TYPE_STRING:
|
||||
default:
|
||||
declareString(name, LLStringUtil::null, LLStringUtil::null, NO_PERSIST);
|
||||
@@ -1035,21 +861,22 @@ U32 LLControlGroup::loadFromFileLegacy(const std::string& filename, BOOL require
|
||||
validitems++;
|
||||
}
|
||||
break;
|
||||
case TYPE_COL4U:
|
||||
{
|
||||
LLColor4U color;
|
||||
|
||||
child_nodep->getAttributeColor4U("value", color);
|
||||
control->set(color.getValue());
|
||||
validitems++;
|
||||
}
|
||||
break;
|
||||
case TYPE_COL4:
|
||||
{
|
||||
LLColor4 color;
|
||||
if(declare_as == TYPE_COL4U)
|
||||
{
|
||||
LLColor4U color;
|
||||
|
||||
child_nodep->getAttributeColor4("value", color);
|
||||
control->set(color.getValue());
|
||||
child_nodep->getAttributeColor4U("value", color);
|
||||
control->set(LLColor4(color).getValue());
|
||||
}
|
||||
else
|
||||
{
|
||||
LLColor4 color;
|
||||
|
||||
child_nodep->getAttributeColor4("value", color);
|
||||
control->set(color.getValue());
|
||||
}
|
||||
validitems++;
|
||||
}
|
||||
break;
|
||||
@@ -1120,15 +947,13 @@ U32 LLControlGroup::saveToFile(const std::string& filename, BOOL nondefault_only
|
||||
return num_saved;
|
||||
}
|
||||
|
||||
U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_values)
|
||||
U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_values, bool save_values)
|
||||
{
|
||||
if(mIncludedFiles.find(filename) != mIncludedFiles.end())
|
||||
return 0; //Already included this file.
|
||||
mIncludedFiles.insert(filename);
|
||||
|
||||
std::string name;
|
||||
LLSD settings;
|
||||
LLSD control_map;
|
||||
llifstream infile;
|
||||
infile.open(filename);
|
||||
if(!infile.is_open())
|
||||
@@ -1148,11 +973,12 @@ U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_v
|
||||
|
||||
U32 validitems = 0;
|
||||
bool hidefromsettingseditor = false;
|
||||
|
||||
for(LLSD::map_const_iterator itr = settings.beginMap(); itr != settings.endMap(); ++itr)
|
||||
{
|
||||
bool persist = true;
|
||||
name = (*itr).first;
|
||||
control_map = (*itr).second;
|
||||
std::string const & name = itr->first;
|
||||
LLSD const & control_map = itr->second;
|
||||
|
||||
if(name == "Include")
|
||||
{
|
||||
@@ -1214,8 +1040,7 @@ U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_v
|
||||
}
|
||||
else if(existing_control->isPersisted())
|
||||
{
|
||||
|
||||
existing_control->setValue(control_map["Value"]);
|
||||
existing_control->setValue(control_map["Value"], save_values);
|
||||
}
|
||||
// *NOTE: If not persisted and not setting defaults,
|
||||
// the value should not get loaded.
|
||||
@@ -1294,7 +1119,7 @@ void LLControlGroup::connectCOAVars(LLControlGroup &OtherGroup)
|
||||
}
|
||||
if(pCOAVar)
|
||||
{
|
||||
pCOAVar->getSignal()->connect(boost::bind(&LLControlGroup::handleCOASettingChange, this, _1));
|
||||
pCOAVar->getSignal()->connect(boost::bind(&LLControlGroup::handleCOASettingChange, this, _2));
|
||||
pCOAVar->firePropertyChanged();
|
||||
}
|
||||
}
|
||||
@@ -1427,4 +1252,298 @@ void main()
|
||||
#endif
|
||||
|
||||
|
||||
template <> eControlType get_control_type<U32>()
|
||||
{
|
||||
return TYPE_U32;
|
||||
}
|
||||
|
||||
template <> eControlType get_control_type<S32>()
|
||||
{
|
||||
return TYPE_S32;
|
||||
}
|
||||
|
||||
template <> eControlType get_control_type<F32>()
|
||||
{
|
||||
return TYPE_F32;
|
||||
}
|
||||
|
||||
template <> eControlType get_control_type<bool> ()
|
||||
{
|
||||
return TYPE_BOOLEAN;
|
||||
}
|
||||
/*
|
||||
// Yay BOOL, its really an S32.
|
||||
template <> eControlType get_control_type<BOOL> ()
|
||||
{
|
||||
return TYPE_BOOLEAN;
|
||||
}
|
||||
*/
|
||||
template <> eControlType get_control_type<std::string>()
|
||||
{
|
||||
return TYPE_STRING;
|
||||
}
|
||||
|
||||
template <> eControlType get_control_type<LLVector3>()
|
||||
{
|
||||
return TYPE_VEC3;
|
||||
}
|
||||
|
||||
template <> eControlType get_control_type<LLVector3d>()
|
||||
{
|
||||
return TYPE_VEC3D;
|
||||
}
|
||||
|
||||
template <> eControlType get_control_type<LLRect>()
|
||||
{
|
||||
return TYPE_RECT;
|
||||
}
|
||||
|
||||
template <> eControlType get_control_type<LLColor4>()
|
||||
{
|
||||
return TYPE_COL4;
|
||||
}
|
||||
|
||||
template <> eControlType get_control_type<LLColor3>()
|
||||
{
|
||||
return TYPE_COL3;
|
||||
}
|
||||
|
||||
template <> eControlType get_control_type<LLSD>()
|
||||
{
|
||||
return TYPE_LLSD;
|
||||
}
|
||||
|
||||
|
||||
template <> LLSD convert_to_llsd<U32>(const U32& in)
|
||||
{
|
||||
return (LLSD::Integer)in;
|
||||
}
|
||||
|
||||
template <> LLSD convert_to_llsd<LLVector3>(const LLVector3& in)
|
||||
{
|
||||
return in.getValue();
|
||||
}
|
||||
|
||||
template <> LLSD convert_to_llsd<LLVector3d>(const LLVector3d& in)
|
||||
{
|
||||
return in.getValue();
|
||||
}
|
||||
|
||||
template <> LLSD convert_to_llsd<LLRect>(const LLRect& in)
|
||||
{
|
||||
return in.getValue();
|
||||
}
|
||||
|
||||
template <> LLSD convert_to_llsd<LLColor4>(const LLColor4& in)
|
||||
{
|
||||
return in.getValue();
|
||||
}
|
||||
|
||||
template <> LLSD convert_to_llsd<LLColor3>(const LLColor3& in)
|
||||
{
|
||||
return in.getValue();
|
||||
}
|
||||
|
||||
template <> LLSD convert_to_llsd<LLColor4U>(const LLColor4U& in)
|
||||
{
|
||||
return in.getValue();
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
bool convert_from_llsd<bool>(const LLSD& sd, eControlType type, const std::string& control_name)
|
||||
{
|
||||
if (type == TYPE_BOOLEAN)
|
||||
return sd.asBoolean();
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid BOOL value for " << control_name << ": " << sd << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
S32 convert_from_llsd<S32>(const LLSD& sd, eControlType type, const std::string& control_name)
|
||||
{
|
||||
if (type == TYPE_S32)
|
||||
return sd.asInteger();
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid S32 value for " << control_name << ": " << sd << llendl;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
U32 convert_from_llsd<U32>(const LLSD& sd, eControlType type, const std::string& control_name)
|
||||
{
|
||||
if (type == TYPE_U32)
|
||||
return sd.asInteger();
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid U32 value for " << control_name << ": " << sd << llendl;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
F32 convert_from_llsd<F32>(const LLSD& sd, eControlType type, const std::string& control_name)
|
||||
{
|
||||
if (type == TYPE_F32)
|
||||
return (F32) sd.asReal();
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid F32 value for " << control_name << ": " << sd << llendl;
|
||||
return 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
std::string convert_from_llsd<std::string>(const LLSD& sd, eControlType type, const std::string& control_name)
|
||||
{
|
||||
if (type == TYPE_STRING)
|
||||
return sd.asString();
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid string value for " << control_name << ": " << sd << llendl;
|
||||
return LLStringUtil::null;
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
LLWString convert_from_llsd<LLWString>(const LLSD& sd, eControlType type, const std::string& control_name)
|
||||
{
|
||||
return utf8str_to_wstring(convert_from_llsd<std::string>(sd, type, control_name));
|
||||
}
|
||||
|
||||
template<>
|
||||
LLVector3 convert_from_llsd<LLVector3>(const LLSD& sd, eControlType type, const std::string& control_name)
|
||||
{
|
||||
if (type == TYPE_VEC3)
|
||||
return (LLVector3)sd;
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid LLVector3 value for " << control_name << ": " << sd << llendl;
|
||||
return LLVector3::zero;
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
LLVector3d convert_from_llsd<LLVector3d>(const LLSD& sd, eControlType type, const std::string& control_name)
|
||||
{
|
||||
if (type == TYPE_VEC3D)
|
||||
return (LLVector3d)sd;
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid LLVector3d value for " << control_name << ": " << sd << llendl;
|
||||
return LLVector3d::zero;
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
LLRect convert_from_llsd<LLRect>(const LLSD& sd, eControlType type, const std::string& control_name)
|
||||
{
|
||||
if (type == TYPE_RECT)
|
||||
return LLRect(sd);
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid rect value for " << control_name << ": " << sd << llendl;
|
||||
return LLRect::null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
LLColor4 convert_from_llsd<LLColor4>(const LLSD& sd, eControlType type, const std::string& control_name)
|
||||
{
|
||||
if (type == TYPE_COL4)
|
||||
{
|
||||
LLColor4 color(sd);
|
||||
if (color.mV[VRED] < 0.f || color.mV[VRED] > 1.f)
|
||||
{
|
||||
llwarns << "Color " << control_name << " red value out of range: " << color << llendflush;
|
||||
}
|
||||
else if (color.mV[VGREEN] < 0.f || color.mV[VGREEN] > 1.f)
|
||||
{
|
||||
llwarns << "Color " << control_name << " green value out of range: " << color << llendflush;
|
||||
}
|
||||
else if (color.mV[VBLUE] < 0.f || color.mV[VBLUE] > 1.f)
|
||||
{
|
||||
llwarns << "Color " << control_name << " blue value out of range: " << color << llendflush;
|
||||
}
|
||||
else if (color.mV[VALPHA] < 0.f || color.mV[VALPHA] > 1.f)
|
||||
{
|
||||
llwarns << "Color " << control_name << " alpha value out of range: " << color << llendflush;
|
||||
}
|
||||
|
||||
return LLColor4(sd);
|
||||
}
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Control " << control_name << " not a color" << llendl;
|
||||
return LLColor4::white;
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
LLColor3 convert_from_llsd<LLColor3>(const LLSD& sd, eControlType type, const std::string& control_name)
|
||||
{
|
||||
if (type == TYPE_COL3)
|
||||
return sd;
|
||||
else
|
||||
{
|
||||
CONTROL_ERRS << "Invalid LLColor3 value for " << control_name << ": " << sd << llendl;
|
||||
return LLColor3::white;
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
LLSD convert_from_llsd<LLSD>(const LLSD& sd, eControlType type, const std::string& control_name)
|
||||
{
|
||||
return sd;
|
||||
}
|
||||
|
||||
|
||||
#if TEST_CACHED_CONTROL
|
||||
|
||||
#define DECL_LLCC(T, V) static LLCachedControl<T> mySetting_##T("TestCachedControl"#T, V)
|
||||
DECL_LLCC(U32, (U32)666);
|
||||
DECL_LLCC(S32, (S32)-666);
|
||||
DECL_LLCC(F32, (F32)-666.666);
|
||||
DECL_LLCC(bool, true);
|
||||
DECL_LLCC(BOOL, FALSE);
|
||||
static LLCachedControl<std::string> mySetting_string("TestCachedControlstring", "Default String Value");
|
||||
DECL_LLCC(LLVector3, LLVector3(1.0f, 2.0f, 3.0f));
|
||||
DECL_LLCC(LLVector3d, LLVector3d(6.0f, 5.0f, 4.0f));
|
||||
DECL_LLCC(LLRect, LLRect(0, 0, 100, 500));
|
||||
DECL_LLCC(LLColor4, LLColor4(0.0f, 0.5f, 1.0f));
|
||||
DECL_LLCC(LLColor3, LLColor3(1.0f, 0.f, 0.5f));
|
||||
|
||||
LLSD test_llsd = LLSD()["testing1"] = LLSD()["testing2"];
|
||||
DECL_LLCC(LLSD, test_llsd);
|
||||
|
||||
static LLCachedControl<std::string> test_BrowserHomePage("BrowserHomePage", "hahahahahha", "Not the real comment");
|
||||
|
||||
void test_cached_control()
|
||||
{
|
||||
#define TEST_LLCC(T, V) if((T)mySetting_##T != V) llerrs << "Fail "#T << llendl; \
|
||||
mySetting_##T = V;\
|
||||
if((T)mySetting_##T != V) llerrs << "Fail "#T << "Pass # 2" << llendl;
|
||||
|
||||
TEST_LLCC(U32, 666);
|
||||
TEST_LLCC(S32, (S32)-666);
|
||||
TEST_LLCC(F32, (F32)-666.666);
|
||||
TEST_LLCC(bool, true);
|
||||
TEST_LLCC(BOOL, FALSE);
|
||||
if((std::string)mySetting_string != "Default String Value") llerrs << "Fail string" << llendl;
|
||||
TEST_LLCC(LLVector3, LLVector3(1.0f, 2.0f, 3.0f));
|
||||
TEST_LLCC(LLVector3d, LLVector3d(6.0f, 5.0f, 4.0f));
|
||||
TEST_LLCC(LLRect, LLRect(0, 0, 100, 500));
|
||||
TEST_LLCC(LLColor4, LLColor4(0.0f, 0.5f, 1.0f));
|
||||
TEST_LLCC(LLColor3, LLColor3(1.0f, 0.f, 0.5f));
|
||||
//There's no LLSD comparsion for LLCC yet. TEST_LLCC(LLSD, test_llsd);
|
||||
|
||||
if((std::string)test_BrowserHomePage != "http://www.singularityviewer.org") llerrs << "Fail BrowserHomePage" << llendl;
|
||||
}
|
||||
#endif // TEST_CACHED_CONTROL
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#ifndef LL_LLCONTROL_H
|
||||
#define LL_LLCONTROL_H
|
||||
|
||||
#include "llboost.h"
|
||||
#include "llevent.h"
|
||||
#include "llnametable.h"
|
||||
#include "llmap.h"
|
||||
@@ -40,6 +41,7 @@
|
||||
#include "llrect.h"
|
||||
#include "v4color.h"
|
||||
#include "v4coloru.h"
|
||||
#include "llinstancetracker.h"
|
||||
|
||||
#include "llcontrolgroupreader.h"
|
||||
|
||||
@@ -55,7 +57,16 @@
|
||||
#endif
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
#if LL_WINDOWS
|
||||
#pragma warning (push)
|
||||
#pragma warning (disable : 4263) // boost::signals2::expired_slot::what() has const mismatch
|
||||
#pragma warning (disable : 4264)
|
||||
#endif
|
||||
#include <boost/signals2.hpp>
|
||||
#if LL_WINDOWS
|
||||
#pragma warning (pop)
|
||||
#endif
|
||||
|
||||
#if LL_WINDOWS
|
||||
# if (_MSC_VER >= 1300 && _MSC_VER < 1400)
|
||||
@@ -66,7 +77,6 @@
|
||||
class LLVector3;
|
||||
class LLVector3d;
|
||||
class LLColor3;
|
||||
class LLColor4U;
|
||||
|
||||
const BOOL NO_PERSIST = FALSE;
|
||||
|
||||
@@ -86,8 +96,8 @@ typedef enum e_control_type
|
||||
TYPE_VEC3D,
|
||||
TYPE_RECT,
|
||||
TYPE_COL4,
|
||||
TYPE_COL4U, //exist merely for legacy colors.xml support. Not a real control type.
|
||||
TYPE_COL3,
|
||||
TYPE_COL4U,
|
||||
TYPE_LLSD,
|
||||
TYPE_COUNT
|
||||
} eControlType;
|
||||
@@ -95,7 +105,10 @@ typedef enum e_control_type
|
||||
class LLControlVariable : public LLRefCount
|
||||
{
|
||||
friend class LLControlGroup;
|
||||
typedef boost::signals2::signal<void(const LLSD&)> signal_t;
|
||||
|
||||
public:
|
||||
typedef boost::signals2::signal<bool(LLControlVariable* control, const LLSD&), boost_boolean_combiner> validate_signal_t;
|
||||
typedef boost::signals2::signal<void(LLControlVariable* control, const LLSD&)> commit_signal_t;
|
||||
|
||||
private:
|
||||
std::string mName;
|
||||
@@ -105,7 +118,8 @@ private:
|
||||
bool mHideFromSettingsEditor;
|
||||
std::vector<LLSD> mValues;
|
||||
|
||||
boost::shared_ptr<signal_t> mSignal; //Signals are non-copyable. Therefore, using a pointer so vars can 'share' signals for COA
|
||||
boost::shared_ptr<commit_signal_t> mCommitSignal; //Signals are non-copyable. Therefore, using a pointer so vars can 'share' signals for COA
|
||||
boost::shared_ptr<validate_signal_t> mValidateSignal;
|
||||
|
||||
//COA stuff:
|
||||
bool mIsCOA; //To have COA connection set.
|
||||
@@ -121,12 +135,14 @@ public:
|
||||
const std::string& getName() const { return mName; }
|
||||
const std::string& getComment() const { return mComment; }
|
||||
|
||||
eControlType type() { return mType; }
|
||||
eControlType type() const { return mType; }
|
||||
bool isType(eControlType tp) const { return tp == mType; }
|
||||
|
||||
void resetToDefault(bool fire_signal = false);
|
||||
|
||||
signal_t* getSignal() { return mSignal.get(); }
|
||||
commit_signal_t* getSignal() { return mCommitSignal.get(); } // shorthand for commit signal
|
||||
commit_signal_t* getCommitSignal() { return mCommitSignal.get(); }
|
||||
validate_signal_t* getValidateSignal() { return mValidateSignal.get(); }
|
||||
|
||||
bool isDefault() { return (mValues.size() == 1); }
|
||||
bool isSaveValueDefault();
|
||||
@@ -146,7 +162,7 @@ public:
|
||||
|
||||
void firePropertyChanged()
|
||||
{
|
||||
(*mSignal)(mValues.back());
|
||||
(*mCommitSignal)(this,mValues.back());
|
||||
}
|
||||
|
||||
//COA stuff
|
||||
@@ -161,31 +177,57 @@ public:
|
||||
mIsCOAParent=IsParent;
|
||||
mCOAConnectedVar=pConnect;
|
||||
if(!IsParent)
|
||||
mSignal = pConnect->mSignal; //Share a single signal.
|
||||
{
|
||||
mCommitSignal = pConnect->mCommitSignal; //Share a single signal.
|
||||
mValidateSignal = pConnect->mValidateSignal;
|
||||
}
|
||||
}
|
||||
private:
|
||||
LLSD getComparableValue(const LLSD& value);
|
||||
bool llsd_compare(const LLSD& a, const LLSD & b);
|
||||
|
||||
};
|
||||
|
||||
typedef LLPointer<LLControlVariable> LLControlVariablePtr;
|
||||
|
||||
//! Helper functions for converting between static types and LLControl values
|
||||
template <class T>
|
||||
eControlType get_control_type()
|
||||
{
|
||||
llwarns << "Usupported control type: " << typeid(T).name() << "." << llendl;
|
||||
return TYPE_COUNT;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
LLSD convert_to_llsd(const T& in)
|
||||
{
|
||||
// default implementation
|
||||
return LLSD(in);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
T convert_from_llsd(const LLSD& sd, eControlType type, const std::string& control_name)
|
||||
{
|
||||
// needs specialization
|
||||
return T(sd);
|
||||
}
|
||||
//const U32 STRING_CACHE_SIZE = 10000;
|
||||
class LLControlGroup : public LLControlGroupReader
|
||||
class LLControlGroup : public LLInstanceTracker<LLControlGroup, std::string>
|
||||
{
|
||||
protected:
|
||||
typedef std::map<std::string, LLPointer<LLControlVariable> > ctrl_name_table_t;
|
||||
typedef std::map<std::string, LLControlVariablePtr > ctrl_name_table_t;
|
||||
ctrl_name_table_t mNameTable;
|
||||
std::set<std::string> mWarnings;
|
||||
std::string mTypeString[TYPE_COUNT];
|
||||
|
||||
eControlType typeStringToEnum(const std::string& typestr);
|
||||
std::string typeEnumToString(eControlType typeenum);
|
||||
std::string typeEnumToString(eControlType typeenum);
|
||||
std::set<std::string> mIncludedFiles; //To prevent perpetual recursion.
|
||||
public:
|
||||
LLControlGroup();
|
||||
LLControlGroup(const std::string& name);
|
||||
~LLControlGroup();
|
||||
void cleanup();
|
||||
|
||||
typedef LLInstanceTracker<LLControlGroup, std::string>::instance_iter instance_iter;
|
||||
LLControlVariable* getControl(std::string const& name);
|
||||
LLControlVariable const* getControl(std::string const& name) const;
|
||||
|
||||
@@ -205,7 +247,6 @@ public:
|
||||
BOOL declareVec3(const std::string& name, const LLVector3 &initial_val,const std::string& comment, BOOL persist = TRUE);
|
||||
BOOL declareVec3d(const std::string& name, const LLVector3d &initial_val, const std::string& comment, BOOL persist = TRUE);
|
||||
BOOL declareRect(const std::string& name, const LLRect &initial_val, const std::string& comment, BOOL persist = TRUE);
|
||||
BOOL declareColor4U(const std::string& name, const LLColor4U &initial_val, const std::string& comment, BOOL persist = TRUE);
|
||||
BOOL declareColor4(const std::string& name, const LLColor4 &initial_val, const std::string& comment, BOOL persist = TRUE);
|
||||
BOOL declareColor3(const std::string& name, const LLColor3 &initial_val, const std::string& comment, BOOL persist = TRUE);
|
||||
BOOL declareLLSD(const std::string& name, const LLSD &initial_val, const std::string& comment, BOOL persist = TRUE);
|
||||
@@ -213,25 +254,44 @@ public:
|
||||
std::string findString(const std::string& name);
|
||||
|
||||
std::string getString(const std::string& name) const;
|
||||
LLWString getWString(const std::string& name);
|
||||
std::string getText(const std::string& name);
|
||||
LLVector3 getVector3(const std::string& name);
|
||||
LLVector3d getVector3d(const std::string& name);
|
||||
LLRect getRect(const std::string& name);
|
||||
std::string getText(const std::string& name);
|
||||
BOOL getBOOL(const std::string& name);
|
||||
S32 getS32(const std::string& name);
|
||||
F32 getF32(const std::string& name);
|
||||
U32 getU32(const std::string& name);
|
||||
|
||||
LLWString getWString(const std::string& name);
|
||||
LLVector3 getVector3(const std::string& name);
|
||||
LLVector3d getVector3d(const std::string& name);
|
||||
LLRect getRect(const std::string& name);
|
||||
LLSD getLLSD(const std::string& name);
|
||||
|
||||
|
||||
// Note: If an LLColor4U control exists, it will cast it to the correct
|
||||
// LLColor4 for you.
|
||||
LLColor4 getColor(const std::string& name);
|
||||
LLColor4U getColor4U(const std::string& name);
|
||||
LLColor4 getColor4(const std::string& name);
|
||||
LLColor3 getColor3(const std::string& name);
|
||||
|
||||
// generic getter
|
||||
template<typename T> T get(const std::string& name) const
|
||||
{
|
||||
const LLControlVariable* control = getControl(name);
|
||||
LLSD value;
|
||||
eControlType type = TYPE_COUNT;
|
||||
|
||||
if (control)
|
||||
{
|
||||
value = control->get();
|
||||
type = control->type();
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "Control " << name << " not found." << llendl;
|
||||
}
|
||||
return convert_from_llsd<T>(value, type, name);
|
||||
}
|
||||
|
||||
void setBOOL(const std::string& name, BOOL val);
|
||||
void setS32(const std::string& name, S32 val);
|
||||
void setF32(const std::string& name, F32 val);
|
||||
@@ -240,12 +300,27 @@ public:
|
||||
void setVector3(const std::string& name, const LLVector3 &val);
|
||||
void setVector3d(const std::string& name, const LLVector3d &val);
|
||||
void setRect(const std::string& name, const LLRect &val);
|
||||
void setColor4U(const std::string& name, const LLColor4U &val);
|
||||
void setColor4(const std::string& name, const LLColor4 &val);
|
||||
void setColor3(const std::string& name, const LLColor3 &val);
|
||||
void setLLSD(const std::string& name, const LLSD& val);
|
||||
void setValue(const std::string& name, const LLSD& val);
|
||||
|
||||
// type agnostic setter that takes LLSD
|
||||
void setUntypedValue(const std::string& name, const LLSD& val);
|
||||
|
||||
// generic setter
|
||||
template<typename T> void set(const std::string& name, const T& val)
|
||||
{
|
||||
LLControlVariable* control = getControl(name);
|
||||
|
||||
if (control && control->isType(get_control_type<T>()))
|
||||
{
|
||||
control->set(convert_to_llsd(val));
|
||||
}
|
||||
else
|
||||
{
|
||||
llerrs << "Invalid control " << name << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL controlExists(const std::string& name) const;
|
||||
|
||||
@@ -254,7 +329,7 @@ public:
|
||||
// as the given type.
|
||||
U32 loadFromFileLegacy(const std::string& filename, BOOL require_declaration = TRUE, eControlType declare_as = TYPE_STRING);
|
||||
U32 saveToFile(const std::string& filename, BOOL nondefault_only);
|
||||
U32 loadFromFile(const std::string& filename, bool default_values = false);
|
||||
U32 loadFromFile(const std::string& filename, bool default_values = false, bool save_values = true);
|
||||
void resetToDefaults();
|
||||
|
||||
|
||||
@@ -275,89 +350,147 @@ public:
|
||||
bool handleCOASettingChange(const LLSD& newvalue);
|
||||
};
|
||||
|
||||
//! Helper function for LLCachedControl
|
||||
template <class T>
|
||||
eControlType get_control_type(const T& in, LLSD& out)
|
||||
{
|
||||
llerrs << "Usupported control type: " << typeid(T).name() << "." << llendl;
|
||||
return TYPE_COUNT;
|
||||
}
|
||||
|
||||
//! Publish/Subscribe object to interact with LLControlGroups.
|
||||
|
||||
//! An LLCachedControl instance to connect to a LLControlVariable
|
||||
//! Use an LLCachedControl instance to connect to a LLControlVariable
|
||||
//! without have to manually create and bind a listener to a local
|
||||
//! object.
|
||||
|
||||
template <class T>
|
||||
class LLCachedControl
|
||||
class LLControlCache : public LLRefCount, public LLInstanceTracker<LLControlCache<T>, std::string>
|
||||
{
|
||||
private:
|
||||
T mCachedValue;
|
||||
LLPointer<LLControlVariable> mControl;
|
||||
boost::signals2::connection mConnection;
|
||||
LLControlGroup *mControlGroup;
|
||||
|
||||
public:
|
||||
LLCachedControl(const std::string& name, const T& default_value, LLControlGroup *group, const std::string& comment = "Declared In Code")
|
||||
{Init(name,default_value,comment,*group);} //for gSavedPerAccountSettings, etc
|
||||
LLCachedControl(const std::string& name, const T& default_value, LLControlGroup &group, const std::string& comment = "Declared In Code")
|
||||
{Init(name,default_value,comment,group);} //for LLUI::sConfigGroup, etc
|
||||
LLCachedControl(const std::string& name,
|
||||
// This constructor will declare a control if it doesn't exist in the contol group
|
||||
LLControlCache(LLControlGroup& group,
|
||||
const std::string& name,
|
||||
const T& default_value,
|
||||
const std::string& comment = "Declared In Code",
|
||||
LLControlGroup &group = gSavedSettings)
|
||||
{Init(name,default_value,comment,group);} //for default (gSavedSettings)
|
||||
private:
|
||||
void Init( const std::string& name,
|
||||
const T& default_value,
|
||||
const std::string& comment,
|
||||
LLControlGroup &group)
|
||||
const std::string& comment)
|
||||
: LLInstanceTracker<LLControlCache<T>, std::string >(name)
|
||||
{
|
||||
mControlGroup = &group;
|
||||
mControl = mControlGroup->getControl(name);
|
||||
if(mControl.isNull())
|
||||
if(!group.controlExists(name))
|
||||
{
|
||||
declareTypedControl(*mControlGroup, name, default_value, comment);
|
||||
mControl = mControlGroup->getControl(name);
|
||||
if(mControl.isNull())
|
||||
if(!declareTypedControl(group, name, default_value, comment))
|
||||
{
|
||||
llerrs << "The control could not be created!!!" << llendl;
|
||||
}
|
||||
|
||||
mCachedValue = default_value;
|
||||
}
|
||||
else
|
||||
|
||||
bindToControl(group, name);
|
||||
}
|
||||
|
||||
LLControlCache(LLControlGroup& group,
|
||||
const std::string& name)
|
||||
: LLInstanceTracker<LLControlCache<T>, std::string >(name)
|
||||
{
|
||||
if(!group.controlExists(name))
|
||||
{
|
||||
handleValueChange(mControl->getValue());
|
||||
llerrs << "Control named " << name << "not found." << llendl;
|
||||
}
|
||||
|
||||
if(mConnection.connected())
|
||||
mConnection.disconnect();
|
||||
bindToControl(group, name);
|
||||
}
|
||||
|
||||
~LLControlCache()
|
||||
{
|
||||
}
|
||||
|
||||
const T& getValue() const { return mCachedValue; }
|
||||
void setTypeValue(const T& v) { mControl->set(convert_to_llsd(v)); }
|
||||
|
||||
private:
|
||||
void bindToControl(LLControlGroup& group, const std::string& name)
|
||||
{
|
||||
LLControlVariablePtr controlp = group.getControl(name);
|
||||
mType = controlp->type();
|
||||
mCachedValue = convert_from_llsd<T>(controlp->get(), mType, name);
|
||||
|
||||
// Add a listener to the controls signal...
|
||||
// and store the connection...
|
||||
mConnection = mControl->getSignal()->connect(
|
||||
boost::bind(&LLCachedControl<T>::handleValueChange, this, _1)
|
||||
mConnection = controlp->getSignal()->connect(
|
||||
boost::bind(&LLControlCache<T>::handleValueChange, this, _2)
|
||||
);
|
||||
mType = controlp->type();
|
||||
mControl = controlp;
|
||||
}
|
||||
public:
|
||||
~LLCachedControl()
|
||||
|
||||
bool declareTypedControl(LLControlGroup& group,
|
||||
const std::string& name,
|
||||
const T& default_value,
|
||||
const std::string& comment)
|
||||
{
|
||||
if(mConnection.connected())
|
||||
LLSD init_value;
|
||||
eControlType type = get_control_type<T>();
|
||||
init_value = convert_to_llsd(default_value);
|
||||
if(type < TYPE_COUNT)
|
||||
{
|
||||
mConnection.disconnect();
|
||||
group.declareControl(name, type, init_value, comment, FALSE);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool handleValueChange(const LLSD& newvalue)
|
||||
{
|
||||
mCachedValue = convert_from_llsd<T>(newvalue, mType, "");
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
T mCachedValue;
|
||||
LLPointer<LLControlVariable> mControl; //Hold a pointer to the control so setters are possible in cachedctrl
|
||||
eControlType mType;
|
||||
boost::signals2::scoped_connection mConnection;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class LLCachedControl
|
||||
{
|
||||
public:
|
||||
LLCachedControl(const std::string& name,
|
||||
const T& default_value,
|
||||
const std::string& comment = "Declared In Code")
|
||||
{
|
||||
mCachedControlPtr = LLControlCache<T>::getInstance(name);
|
||||
if (mCachedControlPtr.isNull())
|
||||
{
|
||||
mCachedControlPtr = new LLControlCache<T>(gSavedSettings, name, default_value, comment);
|
||||
}
|
||||
}
|
||||
|
||||
LLCachedControl& operator =(const T& newvalue)
|
||||
LLCachedControl(const std::string& name)
|
||||
{
|
||||
setTypeValue(*mControl, newvalue);
|
||||
return *this;
|
||||
mCachedControlPtr = LLControlCache<T>::getInstance(name);
|
||||
if (mCachedControlPtr.isNull())
|
||||
{
|
||||
mCachedControlPtr = new LLControlCache<T>(gSavedSettings, name);
|
||||
}
|
||||
}
|
||||
|
||||
operator const T&() const { return mCachedValue; }
|
||||
LLCachedControl(LLControlGroup& group,
|
||||
const std::string& name,
|
||||
const T& default_value,
|
||||
const std::string& comment = "Declared In Code")
|
||||
{
|
||||
mCachedControlPtr = LLControlCache<T>::getInstance(name);
|
||||
if (mCachedControlPtr.isNull())
|
||||
{
|
||||
mCachedControlPtr = new LLControlCache<T>(group, name, default_value, comment);
|
||||
}
|
||||
}
|
||||
|
||||
LLCachedControl(LLControlGroup& group,
|
||||
const std::string& name)
|
||||
{
|
||||
mCachedControlPtr = LLControlCache<T>::getInstance(name);
|
||||
if (mCachedControlPtr.isNull())
|
||||
{
|
||||
mCachedControlPtr = new LLControlCache<T>(group, name);
|
||||
}
|
||||
}
|
||||
|
||||
operator const T&() const { return mCachedControlPtr->getValue(); }
|
||||
operator boost::function<const T&()> () const { return boost::function<const T&()>(*this); }
|
||||
const T& operator()() const { return mCachedControlPtr->getValue(); }
|
||||
/* Sometimes implicit casting doesn't work.
|
||||
For instance, something like "LLCachedControl<LLColor4> color("blah",LLColor4()); color.getValue();"
|
||||
will not compile as it will look for the function getValue() in LLCachedControl, which doesn't exist.
|
||||
@@ -365,71 +498,54 @@ public:
|
||||
|
||||
Manually casting to (const T) would work too, but it's ugly and requires knowledge of LLCachedControl's internals
|
||||
*/
|
||||
const T &get() const { return mCachedValue; }
|
||||
const T &get() const { return mCachedControlPtr->getValue(); }
|
||||
|
||||
LLCachedControl& operator =(const T& newvalue)
|
||||
{
|
||||
mCachedControlPtr->setTypeValue(newvalue);
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
void declareTypedControl(LLControlGroup& group,
|
||||
const std::string& name,
|
||||
const T& default_value,
|
||||
const std::string& comment)
|
||||
{
|
||||
LLSD init_value;
|
||||
eControlType type = get_control_type<T>(default_value, init_value);
|
||||
if(type < TYPE_COUNT)
|
||||
{
|
||||
group.declareControl(name, type, init_value, comment, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void setValue(const LLSD& newvalue) //default behavior
|
||||
{
|
||||
mCachedValue = (const T &)newvalue;
|
||||
}
|
||||
|
||||
bool handleValueChange(const LLSD& newvalue)
|
||||
{
|
||||
setValue(newvalue);
|
||||
return true;
|
||||
}
|
||||
|
||||
void setTypeValue(LLControlVariable& c, const T& v)
|
||||
{
|
||||
// Implicit conversion from T to LLSD...
|
||||
c.set(v);
|
||||
}
|
||||
LLPointer<LLControlCache<T> > mCachedControlPtr;
|
||||
};
|
||||
|
||||
template <> inline void LLCachedControl<LLColor4>::setValue(const LLSD& newvalue)
|
||||
{
|
||||
if(this->mControl->isType(TYPE_COL4U))
|
||||
//a color4u LLSD cannot be auto-converted to color4.. so do it manually.
|
||||
this->mCachedValue.set(LLColor4U(newvalue));
|
||||
else
|
||||
this->mCachedValue = (const LLColor4 &)newvalue;
|
||||
}
|
||||
template <> inline void LLCachedControl<U32>::setValue(const LLSD& newvalue)
|
||||
{
|
||||
if(mControl->isType(TYPE_U32) || mControl->isType(TYPE_S32)) //LLSD does not support U32 fully
|
||||
mCachedValue = (U32)newvalue.asInteger();
|
||||
else if(this->mControl->isType(TYPE_F32))
|
||||
mCachedValue = (U32)newvalue.asReal();
|
||||
else
|
||||
mCachedValue = (U32)0; //What to do...
|
||||
}
|
||||
|
||||
//Following is actually defined in newview/llviewercontrol.cpp, but extern access is fine (Unless GCC bites me)
|
||||
template <> eControlType get_control_type<U32>(const U32& in, LLSD& out);
|
||||
template <> eControlType get_control_type<S32>(const S32& in, LLSD& out);
|
||||
template <> eControlType get_control_type<F32>(const F32& in, LLSD& out);
|
||||
template <> eControlType get_control_type<bool> (const bool& in, LLSD& out);
|
||||
template <> eControlType get_control_type<U32>();
|
||||
template <> eControlType get_control_type<S32>();
|
||||
template <> eControlType get_control_type<F32>();
|
||||
template <> eControlType get_control_type<bool>();
|
||||
// Yay BOOL, its really an S32.
|
||||
//template <> eControlType get_control_type<BOOL> (const BOOL& in, LLSD& out)
|
||||
template <> eControlType get_control_type<std::string>(const std::string& in, LLSD& out);
|
||||
template <> eControlType get_control_type<LLVector3>(const LLVector3& in, LLSD& out);
|
||||
template <> eControlType get_control_type<LLVector3d>(const LLVector3d& in, LLSD& out);
|
||||
template <> eControlType get_control_type<LLRect>(const LLRect& in, LLSD& out);
|
||||
template <> eControlType get_control_type<LLColor4>(const LLColor4& in, LLSD& out);
|
||||
template <> eControlType get_control_type<LLColor3>(const LLColor3& in, LLSD& out);
|
||||
template <> eControlType get_control_type<LLColor4U>(const LLColor4U& in, LLSD& out);
|
||||
template <> eControlType get_control_type<LLSD>(const LLSD& in, LLSD& out);
|
||||
//template <> eControlType get_control_type<BOOL> ()
|
||||
template <> eControlType get_control_type<std::string>();
|
||||
template <> eControlType get_control_type<LLVector3>();
|
||||
template <> eControlType get_control_type<LLVector3d>();
|
||||
template <> eControlType get_control_type<LLRect>();
|
||||
template <> eControlType get_control_type<LLColor4>();
|
||||
template <> eControlType get_control_type<LLColor3>();
|
||||
template <> eControlType get_control_type<LLSD>();
|
||||
|
||||
template <> LLSD convert_to_llsd<U32>(const U32& in);
|
||||
template <> LLSD convert_to_llsd<LLVector3>(const LLVector3& in);
|
||||
template <> LLSD convert_to_llsd<LLVector3d>(const LLVector3d& in);
|
||||
template <> LLSD convert_to_llsd<LLRect>(const LLRect& in);
|
||||
template <> LLSD convert_to_llsd<LLColor4>(const LLColor4& in);
|
||||
template <> LLSD convert_to_llsd<LLColor3>(const LLColor3& in);
|
||||
|
||||
template<> std::string convert_from_llsd<std::string>(const LLSD& sd, eControlType type, const std::string& control_name);
|
||||
template<> LLWString convert_from_llsd<LLWString>(const LLSD& sd, eControlType type, const std::string& control_name);
|
||||
template<> LLVector3 convert_from_llsd<LLVector3>(const LLSD& sd, eControlType type, const std::string& control_name);
|
||||
template<> LLVector3d convert_from_llsd<LLVector3d>(const LLSD& sd, eControlType type, const std::string& control_name);
|
||||
template<> LLRect convert_from_llsd<LLRect>(const LLSD& sd, eControlType type, const std::string& control_name);
|
||||
template<> bool convert_from_llsd<bool>(const LLSD& sd, eControlType type, const std::string& control_name);
|
||||
template<> S32 convert_from_llsd<S32>(const LLSD& sd, eControlType type, const std::string& control_name);
|
||||
template<> F32 convert_from_llsd<F32>(const LLSD& sd, eControlType type, const std::string& control_name);
|
||||
template<> U32 convert_from_llsd<U32>(const LLSD& sd, eControlType type, const std::string& control_name);
|
||||
template<> LLColor3 convert_from_llsd<LLColor3>(const LLSD& sd, eControlType type, const std::string& control_name);
|
||||
template<> LLColor4 convert_from_llsd<LLColor4>(const LLSD& sd, eControlType type, const std::string& control_name);
|
||||
template<> LLSD convert_from_llsd<LLSD>(const LLSD& sd, eControlType type, const std::string& control_name);
|
||||
|
||||
//#define TEST_CACHED_CONTROL 1
|
||||
#ifdef TEST_CACHED_CONTROL
|
||||
void test_cached_control();
|
||||
#endif // TEST_CACHED_CONTROL
|
||||
#endif
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#define LL_LLXMLPARSER_H
|
||||
|
||||
#ifndef XML_STATIC
|
||||
#define XML_STATIC 1
|
||||
#define XML_STATIC
|
||||
#endif
|
||||
#ifdef LL_STANDALONE
|
||||
#include <expat.h>
|
||||
|
||||
@@ -39,9 +39,9 @@
|
||||
|
||||
BOOL AscentKeyword::hasKeyword(std::string msg,int source)
|
||||
{
|
||||
static const LLCachedControl<bool> mKeywordsOn("KeywordsOn", false, gSavedPerAccountSettings);
|
||||
static const LLCachedControl<bool> mKeywordsInChat("KeywordsInChat", false, gSavedPerAccountSettings);
|
||||
static const LLCachedControl<bool> mKeywordsInIM("KeywordsInIM", false, gSavedPerAccountSettings);
|
||||
static const LLCachedControl<bool> mKeywordsOn(gSavedPerAccountSettings,"KeywordsOn", false);
|
||||
static const LLCachedControl<bool> mKeywordsInChat(gSavedPerAccountSettings,"KeywordsInChat", false);
|
||||
static const LLCachedControl<bool> mKeywordsInIM(gSavedPerAccountSettings, "KeywordsInIM", false);
|
||||
|
||||
if (mKeywordsOn)
|
||||
{
|
||||
@@ -61,9 +61,9 @@ BOOL AscentKeyword::hasKeyword(std::string msg,int source)
|
||||
|
||||
bool AscentKeyword::containsKeyWord(std::string source)
|
||||
{
|
||||
static const LLCachedControl<std::string> mKeywordsList("KeywordsList", "", gSavedPerAccountSettings);
|
||||
static const LLCachedControl<bool> mKeywordsPlaySound("KeywordsPlaySound", false, gSavedPerAccountSettings);
|
||||
static const LLCachedControl<std::string> mKeywordsSound("KeywordsSound", "", gSavedPerAccountSettings);
|
||||
static const LLCachedControl<std::string> mKeywordsList(gSavedPerAccountSettings, "KeywordsList", "");
|
||||
static const LLCachedControl<bool> mKeywordsPlaySound(gSavedPerAccountSettings, "KeywordsPlaySound", false);
|
||||
static const LLCachedControl<std::string> mKeywordsSound(gSavedPerAccountSettings, "KeywordsSound", "");
|
||||
|
||||
std::string s = mKeywordsList;
|
||||
LLStringUtil::toLower(s);
|
||||
|
||||
@@ -33,9 +33,9 @@
|
||||
|
||||
#include "llagentaccess.h"
|
||||
#include "indra_constants.h"
|
||||
#include "llcontrolgroupreader.h"
|
||||
#include "llcontrol.h"
|
||||
|
||||
LLAgentAccess::LLAgentAccess(LLControlGroupReader& savedSettings) :
|
||||
LLAgentAccess::LLAgentAccess(LLControlGroup& savedSettings) :
|
||||
mSavedSettings(savedSettings),
|
||||
mAccess(SIM_ACCESS_PG),
|
||||
mAdminOverride(false),
|
||||
|
||||
@@ -36,12 +36,12 @@
|
||||
#include "stdtypes.h"
|
||||
|
||||
// forward declaration so that we don't have to include the whole class
|
||||
class LLControlGroupReader;
|
||||
class LLControlGroup;
|
||||
|
||||
class LLAgentAccess
|
||||
{
|
||||
public:
|
||||
LLAgentAccess(LLControlGroupReader& savedSettings);
|
||||
LLAgentAccess(LLControlGroup& savedSettings);
|
||||
|
||||
bool getAdminOverride() const;
|
||||
void setAdminOverride(bool b);
|
||||
@@ -84,9 +84,7 @@ private:
|
||||
// all of the code that depends on it.
|
||||
bool mAOTransition;
|
||||
|
||||
// we want this to be const but the getters for it aren't, so we're
|
||||
// overriding it for now
|
||||
/* const */ LLControlGroupReader& mSavedSettings;
|
||||
LLControlGroup& mSavedSettings;
|
||||
};
|
||||
|
||||
#endif // LL_LLAGENTACCESS_H
|
||||
|
||||
@@ -626,7 +626,9 @@ bool LLAppViewer::init()
|
||||
// OS-specific login dialogs
|
||||
/////////////////////////////////////////////////
|
||||
|
||||
//test_cached_control();
|
||||
#if TEST_CACHED_CONTROL
|
||||
test_cached_control();
|
||||
#endif
|
||||
|
||||
// track number of times that app has run
|
||||
mNumSessions = gSavedSettings.getS32("NumSessions");
|
||||
@@ -1819,7 +1821,7 @@ bool LLAppViewer::initConfiguration()
|
||||
|
||||
//Load settings files list
|
||||
std::string settings_file_list = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "settings_files.xml");
|
||||
LLControlGroup settings_control;
|
||||
LLControlGroup settings_control("groups");
|
||||
llinfos << "Loading settings file list" << settings_file_list << llendl;
|
||||
if (0 == settings_control.loadFromFile(settings_file_list))
|
||||
{
|
||||
@@ -1881,7 +1883,7 @@ bool LLAppViewer::initConfiguration()
|
||||
gSavedSettings.setBOOL("WatchdogEnabled", FALSE);
|
||||
#endif
|
||||
|
||||
gCrashSettings.getControl(CRASH_BEHAVIOR_SETTING)->getSignal()->connect(boost::bind(&handleCrashSubmitBehaviorChanged, _1));
|
||||
gCrashSettings.getControl(CRASH_BEHAVIOR_SETTING)->getSignal()->connect(boost::bind(&handleCrashSubmitBehaviorChanged, _2));
|
||||
|
||||
// These are warnings that appear on the first experience of that condition.
|
||||
// They are already set in the settings_default.xml file, but still need to be added to LLFirstUse
|
||||
|
||||
@@ -708,7 +708,7 @@ void LLFloaterAvatarList::refreshAvatarList()
|
||||
estate_owner = parent_estate->getOwner();
|
||||
}
|
||||
|
||||
static const LLCachedControl<LLColor4> unselected_color("ScrollUnselectedColor",LLColor4(LLColor4U(0, 0, 0, 204)), gColors );
|
||||
static const LLCachedControl<LLColor4> unselected_color(gColors, "ScrollUnselectedColor",LLColor4(LLColor4U(0, 0, 0, 204)) );
|
||||
|
||||
LLColor4 name_color = unselected_color;
|
||||
|
||||
@@ -829,7 +829,7 @@ void LLFloaterAvatarList::refreshAvatarList()
|
||||
//element["columns"][LIST_METADATA]["column"] = "metadata";
|
||||
//element["columns"][LIST_METADATA]["type"] = "text";
|
||||
|
||||
static const LLCachedControl<LLColor4> avatar_name_color("AvatarNameColor",LLColor4(LLColor4U(251, 175, 93, 255)), gColors );
|
||||
static const LLCachedControl<LLColor4> avatar_name_color(gColors, "AvatarNameColor",LLColor4(LLColor4U(251, 175, 93, 255)) );
|
||||
LLColor4 client_color(avatar_name_color);
|
||||
std::string client;
|
||||
LLVOAvatar *avatarp = gObjectList.findAvatar(av_id);
|
||||
|
||||
@@ -597,8 +597,8 @@ LLColor4 get_text_color(const LLChat& chat)
|
||||
}
|
||||
}
|
||||
|
||||
static const LLCachedControl<bool> mKeywordsChangeColor("KeywordsChangeColor", false, gSavedPerAccountSettings);
|
||||
static const LLCachedControl<LLColor4> mKeywordsColor("KeywordsColor", LLColor4(1.f, 1.f, 1.f, 1.f), gSavedPerAccountSettings);
|
||||
static const LLCachedControl<bool> mKeywordsChangeColor(gSavedPerAccountSettings, "KeywordsChangeColor", false);
|
||||
static const LLCachedControl<LLColor4> mKeywordsColor(gSavedPerAccountSettings, "KeywordsColor", LLColor4(1.f, 1.f, 1.f, 1.f));
|
||||
|
||||
if (gAgent.getID() != chat.mFromID)
|
||||
{
|
||||
|
||||
@@ -1595,8 +1595,8 @@ BOOL LLFloaterIMPanel::inviteToSession(const LLDynamicArray<LLUUID>& ids)
|
||||
|
||||
void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, LLColor4 incolor, bool log_to_file, const LLUUID& source, const std::string& name)
|
||||
{
|
||||
static const LLCachedControl<bool> mKeywordsChangeColor("KeywordsChangeColor", false, gSavedPerAccountSettings);
|
||||
static const LLCachedControl<LLColor4> mKeywordsColor("KeywordsColor", LLColor4(1.f, 1.f, 1.f, 1.f), gSavedPerAccountSettings);
|
||||
static const LLCachedControl<bool> mKeywordsChangeColor(gSavedPerAccountSettings, "KeywordsChangeColor", false);
|
||||
static const LLCachedControl<LLColor4> mKeywordsColor(gSavedPerAccountSettings, "KeywordsColor", LLColor4(1.f, 1.f, 1.f, 1.f));
|
||||
|
||||
if (gAgent.getID() != source)
|
||||
{
|
||||
|
||||
@@ -362,7 +362,7 @@ void LLNetMap::draw()
|
||||
// Draw avatars
|
||||
// LLColor4 mapcolor = gAvatarMapColor;
|
||||
|
||||
static const LLCachedControl<LLColor4> standard_color("MapAvatar",LLColor4(0.f,1.f,0.f,1.f),gColors);
|
||||
static const LLCachedControl<LLColor4> standard_color(gColors,"MapAvatar",LLColor4(0.f,1.f,0.f,1.f));
|
||||
static const LLCachedControl<LLColor4> friend_color_stored("AscentFriendColor",LLColor4(1.f,1.f,0.f,1.f));
|
||||
static const LLCachedControl<LLColor4> em_color("AscentEstateOwnerColor",LLColor4(1.f,0.6f,1.f,1.f));
|
||||
static const LLCachedControl<LLColor4> linden_color("AscentLindenColor",LLColor4(0.f,0.f,1.f,1.f));
|
||||
|
||||
@@ -196,9 +196,9 @@ BOOL LLOverlayBar::postBuild()
|
||||
sAdvSettingsPopup = gSavedSettings.getBOOL("wlfAdvSettingsPopup");
|
||||
sChatVisible = gSavedSettings.getBOOL("ChatVisible");
|
||||
|
||||
gSavedSettings.getControl("wlfAdvSettingsPopup")->getSignal()->connect(&updateAdvSettingsPopup);
|
||||
gSavedSettings.getControl("ChatVisible")->getSignal()->connect(&updateChatVisible);
|
||||
gSavedSettings.getControl("EnableAORemote")->getSignal()->connect(&updateAORemote);
|
||||
gSavedSettings.getControl("wlfAdvSettingsPopup")->getSignal()->connect(boost::bind(&updateAdvSettingsPopup,_2));
|
||||
gSavedSettings.getControl("ChatVisible")->getSignal()->connect(boost::bind(&updateChatVisible,_2));
|
||||
gSavedSettings.getControl("EnableAORemote")->getSignal()->connect(boost::bind(&updateAORemote,_2));
|
||||
childSetVisible("AdvSettings_container", !sAdvSettingsPopup);
|
||||
childSetVisible("AdvSettings_container_exp", sAdvSettingsPopup);
|
||||
childSetVisible("ao_remote_container", gSavedSettings.getBOOL("EnableAORemote"));
|
||||
|
||||
@@ -109,7 +109,7 @@ void LLStatGraph::draw()
|
||||
// gColors.getColor("ColorDropShadow"),
|
||||
// (S32) gSavedSettings.getF32("DropShadowFloater") );
|
||||
|
||||
static const LLCachedControl<LLColor4> menu_default_color("MenuDefaultBgColor",LLColor4(0.f,0.f,0.f,1.f),gColors);
|
||||
static const LLCachedControl<LLColor4> menu_default_color(gColors,"MenuDefaultBgColor",LLColor4(0.f,0.f,0.f,1.f));
|
||||
color = menu_default_color;
|
||||
gGL.color4fv(color.mV);
|
||||
gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, TRUE);
|
||||
|
||||
@@ -246,8 +246,8 @@ void LLStatusBar::draw()
|
||||
|
||||
if (isBackgroundVisible())
|
||||
{
|
||||
static const LLCachedControl<LLColor4> color_drop_shadow("ColorDropShadow",LLColor4(LLColor4U(0,0,0,200)),LLUI::sColorsGroup);
|
||||
static const LLCachedControl<S32> drop_shadow_floater("DropShadowFloater",5,LLUI::sConfigGroup);
|
||||
static const LLCachedControl<LLColor4> color_drop_shadow(*LLUI::sColorsGroup,"ColorDropShadow",LLColor4(LLColor4U(0,0,0,200)));
|
||||
static const LLCachedControl<S32> drop_shadow_floater(*LLUI::sConfigGroup,"DropShadowFloater");
|
||||
gl_drop_shadow(0, getRect().getHeight(), getRect().getWidth(), 0,
|
||||
color_drop_shadow,
|
||||
drop_shadow_floater );
|
||||
|
||||
@@ -87,10 +87,10 @@ BOOL gHackGodmode = FALSE;
|
||||
#endif
|
||||
|
||||
AITHREADSAFE(settings_map_type, gSettings,);
|
||||
LLControlGroup gSavedSettings; // saved at end of session
|
||||
LLControlGroup gSavedPerAccountSettings; // saved at end of session
|
||||
LLControlGroup gColors; // read-only
|
||||
LLControlGroup gCrashSettings; // saved at end of session
|
||||
LLControlGroup gSavedSettings("Global"); // saved at end of session
|
||||
LLControlGroup gSavedPerAccountSettings("PerAccount"); // saved at end of session
|
||||
LLControlGroup gColors("Colors"); // saved at end of session
|
||||
LLControlGroup gCrashSettings("CrashSettings"); // saved at end of session
|
||||
|
||||
std::string gLastRunVersion;
|
||||
std::string gCurrentVersion;
|
||||
@@ -592,306 +592,186 @@ static bool handleAllowLargeSounds(const LLSD& newvalue)
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
void settings_setup_listeners()
|
||||
{
|
||||
gSavedSettings.getControl("FirstPersonAvatarVisible")->getSignal()->connect(boost::bind(&handleRenderAvatarMouselookChanged, _1));
|
||||
gSavedSettings.getControl("RenderFarClip")->getSignal()->connect(boost::bind(&handleRenderFarClipChanged, _1));
|
||||
gSavedSettings.getControl("RenderTerrainDetail")->getSignal()->connect(boost::bind(&handleTerrainDetailChanged, _1));
|
||||
gSavedSettings.getControl("RenderAnimateTrees")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1));
|
||||
gSavedSettings.getControl("RenderAvatarVP")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1));
|
||||
gSavedSettings.getControl("VertexShaderEnable")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1));
|
||||
gSavedSettings.getControl("RenderSpecularResX")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _1));
|
||||
gSavedSettings.getControl("RenderSpecularResY")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _1));
|
||||
gSavedSettings.getControl("RenderSpecularExponent")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _1));
|
||||
gSavedSettings.getControl("RenderFSAASamples")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _1));
|
||||
gSavedSettings.getControl("RenderAnisotropic")->getSignal()->connect(boost::bind(&handleAnisotropicChanged, _1));
|
||||
gSavedSettings.getControl("RenderShadowResolutionScale")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _1));
|
||||
gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _1));
|
||||
gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1));
|
||||
gSavedSettings.getControl("EnableRippleWater")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1));
|
||||
gSavedSettings.getControl("RenderGlowResolutionPow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _1));
|
||||
gSavedSettings.getControl("RenderAvatarCloth")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1));
|
||||
gSavedSettings.getControl("WindLightUseAtmosShaders")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1));
|
||||
gSavedSettings.getControl("RenderGammaFull")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1));
|
||||
gSavedSettings.getControl("RenderAvatarMaxVisible")->getSignal()->connect(boost::bind(&handleAvatarMaxVisibleChanged, _1));
|
||||
gSavedSettings.getControl("RenderAvatarInvisible")->getSignal()->connect(boost::bind(&handleSetSelfInvisible, _1));
|
||||
gSavedSettings.getControl("RenderVolumeLODFactor")->getSignal()->connect(boost::bind(&handleVolumeLODChanged, _1));
|
||||
gSavedSettings.getControl("RenderAvatarLODFactor")->getSignal()->connect(boost::bind(&handleAvatarLODChanged, _1));
|
||||
gSavedSettings.getControl("RenderAvatarPhysicsLODFactor")->getSignal()->connect(boost::bind(&handleAvatarPhysicsLODChanged, _1));
|
||||
gSavedSettings.getControl("RenderTerrainLODFactor")->getSignal()->connect(boost::bind(&handleTerrainLODChanged, _1));
|
||||
gSavedSettings.getControl("RenderTreeLODFactor")->getSignal()->connect(boost::bind(&handleTreeLODChanged, _1));
|
||||
gSavedSettings.getControl("RenderFlexTimeFactor")->getSignal()->connect(boost::bind(&handleFlexLODChanged, _1));
|
||||
gSavedSettings.getControl("ThrottleBandwidthKBPS")->getSignal()->connect(boost::bind(&handleBandwidthChanged, _1));
|
||||
gSavedSettings.getControl("RenderGamma")->getSignal()->connect(boost::bind(&handleGammaChanged, _1));
|
||||
gSavedSettings.getControl("RenderFogRatio")->getSignal()->connect(boost::bind(&handleFogRatioChanged, _1));
|
||||
gSavedSettings.getControl("RenderMaxPartCount")->getSignal()->connect(boost::bind(&handleMaxPartCountChanged, _1));
|
||||
gSavedSettings.getControl("RenderDynamicLOD")->getSignal()->connect(boost::bind(&handleRenderDynamicLODChanged, _1));
|
||||
gSavedSettings.getControl("RenderLocalLights")->getSignal()->connect(boost::bind(&handleRenderLocalLightsChanged, _1));
|
||||
gSavedSettings.getControl("RenderDebugTextureBind")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1));
|
||||
gSavedSettings.getControl("RenderFastAlpha")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1));
|
||||
gSavedSettings.getControl("RenderObjectBump")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1));
|
||||
gSavedSettings.getControl("RenderMaxVBOSize")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1));
|
||||
gSavedSettings.getControl("FirstPersonAvatarVisible")->getSignal()->connect(boost::bind(&handleRenderAvatarMouselookChanged, _2));
|
||||
gSavedSettings.getControl("RenderFarClip")->getSignal()->connect(boost::bind(&handleRenderFarClipChanged, _2));
|
||||
gSavedSettings.getControl("RenderTerrainDetail")->getSignal()->connect(boost::bind(&handleTerrainDetailChanged, _2));
|
||||
gSavedSettings.getControl("RenderAnimateTrees")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
|
||||
gSavedSettings.getControl("RenderAvatarVP")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
|
||||
gSavedSettings.getControl("VertexShaderEnable")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
|
||||
gSavedSettings.getControl("RenderSpecularResX")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
|
||||
gSavedSettings.getControl("RenderSpecularResY")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
|
||||
gSavedSettings.getControl("RenderSpecularExponent")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
|
||||
gSavedSettings.getControl("RenderFSAASamples")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
|
||||
gSavedSettings.getControl("RenderAnisotropic")->getSignal()->connect(boost::bind(&handleAnisotropicChanged, _2));
|
||||
gSavedSettings.getControl("RenderShadowResolutionScale")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
|
||||
gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
|
||||
gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
|
||||
gSavedSettings.getControl("EnableRippleWater")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
|
||||
gSavedSettings.getControl("RenderGlowResolutionPow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
|
||||
gSavedSettings.getControl("RenderAvatarCloth")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
|
||||
gSavedSettings.getControl("WindLightUseAtmosShaders")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
|
||||
gSavedSettings.getControl("RenderGammaFull")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
|
||||
gSavedSettings.getControl("RenderAvatarMaxVisible")->getSignal()->connect(boost::bind(&handleAvatarMaxVisibleChanged, _2));
|
||||
gSavedSettings.getControl("RenderAvatarInvisible")->getSignal()->connect(boost::bind(&handleSetSelfInvisible, _2));
|
||||
gSavedSettings.getControl("RenderVolumeLODFactor")->getSignal()->connect(boost::bind(&handleVolumeLODChanged, _2));
|
||||
gSavedSettings.getControl("RenderAvatarLODFactor")->getSignal()->connect(boost::bind(&handleAvatarLODChanged, _2));
|
||||
gSavedSettings.getControl("RenderAvatarPhysicsLODFactor")->getSignal()->connect(boost::bind(&handleAvatarPhysicsLODChanged, _2));
|
||||
gSavedSettings.getControl("RenderTerrainLODFactor")->getSignal()->connect(boost::bind(&handleTerrainLODChanged, _2));
|
||||
gSavedSettings.getControl("RenderTreeLODFactor")->getSignal()->connect(boost::bind(&handleTreeLODChanged, _2));
|
||||
gSavedSettings.getControl("RenderFlexTimeFactor")->getSignal()->connect(boost::bind(&handleFlexLODChanged, _2));
|
||||
gSavedSettings.getControl("ThrottleBandwidthKBPS")->getSignal()->connect(boost::bind(&handleBandwidthChanged, _2));
|
||||
gSavedSettings.getControl("RenderGamma")->getSignal()->connect(boost::bind(&handleGammaChanged, _2));
|
||||
gSavedSettings.getControl("RenderFogRatio")->getSignal()->connect(boost::bind(&handleFogRatioChanged, _2));
|
||||
gSavedSettings.getControl("RenderMaxPartCount")->getSignal()->connect(boost::bind(&handleMaxPartCountChanged, _2));
|
||||
gSavedSettings.getControl("RenderDynamicLOD")->getSignal()->connect(boost::bind(&handleRenderDynamicLODChanged, _2));
|
||||
gSavedSettings.getControl("RenderLocalLights")->getSignal()->connect(boost::bind(&handleRenderLocalLightsChanged, _2));
|
||||
gSavedSettings.getControl("RenderDebugTextureBind")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
|
||||
gSavedSettings.getControl("RenderFastAlpha")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
|
||||
gSavedSettings.getControl("RenderObjectBump")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
|
||||
gSavedSettings.getControl("RenderMaxVBOSize")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
|
||||
//See LL jira VWR-3258 comment section. Implemented by LL in 2.1 -Shyotl
|
||||
gSavedSettings.getControl("ShyotlRenderUseStreamVBO")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1));
|
||||
gSavedSettings.getControl("SianaRenderOmitBlankVBO")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1));
|
||||
gSavedSettings.getControl("RenderUseFBO")->getSignal()->connect(boost::bind(&handleRenderUseFBOChanged, _1));
|
||||
gSavedSettings.getControl("RenderDeferredNoise")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _1));
|
||||
gSavedSettings.getControl("RenderUseImpostors")->getSignal()->connect(boost::bind(&handleRenderUseImpostorsChanged, _1));
|
||||
gSavedSettings.getControl("RenderDebugGL")->getSignal()->connect(boost::bind(&handleRenderDebugGLChanged, _1));
|
||||
gSavedSettings.getControl("RenderDebugPipeline")->getSignal()->connect(boost::bind(&handleRenderDebugPipelineChanged, _1));
|
||||
gSavedSettings.getControl("RenderResolutionDivisor")->getSignal()->connect(boost::bind(&handleRenderResolutionDivisorChanged, _1));
|
||||
gSavedSettings.getControl("RenderDeferred")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1));
|
||||
gSavedSettings.getControl("RenderShadowDetail")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1));
|
||||
gSavedSettings.getControl("RenderDeferredSSAO")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1));
|
||||
gSavedSettings.getControl("RenderDeferredGI")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1));
|
||||
gSavedSettings.getControl("TextureMemory")->getSignal()->connect(boost::bind(&handleVideoMemoryChanged, _1));
|
||||
gSavedSettings.getControl("AuditTexture")->getSignal()->connect(boost::bind(&handleAuditTextureChanged, _1));
|
||||
gSavedSettings.getControl("ChatFontSize")->getSignal()->connect(boost::bind(&handleChatFontSizeChanged, _1));
|
||||
gSavedSettings.getControl("ChatPersistTime")->getSignal()->connect(boost::bind(&handleChatPersistTimeChanged, _1));
|
||||
gSavedSettings.getControl("UploadBakedTexOld")->getSignal()->connect(boost::bind(&handleUploadBakedTexOldChanged, _1));
|
||||
gSavedSettings.getControl("UseOcclusion")->getSignal()->connect(boost::bind(&handleUseOcclusionChanged, _1));
|
||||
gSavedSettings.getControl("AudioLevelMaster")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1));
|
||||
gSavedSettings.getControl("AudioLevelSFX")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1));
|
||||
gSavedSettings.getControl("AudioLevelUI")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1));
|
||||
gSavedSettings.getControl("AudioLevelAmbient")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1));
|
||||
gSavedSettings.getControl("AudioLevelMusic")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1));
|
||||
gSavedSettings.getControl("AudioLevelMedia")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1));
|
||||
gSavedSettings.getControl("AudioLevelVoice")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1));
|
||||
gSavedSettings.getControl("AudioLevelDoppler")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1));
|
||||
gSavedSettings.getControl("AudioLevelRolloff")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1));
|
||||
gSavedSettings.getControl("AudioStreamingMusic")->getSignal()->connect(boost::bind(&handleAudioStreamMusicChanged, _1));
|
||||
gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1));
|
||||
gSavedSettings.getControl("MuteMusic")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1));
|
||||
gSavedSettings.getControl("MuteMedia")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1));
|
||||
gSavedSettings.getControl("MuteVoice")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1));
|
||||
gSavedSettings.getControl("MuteAmbient")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1));
|
||||
gSavedSettings.getControl("MuteUI")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1));
|
||||
gSavedSettings.getControl("RenderVBOEnable")->getSignal()->connect(boost::bind(&handleRenderUseVBOChanged, _1));
|
||||
gSavedSettings.getControl("RenderVBOMappingDisable")->getSignal()->connect(boost::bind(&handleRenderUseVBOMappingChanged, _1));
|
||||
gSavedSettings.getControl("RenderPreferStreamDraw")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1));
|
||||
gSavedSettings.getControl("WLSkyDetail")->getSignal()->connect(boost::bind(&handleWLSkyDetailChanged, _1));
|
||||
gSavedSettings.getControl("NumpadControl")->getSignal()->connect(boost::bind(&handleNumpadControlChanged, _1));
|
||||
gSavedSettings.getControl("JoystickAxis0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("JoystickAxis1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("JoystickAxis2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("JoystickAxis3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("JoystickAxis4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("JoystickAxis5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("JoystickAxis6")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("FlycamAxisScale0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("FlycamAxisScale1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("FlycamAxisScale2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("FlycamAxisScale3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("FlycamAxisScale4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("FlycamAxisScale5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("FlycamAxisScale6")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("FlycamAxisDeadZone0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("FlycamAxisDeadZone1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("FlycamAxisDeadZone2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("FlycamAxisDeadZone3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("FlycamAxisDeadZone4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("FlycamAxisDeadZone5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("FlycamAxisDeadZone6")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("AvatarAxisScale0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("AvatarAxisScale1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("AvatarAxisScale2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("AvatarAxisScale3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("AvatarAxisScale4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("AvatarAxisScale5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("AvatarAxisDeadZone0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("AvatarAxisDeadZone1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("AvatarAxisDeadZone2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("AvatarAxisDeadZone3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("AvatarAxisDeadZone4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("AvatarAxisDeadZone5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("BuildAxisScale0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("BuildAxisScale1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("BuildAxisScale2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("BuildAxisScale3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("BuildAxisScale4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("BuildAxisScale5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("BuildAxisDeadZone0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("BuildAxisDeadZone1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("BuildAxisDeadZone2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("BuildAxisDeadZone3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("BuildAxisDeadZone4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("BuildAxisDeadZone5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1));
|
||||
gSavedSettings.getControl("DebugViews")->getSignal()->connect(boost::bind(&handleDebugViewsChanged, _1));
|
||||
gSavedSettings.getControl("UserLogFile")->getSignal()->connect(boost::bind(&handleLogFileChanged, _1));
|
||||
gSavedSettings.getControl("RenderHideGroupTitle")->getSignal()->connect(boost::bind(handleHideGroupTitleChanged, _1));
|
||||
gSavedSettings.getControl("EffectColor")->getSignal()->connect(boost::bind(handleEffectColorChanged, _1));
|
||||
gSavedSettings.getControl("VectorizePerfTest")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _1));
|
||||
gSavedSettings.getControl("VectorizeEnable")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _1));
|
||||
gSavedSettings.getControl("VectorizeProcessor")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _1));
|
||||
gSavedSettings.getControl("VectorizeSkin")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _1));
|
||||
gSavedSettings.getControl("EnableVoiceChat")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1));
|
||||
gSavedSettings.getControl("PTTCurrentlyEnabled")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1));
|
||||
gSavedSettings.getControl("PushToTalkButton")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1));
|
||||
gSavedSettings.getControl("PushToTalkToggle")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1));
|
||||
gSavedSettings.getControl("VoiceEarLocation")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1));
|
||||
gSavedSettings.getControl("VoiceInputAudioDevice")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1));
|
||||
gSavedSettings.getControl("VoiceOutputAudioDevice")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1));
|
||||
gSavedSettings.getControl("AudioLevelMic")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1));
|
||||
gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1));
|
||||
gSavedSettings.getControl("TranslateChat")->getSignal()->connect(boost::bind(&handleTranslateChatPrefsChanged, _1));
|
||||
gSavedSettings.getControl("StateMachineMaxTime")->getSignal()->connect(boost::bind(&handleStateMachineMaxTimeChanged, _1));
|
||||
gSavedSettings.getControl("ShyotlRenderUseStreamVBO")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
|
||||
gSavedSettings.getControl("SianaRenderOmitBlankVBO")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
|
||||
gSavedSettings.getControl("RenderUseFBO")->getSignal()->connect(boost::bind(&handleRenderUseFBOChanged, _2));
|
||||
gSavedSettings.getControl("RenderDeferredNoise")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));
|
||||
gSavedSettings.getControl("RenderUseImpostors")->getSignal()->connect(boost::bind(&handleRenderUseImpostorsChanged, _2));
|
||||
gSavedSettings.getControl("RenderDebugGL")->getSignal()->connect(boost::bind(&handleRenderDebugGLChanged, _2));
|
||||
gSavedSettings.getControl("RenderDebugPipeline")->getSignal()->connect(boost::bind(&handleRenderDebugPipelineChanged, _2));
|
||||
gSavedSettings.getControl("RenderResolutionDivisor")->getSignal()->connect(boost::bind(&handleRenderResolutionDivisorChanged, _2));
|
||||
gSavedSettings.getControl("RenderDeferred")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
|
||||
gSavedSettings.getControl("RenderShadowDetail")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
|
||||
gSavedSettings.getControl("RenderDeferredSSAO")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
|
||||
gSavedSettings.getControl("RenderDeferredGI")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
|
||||
gSavedSettings.getControl("TextureMemory")->getSignal()->connect(boost::bind(&handleVideoMemoryChanged, _2));
|
||||
gSavedSettings.getControl("AuditTexture")->getSignal()->connect(boost::bind(&handleAuditTextureChanged, _2));
|
||||
gSavedSettings.getControl("ChatFontSize")->getSignal()->connect(boost::bind(&handleChatFontSizeChanged, _2));
|
||||
gSavedSettings.getControl("ChatPersistTime")->getSignal()->connect(boost::bind(&handleChatPersistTimeChanged, _2));
|
||||
gSavedSettings.getControl("UploadBakedTexOld")->getSignal()->connect(boost::bind(&handleUploadBakedTexOldChanged, _2));
|
||||
gSavedSettings.getControl("UseOcclusion")->getSignal()->connect(boost::bind(&handleUseOcclusionChanged, _2));
|
||||
gSavedSettings.getControl("AudioLevelMaster")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2));
|
||||
gSavedSettings.getControl("AudioLevelSFX")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2));
|
||||
gSavedSettings.getControl("AudioLevelUI")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2));
|
||||
gSavedSettings.getControl("AudioLevelAmbient")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2));
|
||||
gSavedSettings.getControl("AudioLevelMusic")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2));
|
||||
gSavedSettings.getControl("AudioLevelMedia")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2));
|
||||
gSavedSettings.getControl("AudioLevelVoice")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2));
|
||||
gSavedSettings.getControl("AudioLevelDoppler")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2));
|
||||
gSavedSettings.getControl("AudioLevelRolloff")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2));
|
||||
gSavedSettings.getControl("AudioStreamingMusic")->getSignal()->connect(boost::bind(&handleAudioStreamMusicChanged, _2));
|
||||
gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2));
|
||||
gSavedSettings.getControl("MuteMusic")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2));
|
||||
gSavedSettings.getControl("MuteMedia")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2));
|
||||
gSavedSettings.getControl("MuteVoice")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2));
|
||||
gSavedSettings.getControl("MuteAmbient")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2));
|
||||
gSavedSettings.getControl("MuteUI")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2));
|
||||
gSavedSettings.getControl("RenderVBOEnable")->getSignal()->connect(boost::bind(&handleRenderUseVBOChanged, _2));
|
||||
gSavedSettings.getControl("RenderVBOMappingDisable")->getSignal()->connect(boost::bind(&handleRenderUseVBOMappingChanged, _2));
|
||||
gSavedSettings.getControl("RenderPreferStreamDraw")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
|
||||
gSavedSettings.getControl("WLSkyDetail")->getSignal()->connect(boost::bind(&handleWLSkyDetailChanged, _2));
|
||||
gSavedSettings.getControl("NumpadControl")->getSignal()->connect(boost::bind(&handleNumpadControlChanged, _2));
|
||||
gSavedSettings.getControl("JoystickAxis0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("JoystickAxis1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("JoystickAxis2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("JoystickAxis3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("JoystickAxis4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("JoystickAxis5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("JoystickAxis6")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("FlycamAxisScale0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("FlycamAxisScale1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("FlycamAxisScale2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("FlycamAxisScale3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("FlycamAxisScale4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("FlycamAxisScale5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("FlycamAxisScale6")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("FlycamAxisDeadZone0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("FlycamAxisDeadZone1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("FlycamAxisDeadZone2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("FlycamAxisDeadZone3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("FlycamAxisDeadZone4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("FlycamAxisDeadZone5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("FlycamAxisDeadZone6")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("AvatarAxisScale0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("AvatarAxisScale1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("AvatarAxisScale2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("AvatarAxisScale3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("AvatarAxisScale4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("AvatarAxisScale5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("AvatarAxisDeadZone0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("AvatarAxisDeadZone1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("AvatarAxisDeadZone2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("AvatarAxisDeadZone3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("AvatarAxisDeadZone4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("AvatarAxisDeadZone5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("BuildAxisScale0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("BuildAxisScale1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("BuildAxisScale2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("BuildAxisScale3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("BuildAxisScale4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("BuildAxisScale5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("BuildAxisDeadZone0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("BuildAxisDeadZone1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("BuildAxisDeadZone2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("BuildAxisDeadZone3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("BuildAxisDeadZone4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("BuildAxisDeadZone5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
|
||||
gSavedSettings.getControl("DebugViews")->getSignal()->connect(boost::bind(&handleDebugViewsChanged, _2));
|
||||
gSavedSettings.getControl("UserLogFile")->getSignal()->connect(boost::bind(&handleLogFileChanged, _2));
|
||||
gSavedSettings.getControl("RenderHideGroupTitle")->getSignal()->connect(boost::bind(handleHideGroupTitleChanged, _2));
|
||||
gSavedSettings.getControl("EffectColor")->getSignal()->connect(boost::bind(handleEffectColorChanged, _2));
|
||||
gSavedSettings.getControl("VectorizePerfTest")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _2));
|
||||
gSavedSettings.getControl("VectorizeEnable")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _2));
|
||||
gSavedSettings.getControl("VectorizeProcessor")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _2));
|
||||
gSavedSettings.getControl("VectorizeSkin")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _2));
|
||||
gSavedSettings.getControl("EnableVoiceChat")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2));
|
||||
gSavedSettings.getControl("PTTCurrentlyEnabled")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2));
|
||||
gSavedSettings.getControl("PushToTalkButton")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2));
|
||||
gSavedSettings.getControl("PushToTalkToggle")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2));
|
||||
gSavedSettings.getControl("VoiceEarLocation")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2));
|
||||
gSavedSettings.getControl("VoiceInputAudioDevice")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2));
|
||||
gSavedSettings.getControl("VoiceOutputAudioDevice")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2));
|
||||
gSavedSettings.getControl("AudioLevelMic")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2));
|
||||
gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2));
|
||||
gSavedSettings.getControl("TranslateChat")->getSignal()->connect(boost::bind(&handleTranslateChatPrefsChanged, _2));
|
||||
gSavedSettings.getControl("StateMachineMaxTime")->getSignal()->connect(boost::bind(&handleStateMachineMaxTimeChanged, _2));
|
||||
|
||||
gSavedSettings.getControl("CloudsEnabled")->getSignal()->connect(boost::bind(&handleCloudSettingsChanged, _1));
|
||||
gSavedSettings.getControl("SkyUseClassicClouds")->getSignal()->connect(boost::bind(&handleCloudSettingsChanged, _1));
|
||||
gSavedSettings.getControl("RenderTransparentWater")->getSignal()->connect(boost::bind(&handleRenderTransparentWaterChanged, _1));
|
||||
gSavedSettings.getControl("CloudsEnabled")->getSignal()->connect(boost::bind(&handleCloudSettingsChanged, _2));
|
||||
gSavedSettings.getControl("SkyUseClassicClouds")->getSignal()->connect(boost::bind(&handleCloudSettingsChanged, _2));
|
||||
gSavedSettings.getControl("RenderTransparentWater")->getSignal()->connect(boost::bind(&handleRenderTransparentWaterChanged, _2));
|
||||
|
||||
gSavedSettings.getControl("EmeraldBoobMass")->getSignal()->connect(boost::bind(&handleAvatarBoobMassChanged, _1));
|
||||
gSavedSettings.getControl("EmeraldBoobHardness")->getSignal()->connect(boost::bind(&handleAvatarBoobHardnessChanged, _1));
|
||||
gSavedSettings.getControl("EmeraldBoobVelMax")->getSignal()->connect(boost::bind(&handleAvatarBoobVelMaxChanged, _1));
|
||||
gSavedSettings.getControl("EmeraldBoobFriction")->getSignal()->connect(boost::bind(&handleAvatarBoobFrictionChanged, _1));
|
||||
gSavedSettings.getControl("EmeraldBoobVelMin")->getSignal()->connect(boost::bind(&handleAvatarBoobVelMinChanged, _1));
|
||||
gSavedSettings.getControl("EmeraldBreastPhysicsToggle")->getSignal()->connect(boost::bind(&handleAvatarBoobToggleChanged, _1));
|
||||
gSavedSettings.getControl("EmeraldBoobXYInfluence")->getSignal()->connect(boost::bind(&handleAvatarBoobXYInfluence, _1));
|
||||
gSavedSettings.getControl("EmeraldBoobMass")->getSignal()->connect(boost::bind(&handleAvatarBoobMassChanged, _2));
|
||||
gSavedSettings.getControl("EmeraldBoobHardness")->getSignal()->connect(boost::bind(&handleAvatarBoobHardnessChanged, _2));
|
||||
gSavedSettings.getControl("EmeraldBoobVelMax")->getSignal()->connect(boost::bind(&handleAvatarBoobVelMaxChanged, _2));
|
||||
gSavedSettings.getControl("EmeraldBoobFriction")->getSignal()->connect(boost::bind(&handleAvatarBoobFrictionChanged, _2));
|
||||
gSavedSettings.getControl("EmeraldBoobVelMin")->getSignal()->connect(boost::bind(&handleAvatarBoobVelMinChanged, _2));
|
||||
gSavedSettings.getControl("EmeraldBreastPhysicsToggle")->getSignal()->connect(boost::bind(&handleAvatarBoobToggleChanged, _2));
|
||||
gSavedSettings.getControl("EmeraldBoobXYInfluence")->getSignal()->connect(boost::bind(&handleAvatarBoobXYInfluence, _2));
|
||||
|
||||
gSavedSettings.getControl("AscentUseTag")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1));
|
||||
gSavedSettings.getControl("AscentUseCustomTag")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1));
|
||||
gSavedSettings.getControl("AscentCustomTagColor")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1));
|
||||
gSavedSettings.getControl("AscentCustomTagLabel")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1));
|
||||
gSavedSettings.getControl("AscentReportClientUUID")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1));
|
||||
gSavedSettings.getControl("AscentShowFriendsTag")->getSignal()->connect(boost::bind(&handleAscentGlobalTag,_1));
|
||||
gSavedSettings.getControl("AscentUseStatusColors")->getSignal()->connect(boost::bind(&handleAscentGlobalTag,_1));
|
||||
gSavedSettings.getControl("AscentAvatarXModifier")->getSignal()->connect(boost::bind(&handleAscentAvatarModifier, _1));
|
||||
gSavedSettings.getControl("AscentAvatarYModifier")->getSignal()->connect(boost::bind(&handleAscentAvatarModifier, _1));
|
||||
gSavedSettings.getControl("AscentAvatarZModifier")->getSignal()->connect(boost::bind(&handleAscentAvatarModifier, _1));
|
||||
gSavedSettings.getControl("AscentUseTag")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_2));
|
||||
gSavedSettings.getControl("AscentUseCustomTag")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_2));
|
||||
gSavedSettings.getControl("AscentCustomTagColor")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_2));
|
||||
gSavedSettings.getControl("AscentCustomTagLabel")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_2));
|
||||
gSavedSettings.getControl("AscentReportClientUUID")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_2));
|
||||
gSavedSettings.getControl("AscentShowFriendsTag")->getSignal()->connect(boost::bind(&handleAscentGlobalTag,_2));
|
||||
gSavedSettings.getControl("AscentUseStatusColors")->getSignal()->connect(boost::bind(&handleAscentGlobalTag,_2));
|
||||
gSavedSettings.getControl("AscentAvatarXModifier")->getSignal()->connect(boost::bind(&handleAscentAvatarModifier, _2));
|
||||
gSavedSettings.getControl("AscentAvatarYModifier")->getSignal()->connect(boost::bind(&handleAscentAvatarModifier, _2));
|
||||
gSavedSettings.getControl("AscentAvatarZModifier")->getSignal()->connect(boost::bind(&handleAscentAvatarModifier, _2));
|
||||
|
||||
// [Ansariel: Display name support]
|
||||
gSavedSettings.getControl("PhoenixNameSystem")->getSignal()->connect(boost::bind(&handlePhoenixNameSystemChanged, _1));
|
||||
gSavedSettings.getControl("PhoenixNameSystem")->getSignal()->connect(boost::bind(&handlePhoenixNameSystemChanged, _2));
|
||||
// [/Ansariel: Display name support]
|
||||
|
||||
gSavedSettings.getControl("AllowLargeSounds")->getSignal()->connect(boost::bind(&handleAllowLargeSounds, _1));
|
||||
}
|
||||
|
||||
template <> eControlType get_control_type<U32>(const U32& in, LLSD& out)
|
||||
{
|
||||
out = (LLSD::Integer)in;
|
||||
return TYPE_U32;
|
||||
}
|
||||
|
||||
template <> eControlType get_control_type<S32>(const S32& in, LLSD& out)
|
||||
{
|
||||
out = in;
|
||||
return TYPE_S32;
|
||||
}
|
||||
|
||||
template <> eControlType get_control_type<F32>(const F32& in, LLSD& out)
|
||||
{
|
||||
out = in;
|
||||
return TYPE_F32;
|
||||
}
|
||||
|
||||
template <> eControlType get_control_type<bool> (const bool& in, LLSD& out)
|
||||
{
|
||||
out = in;
|
||||
return TYPE_BOOLEAN;
|
||||
}
|
||||
/*
|
||||
// Yay BOOL, its really an S32.
|
||||
template <> eControlType get_control_type<BOOL> (const BOOL& in, LLSD& out)
|
||||
{
|
||||
out = in;
|
||||
return TYPE_BOOLEAN;
|
||||
}
|
||||
*/
|
||||
template <> eControlType get_control_type<std::string>(const std::string& in, LLSD& out)
|
||||
{
|
||||
out = in;
|
||||
return TYPE_STRING;
|
||||
}
|
||||
|
||||
template <> eControlType get_control_type<LLVector3>(const LLVector3& in, LLSD& out)
|
||||
{
|
||||
out = in.getValue();
|
||||
return TYPE_VEC3;
|
||||
}
|
||||
|
||||
template <> eControlType get_control_type<LLVector3d>(const LLVector3d& in, LLSD& out)
|
||||
{
|
||||
out = in.getValue();
|
||||
return TYPE_VEC3D;
|
||||
}
|
||||
|
||||
template <> eControlType get_control_type<LLRect>(const LLRect& in, LLSD& out)
|
||||
{
|
||||
out = in.getValue();
|
||||
return TYPE_RECT;
|
||||
}
|
||||
|
||||
template <> eControlType get_control_type<LLColor4>(const LLColor4& in, LLSD& out)
|
||||
{
|
||||
out = in.getValue();
|
||||
return TYPE_COL4;
|
||||
}
|
||||
|
||||
template <> eControlType get_control_type<LLColor3>(const LLColor3& in, LLSD& out)
|
||||
{
|
||||
out = in.getValue();
|
||||
return TYPE_COL3;
|
||||
}
|
||||
|
||||
template <> eControlType get_control_type<LLColor4U>(const LLColor4U& in, LLSD& out)
|
||||
{
|
||||
out = in.getValue();
|
||||
return TYPE_COL4U;
|
||||
}
|
||||
|
||||
template <> eControlType get_control_type<LLSD>(const LLSD& in, LLSD& out)
|
||||
{
|
||||
out = in;
|
||||
return TYPE_LLSD;
|
||||
gSavedSettings.getControl("AllowLargeSounds")->getSignal()->connect(boost::bind(&handleAllowLargeSounds, _2));
|
||||
}
|
||||
|
||||
void onCommitControlSetting_gSavedSettings(LLUICtrl* ctrl, void* name)
|
||||
{
|
||||
gSavedSettings.setValue((const char*)name,ctrl->getValue());
|
||||
gSavedSettings.setUntypedValue((const char*)name,ctrl->getValue());
|
||||
}
|
||||
|
||||
void onCommitControlSetting_gSavedPerAccountSettings(LLUICtrl* ctrl, void* name)
|
||||
{
|
||||
gSavedPerAccountSettings.setValue((const char*)name,ctrl->getValue());
|
||||
gSavedPerAccountSettings.setUntypedValue((const char*)name,ctrl->getValue());
|
||||
}
|
||||
|
||||
#if TEST_CACHED_CONTROL
|
||||
|
||||
#define DECL_LLCC(T, V) static LLCachedControl<T> mySetting_##T("TestCachedControl"#T, V)
|
||||
DECL_LLCC(U32, (U32)666);
|
||||
DECL_LLCC(S32, (S32)-666);
|
||||
DECL_LLCC(F32, (F32)-666.666);
|
||||
DECL_LLCC(bool, true);
|
||||
DECL_LLCC(BOOL, FALSE);
|
||||
static LLCachedControl<std::string> mySetting_string("TestCachedControlstring", "Default String Value");
|
||||
DECL_LLCC(LLVector3, LLVector3(1.0f, 2.0f, 3.0f));
|
||||
DECL_LLCC(LLVector3d, LLVector3d(6.0f, 5.0f, 4.0f));
|
||||
DECL_LLCC(LLRect, LLRect(0, 0, 100, 500));
|
||||
DECL_LLCC(LLColor4, LLColor4(0.0f, 0.5f, 1.0f));
|
||||
DECL_LLCC(LLColor3, LLColor3(1.0f, 0.f, 0.5f));
|
||||
DECL_LLCC(LLColor4U, LLColor4U(255, 200, 100, 255));
|
||||
|
||||
LLSD test_llsd = LLSD()["testing1"] = LLSD()["testing2"];
|
||||
DECL_LLCC(LLSD, test_llsd);
|
||||
|
||||
static LLCachedControl<std::string> test_BrowserHomePage("BrowserHomePage", "hahahahahha", "Not the real comment");
|
||||
|
||||
void test_cached_control()
|
||||
{
|
||||
#define do { TEST_LLCC(T, V) if((T)mySetting_##T != V) llerrs << "Fail "#T << llendl; } while(0)
|
||||
TEST_LLCC(U32, 666);
|
||||
TEST_LLCC(S32, (S32)-666);
|
||||
TEST_LLCC(F32, (F32)-666.666);
|
||||
TEST_LLCC(bool, true);
|
||||
TEST_LLCC(BOOL, FALSE);
|
||||
if((std::string)mySetting_string != "Default String Value") llerrs << "Fail string" << llendl;
|
||||
TEST_LLCC(LLVector3, LLVector3(1.0f, 2.0f, 3.0f));
|
||||
TEST_LLCC(LLVector3d, LLVector3d(6.0f, 5.0f, 4.0f));
|
||||
TEST_LLCC(LLRect, LLRect(0, 0, 100, 500));
|
||||
TEST_LLCC(LLColor4, LLColor4(0.0f, 0.5f, 1.0f));
|
||||
TEST_LLCC(LLColor3, LLColor3(1.0f, 0.f, 0.5f));
|
||||
TEST_LLCC(LLColor4U, LLColor4U(255, 200, 100, 255));
|
||||
//There's no LLSD comparsion for LLCC yet. TEST_LLCC(LLSD, test_llsd);
|
||||
|
||||
if((std::string)test_BrowserHomePage != "http://www.secondlife.com") llerrs << "Fail BrowserHomePage" << llendl;
|
||||
}
|
||||
#endif // TEST_CACHED_CONTROL
|
||||
|
||||
|
||||
@@ -72,17 +72,9 @@ extern std::string gCurrentVersion;
|
||||
|
||||
bool handleCloudSettingsChanged(const LLSD& newvalue);
|
||||
|
||||
//NOTE: LLCachedControl moved to llxml/llcontrol.h make it easier to use in other projects.
|
||||
|
||||
|
||||
//A template would be a little awkward to use here.. so.. a preprocessor macro. Alas. onCommitControlSetting(gSavedSettings) etc.
|
||||
void onCommitControlSetting_gSavedSettings(LLUICtrl* ctrl, void* name);
|
||||
void onCommitControlSetting_gSavedPerAccountSettings(LLUICtrl* ctrl, void* name);
|
||||
#define onCommitControlSetting(controlgroup) onCommitControlSetting_##controlgroup
|
||||
|
||||
//#define TEST_CACHED_CONTROL 1
|
||||
#ifdef TEST_CACHED_CONTROL
|
||||
void test_cached_control();
|
||||
#endif // TEST_CACHED_CONTROL
|
||||
|
||||
#endif // LL_LLVIEWERCONTROL_H
|
||||
|
||||
@@ -240,7 +240,7 @@ public:
|
||||
mFrequency(pFreqCtrl, 5),
|
||||
mEnabled(false)
|
||||
{
|
||||
gSavedSettings.getControl(pToggleCtrl)->getSignal()->connect(boost::bind(&SH_SpamHandler::CtrlToggle, this, _1));
|
||||
gSavedSettings.getControl(pToggleCtrl)->getSignal()->connect(boost::bind(&SH_SpamHandler::CtrlToggle, this, _2));
|
||||
CtrlToggle(gSavedSettings.getBOOL(pToggleCtrl));
|
||||
}
|
||||
bool CtrlToggle(const LLSD& newvalue)
|
||||
|
||||
@@ -202,12 +202,12 @@ void LLViewerParcelOverlay::updateOverlayTexture()
|
||||
return;
|
||||
}
|
||||
// Can do this because gColors are actually stored as LLColor4U
|
||||
const LLColor4U avail = gColors.getColor4U("PropertyColorAvail");
|
||||
const LLColor4U owned = gColors.getColor4U("PropertyColorOther");
|
||||
const LLColor4U group = gColors.getColor4U("PropertyColorGroup");
|
||||
const LLColor4U self = gColors.getColor4U("PropertyColorSelf");
|
||||
const LLColor4U for_sale = gColors.getColor4U("PropertyColorForSale");
|
||||
const LLColor4U auction = gColors.getColor4U("PropertyColorAuction");
|
||||
const LLColor4U avail = gColors.getColor4("PropertyColorAvail");
|
||||
const LLColor4U owned = gColors.getColor4("PropertyColorOther");
|
||||
const LLColor4U group = gColors.getColor4("PropertyColorGroup");
|
||||
const LLColor4U self = gColors.getColor4("PropertyColorSelf");
|
||||
const LLColor4U for_sale = gColors.getColor4("PropertyColorForSale");
|
||||
const LLColor4U auction = gColors.getColor4("PropertyColorAuction");
|
||||
|
||||
// Create the base texture.
|
||||
U8 *raw = mImageRaw->getData();
|
||||
@@ -315,11 +315,11 @@ void LLViewerParcelOverlay::updatePropertyLines()
|
||||
S32 row, col;
|
||||
|
||||
// Can do this because gColors are actually stored as LLColor4U
|
||||
const LLColor4U self_coloru = gColors.getColor4U("PropertyColorSelf");
|
||||
const LLColor4U other_coloru = gColors.getColor4U("PropertyColorOther");
|
||||
const LLColor4U group_coloru = gColors.getColor4U("PropertyColorGroup");
|
||||
const LLColor4U for_sale_coloru = gColors.getColor4U("PropertyColorForSale");
|
||||
const LLColor4U auction_coloru = gColors.getColor4U("PropertyColorAuction");
|
||||
const LLColor4U self_coloru = gColors.getColor4("PropertyColorSelf");
|
||||
const LLColor4U other_coloru = gColors.getColor4("PropertyColorOther");
|
||||
const LLColor4U group_coloru = gColors.getColor4("PropertyColorGroup");
|
||||
const LLColor4U for_sale_coloru = gColors.getColor4("PropertyColorForSale");
|
||||
const LLColor4U auction_coloru = gColors.getColor4("PropertyColorAuction");
|
||||
|
||||
// Build into dynamic arrays, then copy into static arrays.
|
||||
LLDynamicArray<LLVector3, 256> new_vertex_array;
|
||||
|
||||
@@ -3356,7 +3356,7 @@ void LLVOAvatar::getClientInfo(std::string& client, LLColor4& color, BOOL useCom
|
||||
return;
|
||||
std::string uuid_str = getTE(TEX_HEAD_BODYPAINT)->getID().asString(); //UUID of the head texture
|
||||
|
||||
static const LLCachedControl<LLColor4> avatar_name_color("AvatarNameColor",LLColor4(LLColor4U(251, 175, 93, 255)), gColors );
|
||||
static const LLCachedControl<LLColor4> avatar_name_color(gColors,"AvatarNameColor",LLColor4(LLColor4U(251, 175, 93, 255)) );
|
||||
if (isSelf())
|
||||
{
|
||||
static const LLCachedControl<bool> ascent_use_custom_tag("AscentUseCustomTag", false);
|
||||
|
||||
@@ -156,12 +156,12 @@ LLVoiceVisualizer::LLVoiceVisualizer( const U8 type )
|
||||
setPreferences();
|
||||
|
||||
// Set up our listener to get updates on all prefs values we care about.
|
||||
gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _1));
|
||||
gSavedSettings.getControl("LipSyncOohAahRate")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _1));
|
||||
gSavedSettings.getControl("LipSyncOoh")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _1));
|
||||
gSavedSettings.getControl("LipSyncAah")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _1));
|
||||
gSavedSettings.getControl("LipSyncOohPowerTransfer")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _1));
|
||||
gSavedSettings.getControl("LipSyncAahPowerTransfer")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _1));
|
||||
gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _2));
|
||||
gSavedSettings.getControl("LipSyncOohAahRate")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _2));
|
||||
gSavedSettings.getControl("LipSyncOoh")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _2));
|
||||
gSavedSettings.getControl("LipSyncAah")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _2));
|
||||
gSavedSettings.getControl("LipSyncOohPowerTransfer")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _2));
|
||||
gSavedSettings.getControl("LipSyncAahPowerTransfer")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _2));
|
||||
|
||||
sPrefsInitialized = true;
|
||||
}
|
||||
|
||||
@@ -105,18 +105,18 @@ void RlvSettings::initClass()
|
||||
#ifdef RLV_EXPERIMENTAL_COMPOSITEFOLDERS
|
||||
fCompositeFolders = rlvGetSettingBOOL(RLV_SETTING_ENABLECOMPOSITES, FALSE);
|
||||
if (gSavedSettings.controlExists(RLV_SETTING_ENABLECOMPOSITES))
|
||||
gSavedSettings.getControl(RLV_SETTING_ENABLECOMPOSITES)->getSignal()->connect(boost::bind(&onChangedSettingBOOL, _1, &fCompositeFolders));
|
||||
gSavedSettings.getControl(RLV_SETTING_ENABLECOMPOSITES)->getSignal()->connect(boost::bind(&onChangedSettingBOOL, _2, &fCompositeFolders));
|
||||
#endif // RLV_EXPERIMENTAL_COMPOSITEFOLDERS
|
||||
|
||||
fLegacyNaming = rlvGetSettingBOOL(RLV_SETTING_ENABLELEGACYNAMING, TRUE);
|
||||
if (gSavedSettings.controlExists(RLV_SETTING_ENABLELEGACYNAMING))
|
||||
gSavedSettings.getControl(RLV_SETTING_ENABLELEGACYNAMING)->getSignal()->connect(boost::bind(&onChangedSettingBOOL, _1, &fLegacyNaming));
|
||||
gSavedSettings.getControl(RLV_SETTING_ENABLELEGACYNAMING)->getSignal()->connect(boost::bind(&onChangedSettingBOOL, _2, &fLegacyNaming));
|
||||
|
||||
fNoSetEnv = rlvGetSettingBOOL(RLV_SETTING_NOSETENV, FALSE);
|
||||
|
||||
fShowNameTags = rlvGetSettingBOOL(RLV_SETTING_SHOWNAMETAGS, FALSE);
|
||||
if (gSavedSettings.controlExists(RLV_SETTING_SHOWNAMETAGS))
|
||||
gSavedSettings.getControl(RLV_SETTING_SHOWNAMETAGS)->getSignal()->connect(boost::bind(&onChangedSettingBOOL, _1, &fShowNameTags));
|
||||
gSavedSettings.getControl(RLV_SETTING_SHOWNAMETAGS)->getSignal()->connect(boost::bind(&onChangedSettingBOOL, _2, &fShowNameTags));
|
||||
|
||||
fInitialized = true;
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace tut
|
||||
{
|
||||
int results = mCG->loadFromFile(mTestConfigFile.c_str());
|
||||
ensure("number of settings", (results == 1));
|
||||
mCG->getControl("TestSetting")->getSignal()->connect(boost::bind(&this->handleListenerTest, _1));
|
||||
mCG->getControl("TestSetting")->getSignal()->connect(boost::bind(&this->handleListenerTest, _2));
|
||||
mCG->setU32("TestSetting", 13);
|
||||
ensure("listener fired on changed setting", mListenerFired);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user