summaryrefslogtreecommitdiff
path: root/indra/newview/llfloateravatarrendersettings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloateravatarrendersettings.cpp')
-rw-r--r--indra/newview/llfloateravatarrendersettings.cpp49
1 files changed, 37 insertions, 12 deletions
diff --git a/indra/newview/llfloateravatarrendersettings.cpp b/indra/newview/llfloateravatarrendersettings.cpp
index e7ac3f2737..2bae7d63aa 100644
--- a/indra/newview/llfloateravatarrendersettings.cpp
+++ b/indra/newview/llfloateravatarrendersettings.cpp
@@ -33,6 +33,7 @@
#include "llfloaterreg.h"
#include "llnamelistctrl.h"
#include "llmenugl.h"
+#include "lltrans.h"
#include "llviewerobjectlist.h"
#include "llvoavatar.h"
@@ -144,6 +145,8 @@ void LLFloaterAvatarRenderSettings::updateList()
item_params.columns.add().value(av_name.getCompleteName()).column("name");
std::string setting = getString(iter->second == 1 ? "av_never_render" : "av_always_render");
item_params.columns.add().value(setting).column("setting");
+ std::string timestamp = createTimestamp(LLRenderMuteList::getInstance()->getVisualMuteDate(iter->first));
+ item_params.columns.add().value(timestamp).column("timestamp");
mAvatarSettingsList->addNameItemRow(item_params);
}
}
@@ -205,15 +208,7 @@ void LLFloaterAvatarRenderSettings::onCustomAction (const LLSD& userdata, const
new_setting = S32(LLVOAvatar::AV_ALWAYS_RENDER);
}
- LLVOAvatar *avatarp = find_avatar(av_id);
- if (avatarp)
- {
- avatarp->setVisualMuteSettings(LLVOAvatar::VisualMuteSettings(new_setting));
- }
- else
- {
- LLRenderMuteList::getInstance()->saveVisualMuteSetting(av_id, new_setting);
- }
+ setAvatarRenderSetting(av_id, new_setting);
}
@@ -273,14 +268,44 @@ void LLFloaterAvatarRenderSettings::onClickAdd(const LLSD& userdata)
void LLFloaterAvatarRenderSettings::callbackAvatarPicked(const uuid_vec_t& ids, S32 visual_setting)
{
if (ids.empty()) return;
+ setAvatarRenderSetting(ids[0], visual_setting);
+}
- LLVOAvatar *avatarp = find_avatar(ids[0]);
+void LLFloaterAvatarRenderSettings::setAvatarRenderSetting(const LLUUID& av_id, S32 new_setting)
+{
+ LLVOAvatar *avatarp = find_avatar(av_id);
if (avatarp)
{
- avatarp->setVisualMuteSettings(LLVOAvatar::VisualMuteSettings(visual_setting));
+ avatarp->setVisualMuteSettings(LLVOAvatar::VisualMuteSettings(new_setting));
}
else
{
- LLRenderMuteList::getInstance()->saveVisualMuteSetting(ids[0], visual_setting);
+ LLRenderMuteList::getInstance()->saveVisualMuteSetting(av_id, new_setting);
+ }
+}
+
+BOOL LLFloaterAvatarRenderSettings::handleKeyHere(KEY key, MASK mask )
+{
+ BOOL handled = FALSE;
+
+ if (KEY_DELETE == key)
+ {
+ setAvatarRenderSetting(mAvatarSettingsList->getCurrentID(), (S32)LLVOAvatar::AV_RENDER_NORMALLY);
+ handled = TRUE;
}
+ return handled;
+}
+
+std::string LLFloaterAvatarRenderSettings::createTimestamp(S32 datetime)
+{
+ std::string timeStr;
+ LLSD substitution;
+ substitution["datetime"] = datetime;
+
+ timeStr = "["+LLTrans::getString ("TimeMonth")+"]/["
+ +LLTrans::getString ("TimeDay")+"]/["
+ +LLTrans::getString ("TimeYear")+"]";
+
+ LLStringUtil::format (timeStr, substitution);
+ return timeStr;
}