summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorangela <angela@lindenlab.com>2009-11-11 11:35:12 +0800
committerangela <angela@lindenlab.com>2009-11-11 11:35:12 +0800
commit68d6dffff38d5465c6458eac73985518389aaee7 (patch)
treeadfa7f5b43339741274ea513dfe5c8290bf39af6
parent8ec85a68acee6b600320b10eea2b9aa11e434e83 (diff)
parent1fb3bfea289f28094a7cbb59fe1cdaf9116988f0 (diff)
Automated merge with ssh://angela@hg.lindenlab.com/viewer/viewer-2-0/
-rw-r--r--indra/llui/lluicolortable.cpp13
-rw-r--r--indra/newview/llfloaterpreference.cpp69
-rw-r--r--indra/newview/llfloaterpreference.h5
-rw-r--r--indra/newview/lltexturecache.cpp2
-rw-r--r--indra/newview/skins/default/xui/en/panel_bottomtray.xml11
-rw-r--r--indra/newview/skins/default/xui/en/panel_preferences_chat.xml82
6 files changed, 102 insertions, 80 deletions
diff --git a/indra/llui/lluicolortable.cpp b/indra/llui/lluicolortable.cpp
index 851091f0ca..f1e3000547 100644
--- a/indra/llui/lluicolortable.cpp
+++ b/indra/llui/lluicolortable.cpp
@@ -69,7 +69,14 @@ void LLUIColorTable::insertFromParams(const Params& p)
ColorEntryParams color_entry = *it;
if(color_entry.color.value.isChosen())
{
- setColor(color_entry.name, color_entry.color.value, mLoadedColors);
+ if(mUserSetColors.find(color_entry.name)!=mUserSetColors.end())
+ {
+ setColor(color_entry.name, color_entry.color.value);
+ }
+ else
+ {
+ setColor(color_entry.name, color_entry.color.value, mLoadedColors);
+ }
}
else
{
@@ -213,7 +220,7 @@ bool LLUIColorTable::loadFromSettings()
result |= loadFromFilename(current_filename);
}
- std::string user_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SKIN, "colors.xml");
+ std::string user_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "colors.xml");
loadFromFilename(user_filename);
return result;
@@ -239,7 +246,7 @@ void LLUIColorTable::saveUserSettings() const
if(!output_node->isNull())
{
- const std::string& filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SKIN, "colors.xml");
+ const std::string& filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "colors.xml");
LLFILE *fp = LLFile::fopen(filename, "w");
if(fp != NULL)
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index f07f9412a2..4434a8013d 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -348,6 +348,8 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
mCommitCallbackRegistrar.add("Pref.AutoDetectAspect", boost::bind(&LLFloaterPreference::onCommitAutoDetectAspect, this));
mCommitCallbackRegistrar.add("Pref.onSelectAspectRatio", boost::bind(&LLFloaterPreference::onKeystrokeAspectRatio, this));
mCommitCallbackRegistrar.add("Pref.QualityPerformance", boost::bind(&LLFloaterPreference::onChangeQuality, this, _2));
+ mCommitCallbackRegistrar.add("Pref.applyUIColor", boost::bind(&LLFloaterPreference::applyUIColor, this ,_1, _2));
+ mCommitCallbackRegistrar.add("Pref.getUIColor", boost::bind(&LLFloaterPreference::getUIColor, this ,_1, _2));
sSkin = gSavedSettings.getString("SkinCurrent");
@@ -1356,18 +1358,24 @@ void LLFloaterPreference::initWindowSizeControls(LLPanel* panelp)
}
+void LLFloaterPreference::applyUIColor(LLUICtrl* ctrl, const LLSD& param)
+{
+ LLUIColorTable::instance().setColor(param.asString(), LLColor4(ctrl->getValue()));
+}
+
+void LLFloaterPreference::getUIColor(LLUICtrl* ctrl, const LLSD& param)
+{
+ LLColorSwatchCtrl* color_swatch = (LLColorSwatchCtrl*) ctrl;
+ color_swatch->setOriginal(LLUIColorTable::instance().getColor(param.asString()));
+}
+
//----------------------------------------------------------------------------
static LLRegisterPanelClassWrapper<LLPanelPreference> t_places("panel_preference");
LLPanelPreference::LLPanelPreference()
: LLPanel()
{
- mCommitCallbackRegistrar.add("Pref.setControlFalse", boost::bind(&LLPanelPreference::setControlFalse,this, _2));
-}
-
-static void applyUIColor(const std::string& color_name, LLUICtrl* ctrl, const LLSD& param)
-{
- LLUIColorTable::instance().setColor(color_name, LLColor4(param));
+ mCommitCallbackRegistrar.add("Pref.setControlFalse", boost::bind(&LLPanelPreference::setControlFalse,this, _2));
}
//virtual
@@ -1496,55 +1504,6 @@ BOOL LLPanelPreference::postBuild()
refresh();
}
-
- if(hasChild("user") && hasChild("agent") && hasChild("im")
- && hasChild("system") && hasChild("script_error") && hasChild("objects")
- && hasChild("owner") && hasChild("background") && hasChild("links"))
- {
- LLColorSwatchCtrl* color_swatch = getChild<LLColorSwatchCtrl>("user");
- color_swatch->setCommitCallback(boost::bind(&applyUIColor, "UserChatColor", _1, _2));
- color_swatch->setOriginal(LLUIColorTable::instance().getColor("UserChatColor"));
-
- color_swatch = getChild<LLColorSwatchCtrl>("agent");
- color_swatch->setCommitCallback(boost::bind(&applyUIColor, "AgentChatColor", _1, _2));
- color_swatch->setOriginal(LLUIColorTable::instance().getColor("AgentChatColor"));
-
- color_swatch = getChild<LLColorSwatchCtrl>("im");
- color_swatch->setCommitCallback(boost::bind(&applyUIColor, "IMChatColor", _1, _2));
- color_swatch->setOriginal(LLUIColorTable::instance().getColor("IMChatColor"));
-
- color_swatch = getChild<LLColorSwatchCtrl>("system");
- color_swatch->setCommitCallback(boost::bind(&applyUIColor, "SystemChatColor", _1, _2));
- color_swatch->setOriginal(LLUIColorTable::instance().getColor("SystemChatColor"));
-
- color_swatch = getChild<LLColorSwatchCtrl>("script_error");
- color_swatch->setCommitCallback(boost::bind(&applyUIColor, "ScriptErrorColor", _1, _2));
- color_swatch->setOriginal(LLUIColorTable::instance().getColor("ScriptErrorColor"));
-
- color_swatch = getChild<LLColorSwatchCtrl>("objects");
- color_swatch->setCommitCallback(boost::bind(&applyUIColor, "ObjectChatColor", _1, _2));
- color_swatch->setOriginal(LLUIColorTable::instance().getColor("ObjectChatColor"));
-
- color_swatch = getChild<LLColorSwatchCtrl>("owner");
- color_swatch->setCommitCallback(boost::bind(&applyUIColor, "llOwnerSayChatColor", _1, _2));
- color_swatch->setOriginal(LLUIColorTable::instance().getColor("llOwnerSayChatColor"));
-
- color_swatch = getChild<LLColorSwatchCtrl>("background");
- color_swatch->setCommitCallback(boost::bind(&applyUIColor, "BackgroundChatColor", _1, _2));
- color_swatch->setOriginal(LLUIColorTable::instance().getColor("BackgroundChatColor"));
-
- color_swatch = getChild<LLColorSwatchCtrl>("links");
- color_swatch->setCommitCallback(boost::bind(&applyUIColor, "HTMLLinkColor", _1, _2));
- color_swatch->setOriginal(LLUIColorTable::instance().getColor("HTMLLinkColor"));
- }
-
- if(hasChild("effect_color_swatch"))
- {
- LLColorSwatchCtrl* color_swatch = getChild<LLColorSwatchCtrl>("effect_color_swatch");
- color_swatch->setCommitCallback(boost::bind(&applyUIColor, "EffectColor", _1, _2));
- color_swatch->setOriginal(LLUIColorTable::instance().getColor("EffectColor"));
- }
-
apply();
return true;
}
diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h
index b1ad0348c0..10f39e46f1 100644
--- a/indra/newview/llfloaterpreference.h
+++ b/indra/newview/llfloaterpreference.h
@@ -133,7 +133,9 @@ public:
void onCommitAutoDetectAspect();
void applyResolution();
void applyWindowSize();
-
+ void applyUIColor(LLUICtrl* ctrl, const LLSD& param);
+ void getUIColor(LLUICtrl* ctrl, const LLSD& param);
+
static void initWindowSizeControls(LLPanel* panelp);
static void buildLists(void* data);
@@ -159,6 +161,7 @@ public:
virtual void apply();
virtual void cancel();
void setControlFalse(const LLSD& user_data);
+
private:
typedef std::map<LLControlVariable*, LLSD> control_values_map_t;
control_values_map_t mSavedValues;
diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp
index 69a2d1d7a6..6a4b967487 100644
--- a/indra/newview/lltexturecache.cpp
+++ b/indra/newview/lltexturecache.cpp
@@ -1543,6 +1543,8 @@ bool LLTextureCache::readComplete(handle_t handle, bool abort)
handle_map_t::iterator iter = mReaders.find(handle);
llassert_always(iter != mReaders.end() || abort);
LLTextureCacheWorker* worker = iter->second;
+ if (!worker)
+ return false;
bool res = worker->complete();
if (res || abort)
{
diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml
index 9fc897b93e..ca6d8334a2 100644
--- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml
+++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml
@@ -208,7 +208,7 @@
name="snapshot_panel"
width="40">
<button
- follows="left|right"
+ follows="left|right"
height="23"
left="0"
label=""
@@ -217,9 +217,12 @@
width="36"
top="3"
image_overlay="Snapshot_Off"
- tool_tip="Take snapshot"
- />
- </layout_panel>
+ tool_tip="Take snapshot">
+ <button.commit_callback
+ function="Floater.Toggle"
+ parameter="snapshot" />
+ </button>
+ </layout_panel>
<layout_panel
mouse_opaque="false"
follows="left|right"
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml
index 645863e7a4..5a4b0a3892 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml
@@ -45,14 +45,20 @@
<color_swatch
border_color="0.45098 0.517647 0.607843 1"
can_apply_immediately="true"
- control_name="UserChatColor"
follows="left|top"
height="47"
layout="topleft"
left="30"
name="user"
top_pad="10"
- width="44" />
+ width="44" >
+ <color_swatch.init_callback
+ function="Pref.getUIColor"
+ parameter="UserChatColor" />
+ <color_swatch.commit_callback
+ function="Pref.applyUIColor"
+ parameter="UserChatColor" />
+ </color_swatch>
<text
type="string"
length="1"
@@ -69,14 +75,20 @@
<color_swatch
border_color="0.45098 0.517647 0.607843 1"
can_apply_immediately="true"
- control_name="AgentChatColor"
follows="left|top"
height="47"
layout="topleft"
left="180"
name="agent"
top_pad="-17"
- width="44" />
+ width="44" >
+ <color_swatch.init_callback
+ function="Pref.getUIColor"
+ parameter="AgentChatColor" />
+ <color_swatch.commit_callback
+ function="Pref.applyUIColor"
+ parameter="AgentChatColor" />
+ </color_swatch>
<text
type="string"
length="1"
@@ -94,7 +106,6 @@
border_color="0.45098 0.517647 0.607843 1"
can_apply_immediately="true"
color="0.6 0.6 1 1"
- control_name="IMChatColor"
follows="left|top"
height="47"
label_width="60"
@@ -102,8 +113,15 @@
left="350"
name="im"
top_pad="-17"
- width="44" />
- <text
+ width="44">
+ <color_swatch.init_callback
+ function="Pref.getUIColor"
+ parameter="IMChatColor" />
+ <color_swatch.commit_callback
+ function="Pref.applyUIColor"
+ parameter="IMChatColor" />
+ </color_swatch>
+ <text
type="string"
length="1"
follows="left|top"
@@ -120,7 +138,6 @@
border_color="0.45098 0.517647 0.607843 1"
can_apply_immediately="true"
color="0.8 1 1 1"
- control_name="SystemChatColor"
follows="left|top"
height="47"
label_width="44"
@@ -128,7 +145,14 @@
left="30"
name="system"
top_pad="40"
- width="44" />
+ width="44" >
+ <color_swatch.init_callback
+ function="Pref.getUIColor"
+ parameter="SystemChatColor" />
+ <color_swatch.commit_callback
+ function="Pref.applyUIColor"
+ parameter="SystemChatColor" />
+ </color_swatch>
<text
type="string"
length="1"
@@ -146,14 +170,20 @@
border_color="0.45098 0.517647 0.607843 1"
can_apply_immediately="true"
color="0.82 0.82 0.99 1"
- control_name="ScriptErrorColor"
follows="left|top"
height="47"
layout="topleft"
left="180"
name="script_error"
top_pad="-17"
- width="44" />
+ width="44">
+ <color_swatch.init_callback
+ function="Pref.getUIColor"
+ parameter="ScriptErrorColor" />
+ <color_swatch.commit_callback
+ function="Pref.applyUIColor"
+ parameter="ScriptErrorColor" />
+ </color_swatch>
<text
type="string"
length="1"
@@ -171,14 +201,20 @@
border_color="0.45098 0.517647 0.607843 1"
can_apply_immediately="true"
color="0.7 0.9 0.7 1"
- control_name="ObjectChatColor"
follows="left|top"
height="47"
layout="topleft"
left="350"
name="objects"
top_pad="-17"
- width="44" />
+ width="44" >
+ <color_swatch.init_callback
+ function="Pref.getUIColor"
+ parameter="ObjectChatColor" />
+ <color_swatch.commit_callback
+ function="Pref.applyUIColor"
+ parameter="ObjectChatColor" />
+ </color_swatch>
<text
type="string"
length="1"
@@ -196,14 +232,20 @@
border_color="0.45098 0.517647 0.607843 1"
can_apply_immediately="true"
color="0.7 0.9 0.7 1"
- control_name="llOwnerSayChatColor"
follows="left|top"
height="47"
layout="topleft"
left="30"
name="owner"
top_pad="40"
- width="44" />
+ width="44" >
+ <color_swatch.init_callback
+ function="Pref.getUIColor"
+ parameter="llOwnerSayChatColor" />
+ <color_swatch.commit_callback
+ function="Pref.applyUIColor"
+ parameter="llOwnerSayChatColor" />
+ </color_swatch>
<text
type="string"
length="1"
@@ -221,14 +263,20 @@
border_color="0.45098 0.517647 0.607843 1"
can_apply_immediately="true"
color="0.6 0.6 1 1"
- control_name="HTMLLinkColor"
follows="left|top"
height="47"
layout="topleft"
left="180"
name="links"
top_pad="-17"
- width="44" />
+ width="44" >
+ <color_swatch.init_callback
+ function="Pref.getUIColor"
+ parameter="HTMLLinkColor" />
+ <color_swatch.commit_callback
+ function="Pref.applyUIColor"
+ parameter="HTMLLinkColor" />
+ </color_swatch>
<text
type="string"
length="1"