From a16195fb81d7f4c7a5dd60f91d067bbdcac0f44d Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Mon, 19 Apr 2010 15:50:45 +0300 Subject: Fixed normal bug EXT-6864 (Resident-related menu items are enabled/displayed for PSTN bridge callers) * Disabled all currently processed menu items related to interaction with a resident for Avaline callers. * Added enable callback for View Profile menu item to disable it for Avaline callers. * Disabled menu items related to text chat. Full list is: - View Profile - Add Friend - IM - Call - Share - Pay - Block Text - Moderate Options: -- Allow Text chat DEV notes: To process moderation options separate "on_enable handler" was created for group moderate actions. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/261/ --HG-- branch : product-engine --- indra/newview/llparticipantlist.cpp | 57 +++++++++++++++------- indra/newview/llparticipantlist.h | 1 + .../skins/default/xui/en/menu_participant_list.xml | 11 +++-- 3 files changed, 47 insertions(+), 22 deletions(-) (limited to 'indra') diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index 53f92f7ad1..c3748ca81d 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -643,6 +643,7 @@ LLContextMenu* LLParticipantList::LLParticipantListMenu::createMenu() registrar.add("ParticipantList.ModerateVoice", boost::bind(&LLParticipantList::LLParticipantListMenu::moderateVoice, this, _2)); enable_registrar.add("ParticipantList.EnableItem", boost::bind(&LLParticipantList::LLParticipantListMenu::enableContextMenuItem, this, _2)); + enable_registrar.add("ParticipantList.EnableItem.Moderate", boost::bind(&LLParticipantList::LLParticipantListMenu::enableModerateContextMenuItem, this, _2)); enable_registrar.add("ParticipantList.CheckItem", boost::bind(&LLParticipantList::LLParticipantListMenu::checkContextMenuItem, this, _2)); // create the context menu from the XUI @@ -667,7 +668,7 @@ void LLParticipantList::LLParticipantListMenu::show(LLView* spawning_view, const if (uuids.size() == 0) return; - const LLUUID speaker_id = mUUIDs.front(); + const LLUUID& speaker_id = mUUIDs.front(); BOOL is_muted = isMuted(speaker_id); if (is_muted) @@ -801,28 +802,18 @@ void LLParticipantList::LLParticipantListMenu::moderateVoiceOtherParticipants(co bool LLParticipantList::LLParticipantListMenu::enableContextMenuItem(const LLSD& userdata) { std::string item = userdata.asString(); + const LLUUID& participant_id = mUUIDs.front(); + + // For now non of "can_view_profile" action and menu actions listed below except "can_block" + // can be performed for Avaline callers. + bool is_participant_avatar = LLVoiceClient::getInstance()->isParticipantAvatar(participant_id); + if (!is_participant_avatar && "can_block" != item) return false; + if (item == "can_mute_text" || "can_block" == item || "can_share" == item || "can_im" == item || "can_pay" == item) { return mUUIDs.front() != gAgentID; } - else if (item == "can_allow_text_chat") - { - return isGroupModerator(); - } - else if ("can_moderate_voice" == item) - { - if (isGroupModerator()) - { - LLPointer speakerp = mParent.mSpeakerMgr->findSpeaker(mUUIDs.front()); - if (speakerp.notNull()) - { - // not in voice participants can not be moderated - return speakerp->isInVoiceChannel(); - } - } - return false; - } else if (item == std::string("can_add")) { // We can add friends if: @@ -855,6 +846,36 @@ bool LLParticipantList::LLParticipantListMenu::enableContextMenuItem(const LLSD& return true; } +/* +Processed menu items with such parameters: + can_allow_text_chat + can_moderate_voice +*/ +bool LLParticipantList::LLParticipantListMenu::enableModerateContextMenuItem(const LLSD& userdata) +{ + // only group moderators can perform actions related to this "enable callback" + if (!isGroupModerator()) return false; + + const LLUUID& participant_id = mUUIDs.front(); + LLPointer speakerp = mParent.mSpeakerMgr->findSpeaker(participant_id); + + // not in voice participants can not be moderated + bool speaker_in_voice = speakerp.notNull() && speakerp->isInVoiceChannel(); + + const std::string& item = userdata.asString(); + + if ("can_moderate_voice" == item) + { + return speaker_in_voice; + } + + // For now non of menu actions except "can_moderate_voice" can be performed for Avaline callers. + bool is_participant_avatar = LLVoiceClient::getInstance()->isParticipantAvatar(participant_id); + if (!is_participant_avatar) return false; + + return true; +} + bool LLParticipantList::LLParticipantListMenu::checkContextMenuItem(const LLSD& userdata) { std::string item = userdata.asString(); diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h index 9e5a2cbc1f..bbef8baaac 100644 --- a/indra/newview/llparticipantlist.h +++ b/indra/newview/llparticipantlist.h @@ -158,6 +158,7 @@ class LLParticipantList LLParticipantList& mParent; private: bool enableContextMenuItem(const LLSD& userdata); + bool enableModerateContextMenuItem(const LLSD& userdata); bool checkContextMenuItem(const LLSD& userdata); void sortParticipantList(const LLSD& userdata); diff --git a/indra/newview/skins/default/xui/en/menu_participant_list.xml b/indra/newview/skins/default/xui/en/menu_participant_list.xml index 59c7f4ed85..2515b60868 100644 --- a/indra/newview/skins/default/xui/en/menu_participant_list.xml +++ b/indra/newview/skins/default/xui/en/menu_participant_list.xml @@ -30,6 +30,9 @@ name="View Profile"> + -- cgit v1.2.3 From a94ec45cb18f262e9cb9277960c450d84479757b Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Mon, 19 Apr 2010 16:06:23 +0300 Subject: Fixed normal bug EXT-6896 (String changes to default help text in Friends, Nearby and Recent lists) * Updated default help text in Friends, Nearby and Recent lists according to requirements in the ticket. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/259/ --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_people.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 8131b75b70..43175c8509 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -13,10 +13,10 @@ width="333"> + value="No recent people. Looking for people to hang out with? Try [secondlife:///app/search/people Search] or the [secondlife:///app/worldmap World Map]." /> + value="No one nearby. Looking for people to hang out with? Try [secondlife:///app/search/people Search] or the [secondlife:///app/worldmap World Map]." /> @@ -264,8 +264,8 @@ top="10" width="293" wrap="true"> - To add friends try [secondlife:///app/search/people global search] or use right-click on a Resident to add them as a friend. -If you're looking for people to hang out with, [secondlife:///app/worldmap try the Map]. + Find friends using [secondlife:///app/search/people Search] or right-click on a Resident to add them as a friend. +Looking for people to hang out with? Try the [secondlife:///app/worldmap World Map]. Date: Mon, 19 Apr 2010 16:20:11 +0300 Subject: Fixed windows EOLs. --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_people.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 43175c8509..7330eded4c 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -264,7 +264,7 @@ top="10" width="293" wrap="true"> - Find friends using [secondlife:///app/search/people Search] or right-click on a Resident to add them as a friend. + Find friends using [secondlife:///app/search/people Search] or right-click on a Resident to add them as a friend. Looking for people to hang out with? Try the [secondlife:///app/worldmap World Map]. -- cgit v1.2.3 From d57e8ecc7e119ca6930499ee270f438fc5ec415a Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Mon, 19 Apr 2010 17:21:16 +0300 Subject: fixed EXT-6848 Avoid creation of dummy objects in LLOnlineStatusToast and LLPanelGenericTip classes. * decoupled tip toast panel related logic from class LLTast; * moved documentation comment of LLPanelGenericTip constructor from .cpp to .h file; * corrected name attribute in panel_generic_tip.xml; reviewed by Mike Antipov and Vadim Savchuk at https://codereview.productengine.com/secondlife/r/230/ --HG-- branch : product-engine --- indra/newview/CMakeLists.txt | 6 +- indra/newview/llnotificationtiphandler.cpp | 5 +- indra/newview/llpanelgenerictip.cpp | 9 +-- indra/newview/llpanelgenerictip.h | 14 ++++- indra/newview/llpaneltiptoast.cpp | 69 ++++++++++++++++++++++ indra/newview/llpaneltiptoast.h | 57 ++++++++++++++++++ indra/newview/lltoast.cpp | 29 +++------ indra/newview/lltoast.h | 5 +- .../skins/default/xui/en/panel_generic_tip.xml | 2 +- 9 files changed, 159 insertions(+), 37 deletions(-) create mode 100644 indra/newview/llpaneltiptoast.cpp create mode 100644 indra/newview/llpaneltiptoast.h (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 4158899446..efb16d1e42 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -303,6 +303,7 @@ set(viewer_SOURCE_FILES llpanelcontents.cpp llpaneleditwearable.cpp llpanelface.cpp + llpanelgenerictip.cpp llpanelgroup.cpp llpanelgroupgeneral.cpp llpanelgroupinvite.cpp @@ -342,6 +343,7 @@ set(viewer_SOURCE_FILES llpanelprofile.cpp llpanelprofileview.cpp llpanelteleporthistory.cpp + llpaneltiptoast.cpp llpanelvolume.cpp llpanelvolumepulldown.cpp llparcelselection.cpp @@ -437,7 +439,6 @@ set(viewer_SOURCE_FILES lltracker.cpp lltransientdockablefloater.cpp lltransientfloatermgr.cpp - llpanelgenerictip.cpp lluilistener.cpp lluploaddialog.cpp llurl.cpp @@ -802,6 +803,7 @@ set(viewer_HEADER_FILES llpanelcontents.h llpaneleditwearable.h llpanelface.h + llpanelgenerictip.h llpanelgroup.h llpanelgroupgeneral.h llpanelgroupinvite.h @@ -841,6 +843,7 @@ set(viewer_HEADER_FILES llpanelprofile.h llpanelprofileview.h llpanelteleporthistory.h + llpaneltiptoast.h llpanelvolume.h llpanelvolumepulldown.h llparcelselection.h @@ -939,7 +942,6 @@ set(viewer_HEADER_FILES lltracker.h lltransientdockablefloater.h lltransientfloatermgr.h - llpanelgenerictip.h lluiconstants.h lluilistener.h lluploaddialog.h diff --git a/indra/newview/llnotificationtiphandler.cpp b/indra/newview/llnotificationtiphandler.cpp index 407de79c89..e528f871af 100644 --- a/indra/newview/llnotificationtiphandler.cpp +++ b/indra/newview/llnotificationtiphandler.cpp @@ -41,10 +41,11 @@ #include "llviewercontrol.h" #include "llviewerwindow.h" #include "llnotificationmanager.h" +#include "llpaneltiptoast.h" using namespace LLNotificationsUI; -class LLOnlineStatusToast : public LLToastPanel +class LLOnlineStatusToast : public LLPanelTipToast { public: @@ -57,7 +58,7 @@ public: Params() {} }; - LLOnlineStatusToast(Params& p) : LLToastPanel(p.notification) + LLOnlineStatusToast(Params& p) : LLPanelTipToast(p.notification) { LLUICtrlFactory::getInstance()->buildPanel(this, "panel_online_status_toast.xml"); diff --git a/indra/newview/llpanelgenerictip.cpp b/indra/newview/llpanelgenerictip.cpp index 2e977faf09..e0658554a4 100644 --- a/indra/newview/llpanelgenerictip.cpp +++ b/indra/newview/llpanelgenerictip.cpp @@ -36,15 +36,10 @@ #include "llpanelgenerictip.h" #include "llnotifications.h" -/** - * Generic toast tip panel. - * This is particular case of toast panel that decoupled from LLToastNotifyPanel. - * From now LLToastNotifyPanel is deprecated and will be removed after all panel - * types are represented in separate classes. - */ + LLPanelGenericTip::LLPanelGenericTip( const LLNotificationPtr& notification) : - LLToastPanel(notification) + LLPanelTipToast(notification) { LLUICtrlFactory::getInstance()->buildPanel(this, "panel_generic_tip.xml"); diff --git a/indra/newview/llpanelgenerictip.h b/indra/newview/llpanelgenerictip.h index 0eb502498a..defa069727 100644 --- a/indra/newview/llpanelgenerictip.h +++ b/indra/newview/llpanelgenerictip.h @@ -34,14 +34,24 @@ #ifndef LL_PANELGENERICTIP_H #define LL_PANELGENERICTIP_H -#include "lltoastpanel.h" +#include "llpaneltiptoast.h" -class LLPanelGenericTip: public LLToastPanel +/** + * Represents tip toast panel that contains only one child element - message text. + * This panel can be used for different cases of tip notifications. + */ +class LLPanelGenericTip: public LLPanelTipToast { // disallow instantiation of this class private: // grant privileges to instantiate this class to LLToastPanel friend class LLToastPanel; + /** + * Generic toast tip panel. + * This is particular case of toast panel that decoupled from LLToastNotifyPanel. + * From now LLToastNotifyPanel is deprecated and will be removed after all panel + * types are represented in separate classes. + */ LLPanelGenericTip(const LLNotificationPtr& notification); }; #endif /* LL_PANELGENERICTIP_H */ diff --git a/indra/newview/llpaneltiptoast.cpp b/indra/newview/llpaneltiptoast.cpp new file mode 100644 index 0000000000..23367df41a --- /dev/null +++ b/indra/newview/llpaneltiptoast.cpp @@ -0,0 +1,69 @@ +/** + * @file llpaneltiptoast.cpp + * @brief Represents a base class of tip toast panels. + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llpaneltiptoast.h" + +BOOL LLPanelTipToast::postBuild() +{ + mMessageText= findChild("message"); + + if (mMessageText != NULL) + { + mMessageText->setMouseUpCallback(boost::bind(&LLPanelTipToast::onMessageTextClick,this)); + setMouseUpCallback(boost::bind(&LLPanelTipToast::onPanelClick, this, _2, _3, _4)); + } + else + { + llassert(!"Can't find child 'message' text box."); + return FALSE; + } + + return TRUE; +} + +void LLPanelTipToast::onMessageTextClick() +{ + // notify parent toast about need hide + LLSD info; + info["action"] = "hide_toast"; + notifyParent(info); +} + +void LLPanelTipToast::onPanelClick(S32 x, S32 y, MASK mask) +{ + if (!mMessageText->getRect().pointInRect(x, y)) + { + onMessageTextClick(); + } +} diff --git a/indra/newview/llpaneltiptoast.h b/indra/newview/llpaneltiptoast.h new file mode 100644 index 0000000000..e8678aa1d3 --- /dev/null +++ b/indra/newview/llpaneltiptoast.h @@ -0,0 +1,57 @@ +/** + * @file llpaneltiptoast.h + * @brief Represents a base class of tip toast panels. + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + + +#include "lltoastpanel.h" + +#ifndef LL_PANELTOASTTIP_H +#define LL_PANELTOASTTIP_H + +/** + * Base class for tip toast panels. + * + * Tip toast panels are required to have text message box named as 'message'. + */ +class LLPanelTipToast : public LLToastPanel +{ + LOG_CLASS(LLPanelTipToast); +public: + LLPanelTipToast(const LLNotificationPtr& notification): LLToastPanel(notification) {} + virtual BOOL postBuild(); +private: + void onMessageTextClick(); + void onPanelClick(S32 x, S32 y, MASK mask); + + LLUICtrl* mMessageText; +}; + +#endif /* LL_PANELTOASTTIP_H */ diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index 911ed6ade7..22b12ee132 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -119,29 +119,9 @@ BOOL LLToast::postBuild() mTimer->stop(); } - if (mIsTip) - { - mTextEditor = mPanel->getChild("text_editor_box"); - - if (mTextEditor) - { - mTextEditor->setMouseUpCallback(boost::bind(&LLToast::hide,this)); - mPanel->setMouseUpCallback(boost::bind(&LLToast::handleTipToastClick, this, _2, _3, _4)); - } - } - return TRUE; } -//-------------------------------------------------------------------------- -void LLToast::handleTipToastClick(S32 x, S32 y, MASK mask) -{ - if (!mTextEditor->getRect().pointInRect(x, y)) - { - hide(); - } -} - //-------------------------------------------------------------------------- void LLToast::setHideButtonEnabled(bool enabled) { @@ -421,4 +401,13 @@ bool LLToast::isNotificationValid() //-------------------------------------------------------------------------- +S32 LLToast::notifyParent(const LLSD& info) +{ + if (info.has("action") && "hide_toast" == info["action"].asString()) + { + hide(); + return 1; + } + return LLModalDialog::notifyParent(info); +} diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index bd07ff9fb1..4a213580da 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -190,14 +190,14 @@ public: boost::signals2::connection setMouseEnterCallback( const commit_signal_t::slot_type& cb ) { return mToastMouseEnterSignal.connect(cb); }; boost::signals2::connection setMouseLeaveCallback( const commit_signal_t::slot_type& cb ) { return mToastMouseLeaveSignal.connect(cb); }; + virtual S32 notifyParent(const LLSD& info); + private: void onToastMouseEnter(); void onToastMouseLeave(); - void handleTipToastClick(S32 x, S32 y, MASK mask); - void expire(); LLUUID mNotificationID; @@ -213,7 +213,6 @@ private: LLPanel* mPanel; LLButton* mHideBtn; - LLTextEditor* mTextEditor; LLColor4 mBgColor; bool mCanFade; diff --git a/indra/newview/skins/default/xui/en/panel_generic_tip.xml b/indra/newview/skins/default/xui/en/panel_generic_tip.xml index 453ed7c7a6..eea92895f5 100644 --- a/indra/newview/skins/default/xui/en/panel_generic_tip.xml +++ b/indra/newview/skins/default/xui/en/panel_generic_tip.xml @@ -3,7 +3,7 @@ height="40" layout="topleft" left="0" - name="panel_system_tip" + name="panel_generic_tip" top="0" width="305"> Date: Mon, 19 Apr 2010 17:26:14 +0300 Subject: Fixed normal bug EXT-6899 (String changes to default and null results Groups List help text) * Updated help texts in Groups List according to requirements in the ticket. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/260/ --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_people.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 7330eded4c..8a4a28e188 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -35,10 +35,10 @@ --> + value="Didn't find what you're looking for? Try [secondlife:///app/search/groups Search]." /> + value="Looking for Groups to join? Try [secondlife:///app/search/groups Search]." /> Date: Mon, 19 Apr 2010 17:56:09 +0300 Subject: Fixed bug EXT-6842 ([I18N] Date format in Profile - mm/dd/yyyy needs to be: yyyy/mm/dd for Japanese). - Made avatar registration date localizeable. - Specified localization templates for English, Japanese and German. Reviewed by Mike: https://jira.secondlife.com/browse/EXT-6842 --HG-- branch : product-engine --- indra/newview/llavatarpropertiesprocessor.cpp | 5 +++- indra/newview/llavatarpropertiesprocessor.h | 2 +- indra/newview/lldateutil.cpp | 35 ++++++++++++++++++-------- indra/newview/lldateutil.h | 23 +++++++++++++++++ indra/newview/llinspectavatar.cpp | 7 +++++- indra/newview/llpanelavatar.cpp | 7 +++++- indra/newview/skins/default/xui/de/strings.xml | 3 +++ indra/newview/skins/default/xui/en/strings.xml | 4 +++ indra/newview/skins/default/xui/ja/strings.xml | 3 +++ 9 files changed, 74 insertions(+), 15 deletions(-) (limited to 'indra') diff --git a/indra/newview/llavatarpropertiesprocessor.cpp b/indra/newview/llavatarpropertiesprocessor.cpp index 33e5046f50..c7e788f345 100644 --- a/indra/newview/llavatarpropertiesprocessor.cpp +++ b/indra/newview/llavatarpropertiesprocessor.cpp @@ -37,6 +37,7 @@ // Viewer includes #include "llagent.h" #include "llagentpicksinfo.h" +#include "lldateutil.h" #include "llviewergenericmessage.h" // Linden library includes @@ -246,6 +247,7 @@ std::string LLAvatarPropertiesProcessor::paymentInfo(const LLAvatarData* avatar_ void LLAvatarPropertiesProcessor::processAvatarPropertiesReply(LLMessageSystem* msg, void**) { LLAvatarData avatar_data; + std::string birth_date; msg->getUUIDFast( _PREHASH_AgentData, _PREHASH_AgentID, avatar_data.agent_id); msg->getUUIDFast( _PREHASH_AgentData, _PREHASH_AvatarID, avatar_data.avatar_id); @@ -254,11 +256,12 @@ void LLAvatarPropertiesProcessor::processAvatarPropertiesReply(LLMessageSystem* msg->getUUIDFast( _PREHASH_PropertiesData, _PREHASH_PartnerID, avatar_data.partner_id); msg->getStringFast( _PREHASH_PropertiesData, _PREHASH_AboutText, avatar_data.about_text); msg->getStringFast( _PREHASH_PropertiesData, _PREHASH_FLAboutText, avatar_data.fl_about_text); - msg->getStringFast( _PREHASH_PropertiesData, _PREHASH_BornOn, avatar_data.born_on); + msg->getStringFast( _PREHASH_PropertiesData, _PREHASH_BornOn, birth_date); msg->getString( _PREHASH_PropertiesData, _PREHASH_ProfileURL, avatar_data.profile_url); msg->getU32Fast( _PREHASH_PropertiesData, _PREHASH_Flags, avatar_data.flags); + LLDateUtil::dateFromPDTString(avatar_data.born_on, birth_date); avatar_data.caption_index = 0; S32 charter_member_size = 0; diff --git a/indra/newview/llavatarpropertiesprocessor.h b/indra/newview/llavatarpropertiesprocessor.h index 716c1b8065..b9e8bfd0ab 100644 --- a/indra/newview/llavatarpropertiesprocessor.h +++ b/indra/newview/llavatarpropertiesprocessor.h @@ -67,7 +67,7 @@ struct LLAvatarData LLUUID partner_id; std::string about_text; std::string fl_about_text; - std::string born_on; + LLDate born_on; std::string profile_url; U8 caption_index; std::string caption_text; diff --git a/indra/newview/lldateutil.cpp b/indra/newview/lldateutil.cpp index abb2fdeb9a..3e71ecdfba 100644 --- a/indra/newview/lldateutil.cpp +++ b/indra/newview/lldateutil.cpp @@ -59,19 +59,22 @@ static S32 days_from_month(S32 year, S32 month) } } -std::string LLDateUtil::ageFromDate(const std::string& date_string, - const LLDate& now) +bool LLDateUtil::dateFromPDTString(LLDate& date, const std::string& str) +{ + S32 month, day, year; + S32 matched = sscanf(str.c_str(), "%d/%d/%d", &month, &day, &year); + if (matched != 3) return false; + date.fromYMDHMS(year, month, day); + F64 secs_since_epoch = date.secondsSinceEpoch(); + // Correct for the fact that specified date is in Pacific time, == UTC - 8 + secs_since_epoch += 8.0 * 60.0 * 60.0; + date.secondsSinceEpoch(secs_since_epoch); + return true; +} + +std::string LLDateUtil::ageFromDate(const LLDate& born_date, const LLDate& now) { S32 born_month, born_day, born_year; - S32 matched = sscanf(date_string.c_str(), "%d/%d/%d", &born_month, &born_day, &born_year); - if (matched != 3) return "???"; - LLDate born_date; - born_date.fromYMDHMS(born_year, born_month, born_day); - F64 born_date_secs_since_epoch = born_date.secondsSinceEpoch(); - // Correct for the fact that account creation dates are in Pacific time, - // == UTC - 8 - born_date_secs_since_epoch += 8.0 * 60.0 * 60.0; - born_date.secondsSinceEpoch(born_date_secs_since_epoch); // explode out to month/day/year again born_date.split(&born_year, &born_month, &born_day); @@ -155,6 +158,16 @@ std::string LLDateUtil::ageFromDate(const std::string& date_string, return LLTrans::getString("TodayOld"); } +std::string LLDateUtil::ageFromDate(const std::string& date_string, const LLDate& now) +{ + LLDate born_date; + + if (!dateFromPDTString(born_date, date_string)) + return "???"; + + return ageFromDate(born_date, now); +} + std::string LLDateUtil::ageFromDate(const std::string& date_string) { return ageFromDate(date_string, LLDate::now()); diff --git a/indra/newview/lldateutil.h b/indra/newview/lldateutil.h index 041be07f12..a0df21022e 100644 --- a/indra/newview/lldateutil.h +++ b/indra/newview/lldateutil.h @@ -36,6 +36,29 @@ class LLDate; namespace LLDateUtil { + /** + * Convert a date provided by the server into seconds since the Epoch. + * + * @param[out] date Number of seconds since 01/01/1970 UTC. + * @param[in] str Date string (MM/DD/YYYY) in PDT time zone. + * + * @return true on success, false on parse error + */ + bool dateFromPDTString(LLDate& date, const std::string& str); + + /** + * Get human-readable avatar age. + * + * Used for avatar inspectors and profiles. + * + * @param born_date Date an avatar was born on. + * @param now Current date. + * + * @return human-readable localized string like "1 year, 2 months", + * or "???" on error. + */ + std::string ageFromDate(const LLDate& born_date, const LLDate& now); + // Convert a date provided by the server (MM/DD/YYYY) into a localized, // human-readable age (1 year, 2 months) using translation strings. // Pass LLDate::now() for now. diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 94ea236757..e48bb77bda 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -58,6 +58,7 @@ #include "llfloaterreg.h" #include "llmenubutton.h" #include "lltooltip.h" // positionViewNearMouse() +#include "lltrans.h" #include "lluictrl.h" #include "llavatariconctrl.h" @@ -380,7 +381,11 @@ void LLInspectAvatar::requestUpdate() void LLInspectAvatar::processAvatarData(LLAvatarData* data) { LLStringUtil::format_map_t args; - args["[BORN_ON]"] = data->born_on; + { + std::string birth_date = LLTrans::getString("AvatarBirthDateFormat"); + LLStringUtil::format(birth_date, LLSD().with("datetime", (S32) data->born_on.secondsSinceEpoch())); + args["[BORN_ON]"] = birth_date; + } args["[AGE]"] = LLDateUtil::ageFromDate(data->born_on, LLDate::now()); args["[SL_PROFILE]"] = data->about_text; args["[RW_PROFILE"] = data->fl_about_text; diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index a0ba2f739b..dd632ccefe 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -51,6 +51,7 @@ #include "llnotificationsutil.h" #include "llvoiceclient.h" #include "llnamebox.h" +#include "lltrans.h" //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLDropTarget @@ -645,7 +646,11 @@ void LLPanelAvatarProfile::fillCommonData(const LLAvatarData* avatar_data) LLAvatarIconIDCache::getInstance()->remove(avatar_data->avatar_id); LLStringUtil::format_map_t args; - args["[REG_DATE]"] = avatar_data->born_on; + { + std::string birth_date = LLTrans::getString("AvatarBirthDateFormat"); + LLStringUtil::format(birth_date, LLSD().with("datetime", (S32) avatar_data->born_on.secondsSinceEpoch())); + args["[REG_DATE]"] = birth_date; + } args["[AGE]"] = LLDateUtil::ageFromDate( avatar_data->born_on, LLDate::now()); std::string register_date = getString("RegisterDateFormat", args); childSetValue("register_date", register_date ); diff --git a/indra/newview/skins/default/xui/de/strings.xml b/indra/newview/skins/default/xui/de/strings.xml index fd05f02ceb..b3aeb8cd68 100644 --- a/indra/newview/skins/default/xui/de/strings.xml +++ b/indra/newview/skins/default/xui/de/strings.xml @@ -3577,4 +3577,7 @@ Missbrauchsbericht Inhalt + + [day,datetime,slt]/[mthnum,datetime,slt]/[year,datetime,slt] + diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 813f59ff89..df4e4153f4 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3103,4 +3103,8 @@ Abuse Report New Script New Folder Contents + + + [mthnum,datetime,slt]/[day,datetime,slt]/[year,datetime,slt] + diff --git a/indra/newview/skins/default/xui/ja/strings.xml b/indra/newview/skins/default/xui/ja/strings.xml index b9df82adcd..a54d96061f 100644 --- a/indra/newview/skins/default/xui/ja/strings.xml +++ b/indra/newview/skins/default/xui/ja/strings.xml @@ -3577,4 +3577,7 @@ www.secondlife.com から最新バージョンをダウンロードしてくだ コンテンツ + + [year,datetime,slt]/[mthnum,datetime,slt]/[day,datetime,slt] + -- cgit v1.2.3 From 7f2ca84f5f5cf1bc10e756ef1873b20155bd1974 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Mon, 19 Apr 2010 18:37:36 +0300 Subject: Unhardcoded snapshot upload price in my fix for EXT-6606 (Set As Profile Pic uploads and charges user L$10 without confirmation). Reviewed by Richard: https://codereview.productengine.com/secondlife/r/217/ --HG-- branch : product-engine --- indra/newview/llfloatersnapshot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index a6a8194685..e994a18d9b 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -988,7 +988,7 @@ void profile_pic_upload_callback(const LLUUID& uuid) void LLSnapshotLivePreview::confirmSavingTexture(bool set_as_profile_pic) { LLSD args; - args["AMOUNT"] = "10"; // *TODO: there's currently no way to avoid hardcoding the upload price + args["AMOUNT"] = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); LLNotificationsUtil::add("UploadConfirmation", args, LLSD(), boost::bind(&LLSnapshotLivePreview::onSavingTextureConfirmed, this, _1, _2, set_as_profile_pic)); } -- cgit v1.2.3 From 300651e2c80b1d4fc3498758f65a1d0e8eb59934 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Mon, 19 Apr 2010 19:19:29 +0300 Subject: Fixed bug EXT-6852 ([STRING IN EN] Media settings : Owner, Group, and Anyone). Added names to nameless textboxes. Trivial change, not reviewed. --HG-- branch : product-engine --- .../skins/default/xui/en/panel_media_settings_permissions.xml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_media_settings_permissions.xml b/indra/newview/skins/default/xui/en/panel_media_settings_permissions.xml index b5c2371510..c5f44cd049 100644 --- a/indra/newview/skins/default/xui/en/panel_media_settings_permissions.xml +++ b/indra/newview/skins/default/xui/en/panel_media_settings_permissions.xml @@ -42,10 +42,11 @@ + name="owner_label"> Owner @@ -79,10 +80,11 @@ + name="group_label"> Group: @@ -126,10 +128,11 @@ + name="anyone_label"> Anyone -- cgit v1.2.3 From 8b0c0260078ba90ae30997c0aebcbc0ce45336f0 Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Tue, 20 Apr 2010 07:44:33 +0300 Subject: Fixed normal bug EXT-6801 (EXT-6801 ([TRUNCATION] multiple langs. Me > preferences > graphic > advanced)) - Made labels of sliders wider - Increased distance between radio groups Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/263/ --HG-- branch : product-engine --- .../default/xui/en/panel_preferences_graphics1.xml | 61 ++++++++++------------ .../default/xui/it/panel_preferences_graphics1.xml | 8 +-- 2 files changed, 32 insertions(+), 37 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index 7ab74855a5..0a56f711dd 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -332,21 +332,21 @@ increment="8" initial_value="160" label="Draw distance:" - label_width="140" + label_width="185" layout="topleft" - left="216" + left="200" max_val="512" min_val="64" name="DrawDistance" top="3" - width="255" /> + width="296" /> @@ -360,13 +360,13 @@ increment="256" initial_value="4096" label="Max. particle count:" - label_width="140" + label_width="185" layout="topleft" - left="216" + left="200" max_val="8192" name="MaxParticleCount" top_pad="7" - width="262" /> + width="303" /> + width="264"> @@ -407,14 +407,14 @@ increment="0.125" initial_value="160" label=" Objects:" - label_width="140" + label_width="185" layout="topleft" left_delta="0" max_val="2" name="ObjectMeshDetail" show_text="false" top_pad="6" - width="223"> + width="264"> @@ -425,13 +425,13 @@ height="16" initial_value="160" label=" Flexiprims:" - label_width="140" + label_width="185" layout="topleft" left_delta="0" name="FlexibleMeshDetail" show_text="false" top_pad="4" - width="223"> + width="264"> @@ -443,13 +443,13 @@ increment="0.125" initial_value="160" label=" Trees:" - label_width="140" + label_width="185" layout="topleft" left_delta="0" name="TreeMeshDetail" show_text="false" top_pad="4" - width="223"> + width="264"> @@ -461,13 +461,13 @@ increment="0.125" initial_value="160" label=" Avatars:" - label_width="140" + label_width="185" layout="topleft" left_delta="0" name="AvatarMeshDetail" show_text="false" top_pad="4" - width="223"> + width="264"> @@ -479,7 +479,7 @@ increment="0.125" initial_value="160" label=" Terrain:" - label_width="140" + label_width="185" layout="topleft" left_delta="0" max_val="2" @@ -487,7 +487,7 @@ name="TerrainMeshDetail" show_text="false" top_pad="4" - width="223"> + width="264"> @@ -501,7 +501,7 @@ increment="8" initial_value="160" label=" Sky:" - label_width="140" + label_width="185" layout="topleft" left_delta="0" max_val="128" @@ -509,7 +509,7 @@ name="SkyMeshDetail" show_text="false" top_pad="4" - width="223"> + width="264"> @@ -520,7 +520,7 @@ follows="left|top" height="12" layout="topleft" - left="444" + left="469" name="PostProcessText" top="305" width="128"> @@ -605,7 +605,7 @@ follows="left|top" height="12" layout="topleft" - left_delta="-230" + left="200" name="LightingDetailText" top_pad="8" width="140"> @@ -616,15 +616,13 @@ draw_border="false" height="38" layout="topleft" - left_delta="0" name="LightingDetailRadio" top_pad="5" - width="321"> + width="200"> @@ -659,23 +656,21 @@ left_delta="0" name="TerrainDetailRadio" top_pad="5" - width="321"> + width="70"> + width="50" /> + width="50" /> diff --git a/indra/newview/skins/default/xui/it/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/it/panel_preferences_graphics1.xml index d02a794219..5bd0cfb106 100644 --- a/indra/newview/skins/default/xui/it/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/it/panel_preferences_graphics1.xml @@ -47,12 +47,12 @@ - + m - - + + Dettagli reticolo: @@ -99,7 +99,7 @@