From 2128a929c36dd51590349c9196e38dfc6006b24d Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Mon, 25 Jan 2010 20:53:43 +0200 Subject: Fixed reopened normal bug EXT-4450([BSI] call buttons enabled when voice is disabled). - Added check for call availability in miniinspector's context menu - Removed ability to call yourself in group chat context menu - Added check for call availability for context menu which appears on right mouse click on avatar in game area --HG-- branch : product-engine --- indra/newview/llinspectavatar.cpp | 1 + indra/newview/llparticipantlist.cpp | 4 +++- indra/newview/llviewermenu.cpp | 1 + indra/newview/skins/default/xui/en/menu_attachment_other.xml | 2 ++ indra/newview/skins/default/xui/en/menu_avatar_other.xml | 2 ++ indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml | 2 ++ 6 files changed, 11 insertions(+), 1 deletion(-) diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 4b0539337b..3a41aebf28 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -229,6 +229,7 @@ LLInspectAvatar::LLInspectAvatar(const LLSD& sd) mEnableCallbackRegistrar.add("InspectAvatar.VisibleZoomIn", boost::bind(&LLInspectAvatar::onVisibleZoomIn, this)); mEnableCallbackRegistrar.add("InspectAvatar.Gear.Enable", boost::bind(&LLInspectAvatar::isNotFriend, this)); + mEnableCallbackRegistrar.add("InspectAvatar.Gear.EnableCall", boost::bind(&LLAvatarActions::canCall)); mEnableCallbackRegistrar.add("InspectAvatar.EnableMute", boost::bind(&LLInspectAvatar::enableMute, this)); mEnableCallbackRegistrar.add("InspectAvatar.EnableUnmute", boost::bind(&LLInspectAvatar::enableUnmute, this)); diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index c0302eee9e..f83f3eba96 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -628,7 +628,9 @@ bool LLParticipantList::LLParticipantListMenu::enableContextMenuItem(const LLSD& } else if (item == "can_call") { - return LLVoiceClient::voiceEnabled()&&gVoiceClient->voiceWorking(); + bool not_agent = mUUIDs.front() != gAgentID; + bool can_call = not_agent && LLVoiceClient::voiceEnabled() && gVoiceClient->voiceWorking(); + return can_call; } return true; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 5ff5b82a17..54de693222 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -7959,6 +7959,7 @@ void initialize_menus() commit.add("Avatar.Eject", boost::bind(&handle_avatar_eject, LLSD())); view_listener_t::addMenu(new LLAvatarSendIM(), "Avatar.SendIM"); view_listener_t::addMenu(new LLAvatarCall(), "Avatar.Call"); + enable.add("Avatar.EnableCall", boost::bind(&LLAvatarActions::canCall)); view_listener_t::addMenu(new LLAvatarReportAbuse(), "Avatar.ReportAbuse"); view_listener_t::addMenu(new LLAvatarEnableAddFriend(), "Avatar.EnableAddFriend"); diff --git a/indra/newview/skins/default/xui/en/menu_attachment_other.xml b/indra/newview/skins/default/xui/en/menu_attachment_other.xml index 5b94645b60..c5b31c7f63 100644 --- a/indra/newview/skins/default/xui/en/menu_attachment_other.xml +++ b/indra/newview/skins/default/xui/en/menu_attachment_other.xml @@ -30,6 +30,8 @@ name="Call"> + + + Date: Mon, 25 Jan 2010 22:19:03 +0200 Subject: No ticket. Fixed a bit(added check for canCall()) isCalling() method from LLAvataActions, but it appears that it is not used anywhere. So i commented it out. Maybe it should be removed? --HG-- branch : product-engine --- indra/newview/llavataractions.cpp | 7 +++++-- indra/newview/llavataractions.h | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index bb14c41cec..7eed2e7b9a 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -250,17 +250,20 @@ void LLAvatarActions::startAdhocCall(const std::vector& ids) make_ui_sound("UISndStartIM"); } +/* AD *TODO: Is this function needed any more? + I fixed it a bit(added check for canCall), but it appears that it is not used + anywhere. Maybe it should be removed? // static bool LLAvatarActions::isCalling(const LLUUID &id) { - if (id.isNull()) + if (id.isNull() || !canCall()) { return false; } LLUUID session_id = gIMMgr->computeSessionID(IM_NOTHING_SPECIAL, id); return (LLIMModel::getInstance()->findIMSession(session_id) != NULL); -} +}*/ //static bool LLAvatarActions::canCall() diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index ebfd40b796..c751661acf 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -126,7 +126,10 @@ public: /** * Return true if the avatar is in a P2P voice call with a given user */ - static bool isCalling(const LLUUID &id); + /* AD *TODO: Is this function needed any more? + I fixed it a bit(added check for canCall), but it appears that it is not used + anywhere. Maybe it should be removed? + static bool isCalling(const LLUUID &id);*/ /** * @return true if call to the resident can be made -- cgit v1.2.3 From 12961b57014f099ad35bd9c2e4dfae1bc4a549c3 Mon Sep 17 00:00:00 2001 From: Ychebotarev ProductEngine Date: Tue, 26 Jan 2010 09:12:34 +0200 Subject: fix for normal EXT-4443 Copying text from notifications fails --HG-- branch : product-engine --- indra/llui/lltexteditor.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index f2c3879a6c..ae34b0a042 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -2040,6 +2040,19 @@ void LLTextEditor::showContextMenu(S32 x, S32 y) LLMenuHolderGL::child_registry_t::instance()); } + // Route menu to this class + // previously this was done in ::handleRightMoseDown: + //if(hasTabStop()) + // setFocus(TRUE) - why? weird... + // and then inside setFocus + // .... + // gEditMenuHandler = this; + // .... + // but this didn't work in all cases and just weird... + //why not hear? + + gEditMenuHandler = this; + S32 screen_x, screen_y; localPointToScreen(x, y, &screen_x, &screen_y); mContextMenu->show(screen_x, screen_y); -- cgit v1.2.3 From 865617da42d1ec723362f83d6ab2edbae5bb9a65 Mon Sep 17 00:00:00 2001 From: Ychebotarev ProductEngine Date: Tue, 26 Jan 2010 10:16:19 +0200 Subject: sidefix for EXT-4484 [BSI] default find window size covers up lower tray --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/floater_search.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_search.xml b/indra/newview/skins/default/xui/en/floater_search.xml index b0bb282abd..775e7d66f7 100644 --- a/indra/newview/skins/default/xui/en/floater_search.xml +++ b/indra/newview/skins/default/xui/en/floater_search.xml @@ -2,9 +2,9 @@ Date: Tue, 26 Jan 2010 10:40:30 +0200 Subject: Work on low bug EXT-4637 (Remove Warning flood from the VCP) -- refactoring: moved processing of participants which are not in current voice channel into separate method. --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 52 ++++++++++++++++++++++------------------- indra/newview/llcallfloater.h | 4 ++++ 2 files changed, 32 insertions(+), 24 deletions(-) diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index d9df537e03..ba50d0454e 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -568,34 +568,38 @@ void LLCallFloater::updateParticipantsVoiceState() if (!found) { - // If an avatarID is not found in a speakers list from VoiceClient and - // a panel with this ID has a JOINED status this means that this person - // HAS LEFT the call. - if ((getState(participant_id) == STATE_JOINED)) - { - setState(item, STATE_LEFT); + updateNotInVoiceParticipantState(item); + } + } +} - LLPointer speaker = mSpeakerManager->findSpeaker(item->getAvatarId()); - if (speaker.isNull()) - { - continue; - } +void LLCallFloater::updateNotInVoiceParticipantState(LLAvatarListItem* item) +{ + LLUUID participant_id = item->getAvatarId(); + // If an avatarID is not found in a speakers list from VoiceClient and + // a panel with this ID has a JOINED status this means that this person + // HAS LEFT the call. + if ((getState(participant_id) == STATE_JOINED)) + { + setState(item, STATE_LEFT); - speaker->mHasLeftCurrentCall = TRUE; - } - // If an avatarID is not found in a speakers list from VoiceClient and - // a panel with this ID has a LEFT status this means that this person - // HAS ENTERED session but it is not in voice chat yet. So, set INVITED status - else if ((getState(participant_id) != STATE_LEFT)) - { - setState(item, STATE_INVITED); - } - else - { - llwarns << "Unsupported (" << getState(participant_id) << ") state: " << item->getAvatarName() << llendl; - } + LLPointer speaker = mSpeakerManager->findSpeaker(participant_id); + if (speaker.notNull()) + { + speaker->mHasLeftCurrentCall = TRUE; } } + // If an avatarID is not found in a speakers list from VoiceClient and + // a panel with this ID has a LEFT status this means that this person + // HAS ENTERED session but it is not in voice chat yet. So, set INVITED status + else if ((getState(participant_id) != STATE_LEFT)) + { + setState(item, STATE_INVITED); + } + else + { + llwarns << "Unsupported (" << getState(participant_id) << ") state for: " << item->getAvatarName() << llendl; + } } void LLCallFloater::setState(LLAvatarListItem* item, ESpeakerState state) diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h index eded3a426b..766191379b 100644 --- a/indra/newview/llcallfloater.h +++ b/indra/newview/llcallfloater.h @@ -145,6 +145,10 @@ private: */ void updateParticipantsVoiceState(); + /** + * Updates voice state of participant not in current voice channel depend on its current state. + */ + void updateNotInVoiceParticipantState(LLAvatarListItem* item); void setState(LLAvatarListItem* item, ESpeakerState state); void setState(const LLUUID& speaker_id, ESpeakerState state) { -- cgit v1.2.3 From b15bebb34853cb839100c48f5b28d52e60660c13 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Tue, 26 Jan 2010 12:13:01 +0200 Subject: Fixed low bug EXT-4637 (Remove Warning flood from the VCP) -- refactoring: replaced "if-else" conditions with the "switch" statement. For now all existent for now states are processed. VCP functionality was not changed. --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index ba50d0454e..1e713dade8 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -576,29 +576,38 @@ void LLCallFloater::updateParticipantsVoiceState() void LLCallFloater::updateNotInVoiceParticipantState(LLAvatarListItem* item) { LLUUID participant_id = item->getAvatarId(); - // If an avatarID is not found in a speakers list from VoiceClient and - // a panel with this ID has a JOINED status this means that this person - // HAS LEFT the call. - if ((getState(participant_id) == STATE_JOINED)) + ESpeakerState current_state = getState(participant_id); + + switch (current_state) { + case STATE_JOINED: + // If an avatarID is not found in a speakers list from VoiceClient and + // a panel with this ID has a JOINED status this means that this person + // HAS LEFT the call. setState(item, STATE_LEFT); - LLPointer speaker = mSpeakerManager->findSpeaker(participant_id); - if (speaker.notNull()) { - speaker->mHasLeftCurrentCall = TRUE; + LLPointer speaker = mSpeakerManager->findSpeaker(participant_id); + if (speaker.notNull()) + { + speaker->mHasLeftCurrentCall = TRUE; + } } - } - // If an avatarID is not found in a speakers list from VoiceClient and - // a panel with this ID has a LEFT status this means that this person - // HAS ENTERED session but it is not in voice chat yet. So, set INVITED status - else if ((getState(participant_id) != STATE_LEFT)) - { + break; + case STATE_INVITED: + case STATE_LEFT: + // nothing to do. These states should not be changed. + break; + case STATE_UNKNOWN: + // If an avatarID is not found in a speakers list from VoiceClient and + // a panel with this ID has an UNKNOWN status this means that this person + // HAS ENTERED session but it is not in voice chat yet. So, set INVITED status setState(item, STATE_INVITED); - } - else - { + break; + default: + // for possible new future states. llwarns << "Unsupported (" << getState(participant_id) << ") state for: " << item->getAvatarName() << llendl; + break; } } -- cgit v1.2.3 From a402b2975fdb88781efa340d186c9ace449f9521 Mon Sep 17 00:00:00 2001 From: Ychebotarev ProductEngine Date: Tue, 26 Jan 2010 12:25:11 +0200 Subject: fix for normal [BSI] About Land -> Script Information -> Divider between object owner and parcel location cannot be moved to resize fields --HG-- branch : product-engine --- indra/newview/llfloaterscriptlimits.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp index 0964ad7f91..8875e35821 100644 --- a/indra/newview/llfloaterscriptlimits.cpp +++ b/indra/newview/llfloaterscriptlimits.cpp @@ -528,7 +528,16 @@ BOOL LLPanelScriptLimitsRegionMemory::postBuild() std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestWaiting"); childSetValue("loading_text", LLSD(msg_waiting)); - + + LLScrollListCtrl *list = getChild("scripts_list"); + + //set all columns to resizable mode even if some columns will be empty + for(S32 column = 0; column < list->getNumColumns(); column++) + { + LLScrollListColumn* columnp = list->getColumn(column); + columnp->mHeader->setHasResizableElement(TRUE); + } + return StartRequestChain(); } -- cgit v1.2.3 From cf7ff53d73a4f705e3caac7013ec40e9011f5963 Mon Sep 17 00:00:00 2001 From: Ychebotarev ProductEngine Date: Tue, 26 Jan 2010 13:53:54 +0200 Subject: EXT-4432 [BSI] Script errors are shown in nearby chat floater, but not displayed as nearby chat toast when floater closed --HG-- branch : product-engine --- indra/newview/llnearbychathandler.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index c50e049d4c..a1a9d84c14 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -356,12 +356,17 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg) initChannel(); } + /* + //comment all this due to EXT-4432 + ..may clean up after some time... + //only messages from AGENTS if(CHAT_SOURCE_OBJECT == chat_msg.mSourceType) { if(chat_msg.mChatType == CHAT_TYPE_DEBUG_MSG) return;//ok for now we don't skip messeges from object, so skip only debug messages } + */ LLUUID id; id.generate(); -- cgit v1.2.3 From a1b81987228aca8ea533dcbf25aa8f05880abf84 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Tue, 26 Jan 2010 14:09:15 +0200 Subject: done (fixing patch) EXT-4499 Replace "*" glyph in password fields with a proper circle [PATCH INCLUDED] --HG-- branch : product-engine --- indra/llui/lllineeditor.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 73e4d126f3..cb5aea272d 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -70,6 +70,8 @@ const S32 SCROLL_INCREMENT_DEL = 4; // make space for baskspacing const F32 AUTO_SCROLL_TIME = 0.05f; const F32 TRIPLE_CLICK_INTERVAL = 0.3f; // delay between double and triple click. *TODO: make this equal to the double click interval? +const std::string PASSWORD_ASTERISK( "\xE2\x97\x8F" ); // U+25CF BLACK CIRCLE + static LLDefaultChildRegistry::Register r1("line_editor"); // Compiler optimization, generate extern template @@ -401,7 +403,7 @@ void LLLineEditor::setCursorAtLocalPos( S32 local_mouse_x ) { for (S32 i = 0; i < mText.length(); i++) { - asterix_text += '*'; + asterix_text += utf8str_to_wstring(PASSWORD_ASTERISK); } wtext = asterix_text.c_str(); } @@ -1599,7 +1601,7 @@ void LLLineEditor::draw() std::string text; for (S32 i = 0; i < mText.length(); i++) { - text += '*'; + text += PASSWORD_ASTERISK; } mText = text; } -- cgit v1.2.3 From fd33910c39ceb7f589c085a5cccda7c10784f0ac Mon Sep 17 00:00:00 2001 From: Ychebotarev ProductEngine Date: Tue, 26 Jan 2010 14:34:02 +0200 Subject: add comment for EXT-4443 about EXT-4443... --HG-- branch : product-engine --- indra/llui/lltexteditor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index ae34b0a042..06ba0d80e9 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -2049,7 +2049,8 @@ void LLTextEditor::showContextMenu(S32 x, S32 y) // gEditMenuHandler = this; // .... // but this didn't work in all cases and just weird... - //why not hear? + //why not here? + // (all this was done for EXT-4443) gEditMenuHandler = this; -- cgit v1.2.3 From 1ac01f34b201154ec75d7e0143857b8229af776a Mon Sep 17 00:00:00 2001 From: Denis Serdjuk Date: Tue, 26 Jan 2010 15:21:41 +0200 Subject: fixed minor bug EXT-4186 List items are displayed as links in the FlatList if match URL regexp Solution: disabling html parsing in teleport history item. --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_teleport_history_item.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml b/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml index 4f40e00815..c5f3fcc27d 100644 --- a/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml +++ b/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml @@ -41,6 +41,7 @@ height="20" layout="topleft" left_pad="5" + allow_html="false" use_ellipses="true" name="region" text_color="white" -- cgit v1.2.3 From 4fec1fb665e5a6c93b6131d9746e3890a075c105 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Tue, 26 Jan 2010 15:36:41 +0200 Subject: =?UTF-8?q?fixed=20EXT-3783=20=E2=80=9CSystem=20messages=20display?= =?UTF-8?q?ed=20in=20nearby=20chat=E2=80=9D,=20made=20voice=20status=20mes?= =?UTF-8?q?sages=20displayed=20in=20pop-out=20window;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llimview.cpp | 53 ++++++++++++++++++++++++++---------- indra/newview/llimview.h | 17 ++++++++---- indra/newview/llviewerfloaterreg.cpp | 1 + indra/newview/llvoicechannel.cpp | 12 ++++---- 4 files changed, 57 insertions(+), 26 deletions(-) diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 32b0cbff38..1b1e6501c0 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1577,7 +1577,7 @@ void LLCallDialog::setIcon(const LLSD& session_id, const LLSD& participant_id) } } -bool LLOutgoingCallDialog::lifetimeHasExpired() +bool LLCallDialog::lifetimeHasExpired() { if (mLifetimeTimer.getStarted()) { @@ -1590,7 +1590,7 @@ bool LLOutgoingCallDialog::lifetimeHasExpired() return false; } -void LLOutgoingCallDialog::onLifetimeExpired() +void LLCallDialog::onLifetimeExpired() { mLifetimeTimer.stop(); closeFloater(); @@ -1744,19 +1744,6 @@ LLCallDialog(payload) { } -bool LLIncomingCallDialog::lifetimeHasExpired() -{ - if (mLifetimeTimer.getStarted()) - { - F32 elapsed_time = mLifetimeTimer.getElapsedTimeF32(); - if (elapsed_time > mLifetime) - { - return true; - } - } - return false; -} - void LLIncomingCallDialog::onLifetimeExpired() { // check whether a call is valid or not @@ -3218,6 +3205,42 @@ public: } }; +LLCallInfoDialog::LLCallInfoDialog(const LLSD& payload) : LLCallDialog(payload) +{ +} + +BOOL LLCallInfoDialog::postBuild() +{ + // init notification's lifetime + std::istringstream ss( getString("lifetime") ); + if (!(ss >> mLifetime)) + { + mLifetime = DEFAULT_LIFETIME; + } + return LLCallDialog::postBuild(); +} + +void LLCallInfoDialog::onOpen(const LLSD& key) +{ + if(key.has("msg")) + { + std::string msg = key["msg"]; + getChild("msg")->setValue(msg); + } + + mLifetimeTimer.start(); +} + +void LLCallInfoDialog::show(const std::string& status_name, const LLSD& args) +{ + LLUIString message = LLTrans::getString(status_name); + message.setArgs(args); + + LLSD payload; + payload["msg"] = message; + LLFloaterReg::showInstance("call_info", payload); +} + LLHTTPRegistration gHTTPRegistrationMessageChatterboxsessionstartreply( "/message/ChatterBoxSessionStartReply"); diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index a3b4f78af0..0386ff234d 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -512,8 +512,8 @@ protected: // notification's lifetime in seconds S32 mLifetime; static const S32 DEFAULT_LIFETIME = 5; - virtual bool lifetimeHasExpired() {return false;}; - virtual void onLifetimeExpired() {}; + virtual bool lifetimeHasExpired(); + virtual void onLifetimeExpired(); virtual void getAllowedRect(LLRect& rect); @@ -543,7 +543,6 @@ public: static void onStartIM(void* user_data); private: - /*virtual*/ bool lifetimeHasExpired(); /*virtual*/ void onLifetimeExpired(); void processCallResponse(S32 response); }; @@ -562,8 +561,16 @@ public: private: // hide all text boxes void hideAllText(); - /*virtual*/ bool lifetimeHasExpired(); - /*virtual*/ void onLifetimeExpired(); +}; + +class LLCallInfoDialog : public LLCallDialog +{ +public: + LLCallInfoDialog(const LLSD& payload); + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + + static void show(const std::string& status_name, const LLSD& args); }; // Globals diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 3a834e7532..e87d380e4d 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -204,6 +204,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("openobject", "floater_openobject.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("outgoing_call", "floater_outgoing_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("call_info", "floater_call_info.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("parcel_info", "floater_preview_url.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterPayUtil::registerFloater(); diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index 917d69fe16..589999c026 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -389,13 +389,13 @@ void LLVoiceChannel::setState(EState state) switch(state) { case STATE_RINGING: - gIMMgr->addSystemMessage(mSessionID, "ringing", mNotifyArgs); + LLCallInfoDialog::show("ringing", mNotifyArgs); break; case STATE_CONNECTED: - gIMMgr->addSystemMessage(mSessionID, "connected", mNotifyArgs); + LLCallInfoDialog::show("connected", mNotifyArgs); break; case STATE_HUNG_UP: - gIMMgr->addSystemMessage(mSessionID, "hang_up", mNotifyArgs); + LLCallInfoDialog::show("hang_up", mNotifyArgs); break; default: break; @@ -635,7 +635,7 @@ void LLVoiceChannelGroup::setState(EState state) case STATE_RINGING: if ( !mIsRetrying ) { - gIMMgr->addSystemMessage(mSessionID, "ringing", mNotifyArgs); + LLCallInfoDialog::show("ringing", mNotifyArgs); } doSetState(state); @@ -698,7 +698,7 @@ void LLVoiceChannelProximal::handleStatusChange(EStatusType status) // do not notify user when leaving proximal channel return; case STATUS_VOICE_DISABLED: - gIMMgr->addSystemMessage(LLUUID::null, "unavailable", mNotifyArgs); + LLCallInfoDialog::show("unavailable", mNotifyArgs); return; default: break; @@ -897,7 +897,7 @@ void LLVoiceChannelP2P::setState(EState state) // so provide a special purpose message here if (mReceivedCall && state == STATE_RINGING) { - gIMMgr->addSystemMessage(mSessionID, "answering", mNotifyArgs); + LLCallInfoDialog::show("answering", mNotifyArgs); doSetState(state); return; } -- cgit v1.2.3 From 366baa7b652bee00bd6f4fa2651f4a43ba8aabe0 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Tue, 26 Jan 2010 15:35:41 +0200 Subject: Fixed (EXT-2249) Place profile data blinks several times while updating after teleport. - Added update timer to avoid data blinking. --HG-- branch : product-engine --- indra/newview/llpanelplaces.cpp | 16 ++++++++++++---- indra/newview/llpanelplaces.h | 6 ++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index a8a9717750..7272a8a652 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -34,7 +34,7 @@ #include "llpanelplaces.h" #include "llassettype.h" -#include "llwindow.h" +#include "lltimer.h" #include "llinventory.h" #include "lllandmark.h" @@ -49,6 +49,8 @@ #include "lltrans.h" #include "lluictrlfactory.h" +#include "llwindow.h" + #include "llagent.h" #include "llagentpicksinfo.h" #include "llavatarpropertiesprocessor.h" @@ -73,6 +75,7 @@ #include "llviewerwindow.h" static const S32 LANDMARK_FOLDERS_MENU_WIDTH = 250; +static const F32 PLACE_INFO_UPDATE_INTERVAL = 3.0; static const std::string AGENT_INFO_TYPE = "agent"; static const std::string CREATE_LANDMARK_INFO_TYPE = "create_landmark"; static const std::string LANDMARK_INFO_TYPE = "landmark"; @@ -830,6 +833,10 @@ void LLPanelPlaces::togglePlaceInfoPanel(BOOL visible) { mPlaceProfile->resetLocation(); + // Do not reset location info until mResetInfoTimer has expired + // to avoid text blinking. + mResetInfoTimer.setTimerExpirySec(PLACE_INFO_UPDATE_INTERVAL); + LLRect rect = getRect(); LLRect new_rect = LLRect(rect.mLeft, rect.mTop, rect.mRight, mTabContainer->getRect().mBottom); mPlaceProfile->reshape(new_rect.getWidth(), new_rect.getHeight()); @@ -920,11 +927,12 @@ void LLPanelPlaces::changedParcelSelection() } } - // Reset location info only if global position is changed - // to reduce unnecessary text and icons updates. - if (prev_pos_global != mPosGlobal) + // Reset location info only if global position has changed + // and update timer has expired to reduce unnecessary text and icons updates. + if (prev_pos_global != mPosGlobal && mResetInfoTimer.hasExpired()) { mPlaceProfile->resetLocation(); + mResetInfoTimer.setTimerExpirySec(PLACE_INFO_UPDATE_INTERVAL); } mPlaceProfile->displaySelectedParcelInfo(parcel, region, mPosGlobal, is_current_parcel); diff --git a/indra/newview/llpanelplaces.h b/indra/newview/llpanelplaces.h index 0eba7f3afc..a098974659 100644 --- a/indra/newview/llpanelplaces.h +++ b/indra/newview/llpanelplaces.h @@ -34,6 +34,8 @@ #include "llpanel.h" +class LLTimer; + class LLInventoryItem; class LLFilterEditor; class LLLandmark; @@ -132,6 +134,10 @@ private: // be available (hence zero) LLVector3d mPosGlobal; + // Sets a period of time during which the requested place information + // is expected to be updated and doesn't need to be reset. + LLTimer mResetInfoTimer; + // Information type currently shown in Place Information panel std::string mPlaceInfoType; -- cgit v1.2.3 From a5bb9a722d18ceb0f569013f0c522429bd037030 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Mon, 25 Jan 2010 13:09:50 +0200 Subject: Fixed low bug EXT-4659 - Unnecessary scroll bar appears in location history list if 10 items are presented. --HG-- branch : product-engine --- indra/llui/llscrolllistctrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 4e84013db0..71bba57584 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -498,7 +498,7 @@ void LLScrollListCtrl::fitContents(S32 max_width, S32 max_height) { S32 height = llmin( getRequiredRect().getHeight(), max_height ); if(mPageLines) - height = llmin( mPageLines * mLineHeight + (mDisplayColumnHeaders ? mHeadingHeight : 0), height ); + height = llmin( mPageLines * mLineHeight + 2*mBorderThickness + (mDisplayColumnHeaders ? mHeadingHeight : 0), height ); S32 width = getRect().getWidth(); -- cgit v1.2.3 From f11f8b34478f0d408689fe7959f233567001374d Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Mon, 25 Jan 2010 13:42:22 +0000 Subject: EXT-4576: Changed the pre-login help behavior. The F1 help topic now means: if the user is not logged in yet, show the pre-login topic instead of the default fallback topic, otherwise show help for the focused item --- indra/newview/llviewerhelp.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/indra/newview/llviewerhelp.cpp b/indra/newview/llviewerhelp.cpp index 5af79b4fd3..7c491ad154 100644 --- a/indra/newview/llviewerhelp.cpp +++ b/indra/newview/llviewerhelp.cpp @@ -65,18 +65,16 @@ void LLViewerHelp::showTopic(const std::string &topic) help_topic = defaultTopic(); } - // f1 help topic means: if user not logged in yet, show the - // pre-login topic, otherwise show help for the focused item + // f1 help topic means: if the user is not logged in yet, show + // the pre-login topic instead of the default fallback topic, + // otherwise show help for the focused item if (help_topic == f1HelpTopic()) { - if (! LLLoginInstance::getInstance()->authSuccess()) + help_topic = getTopicFromFocus(); + if (help_topic == defaultTopic() && ! LLLoginInstance::getInstance()->authSuccess()) { help_topic = preLoginTopic(); } - else - { - help_topic = getTopicFromFocus(); - } } // work out the URL for this topic and display it -- cgit v1.2.3 From e3e4a301ab00d62d7ecf5d5ce2f4d217bc6c79e0 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Mon, 25 Jan 2010 18:06:01 +0200 Subject: implemented EXT-4567 [BSI] private voice floaters do not contain standard X buttons --HG-- branch : product-engine --- indra/newview/llimview.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index c2a7969c0d..32b0cbff38 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1680,6 +1680,7 @@ void LLOutgoingCallDialog::show(const LLSD& key) case LLVoiceChannel::STATE_ERROR : getChild("noanswer")->setVisible(true); getChild("Cancel")->setVisible(false); + setCanClose(true); mLifetimeTimer.start(); break; case LLVoiceChannel::STATE_HUNG_UP : @@ -1692,6 +1693,7 @@ void LLOutgoingCallDialog::show(const LLSD& key) getChild("nearby")->setVisible(true); } getChild("Cancel")->setVisible(false); + setCanClose(true); mLifetimeTimer.start(); } -- cgit v1.2.3 From 254b7d72d17c279aa906ee235f08ff1fa9e2b9cf Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Mon, 25 Jan 2010 18:43:31 +0200 Subject: fixed EXT-4601 [BSI] New IM sessions use obsolete timestamps for first message --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 5 +++-- indra/newview/llchathistory.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index a46cd84b60..d6a7edee5b 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -550,8 +550,8 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ if (mLastFromName == chat.mFromName && mLastFromID == chat.mFromID && mLastMessageTime.notNull() - && (new_message_time.secondsSinceEpoch() - mLastMessageTime.secondsSinceEpoch()) < 60.0 - ) + && (new_message_time.secondsSinceEpoch() - mLastMessageTime.secondsSinceEpoch()) < 60.0 + && mLastMessageTimeStr.size() == chat.mTimeStr.size()) //*HACK to distinguish between current and previous chat session's histories { view = getSeparator(); p.top_pad = mTopSeparatorPad; @@ -585,6 +585,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ mLastFromName = chat.mFromName; mLastFromID = chat.mFromID; mLastMessageTime = new_message_time; + mLastMessageTimeStr = chat.mTimeStr; } std::string message = irc_me ? chat.mText.substr(3) : chat.mText; diff --git a/indra/newview/llchathistory.h b/indra/newview/llchathistory.h index f2d403f639..c2c60e60cf 100644 --- a/indra/newview/llchathistory.h +++ b/indra/newview/llchathistory.h @@ -125,6 +125,8 @@ class LLChatHistory : public LLUICtrl std::string mLastFromName; LLUUID mLastFromID; LLDate mLastMessageTime; + std::string mLastMessageTimeStr; + std::string mMessageHeaderFilename; std::string mMessageSeparatorFilename; -- cgit v1.2.3 From af83fe79d8d074d3056e6dff86dcf14d8e71c885 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Mon, 25 Jan 2010 10:04:56 -0800 Subject: "Fix" confusion over media settings Review #89 This implements the changes Sam wanted in order to reduce the confusion over media enabled-ness, in particular: - "Media Enabled" pref now only controls "AudioStreamingMedia" - No more "tentative" state - New "Music Enabled" pref - First run dialog controls Media and Music (Sam, this is a change from your request...I think it works better) - Put a reflection of the "Media Enabled" checkbox in the Nearby Media Floater - Get rid of the "AudioStreamingVideo" setting altogether (whatever used it, it should now obey "AudioStreamingMedia"). --- indra/newview/app_settings/settings.xml | 11 -------- indra/newview/llfloaterpreference.cpp | 29 +++++++++++----------- indra/newview/llfloaterpreference.h | 1 + indra/newview/llviewermedia.cpp | 2 -- indra/newview/llviewerparcelmedia.cpp | 2 +- indra/newview/llviewertexture.cpp | 1 - .../default/xui/en/panel_preferences_privacy.xml | 20 ++++++++++++--- .../default/xui/en/panel_preferences_setup.xml | 2 +- 8 files changed, 34 insertions(+), 34 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index c29a3a0035..e607c3ad15 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -298,17 +298,6 @@ Value 1 - AudioStreamingVideo - - Comment - Enable streaming video - Persist - 1 - Type - Boolean - Value - 1 - AuditTexture Comment diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index fc036cb354..eeda3f133c 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -327,6 +327,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.AutoDetectAspect", boost::bind(&LLFloaterPreference::onCommitAutoDetectAspect, this)); mCommitCallbackRegistrar.add("Pref.ParcelMediaAutoPlayEnable", boost::bind(&LLFloaterPreference::onCommitParcelMediaAutoPlayEnable, this)); mCommitCallbackRegistrar.add("Pref.MediaEnabled", boost::bind(&LLFloaterPreference::onCommitMediaEnabled, this)); + mCommitCallbackRegistrar.add("Pref.MusicEnabled", boost::bind(&LLFloaterPreference::onCommitMusicEnabled, 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)); @@ -1001,12 +1002,14 @@ void LLFloaterPreference::onCommitMediaEnabled() { LLCheckBoxCtrl *media_enabled_ctrl = getChild("media_enabled"); bool enabled = media_enabled_ctrl->get(); - gSavedSettings.setBOOL("AudioStreamingVideo", enabled); - gSavedSettings.setBOOL("AudioStreamingMusic", enabled); gSavedSettings.setBOOL("AudioStreamingMedia", enabled); - media_enabled_ctrl->setTentative(false); - // Update enabled state of the "autoplay" checkbox - getChild("autoplay_enabled")->setEnabled(enabled); +} + +void LLFloaterPreference::onCommitMusicEnabled() +{ + LLCheckBoxCtrl *music_enabled_ctrl = getChild("music_enabled"); + bool enabled = music_enabled_ctrl->get(); + gSavedSettings.setBOOL("AudioStreamingMusic", enabled); } void LLFloaterPreference::refresh() @@ -1424,17 +1427,15 @@ BOOL LLPanelPreference::postBuild() } //////////////////////PanelPrivacy /////////////////// - if(hasChild("media_enabled")) + if (hasChild("media_enabled")) { - bool video_enabled = gSavedSettings.getBOOL("AudioStreamingVideo"); - bool music_enabled = gSavedSettings.getBOOL("AudioStreamingMusic"); bool media_enabled = gSavedSettings.getBOOL("AudioStreamingMedia"); - bool enabled = video_enabled || music_enabled || media_enabled; - - LLCheckBoxCtrl *media_enabled_ctrl = getChild("media_enabled"); - media_enabled_ctrl->set(enabled); - media_enabled_ctrl->setTentative(!(video_enabled == music_enabled == media_enabled)); - getChild("autoplay_enabled")->setEnabled(enabled); + getChild("media_enabled")->set(media_enabled); + getChild("autoplay_enabled")->setEnabled(media_enabled); + } + if (hasChild("music_enabled")) + { + getChild("music_enabled")->set(gSavedSettings.getBOOL("AudioStreamingMusic")); } apply(); diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 6f382620ee..4ec2d277a8 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -134,6 +134,7 @@ public: void onCommitAutoDetectAspect(); void onCommitParcelMediaAutoPlayEnable(); void onCommitMediaEnabled(); + void onCommitMusicEnabled(); void applyResolution(); void applyUIColor(LLUICtrl* ctrl, const LLSD& param); void getUIColor(LLUICtrl* ctrl, const LLSD& param); diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index d712446d83..98d8780b34 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -940,7 +940,6 @@ bool LLViewerMedia::firstRunCallback(const LLSD& notification, const LLSD& respo { // user has elected to automatically play media. gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, TRUE); - gSavedSettings.setBOOL("AudioStreamingVideo", TRUE); gSavedSettings.setBOOL("AudioStreamingMusic", TRUE); gSavedSettings.setBOOL("AudioStreamingMedia", TRUE); @@ -961,7 +960,6 @@ bool LLViewerMedia::firstRunCallback(const LLSD& notification, const LLSD& respo { gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, FALSE); gSavedSettings.setBOOL("AudioStreamingMedia", FALSE); - gSavedSettings.setBOOL("AudioStreamingVideo", FALSE); gSavedSettings.setBOOL("AudioStreamingMusic", FALSE); } return false; diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index e87dbe5c07..c4fc2e5cab 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -179,7 +179,7 @@ void LLViewerParcelMedia::play(LLParcel* parcel) if (!parcel) return; - if (!gSavedSettings.getBOOL("AudioStreamingMedia") || !gSavedSettings.getBOOL("AudioStreamingVideo")) + if (!gSavedSettings.getBOOL("AudioStreamingMedia")) return; std::string media_url = parcel->getMediaURL(); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 3f42cba561..b80dc7d902 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -2777,7 +2777,6 @@ void LLViewerMediaTexture::updateClass() #if 0 //force to play media. gSavedSettings.setBOOL("AudioStreamingMedia", true) ; - gSavedSettings.setBOOL("AudioStreamingVideo", true) ; #endif for(media_map_t::iterator iter = sMediaMap.begin() ; iter != sMediaMap.end(); ) diff --git a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml index a8e24366f2..0aaeb6114e 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml @@ -78,19 +78,19 @@ top_pad="10" width="350" /> - + + + Date: Mon, 25 Jan 2010 11:56:26 -0800 Subject: test commit --- indra/newview/skins/default/xui/en/floater_aaa.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/skins/default/xui/en/floater_aaa.xml b/indra/newview/skins/default/xui/en/floater_aaa.xml index 0b48ba9321..cb9f943949 100644 --- a/indra/newview/skins/default/xui/en/floater_aaa.xml +++ b/indra/newview/skins/default/xui/en/floater_aaa.xml @@ -19,6 +19,7 @@ width="320"> Nudge 1 This string CHANGE is extracted. + Just a test. Date: Mon, 25 Jan 2010 12:07:25 -0800 Subject: pull in the linux+solaris fast-timers impl from snowglobe, fit it into viewer2, start moving headers around. --- doc/contributions.txt | 1 + indra/llcommon/llfasttimer.h | 364 ------------------------------------- indra/llcommon/llfasttimer_class.h | 271 +++++++++++++++++++++++++++ 3 files changed, 272 insertions(+), 364 deletions(-) delete mode 100644 indra/llcommon/llfasttimer.h create mode 100644 indra/llcommon/llfasttimer_class.h diff --git a/doc/contributions.txt b/doc/contributions.txt index cf10ecccfb..2e4d803252 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -500,6 +500,7 @@ Ringo Tuxing CT-231 CT-321 Robin Cornelius + SNOW-108 SNOW-204 VWR-2488 VWR-9557 diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h deleted file mode 100644 index 8af79c90fd..0000000000 --- a/indra/llcommon/llfasttimer.h +++ /dev/null @@ -1,364 +0,0 @@ -/** - * @file llfasttimer.h - * @brief Declaration of a fast timer. - * - * $LicenseInfo:firstyear=2004&license=viewergpl$ - * - * Copyright (c) 2004-2009, 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$ - */ - -#ifndef LL_FASTTIMER_H -#define LL_FASTTIMER_H - -#include "llinstancetracker.h" - -#define FAST_TIMER_ON 1 -#define TIME_FAST_TIMERS 0 - -#if LL_WINDOWS -#define LL_INLINE __forceinline - -// -// NOTE: put back in when we aren't using platform sdk anymore -// -// because MS has different signatures for these functions in winnt.h -// need to rename them to avoid conflicts -//#define _interlockedbittestandset _renamed_interlockedbittestandset -//#define _interlockedbittestandreset _renamed_interlockedbittestandreset -//#include -//#undef _interlockedbittestandset -//#undef _interlockedbittestandreset - -//inline U32 get_cpu_clock_count_32() -//{ -// U64 time_stamp = __rdtsc(); -// return (U32)(time_stamp >> 8); -//} -// -//// return full timer value, *not* shifted by 8 bits -//inline U64 get_cpu_clock_count_64() -//{ -// return __rdtsc(); -//} - -// shift off lower 8 bits for lower resolution but longer term timing -// on 1Ghz machine, a 32-bit word will hold ~1000 seconds of timing -inline U32 get_cpu_clock_count_32() -{ - U32 ret_val; - __asm - { - _emit 0x0f - _emit 0x31 - shr eax,8 - shl edx,24 - or eax, edx - mov dword ptr [ret_val], eax - } - return ret_val; -} - -// return full timer value, *not* shifted by 8 bits -inline U64 get_cpu_clock_count_64() -{ - U64 ret_val; - __asm - { - _emit 0x0f - _emit 0x31 - mov eax,eax - mov edx,edx - mov dword ptr [ret_val+4], edx - mov dword ptr [ret_val], eax - } - return ret_val; -} -#else -#define LL_INLINE -#endif - -#if (LL_LINUX || LL_SOLARIS || LL_DARWIN) && (defined(__i386__) || defined(__amd64__)) -inline U32 get_cpu_clock_count_32() -{ - U64 x; - __asm__ volatile (".byte 0x0f, 0x31": "=A"(x)); - return (U32)x >> 8; -} - -inline U32 get_cpu_clock_count_64() -{ - U64 x; - __asm__ volatile (".byte 0x0f, 0x31": "=A"(x)); - return x >> 8; -} -#endif - -#if ( LL_DARWIN && !(defined(__i386__) || defined(__amd64__))) || (LL_SOLARIS && defined(__sparc__)) -// -// Mac PPC (deprecated) & Solaris SPARC implementation of CPU clock -// -// Just use gettimeofday implementation for now - -inline U32 get_cpu_clock_count_32() -{ - return (U32)get_clock_count(); -} - -inline U32 get_cpu_clock_count_64() -{ - return get_clock_count(); -} -#endif - -class LLMutex; - -#include -#include "llsd.h" - -class LL_COMMON_API LLFastTimer -{ -public: - - class NamedTimer; - - struct LL_COMMON_API FrameState - { - FrameState(NamedTimer* timerp); - - U32 mSelfTimeCounter; - U32 mCalls; - FrameState* mParent; // info for caller timer - FrameState* mLastCaller; // used to bootstrap tree construction - NamedTimer* mTimer; - U16 mActiveCount; // number of timers with this ID active on stack - bool mMoveUpTree; // needs to be moved up the tree of timers at the end of frame - }; - - // stores a "named" timer instance to be reused via multiple LLFastTimer stack instances - class LL_COMMON_API NamedTimer - : public LLInstanceTracker - { - friend class DeclareTimer; - public: - ~NamedTimer(); - - enum { HISTORY_NUM = 60 }; - - const std::string& getName() const { return mName; } - NamedTimer* getParent() const { return mParent; } - void setParent(NamedTimer* parent); - S32 getDepth(); - std::string getToolTip(S32 history_index = -1); - - typedef std::vector::const_iterator child_const_iter; - child_const_iter beginChildren(); - child_const_iter endChildren(); - std::vector& getChildren(); - - void setCollapsed(bool collapsed) { mCollapsed = collapsed; } - bool getCollapsed() const { return mCollapsed; } - - U32 getCountAverage() const { return mCountAverage; } - U32 getCallAverage() const { return mCallAverage; } - - U32 getHistoricalCount(S32 history_index = 0) const; - U32 getHistoricalCalls(S32 history_index = 0) const; - - static NamedTimer& getRootNamedTimer(); - - S32 getFrameStateIndex() const { return mFrameStateIndex; } - - FrameState& getFrameState() const; - - private: - friend class LLFastTimer; - friend class NamedTimerFactory; - - // - // methods - // - NamedTimer(const std::string& name); - // recursive call to gather total time from children - static void accumulateTimings(); - - // updates cumulative times and hierarchy, - // can be called multiple times in a frame, at any point - static void processTimes(); - - static void buildHierarchy(); - static void resetFrame(); - static void reset(); - - // - // members - // - S32 mFrameStateIndex; - - std::string mName; - - U32 mTotalTimeCounter; - - U32 mCountAverage; - U32 mCallAverage; - - U32* mCountHistory; - U32* mCallHistory; - - // tree structure - NamedTimer* mParent; // NamedTimer of caller(parent) - std::vector mChildren; - bool mCollapsed; // don't show children - bool mNeedsSorting; // sort children whenever child added - }; - - // used to statically declare a new named timer - class LL_COMMON_API DeclareTimer - : public LLInstanceTracker - { - friend class LLFastTimer; - public: - DeclareTimer(const std::string& name, bool open); - DeclareTimer(const std::string& name); - - static void updateCachedPointers(); - - private: - NamedTimer& mTimer; - FrameState* mFrameState; - }; - -public: - LLFastTimer(LLFastTimer::FrameState* state); - - LL_INLINE LLFastTimer(LLFastTimer::DeclareTimer& timer) - : mFrameState(timer.mFrameState) - { -#if TIME_FAST_TIMERS - U64 timer_start = get_cpu_clock_count_64(); -#endif -#if FAST_TIMER_ON - LLFastTimer::FrameState* frame_state = mFrameState; - mStartTime = get_cpu_clock_count_32(); - - frame_state->mActiveCount++; - frame_state->mCalls++; - // keep current parent as long as it is active when we are - frame_state->mMoveUpTree |= (frame_state->mParent->mActiveCount == 0); - - LLFastTimer::CurTimerData* cur_timer_data = &LLFastTimer::sCurTimerData; - mLastTimerData = *cur_timer_data; - cur_timer_data->mCurTimer = this; - cur_timer_data->mFrameState = frame_state; - cur_timer_data->mChildTime = 0; -#endif -#if TIME_FAST_TIMERS - U64 timer_end = get_cpu_clock_count_64(); - sTimerCycles += timer_end - timer_start; -#endif - } - - LL_INLINE ~LLFastTimer() - { -#if TIME_FAST_TIMERS - U64 timer_start = get_cpu_clock_count_64(); -#endif -#if FAST_TIMER_ON - LLFastTimer::FrameState* frame_state = mFrameState; - U32 total_time = get_cpu_clock_count_32() - mStartTime; - - frame_state->mSelfTimeCounter += total_time - LLFastTimer::sCurTimerData.mChildTime; - frame_state->mActiveCount--; - - // store last caller to bootstrap tree creation - // do this in the destructor in case of recursion to get topmost caller - frame_state->mLastCaller = mLastTimerData.mFrameState; - - // we are only tracking self time, so subtract our total time delta from parents - mLastTimerData.mChildTime += total_time; - - LLFastTimer::sCurTimerData = mLastTimerData; -#endif -#if TIME_FAST_TIMERS - U64 timer_end = get_cpu_clock_count_64(); - sTimerCycles += timer_end - timer_start; - sTimerCalls++; -#endif - } - -public: - static LLMutex* sLogLock; - static std::queue sLogQueue; - static BOOL sLog; - static BOOL sMetricLog; - static bool sPauseHistory; - static bool sResetHistory; - static U64 sTimerCycles; - static U32 sTimerCalls; - - typedef std::vector info_list_t; - static info_list_t& getFrameStateList(); - - - // call this once a frame to reset timers - static void nextFrame(); - - // dumps current cumulative frame stats to log - // call nextFrame() to reset timers - static void dumpCurTimes(); - - // call this to reset timer hierarchy, averages, etc. - static void reset(); - - static U64 countsPerSecond(); - static S32 getLastFrameIndex() { return sLastFrameIndex; } - static S32 getCurFrameIndex() { return sCurFrameIndex; } - - static void writeLog(std::ostream& os); - static const NamedTimer* getTimerByName(const std::string& name); - - struct CurTimerData - { - LLFastTimer* mCurTimer; - FrameState* mFrameState; - U32 mChildTime; - }; - static CurTimerData sCurTimerData; - -private: - static S32 sCurFrameIndex; - static S32 sLastFrameIndex; - static U64 sLastFrameTime; - static info_list_t* sTimerInfos; - - U32 mStartTime; - LLFastTimer::FrameState* mFrameState; - LLFastTimer::CurTimerData mLastTimerData; - -}; - -typedef class LLFastTimer LLFastTimer; - -#endif // LL_LLFASTTIMER_H diff --git a/indra/llcommon/llfasttimer_class.h b/indra/llcommon/llfasttimer_class.h new file mode 100644 index 0000000000..93d2d0494d --- /dev/null +++ b/indra/llcommon/llfasttimer_class.h @@ -0,0 +1,271 @@ +/** + * @file llfasttimer_class.h + * @brief Declaration of a fast timer. + * + * $LicenseInfo:firstyear=2004&license=viewergpl$ + * + * Copyright (c) 2004-2009, 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$ + */ + +#ifndef LL_FASTTIMER_CLASS_H +#define LL_FASTTIMER_CLASS_H + +#include "llinstancetracker.h" + +#define FAST_TIMER_ON 1 +#define TIME_FAST_TIMERS 0 + + +class LLMutex; + +#include +#include "llsd.h" + +class LL_COMMON_API LLFastTimer +{ +public: + + class NamedTimer; + + struct LL_COMMON_API FrameState + { + FrameState(NamedTimer* timerp); + + U32 mSelfTimeCounter; + U32 mCalls; + FrameState* mParent; // info for caller timer + FrameState* mLastCaller; // used to bootstrap tree construction + NamedTimer* mTimer; + U16 mActiveCount; // number of timers with this ID active on stack + bool mMoveUpTree; // needs to be moved up the tree of timers at the end of frame + }; + + // stores a "named" timer instance to be reused via multiple LLFastTimer stack instances + class LL_COMMON_API NamedTimer + : public LLInstanceTracker + { + friend class DeclareTimer; + public: + ~NamedTimer(); + + enum { HISTORY_NUM = 60 }; + + const std::string& getName() const { return mName; } + NamedTimer* getParent() const { return mParent; } + void setParent(NamedTimer* parent); + S32 getDepth(); + std::string getToolTip(S32 history_index = -1); + + typedef std::vector::const_iterator child_const_iter; + child_const_iter beginChildren(); + child_const_iter endChildren(); + std::vector& getChildren(); + + void setCollapsed(bool collapsed) { mCollapsed = collapsed; } + bool getCollapsed() const { return mCollapsed; } + + U32 getCountAverage() const { return mCountAverage; } + U32 getCallAverage() const { return mCallAverage; } + + U32 getHistoricalCount(S32 history_index = 0) const; + U32 getHistoricalCalls(S32 history_index = 0) const; + + static NamedTimer& getRootNamedTimer(); + + S32 getFrameStateIndex() const { return mFrameStateIndex; } + + FrameState& getFrameState() const; + + private: + friend class LLFastTimer; + friend class NamedTimerFactory; + + // + // methods + // + NamedTimer(const std::string& name); + // recursive call to gather total time from children + static void accumulateTimings(); + + // updates cumulative times and hierarchy, + // can be called multiple times in a frame, at any point + static void processTimes(); + + static void buildHierarchy(); + static void resetFrame(); + static void reset(); + + // + // members + // + S32 mFrameStateIndex; + + std::string mName; + + U32 mTotalTimeCounter; + + U32 mCountAverage; + U32 mCallAverage; + + U32* mCountHistory; + U32* mCallHistory; + + // tree structure + NamedTimer* mParent; // NamedTimer of caller(parent) + std::vector mChildren; + bool mCollapsed; // don't show children + bool mNeedsSorting; // sort children whenever child added + }; + + // used to statically declare a new named timer + class LL_COMMON_API DeclareTimer + : public LLInstanceTracker + { + friend class LLFastTimer; + public: + DeclareTimer(const std::string& name, bool open); + DeclareTimer(const std::string& name); + + static void updateCachedPointers(); + + private: + NamedTimer& mTimer; + FrameState* mFrameState; + }; + +public: + LLFastTimer(LLFastTimer::FrameState* state); + + LL_INLINE LLFastTimer(LLFastTimer::DeclareTimer& timer) + : mFrameState(timer.mFrameState) + { +#if TIME_FAST_TIMERS + U64 timer_start = get_cpu_clock_count_64(); +#endif +#if FAST_TIMER_ON + LLFastTimer::FrameState* frame_state = mFrameState; + mStartTime = get_cpu_clock_count_32(); + + frame_state->mActiveCount++; + frame_state->mCalls++; + // keep current parent as long as it is active when we are + frame_state->mMoveUpTree |= (frame_state->mParent->mActiveCount == 0); + + LLFastTimer::CurTimerData* cur_timer_data = &LLFastTimer::sCurTimerData; + mLastTimerData = *cur_timer_data; + cur_timer_data->mCurTimer = this; + cur_timer_data->mFrameState = frame_state; + cur_timer_data->mChildTime = 0; +#endif +#if TIME_FAST_TIMERS + U64 timer_end = get_cpu_clock_count_64(); + sTimerCycles += timer_end - timer_start; +#endif + } + + LL_INLINE ~LLFastTimer() + { +#if TIME_FAST_TIMERS + U64 timer_start = get_cpu_clock_count_64(); +#endif +#if FAST_TIMER_ON + LLFastTimer::FrameState* frame_state = mFrameState; + U32 total_time = get_cpu_clock_count_32() - mStartTime; + + frame_state->mSelfTimeCounter += total_time - LLFastTimer::sCurTimerData.mChildTime; + frame_state->mActiveCount--; + + // store last caller to bootstrap tree creation + // do this in the destructor in case of recursion to get topmost caller + frame_state->mLastCaller = mLastTimerData.mFrameState; + + // we are only tracking self time, so subtract our total time delta from parents + mLastTimerData.mChildTime += total_time; + + LLFastTimer::sCurTimerData = mLastTimerData; +#endif +#if TIME_FAST_TIMERS + U64 timer_end = get_cpu_clock_count_64(); + sTimerCycles += timer_end - timer_start; + sTimerCalls++; +#endif + } + +public: + static LLMutex* sLogLock; + static std::queue sLogQueue; + static BOOL sLog; + static BOOL sMetricLog; + static bool sPauseHistory; + static bool sResetHistory; + static U64 sTimerCycles; + static U32 sTimerCalls; + + typedef std::vector info_list_t; + static info_list_t& getFrameStateList(); + + + // call this once a frame to reset timers + static void nextFrame(); + + // dumps current cumulative frame stats to log + // call nextFrame() to reset timers + static void dumpCurTimes(); + + // call this to reset timer hierarchy, averages, etc. + static void reset(); + + static U64 countsPerSecond(); + static S32 getLastFrameIndex() { return sLastFrameIndex; } + static S32 getCurFrameIndex() { return sCurFrameIndex; } + + static void writeLog(std::ostream& os); + static const NamedTimer* getTimerByName(const std::string& name); + + struct CurTimerData + { + LLFastTimer* mCurTimer; + FrameState* mFrameState; + U32 mChildTime; + }; + static CurTimerData sCurTimerData; + +private: + static S32 sCurFrameIndex; + static S32 sLastFrameIndex; + static U64 sLastFrameTime; + static info_list_t* sTimerInfos; + static U64 sClockResolution; + + U32 mStartTime; + LLFastTimer::FrameState* mFrameState; + LLFastTimer::CurTimerData mLastTimerData; + +}; + +typedef class LLFastTimer LLFastTimer; + +#endif // LL_LLFASTTIMER_CLASS_H -- cgit v1.2.3 From ec7b204ed657f7c1becac3b410ae0bc94c03aa75 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 25 Jan 2010 12:31:50 -0800 Subject: shuffle shuffle of timer code. cleanup. --- indra/llcommon/CMakeLists.txt | 2 +- indra/llcommon/llfasttimer.h | 169 ++++++++ indra/llcommon/llfasttimer_class.cpp | 751 +++++++++++++++++++++++++++++++++++ indra/llcommon/llfasttimer_class.h | 24 +- 4 files changed, 937 insertions(+), 9 deletions(-) create mode 100644 indra/llcommon/llfasttimer.h create mode 100644 indra/llcommon/llfasttimer_class.cpp diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index ac7cc2cdac..05e45d6d8a 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -50,7 +50,7 @@ set(llcommon_SOURCE_FILES lleventdispatcher.cpp lleventfilter.cpp llevents.cpp - llfasttimer.cpp + llfasttimer_class.cpp llfile.cpp llfindlocale.cpp llfixedbuffer.cpp diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h new file mode 100644 index 0000000000..0f3280023c --- /dev/null +++ b/indra/llcommon/llfasttimer.h @@ -0,0 +1,169 @@ +/** + * @file llfasttimer.h + * @brief Inline implementations of fast timers. + * + * $LicenseInfo:firstyear=2004&license=viewergpl$ + * + * Copyright (c) 2004-2009, 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$ + */ + +#ifndef LL_FASTTIMER_H +#define LL_FASTTIMER_H + +// pull in the actual class definition +#include "llfasttimer_class.h" + +#if LL_WINDOWS +#define LL_INLINE __forceinline +// +// Windows implementation of CPU clock +// + +// +// NOTE: put back in when we aren't using platform sdk anymore +// +// because MS has different signatures for these functions in winnt.h +// need to rename them to avoid conflicts +//#define _interlockedbittestandset _renamed_interlockedbittestandset +//#define _interlockedbittestandreset _renamed_interlockedbittestandreset +//#include +//#undef _interlockedbittestandset +//#undef _interlockedbittestandreset + +//inline U32 get_cpu_clock_count_32() +//{ +// U64 time_stamp = __rdtsc(); +// return (U32)(time_stamp >> 8); +//} +// +//// return full timer value, *not* shifted by 8 bits +//inline U64 get_cpu_clock_count_64() +//{ +// return __rdtsc(); +//} + +// shift off lower 8 bits for lower resolution but longer term timing +// on 1Ghz machine, a 32-bit word will hold ~1000 seconds of timing +inline U32 get_cpu_clock_count_32() +{ + U32 ret_val; + __asm + { + _emit 0x0f + _emit 0x31 + shr eax,8 + shl edx,24 + or eax, edx + mov dword ptr [ret_val], eax + } + return ret_val; +} + +// return full timer value, *not* shifted by 8 bits +inline U64 get_cpu_clock_count_64() +{ + U64 ret_val; + __asm + { + _emit 0x0f + _emit 0x31 + mov eax,eax + mov edx,edx + mov dword ptr [ret_val+4], edx + mov dword ptr [ret_val], eax + } + return ret_val; +} +#else +#define LL_INLINE +#endif + + +#if LL_LINUX || LL_SOLARIS +// +// Linux and Solaris implementation of CPU clock - all architectures. +// +// Try to use the MONOTONIC clock if available, this is a constant time counter +// with nanosecond resolution (but not necessarily accuracy) and attempts are made +// to synchronize this value between cores at kernel start. It should not be affected +// by CPU frequency. If not available use the REALTIME clock, but this may be affected by +// NTP adjustments or other user activity affecting the system time. +inline U64 get_cpu_clock_count_64() +{ + struct timespec tp; + +#ifdef CLOCK_MONOTONIC // MONOTONIC supported at build-time? + if (-1 == clock_gettime(CLOCK_MONOTONIC,&tp)) // if MONOTONIC isn't supported at runtime, try REALTIME +#endif + clock_gettime(CLOCK_REALTIME,&tp); + + return (tp.tv_sec*LLFastTimer::sClockResolution)+tp.tv_nsec; +} + +inline U32 get_cpu_clock_count_32() +{ + return (U32)get_cpu_clock_count_64(); +} +#endif // (LL_LINUX || LL_SOLARIS)) + + +#if (LL_DARWIN) && (defined(__i386__) || defined(__amd64__)) +// +// Mac x86 implementation of CPU clock +inline U32 get_cpu_clock_count_32() +{ + U64 x; + __asm__ volatile (".byte 0x0f, 0x31": "=A"(x)); + return (U32)x >> 8; +} + +inline U32 get_cpu_clock_count_64() +{ + U64 x; + __asm__ volatile (".byte 0x0f, 0x31": "=A"(x)); + return x >> 8; +} +#endif + + +#if ( LL_DARWIN && !(defined(__i386__) || defined(__amd64__))) +// +// Mac PPC (deprecated) implementation of CPU clock +// +// Just use gettimeofday implementation for now + +inline U32 get_cpu_clock_count_32() +{ + return (U32)get_clock_count(); +} + +inline U32 get_cpu_clock_count_64() +{ + return get_clock_count(); +} +#endif + +#endif // LL_LLFASTTIMER_H diff --git a/indra/llcommon/llfasttimer_class.cpp b/indra/llcommon/llfasttimer_class.cpp new file mode 100644 index 0000000000..6dbd90f9fa --- /dev/null +++ b/indra/llcommon/llfasttimer_class.cpp @@ -0,0 +1,751 @@ +/** + * @file llfasttimer_class.cpp + * @brief Implementation of the fast timer. + * + * $LicenseInfo:firstyear=2004&license=viewergpl$ + * + * Copyright (c) 2004-2007, 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://secondlife.com/developers/opensource/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://secondlife.com/developers/opensource/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 "linden_common.h" + +#include "llfasttimer.h" + +#include "llmemory.h" +#include "llprocessor.h" +#include "llsingleton.h" +#include "lltreeiterators.h" +#include "llsdserialize.h" + +#include + +#if LL_WINDOWS +#elif LL_LINUX || LL_SOLARIS +#include +#include +#elif LL_DARWIN +#include +#include "lltimer.h" // get_clock_count() +#else +#error "architecture not supported" +#endif + +////////////////////////////////////////////////////////////////////////////// +// statics + +S32 LLFastTimer::sCurFrameIndex = -1; +S32 LLFastTimer::sLastFrameIndex = -1; +U64 LLFastTimer::sLastFrameTime = get_cpu_clock_count_64(); +bool LLFastTimer::sPauseHistory = 0; +bool LLFastTimer::sResetHistory = 0; +LLFastTimer::CurTimerData LLFastTimer::sCurTimerData; +BOOL LLFastTimer::sLog = FALSE; +BOOL LLFastTimer::sMetricLog = FALSE; +LLMutex* LLFastTimer::sLogLock = NULL; +std::queue LLFastTimer::sLogQueue; + +#if LL_LINUX || LL_SOLARIS +U64 LLFastTimer::sClockResolution = 1000000000; // Nanosecond resolution +#else +U64 LLFastTimer::sClockResolution = 1000000; // Microsecond resolution +#endif + +std::vector* LLFastTimer::sTimerInfos = NULL; +U64 LLFastTimer::sTimerCycles = 0; +U32 LLFastTimer::sTimerCalls = 0; + + +// FIXME: move these declarations to the relevant modules + +// helper functions +typedef LLTreeDFSPostIter timer_tree_bottom_up_iterator_t; + +static timer_tree_bottom_up_iterator_t begin_timer_tree_bottom_up(LLFastTimer::NamedTimer& id) +{ + return timer_tree_bottom_up_iterator_t(&id, + boost::bind(boost::mem_fn(&LLFastTimer::NamedTimer::beginChildren), _1), + boost::bind(boost::mem_fn(&LLFastTimer::NamedTimer::endChildren), _1)); +} + +static timer_tree_bottom_up_iterator_t end_timer_tree_bottom_up() +{ + return timer_tree_bottom_up_iterator_t(); +} + +typedef LLTreeDFSIter timer_tree_dfs_iterator_t; + + +static timer_tree_dfs_iterator_t begin_timer_tree(LLFastTimer::NamedTimer& id) +{ + return timer_tree_dfs_iterator_t(&id, + boost::bind(boost::mem_fn(&LLFastTimer::NamedTimer::beginChildren), _1), + boost::bind(boost::mem_fn(&LLFastTimer::NamedTimer::endChildren), _1)); +} + +static timer_tree_dfs_iterator_t end_timer_tree() +{ + return timer_tree_dfs_iterator_t(); +} + + + +// factory class that creates NamedTimers via static DeclareTimer objects +class NamedTimerFactory : public LLSingleton +{ +public: + NamedTimerFactory() + {} + + /*virtual */ void initSingleton() + { + mTimerRoot = new LLFastTimer::NamedTimer("root"); + + mActiveTimerRoot = new LLFastTimer::NamedTimer("Frame"); + mActiveTimerRoot->setCollapsed(false); + + mRootFrameState = new LLFastTimer::FrameState(mActiveTimerRoot); + mRootFrameState->mParent = &mTimerRoot->getFrameState(); + mActiveTimerRoot->setParent(mTimerRoot); + + mAppTimer = new LLFastTimer(mRootFrameState); + } + + ~NamedTimerFactory() + { + std::for_each(mTimers.begin(), mTimers.end(), DeletePairedPointer()); + + delete mAppTimer; + delete mActiveTimerRoot; + delete mTimerRoot; + delete mRootFrameState; + } + + LLFastTimer::NamedTimer& createNamedTimer(const std::string& name) + { + timer_map_t::iterator found_it = mTimers.find(name); + if (found_it != mTimers.end()) + { + return *found_it->second; + } + + LLFastTimer::NamedTimer* timer = new LLFastTimer::NamedTimer(name); + timer->setParent(mTimerRoot); + mTimers.insert(std::make_pair(name, timer)); + + return *timer; + } + + LLFastTimer::NamedTimer* getTimerByName(const std::string& name) + { + timer_map_t::iterator found_it = mTimers.find(name); + if (found_it != mTimers.end()) + { + return found_it->second; + } + return NULL; + } + + LLFastTimer::NamedTimer* getActiveRootTimer() { return mActiveTimerRoot; } + LLFastTimer::NamedTimer* getRootTimer() { return mTimerRoot; } + const LLFastTimer* getAppTimer() { return mAppTimer; } + LLFastTimer::FrameState& getRootFrameState() { return *mRootFrameState; } + + typedef std::map timer_map_t; + timer_map_t::iterator beginTimers() { return mTimers.begin(); } + timer_map_t::iterator endTimers() { return mTimers.end(); } + S32 timerCount() { return mTimers.size(); } + +private: + timer_map_t mTimers; + + LLFastTimer::NamedTimer* mActiveTimerRoot; + LLFastTimer::NamedTimer* mTimerRoot; + LLFastTimer* mAppTimer; + LLFastTimer::FrameState* mRootFrameState; +}; + +void update_cached_pointers_if_changed() +{ + // detect when elements have moved and update cached pointers + static LLFastTimer::FrameState* sFirstTimerAddress = NULL; + if (&*(LLFastTimer::getFrameStateList().begin()) != sFirstTimerAddress) + { + LLFastTimer::DeclareTimer::updateCachedPointers(); + } + sFirstTimerAddress = &*(LLFastTimer::getFrameStateList().begin()); +} + +LLFastTimer::DeclareTimer::DeclareTimer(const std::string& name, bool open ) +: mTimer(NamedTimerFactory::instance().createNamedTimer(name)) +{ + mTimer.setCollapsed(!open); + mFrameState = &mTimer.getFrameState(); + update_cached_pointers_if_changed(); +} + +LLFastTimer::DeclareTimer::DeclareTimer(const std::string& name) +: mTimer(NamedTimerFactory::instance().createNamedTimer(name)) +{ + mFrameState = &mTimer.getFrameState(); + update_cached_pointers_if_changed(); +} + +// static +void LLFastTimer::DeclareTimer::updateCachedPointers() +{ + // propagate frame state pointers to timer declarations + for (DeclareTimer::instance_iter it = DeclareTimer::beginInstances(); + it != DeclareTimer::endInstances(); + ++it) + { + // update cached pointer + it->mFrameState = &it->mTimer.getFrameState(); + } +} + +//static +#if LL_LINUX || LL_SOLARIS || ( LL_DARWIN && !(defined(__i386__) || defined(__amd64__)) ) +U64 LLFastTimer::countsPerSecond() +{ + return sClockResolution; +} +#else // windows or x86-mac +U64 LLFastTimer::countsPerSecond() +{ + static U64 sCPUClockFrequency = U64(CProcessor().GetCPUFrequency(50)); + + // we drop the low-order byte in out timers, so report a lower frequency + return sCPUClockFrequency >> 8; +} +#endif + +LLFastTimer::FrameState::FrameState(LLFastTimer::NamedTimer* timerp) +: mActiveCount(0), + mCalls(0), + mSelfTimeCounter(0), + mParent(NULL), + mLastCaller(NULL), + mMoveUpTree(false), + mTimer(timerp) +{} + + +LLFastTimer::NamedTimer::NamedTimer(const std::string& name) +: mName(name), + mCollapsed(true), + mParent(NULL), + mTotalTimeCounter(0), + mCountAverage(0), + mCallAverage(0), + mNeedsSorting(false) +{ + info_list_t& frame_state_list = getFrameStateList(); + mFrameStateIndex = frame_state_list.size(); + getFrameStateList().push_back(FrameState(this)); + + mCountHistory = new U32[HISTORY_NUM]; + memset(mCountHistory, 0, sizeof(U32) * HISTORY_NUM); + mCallHistory = new U32[HISTORY_NUM]; + memset(mCallHistory, 0, sizeof(U32) * HISTORY_NUM); +} + +LLFastTimer::NamedTimer::~NamedTimer() +{ + delete[] mCountHistory; + delete[] mCallHistory; +} + +std::string LLFastTimer::NamedTimer::getToolTip(S32 history_idx) +{ + if (history_idx < 0) + { + // by default, show average number of calls + return llformat("%s (%d calls)", getName().c_str(), (S32)getCallAverage()); + } + else + { + return llformat("%s (%d calls)", getName().c_str(), (S32)getHistoricalCalls(history_idx)); + } +} + +void LLFastTimer::NamedTimer::setParent(NamedTimer* parent) +{ + llassert_always(parent != this); + llassert_always(parent != NULL); + + if (mParent) + { + // subtract our accumulated from previous parent + for (S32 i = 0; i < HISTORY_NUM; i++) + { + mParent->mCountHistory[i] -= mCountHistory[i]; + } + + // subtract average timing from previous parent + mParent->mCountAverage -= mCountAverage; + + std::vector& children = mParent->getChildren(); + std::vector::iterator found_it = std::find(children.begin(), children.end(), this); + if (found_it != children.end()) + { + children.erase(found_it); + } + } + + mParent = parent; + if (parent) + { + getFrameState().mParent = &parent->getFrameState(); + parent->getChildren().push_back(this); + parent->mNeedsSorting = true; + } +} + +S32 LLFastTimer::NamedTimer::getDepth() +{ + S32 depth = 0; + NamedTimer* timerp = mParent; + while(timerp) + { + depth++; + timerp = timerp->mParent; + } + return depth; +} + +// static +void LLFastTimer::NamedTimer::processTimes() +{ + if (sCurFrameIndex < 0) return; + + buildHierarchy(); + accumulateTimings(); +} + +// sort timer info structs by depth first traversal order +struct SortTimersDFS +{ + bool operator()(const LLFastTimer::FrameState& i1, const LLFastTimer::FrameState& i2) + { + return i1.mTimer->getFrameStateIndex() < i2.mTimer->getFrameStateIndex(); + } +}; + +// sort child timers by name +struct SortTimerByName +{ + bool operator()(const LLFastTimer::NamedTimer* i1, const LLFastTimer::NamedTimer* i2) + { + return i1->getName() < i2->getName(); + } +}; + +//static +void LLFastTimer::NamedTimer::buildHierarchy() +{ + if (sCurFrameIndex < 0 ) return; + + // set up initial tree + for (instance_iter it = NamedTimer::beginInstances(); + it != endInstances(); + ++it) + { + NamedTimer& timer = *it; + if (&timer == NamedTimerFactory::instance().getRootTimer()) continue; + + // bootstrap tree construction by attaching to last timer to be on stack + // when this timer was called + if (timer.getFrameState().mLastCaller && timer.mParent == NamedTimerFactory::instance().getRootTimer()) + { + timer.setParent(timer.getFrameState().mLastCaller->mTimer); + // no need to push up tree on first use, flag can be set spuriously + timer.getFrameState().mMoveUpTree = false; + } + } + + // bump timers up tree if they've been flagged as being in the wrong place + // do this in a bottom up order to promote descendants first before promoting ancestors + // this preserves partial order derived from current frame's observations + for(timer_tree_bottom_up_iterator_t it = begin_timer_tree_bottom_up(*NamedTimerFactory::instance().getRootTimer()); + it != end_timer_tree_bottom_up(); + ++it) + { + NamedTimer* timerp = *it; + // skip root timer + if (timerp == NamedTimerFactory::instance().getRootTimer()) continue; + + if (timerp->getFrameState().mMoveUpTree) + { + // since ancestors have already been visited, reparenting won't affect tree traversal + //step up tree, bringing our descendants with us + //llinfos << "Moving " << timerp->getName() << " from child of " << timerp->getParent()->getName() << + // " to child of " << timerp->getParent()->getParent()->getName() << llendl; + timerp->setParent(timerp->getParent()->getParent()); + timerp->getFrameState().mMoveUpTree = false; + + // don't bubble up any ancestors until descendants are done bubbling up + it.skipAncestors(); + } + } + + // sort timers by time last called, so call graph makes sense + for(timer_tree_dfs_iterator_t it = begin_timer_tree(*NamedTimerFactory::instance().getRootTimer()); + it != end_timer_tree(); + ++it) + { + NamedTimer* timerp = (*it); + if (timerp->mNeedsSorting) + { + std::sort(timerp->getChildren().begin(), timerp->getChildren().end(), SortTimerByName()); + } + timerp->mNeedsSorting = false; + } +} + +//static +void LLFastTimer::NamedTimer::accumulateTimings() +{ + U32 cur_time = get_cpu_clock_count_32(); + + // walk up stack of active timers and accumulate current time while leaving timing structures active + LLFastTimer* cur_timer = sCurTimerData.mCurTimer; + // root defined by parent pointing to self + CurTimerData* cur_data = &sCurTimerData; + while(cur_timer->mLastTimerData.mCurTimer != cur_timer) + { + U32 cumulative_time_delta = cur_time - cur_timer->mStartTime; + U32 self_time_delta = cumulative_time_delta - cur_data->mChildTime; + cur_data->mChildTime = 0; + cur_timer->mFrameState->mSelfTimeCounter += self_time_delta; + cur_timer->mStartTime = cur_time; + + cur_data = &cur_timer->mLastTimerData; + cur_data->mChildTime += cumulative_time_delta; + + cur_timer = cur_timer->mLastTimerData.mCurTimer; + } + + // traverse tree in DFS post order, or bottom up + for(timer_tree_bottom_up_iterator_t it = begin_timer_tree_bottom_up(*NamedTimerFactory::instance().getActiveRootTimer()); + it != end_timer_tree_bottom_up(); + ++it) + { + NamedTimer* timerp = (*it); + timerp->mTotalTimeCounter = timerp->getFrameState().mSelfTimeCounter; + for (child_const_iter child_it = timerp->beginChildren(); child_it != timerp->endChildren(); ++child_it) + { + timerp->mTotalTimeCounter += (*child_it)->mTotalTimeCounter; + } + + S32 cur_frame = sCurFrameIndex; + if (cur_frame >= 0) + { + // update timer history + int hidx = cur_frame % HISTORY_NUM; + + timerp->mCountHistory[hidx] = timerp->mTotalTimeCounter; + timerp->mCountAverage = (timerp->mCountAverage * cur_frame + timerp->mTotalTimeCounter) / (cur_frame+1); + timerp->mCallHistory[hidx] = timerp->getFrameState().mCalls; + timerp->mCallAverage = (timerp->mCallAverage * cur_frame + timerp->getFrameState().mCalls) / (cur_frame+1); + } + } +} + +// static +void LLFastTimer::NamedTimer::resetFrame() +{ + if (sLog) + { //output current frame counts to performance log + F64 iclock_freq = 1000.0 / countsPerSecond(); // good place to calculate clock frequency + + F64 total_time = 0; + LLSD sd; + + for (NamedTimer::instance_iter it = NamedTimer::beginInstances(); + it != NamedTimer::endInstances(); + ++it) + { + NamedTimer& timer = *it; + FrameState& info = timer.getFrameState(); + sd[timer.getName()]["Time"] = (LLSD::Real) (info.mSelfTimeCounter*iclock_freq); + sd[timer.getName()]["Calls"] = (LLSD::Integer) info.mCalls; + + // computing total time here because getting the root timer's getCountHistory + // doesn't work correctly on the first frame + total_time = total_time + info.mSelfTimeCounter * iclock_freq; + } + + sd["Total"]["Time"] = (LLSD::Real) total_time; + sd["Total"]["Calls"] = (LLSD::Integer) 1; + + { + LLMutexLock lock(sLogLock); + sLogQueue.push(sd); + } + } + + + // tag timers by position in depth first traversal of tree + S32 index = 0; + for(timer_tree_dfs_iterator_t it = begin_timer_tree(*NamedTimerFactory::instance().getRootTimer()); + it != end_timer_tree(); + ++it) + { + NamedTimer* timerp = (*it); + + timerp->mFrameStateIndex = index; + index++; + + llassert_always(timerp->mFrameStateIndex < (S32)getFrameStateList().size()); + } + + // sort timers by dfs traversal order to improve cache coherency + std::sort(getFrameStateList().begin(), getFrameStateList().end(), SortTimersDFS()); + + // update pointers into framestatelist now that we've sorted it + DeclareTimer::updateCachedPointers(); + + // reset for next frame + for (NamedTimer::instance_iter it = NamedTimer::beginInstances(); + it != NamedTimer::endInstances(); + ++it) + { + NamedTimer& timer = *it; + + FrameState& info = timer.getFrameState(); + info.mSelfTimeCounter = 0; + info.mCalls = 0; + info.mLastCaller = NULL; + info.mMoveUpTree = false; + // update parent pointer in timer state struct + if (timer.mParent) + { + info.mParent = &timer.mParent->getFrameState(); + } + } + + //sTimerCycles = 0; + //sTimerCalls = 0; +} + +//static +void LLFastTimer::NamedTimer::reset() +{ + resetFrame(); // reset frame data + + // walk up stack of active timers and reset start times to current time + // effectively zeroing out any accumulated time + U32 cur_time = get_cpu_clock_count_32(); + + // root defined by parent pointing to self + CurTimerData* cur_data = &sCurTimerData; + LLFastTimer* cur_timer = cur_data->mCurTimer; + while(cur_timer->mLastTimerData.mCurTimer != cur_timer) + { + cur_timer->mStartTime = cur_time; + cur_data->mChildTime = 0; + + cur_data = &cur_timer->mLastTimerData; + cur_timer = cur_data->mCurTimer; + } + + // reset all history + for (NamedTimer::instance_iter it = NamedTimer::beginInstances(); + it != NamedTimer::endInstances(); + ++it) + { + NamedTimer& timer = *it; + if (&timer != NamedTimerFactory::instance().getRootTimer()) + { + timer.setParent(NamedTimerFactory::instance().getRootTimer()); + } + + timer.mCountAverage = 0; + timer.mCallAverage = 0; + memset(timer.mCountHistory, 0, sizeof(U32) * HISTORY_NUM); + memset(timer.mCallHistory, 0, sizeof(U32) * HISTORY_NUM); + } + + sLastFrameIndex = 0; + sCurFrameIndex = 0; +} + +//static +LLFastTimer::info_list_t& LLFastTimer::getFrameStateList() +{ + if (!sTimerInfos) + { + sTimerInfos = new info_list_t(); + } + return *sTimerInfos; +} + + +U32 LLFastTimer::NamedTimer::getHistoricalCount(S32 history_index) const +{ + S32 history_idx = (getLastFrameIndex() + history_index) % LLFastTimer::NamedTimer::HISTORY_NUM; + return mCountHistory[history_idx]; +} + +U32 LLFastTimer::NamedTimer::getHistoricalCalls(S32 history_index ) const +{ + S32 history_idx = (getLastFrameIndex() + history_index) % LLFastTimer::NamedTimer::HISTORY_NUM; + return mCallHistory[history_idx]; +} + +LLFastTimer::FrameState& LLFastTimer::NamedTimer::getFrameState() const +{ + llassert_always(mFrameStateIndex >= 0); + if (this == NamedTimerFactory::instance().getActiveRootTimer()) + { + return NamedTimerFactory::instance().getRootFrameState(); + } + return getFrameStateList()[mFrameStateIndex]; +} + +// static +LLFastTimer::NamedTimer& LLFastTimer::NamedTimer::getRootNamedTimer() +{ + return *NamedTimerFactory::instance().getActiveRootTimer(); +} + +std::vector::const_iterator LLFastTimer::NamedTimer::beginChildren() +{ + return mChildren.begin(); +} + +std::vector::const_iterator LLFastTimer::NamedTimer::endChildren() +{ + return mChildren.end(); +} + +std::vector& LLFastTimer::NamedTimer::getChildren() +{ + return mChildren; +} + +//static +void LLFastTimer::nextFrame() +{ + countsPerSecond(); // good place to calculate clock frequency + U64 frame_time = get_cpu_clock_count_64(); + if ((frame_time - sLastFrameTime) >> 8 > 0xffffffff) + { + llinfos << "Slow frame, fast timers inaccurate" << llendl; + } + + if (sPauseHistory) + { + sResetHistory = true; + } + else if (sResetHistory) + { + sLastFrameIndex = 0; + sCurFrameIndex = 0; + sResetHistory = false; + } + else // not paused + { + NamedTimer::processTimes(); + sLastFrameIndex = sCurFrameIndex++; + } + + // get ready for next frame + NamedTimer::resetFrame(); + sLastFrameTime = frame_time; +} + +//static +void LLFastTimer::dumpCurTimes() +{ + // accumulate timings, etc. + NamedTimer::processTimes(); + + F64 clock_freq = (F64)countsPerSecond(); + F64 iclock_freq = 1000.0 / clock_freq; // clock_ticks -> milliseconds + + // walk over timers in depth order and output timings + for(timer_tree_dfs_iterator_t it = begin_timer_tree(*NamedTimerFactory::instance().getRootTimer()); + it != end_timer_tree(); + ++it) + { + NamedTimer* timerp = (*it); + F64 total_time_ms = ((F64)timerp->getHistoricalCount(0) * iclock_freq); + // Don't bother with really brief times, keep output concise + if (total_time_ms < 0.1) continue; + + std::ostringstream out_str; + for (S32 i = 0; i < timerp->getDepth(); i++) + { + out_str << "\t"; + } + + + out_str << timerp->getName() << " " + << std::setprecision(3) << total_time_ms << " ms, " + << timerp->getHistoricalCalls(0) << " calls"; + + llinfos << out_str.str() << llendl; + } +} + +//static +void LLFastTimer::reset() +{ + NamedTimer::reset(); +} + + +//static +void LLFastTimer::writeLog(std::ostream& os) +{ + while (!sLogQueue.empty()) + { + LLSD& sd = sLogQueue.front(); + LLSDSerialize::toXML(sd, os); + LLMutexLock lock(sLogLock); + sLogQueue.pop(); + } +} + +//static +const LLFastTimer::NamedTimer* LLFastTimer::getTimerByName(const std::string& name) +{ + return NamedTimerFactory::instance().getTimerByName(name); +} + +LLFastTimer::LLFastTimer(LLFastTimer::FrameState* state) +: mFrameState(state) +{ + U32 start_time = get_cpu_clock_count_32(); + mStartTime = start_time; + mFrameState->mActiveCount++; + LLFastTimer::sCurTimerData.mCurTimer = this; + LLFastTimer::sCurTimerData.mFrameState = mFrameState; + LLFastTimer::sCurTimerData.mChildTime = 0; + mLastTimerData = LLFastTimer::sCurTimerData; +} + + +////////////////////////////////////////////////////////////////////////////// diff --git a/indra/llcommon/llfasttimer_class.h b/indra/llcommon/llfasttimer_class.h index 93d2d0494d..4cb0c2d04e 100644 --- a/indra/llcommon/llfasttimer_class.h +++ b/indra/llcommon/llfasttimer_class.h @@ -39,6 +39,12 @@ #define TIME_FAST_TIMERS 0 +#if LL_WINDOWS +#define LL_INLINE __forceinline +#else +#define LL_INLINE +#endif // LL_WINDOWS + class LLMutex; #include @@ -47,7 +53,6 @@ class LLMutex; class LL_COMMON_API LLFastTimer { public: - class NamedTimer; struct LL_COMMON_API FrameState @@ -163,11 +168,11 @@ public: : mFrameState(timer.mFrameState) { #if TIME_FAST_TIMERS - U64 timer_start = get_cpu_clock_count_64(); + U64 timer_start = getCPUClockCount64(); #endif #if FAST_TIMER_ON LLFastTimer::FrameState* frame_state = mFrameState; - mStartTime = get_cpu_clock_count_32(); + mStartTime = getCPUClockCount32(); frame_state->mActiveCount++; frame_state->mCalls++; @@ -181,7 +186,7 @@ public: cur_timer_data->mChildTime = 0; #endif #if TIME_FAST_TIMERS - U64 timer_end = get_cpu_clock_count_64(); + U64 timer_end = getCPUClockCount64(); sTimerCycles += timer_end - timer_start; #endif } @@ -189,11 +194,11 @@ public: LL_INLINE ~LLFastTimer() { #if TIME_FAST_TIMERS - U64 timer_start = get_cpu_clock_count_64(); + U64 timer_start = getCPUClockCount64(); #endif #if FAST_TIMER_ON LLFastTimer::FrameState* frame_state = mFrameState; - U32 total_time = get_cpu_clock_count_32() - mStartTime; + U32 total_time = getCPUClockCount32() - mStartTime; frame_state->mSelfTimeCounter += total_time - LLFastTimer::sCurTimerData.mChildTime; frame_state->mActiveCount--; @@ -208,7 +213,7 @@ public: LLFastTimer::sCurTimerData = mLastTimerData; #endif #if TIME_FAST_TIMERS - U64 timer_end = get_cpu_clock_count_64(); + U64 timer_end = getCPUClockCount64(); sTimerCycles += timer_end - timer_start; sTimerCalls++; #endif @@ -254,11 +259,14 @@ public: static CurTimerData sCurTimerData; private: + static U32 getCPUClockCount32(); + static U64 getCPUClockCount64(); + static U64 sClockResolution; + static S32 sCurFrameIndex; static S32 sLastFrameIndex; static U64 sLastFrameTime; static info_list_t* sTimerInfos; - static U64 sClockResolution; U32 mStartTime; LLFastTimer::FrameState* mFrameState; -- cgit v1.2.3 From 3d0ff2585eb32c67d503452ce9f8d2198be823c8 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 25 Jan 2010 13:24:45 -0800 Subject: Final fix for fast timer reshuffle. --- indra/llcommon/llfasttimer.h | 25 +++++++++++-------------- indra/llcommon/llfasttimer_class.cpp | 10 +++++----- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index 0f3280023c..9f9e2ea945 100644 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -37,7 +37,6 @@ #include "llfasttimer_class.h" #if LL_WINDOWS -#define LL_INLINE __forceinline // // Windows implementation of CPU clock // @@ -53,21 +52,21 @@ //#undef _interlockedbittestandset //#undef _interlockedbittestandreset -//inline U32 get_cpu_clock_count_32() +//inline U32 LLFastTimer::getCPUClockCount32() //{ // U64 time_stamp = __rdtsc(); // return (U32)(time_stamp >> 8); //} // //// return full timer value, *not* shifted by 8 bits -//inline U64 get_cpu_clock_count_64() +//inline U64 LLFastTimer::getCPUClockCount64() //{ // return __rdtsc(); //} // shift off lower 8 bits for lower resolution but longer term timing // on 1Ghz machine, a 32-bit word will hold ~1000 seconds of timing -inline U32 get_cpu_clock_count_32() +inline U32 LLFastTimer::getCPUClockCount32() { U32 ret_val; __asm @@ -83,7 +82,7 @@ inline U32 get_cpu_clock_count_32() } // return full timer value, *not* shifted by 8 bits -inline U64 get_cpu_clock_count_64() +inline U64 LLFastTimer::getCPUClockCount64() { U64 ret_val; __asm @@ -97,8 +96,6 @@ inline U64 get_cpu_clock_count_64() } return ret_val; } -#else -#define LL_INLINE #endif @@ -111,7 +108,7 @@ inline U64 get_cpu_clock_count_64() // to synchronize this value between cores at kernel start. It should not be affected // by CPU frequency. If not available use the REALTIME clock, but this may be affected by // NTP adjustments or other user activity affecting the system time. -inline U64 get_cpu_clock_count_64() +inline U64 LLFastTimer::getCPUClockCount64() { struct timespec tp; @@ -123,9 +120,9 @@ inline U64 get_cpu_clock_count_64() return (tp.tv_sec*LLFastTimer::sClockResolution)+tp.tv_nsec; } -inline U32 get_cpu_clock_count_32() +inline U32 LLFastTimer::getCPUClockCount32() { - return (U32)get_cpu_clock_count_64(); + return (U32)LLFastTimer::getCPUClockCount64(); } #endif // (LL_LINUX || LL_SOLARIS)) @@ -133,14 +130,14 @@ inline U32 get_cpu_clock_count_32() #if (LL_DARWIN) && (defined(__i386__) || defined(__amd64__)) // // Mac x86 implementation of CPU clock -inline U32 get_cpu_clock_count_32() +inline U32 LLFastTimer::getCPUClockCount32() { U64 x; __asm__ volatile (".byte 0x0f, 0x31": "=A"(x)); return (U32)x >> 8; } -inline U32 get_cpu_clock_count_64() +inline U32 LLFastTimer::getCPUClockCount64() { U64 x; __asm__ volatile (".byte 0x0f, 0x31": "=A"(x)); @@ -155,12 +152,12 @@ inline U32 get_cpu_clock_count_64() // // Just use gettimeofday implementation for now -inline U32 get_cpu_clock_count_32() +inline U32 LLFastTimer::getCPUClockCount32() { return (U32)get_clock_count(); } -inline U32 get_cpu_clock_count_64() +inline U32 LLFastTimer::getCPUClockCount64() { return get_clock_count(); } diff --git a/indra/llcommon/llfasttimer_class.cpp b/indra/llcommon/llfasttimer_class.cpp index 6dbd90f9fa..abcaee673e 100644 --- a/indra/llcommon/llfasttimer_class.cpp +++ b/indra/llcommon/llfasttimer_class.cpp @@ -56,7 +56,7 @@ S32 LLFastTimer::sCurFrameIndex = -1; S32 LLFastTimer::sLastFrameIndex = -1; -U64 LLFastTimer::sLastFrameTime = get_cpu_clock_count_64(); +U64 LLFastTimer::sLastFrameTime = LLFastTimer::getCPUClockCount64(); bool LLFastTimer::sPauseHistory = 0; bool LLFastTimer::sResetHistory = 0; LLFastTimer::CurTimerData LLFastTimer::sCurTimerData; @@ -426,7 +426,7 @@ void LLFastTimer::NamedTimer::buildHierarchy() //static void LLFastTimer::NamedTimer::accumulateTimings() { - U32 cur_time = get_cpu_clock_count_32(); + U32 cur_time = getCPUClockCount32(); // walk up stack of active timers and accumulate current time while leaving timing structures active LLFastTimer* cur_timer = sCurTimerData.mCurTimer; @@ -556,7 +556,7 @@ void LLFastTimer::NamedTimer::reset() // walk up stack of active timers and reset start times to current time // effectively zeroing out any accumulated time - U32 cur_time = get_cpu_clock_count_32(); + U32 cur_time = getCPUClockCount32(); // root defined by parent pointing to self CurTimerData* cur_data = &sCurTimerData; @@ -649,7 +649,7 @@ std::vector& LLFastTimer::NamedTimer::getChildren() void LLFastTimer::nextFrame() { countsPerSecond(); // good place to calculate clock frequency - U64 frame_time = get_cpu_clock_count_64(); + U64 frame_time = getCPUClockCount64(); if ((frame_time - sLastFrameTime) >> 8 > 0xffffffff) { llinfos << "Slow frame, fast timers inaccurate" << llendl; @@ -738,7 +738,7 @@ const LLFastTimer::NamedTimer* LLFastTimer::getTimerByName(const std::string& na LLFastTimer::LLFastTimer(LLFastTimer::FrameState* state) : mFrameState(state) { - U32 start_time = get_cpu_clock_count_32(); + U32 start_time = getCPUClockCount32(); mStartTime = start_time; mFrameState->mActiveCount++; LLFastTimer::sCurTimerData.mCurTimer = this; -- cgit v1.2.3 From 18bdeb3d0e5ef4e5b014b41a8003569061e00910 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 25 Jan 2010 13:32:49 -0800 Subject: DEV-45468 'SNOW-108: Fast timers are broken / badly-scaled on linux' ready to merge. legacy coding policy fix-up. --- indra/llcommon/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 05e45d6d8a..9ead183a9e 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -250,7 +250,7 @@ list(APPEND llcommon_SOURCE_FILES ${llcommon_HEADER_FILES}) if(LLCOMMON_LINK_SHARED) add_library (llcommon SHARED ${llcommon_SOURCE_FILES}) - ll_stage_sharedlib(llcommon) + ll_stage_sharedlib(llcommon) else(LLCOMMON_LINK_SHARED) add_library (llcommon ${llcommon_SOURCE_FILES}) endif(LLCOMMON_LINK_SHARED) -- cgit v1.2.3 From 2375afc4283e47a50516c1e003a6f699b0a2cfe1 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 25 Jan 2010 13:49:13 -0800 Subject: Gosh, the mac prototypes for get_cpu_clock_count_64 have always been wrong, but the compiler didn't start caring until I made these proper member functions. fixed. --- indra/llcommon/llfasttimer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index 9f9e2ea945..32f3561616 100644 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -137,7 +137,7 @@ inline U32 LLFastTimer::getCPUClockCount32() return (U32)x >> 8; } -inline U32 LLFastTimer::getCPUClockCount64() +inline U64 LLFastTimer::getCPUClockCount64() { U64 x; __asm__ volatile (".byte 0x0f, 0x31": "=A"(x)); @@ -157,7 +157,7 @@ inline U32 LLFastTimer::getCPUClockCount32() return (U32)get_clock_count(); } -inline U32 LLFastTimer::getCPUClockCount64() +inline U64 LLFastTimer::getCPUClockCount64() { return get_clock_count(); } -- cgit v1.2.3 From 88108c0ae85c541be08a6b9313a2606c5bfd2d92 Mon Sep 17 00:00:00 2001 From: Eli Linden Date: Mon, 25 Jan 2010 14:23:47 -0800 Subject: test change. --- indra/newview/skins/default/xui/en/floater_aaa.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/floater_aaa.xml b/indra/newview/skins/default/xui/en/floater_aaa.xml index cb9f943949..443be58c97 100644 --- a/indra/newview/skins/default/xui/en/floater_aaa.xml +++ b/indra/newview/skins/default/xui/en/floater_aaa.xml @@ -19,7 +19,7 @@ width="320"> Nudge 1 This string CHANGE is extracted. - Just a test. + Just a test. change here. Date: Mon, 25 Jan 2010 14:25:58 -0800 Subject: We already have a LL_FORCE_INLINE in llpreprocessor.h, don't re-invent it for llfasttimers.h. Also define LL_LIKELY/LL_UNLIKELY with a warning about its micro-optimizey nature, and use it to annotate llasserts (i.e. make llassert() lower-overhead and thus more attractive, even in inner-ish loops.) --- indra/llcommon/llerrorlegacy.h | 4 ++-- indra/llcommon/llfasttimer_class.h | 11 ++--------- indra/llcommon/llpreprocessor.h | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/indra/llcommon/llerrorlegacy.h b/indra/llcommon/llerrorlegacy.h index 9920921a58..476d75380f 100644 --- a/indra/llcommon/llerrorlegacy.h +++ b/indra/llcommon/llerrorlegacy.h @@ -34,7 +34,7 @@ #ifndef LL_LLERRORLEGACY_H #define LL_LLERRORLEGACY_H - +#include "llpreprocessor.h" /* LEGACY -- DO NOT USE THIS STUFF ANYMORE @@ -107,7 +107,7 @@ const int LL_ERR_PRICE_MISMATCH = -23018; #define llwarning(msg, num) llwarns << "Warning # " << num << ": " << msg << llendl; -#define llassert_always(func) if (!(func)) llerrs << "ASSERT (" << #func << ")" << llendl; +#define llassert_always(func) if (LL_UNLIKELY(!(func))) llerrs << "ASSERT (" << #func << ")" << llendl; #ifdef SHOW_ASSERT #define llassert(func) llassert_always(func) diff --git a/indra/llcommon/llfasttimer_class.h b/indra/llcommon/llfasttimer_class.h index 4cb0c2d04e..ddb1a74793 100644 --- a/indra/llcommon/llfasttimer_class.h +++ b/indra/llcommon/llfasttimer_class.h @@ -38,13 +38,6 @@ #define FAST_TIMER_ON 1 #define TIME_FAST_TIMERS 0 - -#if LL_WINDOWS -#define LL_INLINE __forceinline -#else -#define LL_INLINE -#endif // LL_WINDOWS - class LLMutex; #include @@ -164,7 +157,7 @@ public: public: LLFastTimer(LLFastTimer::FrameState* state); - LL_INLINE LLFastTimer(LLFastTimer::DeclareTimer& timer) + LL_FORCE_INLINE LLFastTimer(LLFastTimer::DeclareTimer& timer) : mFrameState(timer.mFrameState) { #if TIME_FAST_TIMERS @@ -191,7 +184,7 @@ public: #endif } - LL_INLINE ~LLFastTimer() + LL_FORCE_INLINE ~LLFastTimer() { #if TIME_FAST_TIMERS U64 timer_start = getCPUClockCount64(); diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h index 5eefa6a16b..1c1503ca7b 100644 --- a/indra/llcommon/llpreprocessor.h +++ b/indra/llcommon/llpreprocessor.h @@ -55,13 +55,28 @@ #define LL_BIG_ENDIAN 1 #endif + // Per-compiler switches + #ifdef __GNUC__ #define LL_FORCE_INLINE inline __attribute__((always_inline)) #else #define LL_FORCE_INLINE __forceinline #endif +// Mark-up expressions with branch prediction hints. Do NOT use +// this with reckless abandon - it's an obfuscating micro-optimization +// outside of inner loops or other places where you are OVERWHELMINGLY +// sure which way an expression almost-always evaluates. +#if __GNUC__ >= 3 +# define LL_LIKELY(EXPR) __builtin_expect (!!(EXPR), true) +# define LL_UNLIKELY(EXPR) __builtin_expect (!!(EXPR), false) +#else +# define LL_LIKELY(EXPR) (EXPR) +# define LL_UNLIKELY(EXPR) (EXPR) +#endif + + // Figure out differences between compilers #if defined(__GNUC__) #define GCC_VERSION (__GNUC__ * 10000 \ -- cgit v1.2.3 From b897406e0591b82c685a76ac03bfe219e91ea96a Mon Sep 17 00:00:00 2001 From: Ramzi Linden Date: Mon, 25 Jan 2010 14:45:59 -0800 Subject: harmless test commit to work with eli. --- indra/newview/skins/default/xui/en/floater_aaa.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/floater_aaa.xml b/indra/newview/skins/default/xui/en/floater_aaa.xml index cb9f943949..b072b57ce7 100644 --- a/indra/newview/skins/default/xui/en/floater_aaa.xml +++ b/indra/newview/skins/default/xui/en/floater_aaa.xml @@ -18,7 +18,7 @@ single_instance="true" width="320"> Nudge 1 - This string CHANGE is extracted. + This string CHANGE2 is extracted. Just a test. Date: Mon, 25 Jan 2010 16:14:55 -0800 Subject: test change. --- indra/newview/skins/default/xui/en/floater_aaa.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/floater_aaa.xml b/indra/newview/skins/default/xui/en/floater_aaa.xml index 55196d5b65..b4d2dabc5c 100644 --- a/indra/newview/skins/default/xui/en/floater_aaa.xml +++ b/indra/newview/skins/default/xui/en/floater_aaa.xml @@ -19,7 +19,7 @@ width="320"> Nudge 1 This string CHANGE2 is extracted. - Just a test. change here. + Just a test. change here. more change. Date: Mon, 25 Jan 2010 16:35:50 -0800 Subject: EXT-4388 Crash in octree line segment intersection code a more complete fix and some sanity to prevent recurrance of a similar problem. reviewed by bao! --- indra/llrender/llimagegl.cpp | 43 +++++++++++++++++++++++++------------------ indra/llrender/llimagegl.h | 2 ++ 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index cd493481d5..46478ba3c9 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -436,6 +436,8 @@ void LLImageGL::init(BOOL usemipmaps) mLastBindTime = 0.f; mPickMask = NULL; + mPickMaskWidth = 0; + mPickMaskHeight = 0; mUseMipMaps = usemipmaps; mHasExplicitFormat = FALSE; mAutoGenMips = FALSE; @@ -527,7 +529,12 @@ void LLImageGL::setSize(S32 width, S32 height, S32 ncomponents) // llwarns << "Setting Size of LLImageGL with existing mTexName = " << mTexName << llendl; destroyGLTexture(); } - + + // pickmask validity depends on old image size, delete it + delete [] mPickMask; + mPickMask = NULL; + mPickMaskWidth = mPickMaskHeight = 0; + mWidth = width; mHeight = height; mComponents = ncomponents; @@ -1675,12 +1682,14 @@ void LLImageGL::updatePickMask(S32 width, S32 height, const U8* data_in) return ; } + delete [] mPickMask; + mPickMask = NULL; + mPickMaskWidth = mPickMaskHeight = 0; + if (mFormatType != GL_UNSIGNED_BYTE || mFormatPrimary != GL_RGBA) { //cannot generate a pick mask for this texture - delete [] mPickMask; - mPickMask = NULL; return; } @@ -1688,11 +1697,10 @@ void LLImageGL::updatePickMask(S32 width, S32 height, const U8* data_in) U32 pick_height = height/2; U32 size = llmax(pick_width, (U32) 1) * llmax(pick_height, (U32) 1); - size = size/8 + 1; - - delete[] mPickMask; mPickMask = new U8[size]; + mPickMaskWidth = pick_width; + mPickMaskHeight = pick_height; memset(mPickMask, 0, sizeof(U8) * size); @@ -1727,35 +1735,34 @@ BOOL LLImageGL::getMask(const LLVector2 &tc) if (mPickMask) { - S32 width = getWidth()/2; - S32 height = getHeight()/2; - F32 u = tc.mV[0] - floorf(tc.mV[0]); F32 v = tc.mV[1] - floorf(tc.mV[1]); - if (u < 0.f || u > 1.f || - v < 0.f || v > 1.f) + if (LL_UNLIKELY(u < 0.f || u > 1.f || + v < 0.f || v > 1.f)) { LL_WARNS_ONCE("render") << "Ugh, u/v out of range in image mask pick" << LL_ENDL; u = v = 0.f; llassert(false); } + + llassert(mPickMaskWidth > 0 && mPickMaskHeight > 0); - S32 x = (S32)(u * width); - S32 y = (S32)(v * height); + S32 x = (S32)(u * mPickMaskWidth); + S32 y = (S32)(v * mPickMaskHeight); - if (x >= width) + if (LL_UNLIKELY(x >= mPickMaskWidth)) { LL_WARNS_ONCE("render") << "Ooh, width overrun on pick mask read, that coulda been bad." << LL_ENDL; - x = llmax(0, width-1); + x = llmax(0, mPickMaskWidth-1); } - if (y >= height) + if (LL_UNLIKELY(y >= mPickMaskHeight)) { LL_WARNS_ONCE("render") << "Ooh, height overrun on pick mask read, that woulda been bad." << LL_ENDL; - y = llmax(0, height-1); + y = llmax(0, mPickMaskHeight-1); } - S32 idx = y*width+x; + S32 idx = y*mPickMaskWidth+x; S32 offset = idx%8; res = mPickMask[idx/8] & (1 << offset) ? TRUE : FALSE; diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h index facfb7bd62..f0870c3fc4 100644 --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -193,6 +193,8 @@ public: private: LLPointer mSaveData; // used for destroyGL/restoreGL U8* mPickMask; //downsampled bitmap approximation of alpha channel. NULL if no alpha channel + U16 mPickMaskWidth; + U16 mPickMaskHeight; S8 mUseMipMaps; S8 mHasExplicitFormat; // If false (default), GL format is f(mComponents) S8 mAutoGenMips; -- cgit v1.2.3 From fbf605ea321ee29afad63a4afe47f65584d67eea Mon Sep 17 00:00:00 2001 From: Palmer Date: Mon, 25 Jan 2010 17:13:35 -0800 Subject: EXT-4712 - Upgraded some 7000 series cards and 9000 series cards from class 2 to 3 for more lights. No code changed. --- indra/newview/gpu_table.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt index cc8f6780e3..887dab66d1 100644 --- a/indra/newview/gpu_table.txt +++ b/indra/newview/gpu_table.txt @@ -192,9 +192,9 @@ NVIDIA GeForce 7100 .*NVIDIA.*GeForce 71.* 0 1 NVIDIA GeForce 7200 .*NVIDIA.*GeForce 72.* 1 1 NVIDIA GeForce 7300 .*NVIDIA.*GeForce 73.* 1 1 NVIDIA GeForce 7500 .*NVIDIA.*GeForce 75.* 1 1 -NVIDIA GeForce 7600 .*NVIDIA.*GeForce 76.* 2 1 -NVIDIA GeForce 7800 .*NVIDIA.*GeForce.*78.* 2 1 -NVIDIA GeForce 7900 .*NVIDIA.*GeForce.*79.* 2 1 +NVIDIA GeForce 7600 .*NVIDIA.*GeForce 76.* 3 1 +NVIDIA GeForce 7800 .*NVIDIA.*GeForce.*78.* 3 1 +NVIDIA GeForce 7900 .*NVIDIA.*GeForce.*79.* 3 1 NVIDIA GeForce 8100 .*NVIDIA.*GeForce 81.* 1 1 NVIDIA GeForce 8200 .*NVIDIA.*GeForce 82.* 1 1 NVIDIA GeForce 8300 .*NVIDIA.*GeForce 83.* 1 1 @@ -207,8 +207,8 @@ NVIDIA GeForce 8800 .*NVIDIA.*GeForce 88.* 3 1 NVIDIA GeForce 9300M .*NVIDIA.*GeForce 9300M.* 1 1 NVIDIA GeForce 9400M .*NVIDIA.*GeForce 9400M.* 1 1 NVIDIA GeForce 9500M .*NVIDIA.*GeForce 9500M.* 2 1 -NVIDIA GeForce 9600M .*NVIDIA.*GeForce 9600M.* 2 1 -NVIDIA GeForce 9700M .*NVIDIA.*GeForce 9700M.* 2 1 +NVIDIA GeForce 9600M .*NVIDIA.*GeForce 9600M.* 3 1 +NVIDIA GeForce 9700M .*NVIDIA.*GeForce 9700M.* 3 1 NVIDIA GeForce 9300 .*NVIDIA.*GeForce 93.* 1 1 NVIDIA GeForce 9400 .*GeForce 94.* 1 1 NVIDIA GeForce 9500 .*NVIDIA.*GeForce 95.* 2 1 -- cgit v1.2.3 From cd790bfd54733fe2d14dc501d99b826d968e1252 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Tue, 26 Jan 2010 10:45:53 +0200 Subject: Update for low bug EXT-4306 - Landmark name is shown with prefix in the group notice attachment. --HG-- branch : product-engine --- indra/newview/llviewerinventory.h | 2 +- indra/newview/llviewermessage.cpp | 27 ++++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 917b8747ea..7f3f019b07 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -58,7 +58,6 @@ public: protected: ~LLViewerInventoryItem( void ); // ref counted BOOL extractSortFieldAndDisplayName(S32* sortField, std::string* displayName) const { return extractSortFieldAndDisplayName(mName, sortField, displayName); } - static char getSeparator() { return '@'; } mutable std::string mDisplayName; public: @@ -67,6 +66,7 @@ public: virtual const std::string& getName() const; virtual const std::string& getDisplayName() const; static std::string getDisplayName(const std::string& name); + static char getSeparator() { return '@'; } virtual S32 getSortField() const; virtual void setSortField(S32 sortField); virtual void rename(const std::string& new_name); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 0358efc0af..1d3ac3fb0f 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1436,6 +1436,31 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const return false; } +std::string get_display_name(const std::string& name) +{ + // We receive landmark name as \'@name\' where is a number + // LLViewerInventoryItem::getDisplayName will remove \'@ though we need the \' + // Lets save all chars preceding @ and insert them back after @ was removed + + std::string saved; + + if(std::string::npos != name.find(LLViewerInventoryItem::getSeparator())) + { + int n = 0; + while(!isdigit(name[n]) && LLViewerInventoryItem::getSeparator() != name[n]) + { + ++n; + } + saved = name.substr(0, n); + } + + std::string d_name = LLViewerInventoryItem::getDisplayName(name); + d_name.insert(0, saved); + LLStringUtil::trim(d_name); + + return d_name; +} + void inventory_offer_handler(LLOfferInfo* info) { //Until throttling is implmented, busy mode should reject inventory instead of silently @@ -1475,7 +1500,7 @@ void inventory_offer_handler(LLOfferInfo* info) if(LLAssetType::AT_LANDMARK == info->mType) { - msg = LLViewerInventoryItem::getDisplayName(msg); + msg = get_display_name(msg); } LLSD args; -- cgit v1.2.3 From 2bb3a24ca115832bdbfc5030f4ab553cab1e2ef8 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Tue, 26 Jan 2010 10:40:17 +0000 Subject: EXT-4716: Added new SLapps for Home web content. secondlife:///app/appearance - to open the My Appearance sidetray secondlife:///app/help/{TOPIC} - to display help for a given topic I've updated https://wiki.lindenlab.com/wiki/Viewer_2.0_SLapps --- indra/newview/llappearancemgr.cpp | 18 ++++++++++++++++++ indra/newview/llviewerhelp.cpp | 28 ++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 03180b6a9d..66e9b377d9 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -35,6 +35,7 @@ #include "llagent.h" #include "llagentwearables.h" #include "llappearancemgr.h" +#include "llcommandhandler.h" #include "llfloatercustomize.h" #include "llgesturemgr.h" #include "llinventorybridge.h" @@ -47,6 +48,23 @@ #include "llviewerregion.h" #include "llwearablelist.h" +// support for secondlife:///app/appearance SLapps +class LLAppearanceHandler : public LLCommandHandler +{ +public: + // requests will be throttled from a non-trusted browser + LLAppearanceHandler() : LLCommandHandler("appearance", UNTRUSTED_THROTTLE) {} + + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + { + // we currently don't support any commands after the "appearance" + // part of the SLapp - we just show the appearance side panel + LLSideTray::getInstance()->showPanel("sidepanel_appearance", LLSD()); + return true; + } +}; +LLAppearanceHandler gAppearanceHandler; + class LLWearInventoryCategoryCallback : public LLInventoryCallback { public: diff --git a/indra/newview/llviewerhelp.cpp b/indra/newview/llviewerhelp.cpp index 7c491ad154..b82538dacb 100644 --- a/indra/newview/llviewerhelp.cpp +++ b/indra/newview/llviewerhelp.cpp @@ -33,6 +33,7 @@ #include "llviewerprecompiledheaders.h" +#include "llcommandhandler.h" #include "llfloaterhelpbrowser.h" #include "llfloaterreg.h" #include "llfocusmgr.h" @@ -43,6 +44,33 @@ #include "llviewerhelputil.h" #include "llviewerhelp.h" +// support for secondlife:///app/help/{TOPIC} SLapps +class LLHelpHandler : public LLCommandHandler +{ +public: + // requests will be throttled from a non-trusted browser + LLHelpHandler() : LLCommandHandler("help", UNTRUSTED_THROTTLE) {} + + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + { + LLViewerHelp* vhelp = LLViewerHelp::getInstance(); + if (! vhelp) + { + return false; + } + + // get the requested help topic name, or use the fallback if none + std::string help_topic = vhelp->defaultTopic(); + if (params.size() >= 1) + { + help_topic = params[0].asString(); + } + + vhelp->showTopic(help_topic); + return true; + } +}; +LLHelpHandler gHelpHandler; ////////////////////////////// // implement LLHelp interface -- cgit v1.2.3 From aad8a1bd00ff12afdfdb7f508bc57a8ea1347b3b Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Tue, 26 Jan 2010 10:42:54 +0000 Subject: EXT-4716: Updated a comment. To say that we must explicitly support secondlife:///app/appearance/show --- indra/newview/llappearancemgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 66e9b377d9..1dec8c7bd8 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -57,8 +57,8 @@ public: bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) { - // we currently don't support any commands after the "appearance" - // part of the SLapp - we just show the appearance side panel + // support secondlife:///app/appearance/show, but for now we just + // make all secondlife:///app/appearance SLapps behave this way LLSideTray::getInstance()->showPanel("sidepanel_appearance", LLSD()); return true; } -- cgit v1.2.3 From 0a38adfd8af7d95627cd43e44901b9ae4e4e2d29 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Tue, 26 Jan 2010 13:09:26 +0000 Subject: EXT-4678: Don't hyperlink sim URLs in About window. Added support for specifying a black list of URLs on a per-widget basis. URLs on this black list will not be hyperlinked in the text widget. The About dialog adds the sim hostname to this black list. --- indra/llui/lltextbase.cpp | 46 ++++++++++++++++++++++++++++++++-------- indra/llui/lltextbase.h | 8 +++++++ indra/newview/llfloaterabout.cpp | 6 ++++++ 3 files changed, 51 insertions(+), 9 deletions(-) diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 47db990a37..ab0d9b2221 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1511,6 +1511,25 @@ void LLTextBase::setText(const LLStringExplicit &utf8str, const LLStyle::Params& onValueChange(0, getLength()); } +void LLTextBase::addBlackListUrl(const std::string &url) +{ + mBlackListUrls.push_back(url); +} + +bool LLTextBase::isBlackListUrl(const std::string &url) const +{ + std::vector::const_iterator it; + for (it = mBlackListUrls.begin(); it != mBlackListUrls.end(); ++it) + { + const std::string &blacklist_url = *it; + if (url.find(blacklist_url) != std::string::npos) + { + return true; + } + } + return false; +} + //virtual std::string LLTextBase::getText() const { @@ -1585,20 +1604,29 @@ void LLTextBase::appendText(const std::string &new_text, bool prepend_newline, c prepend_newline = false; } } - // output the styled Url - appendAndHighlightText(match.getLabel(), prepend_newline, part, link_params); - prepend_newline = false; - // set the tooltip for the Url label - if (! match.getTooltip().empty()) + // output the styled Url (unless we've been asked to suppress it) + if (isBlackListUrl(match.getUrl())) + { + std::string orig_url = text.substr(start, end-start); + appendAndHighlightText(orig_url, prepend_newline, part, style_params); + } + else { - segment_set_t::iterator it = getSegIterContaining(getLength()-1); - if (it != mSegments.end()) + appendAndHighlightText(match.getLabel(), prepend_newline, part, link_params); + + // set the tooltip for the Url label + if (! match.getTooltip().empty()) { - LLTextSegmentPtr segment = *it; - segment->setToolTip(match.getTooltip()); + segment_set_t::iterator it = getSegIterContaining(getLength()-1); + if (it != mSegments.end()) + { + LLTextSegmentPtr segment = *it; + segment->setToolTip(match.getTooltip()); + } } } + prepend_newline = false; // move on to the rest of the text after the Url if (end < (S32)text.length()) diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 038b9eaa62..e1c6cc36ab 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -41,6 +41,7 @@ #include "llpanel.h" #include +#include #include #include @@ -186,6 +187,9 @@ public: const LLFontGL* getDefaultFont() const { return mDefaultFont; } LLStyle::Params getDefaultStyle(); + // tell the text object to suppress auto highlighting of a specific URL + void addBlackListUrl(const std::string &url); + public: // Fired when a URL link is clicked commit_signal_t mURLClickSignal; @@ -308,6 +312,7 @@ protected: void updateRects(); void needsScroll() { mScrollNeeded = TRUE; } void replaceUrlLabel(const std::string &url, const std::string &label); + bool isBlackListUrl(const std::string &url) const; protected: // text segmentation and flow @@ -359,6 +364,9 @@ protected: LLView* mDocumentView; class LLScrollContainer* mScroller; + // list of URLs to suppress from automatic hyperlinking + std::vector mBlackListUrls; + // transient state bool mReflowNeeded; // need to reflow text because of change to text contents or display region bool mScrollNeeded; // need to change scroll region because of change to cursor position diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index ef69f39ad2..04f4ddf996 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -187,6 +187,12 @@ BOOL LLFloaterAbout::postBuild() support << '\n' << getString("AboutTraffic", args); } + // don't make the sim hostname be a hyperlink + if (info.has("HOSTNAME")) + { + support_widget->addBlackListUrl(info["HOSTNAME"].asString()); + } + support_widget->appendText(support.str(), FALSE, LLStyle::Params() -- cgit v1.2.3 From 71d47402514b26ea9adf768582ad7d8cfe1a1c74 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Tue, 26 Jan 2010 16:15:26 +0200 Subject: Fixed EXT-4646 ([BSI] Movement controls close after hitting stand) - reason: fix for bug EXT-2504 (black bars present at top and bottom when in mouselook) (changing parent visibility of panel with "Stand/Stop flying" buttons) - fix: updated condition to process visibility of the parent of the panel with "Stand/Stop flying" buttons: only if panel is not attached to Move Floater NOTE: The same problem was for EXT-3632 (Move floater closes after user click on Stop Flying btn) Reverted that fix for Stop flying button to be consistent with "Stand". --HG-- branch : product-engine --- indra/newview/llmoveview.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index 0ab3b07aea..de8ea98e05 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -589,8 +589,12 @@ void LLPanelStandStopFlying::setVisible(BOOL visible) updatePosition(); } - //change visibility of parent layout_panel to animate in/out - if (getParent()) getParent()->setVisible(visible); + // do not change parent visibility in case panel is attached into Move Floater: EXT-3632, EXT-4646 + if (!mAttached) + { + //change visibility of parent layout_panel to animate in/out. EXT-2504 + if (getParent()) getParent()->setVisible(visible); + } } BOOL LLPanelStandStopFlying::handleToolTip(S32 x, S32 y, MASK mask) @@ -614,7 +618,7 @@ void LLPanelStandStopFlying::reparent(LLFloaterMove* move_view) LLPanel* parent = dynamic_cast(getParent()); if (!parent) { - llwarns << "Stand/stop flying panel parent is unset" << llendl; + llwarns << "Stand/stop flying panel parent is unset, already attached?: " << mAttached << ", new parent: " << (move_view == NULL ? "NULL" : "Move Floater") << llendl; return; } @@ -684,6 +688,7 @@ void LLPanelStandStopFlying::onStopFlyingButtonClick() gAgent.setFlying(FALSE); setFocus(FALSE); // EXT-482 + setVisible(FALSE); } /** -- cgit v1.2.3 From 020f855f643a198737e7bd4066bdc1757d864a54 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Tue, 26 Jan 2010 14:23:28 +0000 Subject: EXT-4063: Enable tear-offs for pre-login menus. --- indra/newview/skins/default/xui/en/menu_login.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/newview/skins/default/xui/en/menu_login.xml b/indra/newview/skins/default/xui/en/menu_login.xml index a0dec346a4..5f38522758 100644 --- a/indra/newview/skins/default/xui/en/menu_login.xml +++ b/indra/newview/skins/default/xui/en/menu_login.xml @@ -10,6 +10,7 @@ Date: Tue, 26 Jan 2010 16:30:51 +0200 Subject: Fixed low bug EXT-4354(Dragging landmarks into landmark folders doesn't scroll window) --HG-- branch : product-engine --- indra/llui/llaccordionctrl.cpp | 75 +++++++++++++++++++++++++++++++++++++++ indra/llui/llaccordionctrl.h | 9 +++++ indra/llui/llaccordionctrltab.cpp | 34 ++++++++++++++++++ indra/llui/llaccordionctrltab.h | 1 + 4 files changed, 119 insertions(+) diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp index b5e870228a..d0c73fbfbc 100644 --- a/indra/llui/llaccordionctrl.cpp +++ b/indra/llui/llaccordionctrl.cpp @@ -63,6 +63,8 @@ static LLDefaultChildRegistry::Register t2("accordion"); LLAccordionCtrl::LLAccordionCtrl(const Params& params):LLPanel(params) , mFitParent(params.fit_parent) + , mAutoScrolling( false ) + , mAutoScrollRate( 0.f ) { mSingleExpansion = params.single_expansion; if(mFitParent && !mSingleExpansion) @@ -72,6 +74,8 @@ LLAccordionCtrl::LLAccordionCtrl(const Params& params):LLPanel(params) } LLAccordionCtrl::LLAccordionCtrl() : LLPanel() + , mAutoScrolling( false ) + , mAutoScrollRate( 0.f ) { mSingleExpansion = false; mFitParent = false; @@ -81,6 +85,19 @@ LLAccordionCtrl::LLAccordionCtrl() : LLPanel() //--------------------------------------------------------------------------------- void LLAccordionCtrl::draw() { + if (mAutoScrolling) + { + // add acceleration to autoscroll + mAutoScrollRate = llmin(mAutoScrollRate + (LLFrameTimer::getFrameDeltaTimeF32() * AUTO_SCROLL_RATE_ACCEL), MAX_AUTO_SCROLL_RATE); + } + else + { + // reset to minimum for next time + mAutoScrollRate = MIN_AUTO_SCROLL_RATE; + } + // clear this flag to be set on next call to autoScroll + mAutoScrolling = false; + LLRect local_rect(0, getRect().getHeight(), getRect().getWidth(), 0); LLLocalClipRect clip(local_rect); @@ -420,6 +437,64 @@ BOOL LLAccordionCtrl::handleKeyHere (KEY key, MASK mask) return LLPanel::handleKeyHere(key,mask); } +BOOL LLAccordionCtrl::handleDragAndDrop (S32 x, S32 y, MASK mask, + BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg) +{ + // Scroll folder view if needed. Never accepts a drag or drop. + *accept = ACCEPT_NO; + BOOL handled = autoScroll(x, y); + + if( !handled ) + { + handled = childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, + cargo_data, accept, tooltip_msg) != NULL; + } + return TRUE; +} + +BOOL LLAccordionCtrl::autoScroll (S32 x, S32 y) +{ + static LLUICachedControl scrollbar_size ("UIScrollbarSize", 0); + + bool scrolling = false; + if( mScrollbar->getVisible() ) + { + LLRect rect_local( 0, getRect().getHeight(), getRect().getWidth() - scrollbar_size, 0 ); + LLRect screen_local_extents; + + // clip rect against root view + screenRectToLocal(getRootView()->getLocalRect(), &screen_local_extents); + rect_local.intersectWith(screen_local_extents); + + // autoscroll region should take up no more than one third of visible scroller area + S32 auto_scroll_region_height = llmin(rect_local.getHeight() / 3, 10); + S32 auto_scroll_speed = llround(mAutoScrollRate * LLFrameTimer::getFrameDeltaTimeF32()); + + LLRect bottom_scroll_rect = screen_local_extents; + bottom_scroll_rect.mTop = rect_local.mBottom + auto_scroll_region_height; + if( bottom_scroll_rect.pointInRect( x, y ) && (mScrollbar->getDocPos() < mScrollbar->getDocPosMax()) ) + { + mScrollbar->setDocPos( mScrollbar->getDocPos() + auto_scroll_speed ); + mAutoScrolling = true; + scrolling = true; + } + + LLRect top_scroll_rect = screen_local_extents; + top_scroll_rect.mBottom = rect_local.mTop - auto_scroll_region_height; + if( top_scroll_rect.pointInRect( x, y ) && (mScrollbar->getDocPos() > 0) ) + { + mScrollbar->setDocPos( mScrollbar->getDocPos() - auto_scroll_speed ); + mAutoScrolling = true; + scrolling = true; + } + } + return scrolling; +} + void LLAccordionCtrl::updateLayout (S32 width, S32 height) { S32 panel_top = height - BORDER_MARGIN ; diff --git a/indra/llui/llaccordionctrl.h b/indra/llui/llaccordionctrl.h index 4cb0f38281..d57a42df32 100644 --- a/indra/llui/llaccordionctrl.h +++ b/indra/llui/llaccordionctrl.h @@ -81,6 +81,11 @@ public: virtual BOOL handleRightMouseDown ( S32 x, S32 y, MASK mask); virtual BOOL handleScrollWheel ( S32 x, S32 y, S32 clicks ); virtual BOOL handleKeyHere (KEY key, MASK mask); + virtual BOOL handleDragAndDrop (S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg); // // Call reshape after changing splitter's size @@ -112,11 +117,15 @@ private: void showScrollbar (S32 width, S32 height); void hideScrollbar (S32 width, S32 height); + BOOL autoScroll (S32 x, S32 y); + private: LLRect mInnerRect; LLScrollbar* mScrollbar; bool mSingleExpansion; bool mFitParent; + bool mAutoScrolling; + F32 mAutoScrollRate; }; diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp index 4bfe44135a..daa9e08f14 100644 --- a/indra/llui/llaccordionctrltab.cpp +++ b/indra/llui/llaccordionctrltab.cpp @@ -45,6 +45,7 @@ static const std::string DD_HEADER_NAME = "dd_header"; static const S32 HEADER_HEIGHT = 20; static const S32 HEADER_IMAGE_LEFT_OFFSET = 5; static const S32 HEADER_TEXT_LEFT_OFFSET = 30; +static const F32 AUTO_OPEN_TIME = 1.f; static LLDefaultChildRegistry::Register t1("accordion_tab"); @@ -73,6 +74,11 @@ public: virtual void onMouseEnter(S32 x, S32 y, MASK mask); virtual void onMouseLeave(S32 x, S32 y, MASK mask); virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); + virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg); private: LLTextBox* mHeaderTextbox; @@ -92,6 +98,8 @@ private: LLUIColor mHeaderBGColor; bool mNeedsHighlight; + + LLFrameTimer mAutoOpenTimer; }; LLAccordionCtrlTab::LLAccordionCtrlTabHeader::Params::Params() @@ -209,6 +217,7 @@ void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::onMouseLeave(S32 x, S32 y, MA { LLUICtrl::onMouseLeave(x, y, mask); mNeedsHighlight = false; + mAutoOpenTimer.stop(); } BOOL LLAccordionCtrlTab::LLAccordionCtrlTabHeader::handleKey(KEY key, MASK mask, BOOL called_from_parent) { @@ -218,8 +227,33 @@ BOOL LLAccordionCtrlTab::LLAccordionCtrlTabHeader::handleKey(KEY key, MASK mask, } return LLUICtrl::handleKey(key, mask, called_from_parent); } +BOOL LLAccordionCtrlTab::LLAccordionCtrlTabHeader::handleDragAndDrop(S32 x, S32 y, MASK mask, + BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg) +{ + LLAccordionCtrlTab* parent = dynamic_cast(getParent()); + if ( parent && !parent->getDisplayChildren() && parent->getCollapsible() && parent->canOpenClose() ) + { + if (mAutoOpenTimer.getStarted()) + { + if (mAutoOpenTimer.getElapsedTimeF32() > AUTO_OPEN_TIME) + { + parent->changeOpenClose(false); + mAutoOpenTimer.stop(); + return TRUE; + } + } + else + mAutoOpenTimer.start(); + } + return LLUICtrl::handleDragAndDrop(x, y, mask, drop, cargo_type, + cargo_data, accept, tooltip_msg); +} LLAccordionCtrlTab::Params::Params() : title("title") ,display_children("expanded", true) diff --git a/indra/llui/llaccordionctrltab.h b/indra/llui/llaccordionctrltab.h index b200d43438..2e0260ab16 100644 --- a/indra/llui/llaccordionctrltab.h +++ b/indra/llui/llaccordionctrltab.h @@ -115,6 +115,7 @@ public: void changeOpenClose(bool is_open); void canOpenClose(bool can_open_close) { mCanOpenClose = can_open_close;}; + bool canOpenClose() const { return mCanOpenClose; }; virtual BOOL postBuild(); -- cgit v1.2.3 From 3a0226824b7d03f7ad745af995066cfa99833cbc Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Tue, 26 Jan 2010 17:04:13 +0200 Subject: Fixed normal bug EXT-4718 ( Stop Flying button is displayed in the mouse look mode) - restore base processing of visibility of Panel with "stand/stop flying" buttons broken in EXT-2504 --HG-- branch : product-engine --- indra/newview/llmoveview.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index de8ea98e05..5981baab60 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -595,6 +595,10 @@ void LLPanelStandStopFlying::setVisible(BOOL visible) //change visibility of parent layout_panel to animate in/out. EXT-2504 if (getParent()) getParent()->setVisible(visible); } + + // also change own visibility to avoid displaying the panel in mouselook (broken when EXT-2504 was implemented). + // See EXT-4718. + LLPanel::setVisible(visible); } BOOL LLPanelStandStopFlying::handleToolTip(S32 x, S32 y, MASK mask) -- cgit v1.2.3 From e8b4a14b1ddf8225909a577a1060c9fbd9456dbe Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Tue, 26 Jan 2010 17:07:12 +0200 Subject: Fixed major bug EXT-4719 - Crash in LLTextBase after showing popup menu for link. --HG-- branch : product-engine --- indra/llui/lltextbase.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 47db990a37..f7da9f089a 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -244,7 +244,8 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p) LLTextBase::~LLTextBase() { - delete mPopupMenu; + // Menu, like any other LLUICtrl, is deleted by its parent - gMenuHolder + clearSegments(); } -- cgit v1.2.3 From 4c82ec8088ec5972fdfdbcef8b6e985156d71de3 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Tue, 26 Jan 2010 17:22:18 +0200 Subject: =?UTF-8?q?implemented=20EXT-4588=20=E2=80=9CRedirect=20messages?= =?UTF-8?q?=20that=20went=20to=20the=20Communicate=20floater=E2=80=9D;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llcompilequeue.cpp | 14 ++++++-------- indra/newview/llviewermenu.cpp | 14 ++++++-------- indra/newview/llviewermessage.cpp | 31 +++++++++++++------------------ 3 files changed, 25 insertions(+), 34 deletions(-) diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index 47f1b7c9f5..5c05a54120 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -446,19 +446,17 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id, if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status ) { - //TODO* CHAT: how to show this? - //LLSD args; - //args["MESSAGE"] = LLTrans::getString("CompileQueueScriptNotFound); - //LLNotificationsUtil::add("SystemMessage", args); + LLSD args; + args["MESSAGE"] = LLTrans::getString("CompileQueueScriptNotFound"); + LLNotificationsUtil::add("SystemMessage", args); buffer = LLTrans::getString("CompileQueueProblemDownloading") + (": ") + data->mScriptName; } else if (LL_ERR_INSUFFICIENT_PERMISSIONS == status) { - //TODO* CHAT: how to show this? - //LLSD args; - //args["MESSAGE"] = LLTrans::getString("CompileQueueScriptNotFound); - //LLNotificationsUtil::add("SystemMessage", args); + LLSD args; + args["MESSAGE"] = LLTrans::getString("CompileQueueInsufficientPermDownload"); + LLNotificationsUtil::add("SystemMessage", args); buffer = LLTrans::getString("CompileQueueInsufficientPermFor") + (": ") + data->mScriptName; } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 54de693222..96251f7571 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -6389,10 +6389,9 @@ void handle_selected_texture_info(void*) msg.assign("Texture info for: "); msg.append(node->mName); - //TODO* CHAT: how to show this? - //LLSD args; - //args["MESSAGE"] = msg; - //LLNotificationsUtil::add("SystemMessage", args); + LLSD args; + args["MESSAGE"] = msg; + LLNotificationsUtil::add("SystemMessage", args); U8 te_count = node->getObject()->getNumTEs(); // map from texture ID to list of faces using it @@ -6425,10 +6424,9 @@ void handle_selected_texture_info(void*) msg.append( llformat("%d ", (S32)(it->second[i]))); } - //TODO* CHAT: how to show this? - //LLSD args; - //args["MESSAGE"] = msg; - //LLNotificationsUtil::add("SystemMessage", args); + LLSD args; + args["MESSAGE"] = msg; + LLNotificationsUtil::add("SystemMessage", args); } } } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 1d3ac3fb0f..d6ce356c4b 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1365,10 +1365,9 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const if (check_offer_throttle(mFromName, true)) { log_message = chatHistory_string + " " + LLTrans::getString("InvOfferGaveYou") + " " + mDesc + LLTrans::getString("."); - //TODO* CHAT: how to show this? - //LLSD args; - //args["MESSAGE"] = log_message; - //LLNotificationsUtil::add("SystemMessage", args); + LLSD args; + args["MESSAGE"] = log_message; + LLNotificationsUtil::add("SystemMessage", args); } // we will want to open this item when it comes back. @@ -1410,11 +1409,10 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const // send the message msg->sendReliable(mHost); - //TODO* CHAT: how to show this? - //log_message = LLTrans::getString("InvOfferYouDecline") + " " + mDesc + " " + LLTrans::getString("InvOfferFrom") + " " + mFromName +"."; - //LLSD args; - //args["MESSAGE"] = log_message; - //LLNotificationsUtil::add("SystemMessage", args); + log_message = LLTrans::getString("InvOfferYouDecline") + " " + mDesc + " " + LLTrans::getString("InvOfferFrom") + " " + mFromName +"."; + LLSD args; + args["MESSAGE"] = log_message; + LLNotificationsUtil::add("SystemMessage", args); if (busy && (!mFromGroup && !mFromObject)) { @@ -1868,11 +1866,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // history. Pretend the chat is from a local agent, // so it will go into the history but not be shown on screen. - //TODO* CHAT: how to show this? - //and this is not system message... - //LLSD args; - //args["MESSAGE"] = buffer; - //LLNotificationsUtil::add("SystemMessage", args); + LLSD args; + args["MESSAGE"] = buffer; + LLNotificationsUtil::add("SystemMessageTip", args); } } break; @@ -3103,10 +3099,9 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) { // Chat the "back" SLURL. (DEV-4907) - //TODO* CHAT: how to show this? - //LLSD args; - //args["MESSAGE"] = message; - //LLNotificationsUtil::add("SystemMessage", args); + LLSD args; + args["MESSAGE"] = "Teleport completed from " + gAgent.getTeleportSourceSLURL(); + LLNotificationsUtil::add("SystemMessageTip", args); // Set the new position avatarp->setPositionAgent(agent_pos); -- cgit v1.2.3 From 43bb3d00ecba66fe3dd9fa5a2d487ffc5633ed5e Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Tue, 26 Jan 2010 18:25:42 +0200 Subject: =?UTF-8?q?fixed=20EXT-4643=20=E2=80=9CIM=20toasts=20don't=20appea?= =?UTF-8?q?r=20after=20few=20teleport=20offers=20were=20sent=20to=20that?= =?UTF-8?q?=20avatar=E2=80=9D=20corrected=20checking=20opened=20active=20I?= =?UTF-8?q?M=20session;=20corrected=20restoring=20active=20IM=20session=20?= =?UTF-8?q?after=20logging=20IM=20notification;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llimview.cpp | 3 ++- indra/newview/llnotificationhandlerutil.cpp | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 1b1e6501c0..f90a51c3f3 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -95,7 +95,8 @@ void toast_callback(const LLSD& msg){ } // check whether incoming IM belongs to an active session or not - if (LLIMModel::getInstance()->getActiveSessionID() == msg["session_id"]) + if (LLIMModel::getInstance()->getActiveSessionID().notNull() + && LLIMModel::getInstance()->getActiveSessionID() == msg["session_id"]) { return; } diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index fba5773602..02f948eca9 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -123,7 +123,14 @@ void LLHandlerUtil::logToIM(const EInstantMessage& session_type, message); // restore active session id - LLIMModel::instance().setActiveSessionID(active_session_id); + if (active_session_id.isNull()) + { + LLIMModel::instance().resetActiveSessionID(); + } + else + { + LLIMModel::instance().setActiveSessionID(active_session_id); + } } } -- cgit v1.2.3 From 5344f82e282ed4ce1c016c1e164f674f64bb78be Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Tue, 26 Jan 2010 20:17:44 +0200 Subject: Fixed normal bug (EXT-4720) N/A is displayed in the Create Landmark panel while data is retrieved. --HG-- branch : product-engine --- indra/newview/llpanellandmarkinfo.cpp | 8 ++-- indra/newview/llpanelplaceinfo.cpp | 18 +++++--- indra/newview/llpanelplaceprofile.cpp | 80 ++++++++++++++++++----------------- 3 files changed, 57 insertions(+), 49 deletions(-) diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index 9654e17659..c792fd4fe3 100644 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -98,10 +98,10 @@ void LLPanelLandmarkInfo::resetLocation() { LLPanelPlaceInfo::resetLocation(); - std::string not_available = getString("not_available"); - mCreator->setText(not_available); - mOwner->setText(not_available); - mCreated->setText(not_available); + std::string loading = LLTrans::getString("LoadingData"); + mCreator->setText(loading); + mOwner->setText(loading); + mCreated->setText(loading); mLandmarkTitle->setText(LLStringUtil::null); mLandmarkTitleEditor->setText(LLStringUtil::null); mNotesEditor->setText(LLStringUtil::null); diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index 0c10f11bfc..5f75668722 100644 --- a/indra/newview/llpanelplaceinfo.cpp +++ b/indra/newview/llpanelplaceinfo.cpp @@ -43,6 +43,8 @@ #include "lliconctrl.h" #include "lltextbox.h" +#include "lltrans.h" + #include "llagent.h" #include "llexpandabletextbox.h" #include "llpanelpick.h" @@ -99,12 +101,12 @@ void LLPanelPlaceInfo::resetLocation() mRequestedID.setNull(); mPosRegion.clearVec(); - std::string not_available = getString("not_available"); - mMaturityRatingIcon->setValue(not_available); - mMaturityRatingText->setValue(not_available); - mRegionName->setText(not_available); - mParcelName->setText(not_available); - mDescEditor->setText(not_available); + std::string loading = LLTrans::getString("LoadingData"); + mMaturityRatingIcon->setValue(loading); + mMaturityRatingText->setValue(loading); + mRegionName->setText(loading); + mParcelName->setText(loading); + mDescEditor->setText(loading); mSnapshotCtrl->setImageAssetID(LLUUID::null); mSnapshotCtrl->setFallbackImageName("default_land_picture.j2c"); @@ -206,6 +208,10 @@ void LLPanelPlaceInfo::processParcelInfo(const LLParcelData& parcel_data) { mDescEditor->setText(parcel_data.desc); } + else + { + mDescEditor->setText(getString("not_available")); + } S32 region_x; S32 region_y; diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index d892e2885b..3c798639d4 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -42,6 +42,8 @@ #include "lltextbox.h" #include "lltexteditor.h" +#include "lltrans.h" + #include "llaccordionctrl.h" #include "llaccordionctrltab.h" #include "llagent.h" @@ -163,45 +165,45 @@ void LLPanelPlaceProfile::resetLocation() mForSalePanel->setVisible(FALSE); mYouAreHerePanel->setVisible(FALSE); - std::string not_available = getString("not_available"); - mParcelOwner->setValue(not_available); - - mParcelRatingIcon->setValue(not_available); - mParcelRatingText->setText(not_available); - mVoiceIcon->setValue(not_available); - mVoiceText->setText(not_available); - mFlyIcon->setValue(not_available); - mFlyText->setText(not_available); - mPushIcon->setValue(not_available); - mPushText->setText(not_available); - mBuildIcon->setValue(not_available); - mBuildText->setText(not_available); - mScriptsIcon->setValue(not_available); - mScriptsText->setText(not_available); - mDamageIcon->setValue(not_available); - mDamageText->setText(not_available); - - mRegionNameText->setValue(not_available); - mRegionTypeText->setValue(not_available); - mRegionRatingIcon->setValue(not_available); - mRegionRatingText->setValue(not_available); - mRegionOwnerText->setValue(not_available); - mRegionGroupText->setValue(not_available); - - mEstateNameText->setValue(not_available); - mEstateRatingText->setValue(not_available); - mEstateOwnerText->setValue(not_available); - mCovenantText->setValue(not_available); - - mSalesPriceText->setValue(not_available); - mAreaText->setValue(not_available); - mTrafficText->setValue(not_available); - mPrimitivesText->setValue(not_available); - mParcelScriptsText->setValue(not_available); - mTerraformLimitsText->setValue(not_available); - mSubdivideText->setValue(not_available); - mResaleText->setValue(not_available); - mSaleToText->setValue(not_available); + std::string loading = LLTrans::getString("LoadingData"); + mParcelOwner->setValue(loading); + + mParcelRatingIcon->setValue(loading); + mParcelRatingText->setText(loading); + mVoiceIcon->setValue(loading); + mVoiceText->setText(loading); + mFlyIcon->setValue(loading); + mFlyText->setText(loading); + mPushIcon->setValue(loading); + mPushText->setText(loading); + mBuildIcon->setValue(loading); + mBuildText->setText(loading); + mScriptsIcon->setValue(loading); + mScriptsText->setText(loading); + mDamageIcon->setValue(loading); + mDamageText->setText(loading); + + mRegionNameText->setValue(loading); + mRegionTypeText->setValue(loading); + mRegionRatingIcon->setValue(loading); + mRegionRatingText->setValue(loading); + mRegionOwnerText->setValue(loading); + mRegionGroupText->setValue(loading); + + mEstateNameText->setValue(loading); + mEstateRatingText->setValue(loading); + mEstateOwnerText->setValue(loading); + mCovenantText->setValue(loading); + + mSalesPriceText->setValue(loading); + mAreaText->setValue(loading); + mTrafficText->setValue(loading); + mPrimitivesText->setValue(loading); + mParcelScriptsText->setValue(loading); + mTerraformLimitsText->setValue(loading); + mSubdivideText->setValue(loading); + mResaleText->setValue(loading); + mSaleToText->setValue(loading); } // virtual -- cgit v1.2.3 From dfad0f4e67821670cfc806dd2f8fcdf9a0d96530 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Tue, 26 Jan 2010 20:17:45 +0200 Subject: Fixed critical bug EXT-4663 ([BSI] Inviting Residents to groups produces error 100% of time). Overriden LLScrollListItem::getUUID() in LLNameListCtrl so that you can get correct ID of a name list item. --HG-- branch : product-engine --- indra/llui/llscrolllistctrl.cpp | 8 ++++++-- indra/llui/llscrolllistctrl.h | 1 + indra/llui/llscrolllistitem.h | 2 +- indra/newview/llnamelistctrl.cpp | 21 ++++++++------------- indra/newview/llnamelistctrl.h | 21 ++++++++++++++++++++- indra/newview/llpanelgrouproles.cpp | 10 +++++----- 6 files changed, 41 insertions(+), 22 deletions(-) diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 71bba57584..78386220d9 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -2760,9 +2760,13 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& element, EAddPosition LLScrollListItem* LLScrollListCtrl::addRow(const LLScrollListItem::Params& item_p, EAddPosition pos) { - if (!item_p.validateBlock()) return NULL; - LLScrollListItem *new_item = new LLScrollListItem(item_p); + return addRow(new_item, item_p, pos); +} + +LLScrollListItem* LLScrollListCtrl::addRow(LLScrollListItem *new_item, const LLScrollListItem::Params& item_p, EAddPosition pos) +{ + if (!item_p.validateBlock() || !new_item) return NULL; new_item->setNumColumns(mColumns.size()); // Add any columns we don't already have diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index 907dc90bea..d2d2379328 100644 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -148,6 +148,7 @@ public: // "columns" => [ "column" => column name, "value" => value, "type" => type, "font" => font, "font-style" => style ], "id" => uuid // Creates missing columns automatically. virtual LLScrollListItem* addElement(const LLSD& element, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL); + virtual LLScrollListItem* addRow(LLScrollListItem *new_item, const LLScrollListItem::Params& value, EAddPosition pos = ADD_BOTTOM); virtual LLScrollListItem* addRow(const LLScrollListItem::Params& value, EAddPosition pos = ADD_BOTTOM); // Simple add element. Takes a single array of: // [ "value" => value, "font" => font, "font-style" => style ] diff --git a/indra/llui/llscrolllistitem.h b/indra/llui/llscrolllistitem.h index 15b86cc945..25ce846d90 100644 --- a/indra/llui/llscrolllistitem.h +++ b/indra/llui/llscrolllistitem.h @@ -95,7 +95,7 @@ public: void setUserdata( void* userdata ) { mUserdata = userdata; } void* getUserdata() const { return mUserdata; } - LLUUID getUUID() const { return mItemValue.asUUID(); } + virtual LLUUID getUUID() const { return mItemValue.asUUID(); } LLSD getValue() const { return mItemValue; } void setRect(LLRect rect) { mRectangle = rect; } diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index 6375362ae2..9f04558d50 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -148,7 +148,7 @@ BOOL LLNameListCtrl::handleToolTip(S32 x, S32 y, MASK mask) && column_index == mNameColumnIndex) { // ...this is the column with the avatar name - LLUUID avatar_id = getItemId(hit_item); + LLUUID avatar_id = hit_item->getUUID(); if (avatar_id.notNull()) { // ...valid avatar id @@ -230,14 +230,15 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow( std::string& suffix) { LLUUID id = name_item.value().asUUID(); - LLScrollListItem* item = NULL; + LLNameListItem* item = NULL; // Store item type so that we can invoke the proper inspector. // *TODO Vadim: Is there a more proper way of storing additional item data? { - LLNameListCtrl::NameItem name_item_(name_item); - name_item_.value = LLSD().with("uuid", id).with("is_group", name_item.target() == GROUP); - item = LLScrollListCtrl::addRow(name_item_, pos); + LLNameListCtrl::NameItem item_p(name_item); + item_p.value = LLSD().with("uuid", id).with("is_group", name_item.target() == GROUP); + item = new LLNameListItem(item_p); + LLScrollListCtrl::addRow(item, item_p, pos); } if (!item) return NULL; @@ -298,7 +299,7 @@ void LLNameListCtrl::removeNameItem(const LLUUID& agent_id) for (item_list::iterator it = getItemList().begin(); it != getItemList().end(); it++) { LLScrollListItem* item = *it; - if (getItemId(item) == agent_id) + if (item->getUUID() == agent_id) { idx = getItemIndex(item); break; @@ -335,7 +336,7 @@ void LLNameListCtrl::refresh(const LLUUID& id, const std::string& first, for (iter = getItemList().begin(); iter != getItemList().end(); iter++) { LLScrollListItem* item = *iter; - if (getItemId(item) == id) + if (item->getUUID() == id) { LLScrollListCell* cell = (LLScrollListCell*)item->getColumn(0); cell = item->getColumn(mNameColumnIndex); @@ -375,9 +376,3 @@ void LLNameListCtrl::updateColumns() } } } - -// static -LLUUID LLNameListCtrl::getItemId(LLScrollListItem* item) -{ - return item->getValue()["uuid"].asUUID(); -} diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index 192a3a5afa..23b1cb6897 100644 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -122,7 +122,6 @@ public: /*virtual*/ void updateColumns(); private: void showInspector(const LLUUID& avatar_id, bool is_group); - static LLUUID getItemId(LLScrollListItem* item); private: S32 mNameColumnIndex; @@ -130,4 +129,24 @@ private: BOOL mAllowCallingCardDrop; }; +/** + * LLNameListCtrl item + * + * We don't use LLScrollListItem to be able to override getUUID(), which is needed + * because the name list item value is not simply an UUID but a map (uuid, is_group). + */ +class LLNameListItem : public LLScrollListItem +{ +public: + LLUUID getUUID() const { return getValue()["uuid"].asUUID(); } + +protected: + friend class LLNameListCtrl; + + LLNameListItem( const LLScrollListItem::Params& p ) + : LLScrollListItem(p) + { + } +}; + #endif diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 45f0381d6f..c6287472fe 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -867,7 +867,7 @@ void LLPanelGroupMembersSubTab::handleMemberSelect() for (itor = selection.begin(); itor != selection.end(); ++itor) { - LLUUID member_id = (*itor)->getValue()["uuid"]; + LLUUID member_id = (*itor)->getUUID(); selected_members.push_back( member_id ); // Get this member's power mask including any unsaved changes @@ -1093,7 +1093,7 @@ void LLPanelGroupMembersSubTab::handleEjectMembers() for (itor = selection.begin() ; itor != selection.end(); ++itor) { - LLUUID member_id = (*itor)->getValue()["uuid"]; + LLUUID member_id = (*itor)->getUUID(); selected_members.push_back( member_id ); } @@ -1151,7 +1151,7 @@ void LLPanelGroupMembersSubTab::handleRoleCheck(const LLUUID& role_id, itor != selection.end(); ++itor) { - member_id = (*itor)->getValue()["uuid"]; + member_id = (*itor)->getUUID(); //see if we requested a change for this member before if ( mMemberRoleChangeData.find(member_id) == mMemberRoleChangeData.end() ) @@ -1242,7 +1242,7 @@ void LLPanelGroupMembersSubTab::handleMemberDoubleClick() LLScrollListItem* selected = mMembersList->getFirstSelected(); if (selected) { - LLUUID member_id = selected->getValue()["uuid"]; + LLUUID member_id = selected->getUUID(); LLAvatarActions::showProfile( member_id ); } } @@ -1632,7 +1632,7 @@ void LLPanelGroupMembersSubTab::updateMembers() LLScrollListItem* member = mMembersList->addElement(row);//, ADD_SORTED); - LLUUID id = member->getValue()["uuid"]; + LLUUID id = member->getUUID(); mHasMatch = TRUE; } } -- cgit v1.2.3 From d72748a0af3e77de9a5dfedd2b8c9d87bfe7da24 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Tue, 26 Jan 2010 20:19:39 +0200 Subject: Removed an unused class. --HG-- branch : product-engine --- indra/newview/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 5373556c20..492e3b1c7f 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -343,7 +343,6 @@ set(viewer_SOURCE_FILES llpanelprimmediacontrols.cpp llpanelprofile.cpp llpanelprofileview.cpp - llpanelshower.cpp llpanelteleporthistory.cpp llpanelvolume.cpp llpanelvolumepulldown.cpp @@ -846,7 +845,6 @@ set(viewer_HEADER_FILES llpanelprimmediacontrols.h llpanelprofile.h llpanelprofileview.h - llpanelshower.h llpanelteleporthistory.h llpanelvolume.h llpanelvolumepulldown.h -- cgit v1.2.3 From e33483a7eee40615677b9abf1691c44dd80a961e Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Tue, 26 Jan 2010 21:38:29 +0200 Subject: Fixed normal bug EXT-4672 (Relog displays Voice Controls floater with Leave Call button) --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 1e713dade8..f62fd44bc0 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -163,6 +163,8 @@ BOOL LLCallFloater::postBuild() //chrome="true" hides floater caption if (mDragHandle) mDragHandle->setTitleVisible(TRUE); + + updateSession(); return TRUE; } @@ -246,7 +248,7 @@ void LLCallFloater::updateSession() } } - const LLUUID& session_id = voice_channel->getSessionID(); + const LLUUID& session_id = voice_channel ? voice_channel->getSessionID() : LLUUID::null; lldebugs << "Set speaker manager for session: " << session_id << llendl; LLIMModel::LLIMSession* im_session = LLIMModel::getInstance()->findIMSession(session_id); -- cgit v1.2.3 From 88a6cbdaecc06c0ff174d29ca9ff600775edff49 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Tue, 26 Jan 2010 22:29:17 +0200 Subject: Workaround for EXT-4725(Viewer crashes if try to call from 'Nearby voice' floater). - Enabling/disabling 'Call'menu item is moved to createMenu(). Some way to properly enable/disable it in enableContextMenuItem() should be found. --HG-- branch : product-engine --- indra/newview/llparticipantlist.cpp | 6 ++++++ indra/newview/skins/default/xui/en/menu_participant_list.xml | 3 --- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index f83f3eba96..d54cbfe203 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -433,6 +433,12 @@ LLContextMenu* LLParticipantList::LLParticipantListMenu::createMenu() LLContextMenu* main_menu = LLUICtrlFactory::getInstance()->createFromFile( "menu_participant_list.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); + // AD *TODO: This is workaround for EXT-4725- way to properly enable/disable "Call" menu item in + // enableContextMenuItem() should be found. + bool not_agent = mUUIDs.front() != gAgentID; + bool can_call = not_agent && LLVoiceClient::voiceEnabled() && gVoiceClient->voiceWorking(); + main_menu->setItemEnabled("Call", can_call); + // Don't show sort options for P2P chat bool is_sort_visible = (mParent.mAvatarList && mParent.mAvatarList->size() > 1); main_menu->setItemVisible("SortByName", is_sort_visible); 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 805ffbae66..04e02d0f6c 100644 --- a/indra/newview/skins/default/xui/en/menu_participant_list.xml +++ b/indra/newview/skins/default/xui/en/menu_participant_list.xml @@ -57,9 +57,6 @@ name="Call"> - Date: Tue, 26 Jan 2010 12:35:22 -0800 Subject: DEV-45468 SNOW-108: Fast timers are broken / badly-scaled on linux more reliable fix based on feedback from Richard. dicked with the Darwin results too since those seemed wrong based on the same feedback (also covered in test plan). --- indra/llcommon/llfasttimer.h | 10 +++++----- indra/llcommon/llfasttimer_class.cpp | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index 32f3561616..48461df6ae 100644 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -113,7 +113,7 @@ inline U64 LLFastTimer::getCPUClockCount64() struct timespec tp; #ifdef CLOCK_MONOTONIC // MONOTONIC supported at build-time? - if (-1 == clock_gettime(CLOCK_MONOTONIC,&tp)) // if MONOTONIC isn't supported at runtime, try REALTIME + if (-1 == clock_gettime(CLOCK_MONOTONIC,&tp)) // if MONOTONIC isn't supported at runtime then ouch, try REALTIME #endif clock_gettime(CLOCK_REALTIME,&tp); @@ -122,7 +122,7 @@ inline U64 LLFastTimer::getCPUClockCount64() inline U32 LLFastTimer::getCPUClockCount32() { - return (U32)LLFastTimer::getCPUClockCount64(); + return (U32)(LLFastTimer::getCPUClockCount64() >> 8); } #endif // (LL_LINUX || LL_SOLARIS)) @@ -134,14 +134,14 @@ inline U32 LLFastTimer::getCPUClockCount32() { U64 x; __asm__ volatile (".byte 0x0f, 0x31": "=A"(x)); - return (U32)x >> 8; + return (U32)(x >> 8); } inline U64 LLFastTimer::getCPUClockCount64() { U64 x; __asm__ volatile (".byte 0x0f, 0x31": "=A"(x)); - return x >> 8; + return x; } #endif @@ -154,7 +154,7 @@ inline U64 LLFastTimer::getCPUClockCount64() inline U32 LLFastTimer::getCPUClockCount32() { - return (U32)get_clock_count(); + return (U32)(get_clock_count()>>8); } inline U64 LLFastTimer::getCPUClockCount64() diff --git a/indra/llcommon/llfasttimer_class.cpp b/indra/llcommon/llfasttimer_class.cpp index abcaee673e..fae0a66873 100644 --- a/indra/llcommon/llfasttimer_class.cpp +++ b/indra/llcommon/llfasttimer_class.cpp @@ -226,12 +226,12 @@ void LLFastTimer::DeclareTimer::updateCachedPointers() //static #if LL_LINUX || LL_SOLARIS || ( LL_DARWIN && !(defined(__i386__) || defined(__amd64__)) ) -U64 LLFastTimer::countsPerSecond() +U64 LLFastTimer::countsPerSecond() // counts per second for the *32-bit* timer { - return sClockResolution; + return sClockResolution >> 8; } #else // windows or x86-mac -U64 LLFastTimer::countsPerSecond() +U64 LLFastTimer::countsPerSecond() // counts per second for the *32-bit* timer { static U64 sCPUClockFrequency = U64(CProcessor().GetCPUFrequency(50)); -- cgit v1.2.3 From 38f4c6981fc49a8c2b0c290a8baed9f317440069 Mon Sep 17 00:00:00 2001 From: "Mark Palange (Mani)" Date: Tue, 26 Jan 2010 13:13:38 -0800 Subject: Configured build for the windows lightweight(stub) installer. Added a dependency on the package target to get parabuild to build the indra/win_setup project. Reviewed by Palmer --- indra/newview/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 5373556c20..ecea72fa0d 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1580,7 +1580,10 @@ if (WINDOWS) DEPENDS ${VIEWER_BINARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ) - add_custom_target(package ALL DEPENDS ${CMAKE_CFG_INTDIR}/touched.bat) + add_custom_target(package ALL DEPENDS + ${CMAKE_CFG_INTDIR}/touched.bat + windows-setup-build-all + ) # temporarily disable packaging of event_host until hg subrepos get # sorted out on the parabuild cluster... #${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event_host.tar.bz2) -- cgit v1.2.3 From fee564c26e1018787cf70b95fc677c1da447118c Mon Sep 17 00:00:00 2001 From: "Mark Palange (Mani)" Date: Tue, 26 Jan 2010 13:15:52 -0800 Subject: Removed tabs. --- indra/newview/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 8f333e9fd8..7ddeb90d29 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1579,9 +1579,9 @@ if (WINDOWS) ) add_custom_target(package ALL DEPENDS - ${CMAKE_CFG_INTDIR}/touched.bat - windows-setup-build-all - ) + ${CMAKE_CFG_INTDIR}/touched.bat + windows-setup-build-all + ) # temporarily disable packaging of event_host until hg subrepos get # sorted out on the parabuild cluster... #${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event_host.tar.bz2) -- cgit v1.2.3 From 3f7ed7ef1de1012e3bea719e8042a256deb10ac3 Mon Sep 17 00:00:00 2001 From: Eli Linden Date: Tue, 26 Jan 2010 14:28:07 -0800 Subject: DEV-43688 cycle3 for DE --- .../skins/default/xui/de/floater_about_land.xml | 144 +++++------ .../default/xui/de/floater_animation_preview.xml | 5 +- .../default/xui/de/floater_avatar_textures.xml | 62 ++--- .../skins/default/xui/de/floater_buy_currency.xml | 2 +- .../skins/default/xui/de/floater_customize.xml | 71 ++--- .../skins/default/xui/de/floater_god_tools.xml | 9 +- .../skins/default/xui/de/floater_im_container.xml | 2 +- .../skins/default/xui/de/floater_incoming_call.xml | 6 + .../skins/default/xui/de/floater_lsl_guide.xml | 2 +- .../skins/default/xui/de/floater_media_browser.xml | 2 +- .../default/xui/de/floater_outfit_save_as.xml | 11 + .../skins/default/xui/de/floater_outgoing_call.xml | 9 + .../default/xui/de/floater_preview_gesture.xml | 3 + .../default/xui/de/floater_preview_notecard.xml | 4 +- .../default/xui/de/floater_preview_texture.xml | 5 +- .../skins/default/xui/de/floater_report_abuse.xml | 4 +- .../skins/default/xui/de/floater_script_limits.xml | 2 + .../skins/default/xui/de/floater_search.xml | 7 + .../skins/default/xui/de/floater_select_key.xml | 7 +- .../skins/default/xui/de/floater_sell_land.xml | 2 +- .../skins/default/xui/de/floater_snapshot.xml | 18 +- .../skins/default/xui/de/floater_sys_well.xml | 9 +- .../skins/default/xui/de/floater_telehub.xml | 11 +- .../newview/skins/default/xui/de/floater_tools.xml | 13 +- .../skins/default/xui/de/floater_top_objects.xml | 67 ++--- .../default/xui/de/floater_voice_controls.xml | 30 ++- .../default/xui/de/floater_whitelist_entry.xml | 2 +- .../skins/default/xui/de/floater_window_size.xml | 17 ++ .../skins/default/xui/de/floater_world_map.xml | 128 +++++---- .../skins/default/xui/de/inspect_avatar.xml | 10 +- .../newview/skins/default/xui/de/inspect_group.xml | 1 + .../skins/default/xui/de/menu_attachment_other.xml | 17 ++ .../skins/default/xui/de/menu_attachment_self.xml | 12 + .../skins/default/xui/de/menu_avatar_icon.xml | 2 +- .../skins/default/xui/de/menu_avatar_other.xml | 16 ++ .../skins/default/xui/de/menu_avatar_self.xml | 27 ++ .../skins/default/xui/de/menu_bottomtray.xml | 5 + .../skins/default/xui/de/menu_im_well_button.xml | 4 + .../skins/default/xui/de/menu_imchiclet_adhoc.xml | 4 + .../default/xui/de/menu_inspect_avatar_gear.xml | 1 + .../skins/default/xui/de/menu_inventory.xml | 10 +- .../skins/default/xui/de/menu_inventory_add.xml | 2 +- .../default/xui/de/menu_inventory_gear_default.xml | 2 + indra/newview/skins/default/xui/de/menu_land.xml | 9 + indra/newview/skins/default/xui/de/menu_login.xml | 6 +- .../xui/de/menu_notification_well_button.xml | 4 + indra/newview/skins/default/xui/de/menu_object.xml | 25 ++ .../skins/default/xui/de/menu_participant_list.xml | 19 +- .../skins/default/xui/de/menu_people_groups.xml | 8 + .../skins/default/xui/de/menu_people_nearby.xml | 1 + .../skins/default/xui/de/menu_profile_overflow.xml | 4 + indra/newview/skins/default/xui/de/menu_viewer.xml | 46 ++-- .../skins/default/xui/de/mime_types_linux.xml | 217 ++++++++++++++++ .../skins/default/xui/de/mime_types_mac.xml | 217 ++++++++++++++++ .../newview/skins/default/xui/de/notifications.xml | 159 +++++------- .../default/xui/de/panel_active_object_row.xml | 9 + .../default/xui/de/panel_adhoc_control_panel.xml | 16 +- .../default/xui/de/panel_avatar_list_item.xml | 1 + .../default/xui/de/panel_block_list_sidetray.xml | 4 +- .../skins/default/xui/de/panel_bottomtray.xml | 12 +- .../skins/default/xui/de/panel_edit_classified.xml | 4 +- .../skins/default/xui/de/panel_edit_profile.xml | 5 +- .../newview/skins/default/xui/de/panel_friends.xml | 46 ++-- .../default/xui/de/panel_group_control_panel.xml | 20 +- .../skins/default/xui/de/panel_group_general.xml | 8 +- .../default/xui/de/panel_group_info_sidetray.xml | 2 + .../skins/default/xui/de/panel_group_invite.xml | 8 +- .../skins/default/xui/de/panel_group_list_item.xml | 1 + .../skins/default/xui/de/panel_group_notices.xml | 14 +- .../default/xui/de/panel_im_control_panel.xml | 32 ++- .../skins/default/xui/de/panel_landmark_info.xml | 1 + indra/newview/skins/default/xui/de/panel_login.xml | 68 ++--- .../skins/default/xui/de/panel_main_inventory.xml | 8 +- .../xui/de/panel_media_settings_general.xml | 10 +- .../xui/de/panel_media_settings_permissions.xml | 25 +- .../xui/de/panel_media_settings_security.xml | 6 +- .../skins/default/xui/de/panel_my_profile.xml | 80 +++--- .../skins/default/xui/de/panel_navigation_bar.xml | 2 +- indra/newview/skins/default/xui/de/panel_notes.xml | 18 +- .../default/xui/de/panel_outfits_inventory.xml | 15 +- .../de/panel_outfits_inventory_gear_default.xml | 6 +- .../newview/skins/default/xui/de/panel_people.xml | 1 + indra/newview/skins/default/xui/de/panel_picks.xml | 12 +- .../skins/default/xui/de/panel_place_profile.xml | 1 + .../newview/skins/default/xui/de/panel_places.xml | 7 +- .../default/xui/de/panel_preferences_alerts.xml | 2 +- .../default/xui/de/panel_preferences_chat.xml | 10 +- .../default/xui/de/panel_preferences_general.xml | 24 +- .../default/xui/de/panel_preferences_privacy.xml | 6 +- .../default/xui/de/panel_preferences_setup.xml | 8 +- .../default/xui/de/panel_preferences_sound.xml | 2 +- .../default/xui/de/panel_prim_media_controls.xml | 52 +++- .../newview/skins/default/xui/de/panel_profile.xml | 77 +++--- .../skins/default/xui/de/panel_region_estate.xml | 9 +- .../skins/default/xui/de/panel_region_general.xml | 6 +- .../default/xui/de/panel_region_general_layout.xml | 43 ++++ .../skins/default/xui/de/panel_region_texture.xml | 3 +- .../xui/de/panel_script_limits_my_avatar.xml | 13 + .../xui/de/panel_script_limits_region_memory.xml | 24 ++ .../skins/default/xui/de/panel_side_tray.xml | 11 +- .../skins/default/xui/de/panel_status_bar.xml | 3 +- .../default/xui/de/panel_teleport_history.xml | 4 +- .../default/xui/de/panel_teleport_history_item.xml | 1 + .../newview/skins/default/xui/de/role_actions.xml | 244 +++++------------- .../skins/default/xui/de/sidepanel_appearance.xml | 8 +- .../skins/default/xui/de/sidepanel_inventory.xml | 2 +- .../skins/default/xui/de/sidepanel_item_info.xml | 57 ++-- .../skins/default/xui/de/sidepanel_task_info.xml | 76 +++--- indra/newview/skins/default/xui/de/strings.xml | 286 +++++++++++++++++++-- 109 files changed, 1904 insertions(+), 991 deletions(-) create mode 100644 indra/newview/skins/default/xui/de/floater_outfit_save_as.xml create mode 100644 indra/newview/skins/default/xui/de/floater_script_limits.xml create mode 100644 indra/newview/skins/default/xui/de/floater_window_size.xml create mode 100644 indra/newview/skins/default/xui/de/menu_attachment_other.xml create mode 100644 indra/newview/skins/default/xui/de/menu_attachment_self.xml create mode 100644 indra/newview/skins/default/xui/de/menu_avatar_other.xml create mode 100644 indra/newview/skins/default/xui/de/menu_avatar_self.xml create mode 100644 indra/newview/skins/default/xui/de/menu_im_well_button.xml create mode 100644 indra/newview/skins/default/xui/de/menu_imchiclet_adhoc.xml create mode 100644 indra/newview/skins/default/xui/de/menu_land.xml create mode 100644 indra/newview/skins/default/xui/de/menu_notification_well_button.xml create mode 100644 indra/newview/skins/default/xui/de/menu_object.xml create mode 100644 indra/newview/skins/default/xui/de/menu_people_groups.xml create mode 100644 indra/newview/skins/default/xui/de/mime_types_linux.xml create mode 100644 indra/newview/skins/default/xui/de/mime_types_mac.xml create mode 100644 indra/newview/skins/default/xui/de/panel_active_object_row.xml create mode 100644 indra/newview/skins/default/xui/de/panel_region_general_layout.xml create mode 100644 indra/newview/skins/default/xui/de/panel_script_limits_my_avatar.xml create mode 100644 indra/newview/skins/default/xui/de/panel_script_limits_region_memory.xml diff --git a/indra/newview/skins/default/xui/de/floater_about_land.xml b/indra/newview/skins/default/xui/de/floater_about_land.xml index af489d39d2..cd5abf86e0 100644 --- a/indra/newview/skins/default/xui/de/floater_about_land.xml +++ b/indra/newview/skins/default/xui/de/floater_about_land.xml @@ -13,7 +13,7 @@ Restzeit - + Nur neue Benutzer @@ -36,10 +36,10 @@ (In Gruppenbesitz) - Profil... + Profil - Info... + Info (öffentlich) @@ -52,7 +52,6 @@ Keine Parzelle ausgewählt. -Öffnen Sie „Welt“ > „Land-Info“ oder wählen Sie eine andere Parzelle aus, um Informationen darüber anzuzeigen. Name: @@ -78,33 +77,35 @@ Leyla Linden - -- cgit v1.2.3 From a5180babefa3f81de5321a9d6d5148ef1bd8e03a Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Wed, 27 Jan 2010 13:10:31 +0200 Subject: =?UTF-8?q?EXT-3783=20=E2=80=9CSystem=20messages=20displayed=20in?= =?UTF-8?q?=20nearby=20chat=E2=80=9D,=20added=20missing=20floater=5Fcall?= =?UTF-8?q?=5Finfo.xml;=20avoided=20recreation=20of=20LLCallInfoDialog=20w?= =?UTF-8?q?ith=20the=20same=20message;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llimview.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index f90a51c3f3..6ac7378c58 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -3239,7 +3239,13 @@ void LLCallInfoDialog::show(const std::string& status_name, const LLSD& args) LLSD payload; payload["msg"] = message; - LLFloaterReg::showInstance("call_info", payload); + LLFloater* inst = LLFloaterReg::findInstance("call_info"); + + // avoid recreate instance with the same message + if (inst == NULL || message.getString() != inst->getChild("msg")->getValue()) + { + LLFloaterReg::showInstance("call_info", payload); + } } LLHTTPRegistration -- cgit v1.2.3 From 8ea2c7a37380162ba2926bd23a01583023884408 Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Wed, 27 Jan 2010 14:16:37 +0200 Subject: Implemeted normal Sub-Task EXT - 2753 (Implement Avatar icons on IM multifloater tabs) --HG-- branch : product-engine --- indra/llui/llbutton.cpp | 22 +++++-- indra/llui/llbutton.h | 20 ++++++ indra/llui/lltabcontainer.cpp | 75 ++++++++++------------ indra/llui/lltabcontainer.h | 1 + indra/newview/app_settings/settings.xml | 44 +++++++++++++ indra/newview/llgroupmgr.cpp | 38 +++++++++++ indra/newview/llgroupmgr.h | 15 +++++ indra/newview/llimfloatercontainer.cpp | 46 ++++++------- indra/newview/llimfloatercontainer.h | 7 +- .../skins/default/xui/en/widgets/button.xml | 4 ++ 10 files changed, 197 insertions(+), 75 deletions(-) diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 9ce8ce8d55..4944ed4fe7 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -81,6 +81,10 @@ LLButton::Params::Params() image_pressed_selected("image_pressed_selected"), image_overlay("image_overlay"), image_overlay_alignment("image_overlay_alignment", std::string("center")), + image_left_pad("image_left_pad"), + image_right_pad("image_right_pad"), + image_top_pad("image_top_pad"), + image_bottom_pad("image_bottom_pad"), label_color("label_color"), label_color_selected("label_color_selected"), // requires is_toggle true label_color_disabled("label_color_disabled"), @@ -140,6 +144,10 @@ LLButton::LLButton(const LLButton::Params& p) mImageOverlay(p.image_overlay()), mImageOverlayColor(p.image_overlay_color()), mImageOverlayAlignment(LLFontGL::hAlignFromName(p.image_overlay_alignment)), + mImageOverlayLeftPad(p.image_left_pad), + mImageOverlayRightPad(p.image_right_pad), + mImageOverlayTopPad(p.image_top_pad), + mImageOverlayBottomPad(p.image_bottom_pad), mIsToggle(p.is_toggle), mScaleImage(p.scale_image), mDropShadowedText(p.label_shadow), @@ -763,6 +771,12 @@ void LLButton::draw() center_x++; } + S32 text_width_delta = overlay_width + 1; + // if image paddings set, they should participate in scaling process + S32 image_size_delta = mImageOverlayTopPad + mImageOverlayBottomPad; + overlay_width = overlay_width - image_size_delta; + overlay_height = overlay_height - image_size_delta; + // fade out overlay images on disabled buttons LLColor4 overlay_color = mImageOverlayColor.get(); if (!enabled) @@ -774,8 +788,8 @@ void LLButton::draw() switch(mImageOverlayAlignment) { case LLFontGL::LEFT: - text_left += overlay_width + 1; - text_width -= overlay_width + 1; + text_left += overlay_width + mImageOverlayRightPad + 1; + text_width -= text_width_delta; mImageOverlay->draw( mLeftHPad, center_y - (overlay_height / 2), @@ -792,8 +806,8 @@ void LLButton::draw() overlay_color); break; case LLFontGL::RIGHT: - text_right -= overlay_width + 1; - text_width -= overlay_width + 1; + text_right -= overlay_width + mImageOverlayLeftPad+ 1; + text_width -= text_width_delta; mImageOverlay->draw( getRect().getWidth() - mRightHPad - overlay_width, center_y - (overlay_height / 2), diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index cd149e3113..8e5f19602f 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -106,6 +106,12 @@ public: Optional pad_left; Optional pad_bottom; // under text label + //image overlay paddings + Optional image_left_pad; + Optional image_right_pad; + Optional image_top_pad; + Optional image_bottom_pad; + // callbacks Optional click_callback, // alias -> commit_callback mouse_down_callback, @@ -186,6 +192,15 @@ public: void setLeftHPad( S32 pad ) { mLeftHPad = pad; } void setRightHPad( S32 pad ) { mRightHPad = pad; } + void setImageOverlayLeftPad( S32 pad ) { mImageOverlayLeftPad = pad; } + S32 getImageOverlayLeftPad() const { return mImageOverlayLeftPad; } + void setImageOverlayRightPad( S32 pad ) { mImageOverlayRightPad = pad; } + S32 getImageOverlayRightPad() const { return mImageOverlayRightPad; } + void setImageOverlayTopPad( S32 pad ) { mImageOverlayTopPad = pad; } + S32 getImageOverlayTopPad() const { return mImageOverlayTopPad; } + void setImageOverlayBottomPad( S32 pad ) { mImageOverlayBottomPad = pad; } + S32 getImageOverlayBottomPad() const { return mImageOverlayBottomPad; } + const std::string getLabelUnselected() const { return wstring_to_utf8str(mUnselectedLabel); } const std::string getLabelSelected() const { return wstring_to_utf8str(mSelectedLabel); } @@ -313,6 +328,11 @@ private: S32 mRightHPad; S32 mBottomVPad; // under text label + S32 mImageOverlayLeftPad; + S32 mImageOverlayRightPad; + S32 mImageOverlayTopPad; + S32 mImageOverlayBottomPad; + F32 mHoverGlowStrength; F32 mCurGlowStrength; diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 43c44f2253..dcb3542e18 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -1373,6 +1373,8 @@ BOOL LLTabContainer::setTab(S32 which) { LLTabTuple* tuple = *iter; BOOL is_selected = ( tuple == selected_tuple ); + tuple->mButton->setUseEllipses(TRUE); + tuple->mButton->setHAlign(LLFontGL::LEFT); tuple->mTabPanel->setVisible( is_selected ); // tuple->mTabPanel->setFocus(is_selected); // not clear that we want to do this here. tuple->mButton->setToggleState( is_selected ); @@ -1478,63 +1480,54 @@ void LLTabContainer::setTabPanelFlashing(LLPanel* child, BOOL state ) void LLTabContainer::setTabImage(LLPanel* child, std::string image_name, const LLColor4& color) { - static LLUICachedControl tab_padding ("UITabPadding", 0); LLTabTuple* tuple = getTabByPanel(child); if( tuple ) { - tuple->mButton->setImageOverlay(image_name, LLFontGL::RIGHT, color); - - if (!mIsVertical) - { - // remove current width from total tab strip width - mTotalTabWidth -= tuple->mButton->getRect().getWidth(); - - S32 image_overlay_width = tuple->mButton->getImageOverlay().notNull() ? - tuple->mButton->getImageOverlay()->getImage()->getWidth(0) : - 0; - - tuple->mPadding = image_overlay_width; - - tuple->mButton->setRightHPad(6); - tuple->mButton->reshape(llclamp(mFont->getWidth(tuple->mButton->getLabelSelected()) + tab_padding + tuple->mPadding, mMinTabWidth, mMaxTabWidth), - tuple->mButton->getRect().getHeight()); - // add back in button width to total tab strip width - mTotalTabWidth += tuple->mButton->getRect().getWidth(); - - // tabs have changed size, might need to scroll to see current tab - updateMaxScrollPos(); - } + tuple->mButton->setImageOverlay(image_name, LLFontGL::LEFT, color); + reshape_tuple(tuple); } } void LLTabContainer::setTabImage(LLPanel* child, const LLUUID& image_id, const LLColor4& color) { - static LLUICachedControl tab_padding ("UITabPadding", 0); LLTabTuple* tuple = getTabByPanel(child); if( tuple ) { - tuple->mButton->setImageOverlay(image_id, LLFontGL::RIGHT, color); + tuple->mButton->setImageOverlay(image_id, LLFontGL::LEFT, color); + reshape_tuple(tuple); + } +} - if (!mIsVertical) - { - // remove current width from total tab strip width - mTotalTabWidth -= tuple->mButton->getRect().getWidth(); +void LLTabContainer::reshape_tuple(LLTabTuple* tuple) +{ + static LLUICachedControl tab_padding ("UITabPadding", 0); + static LLUICachedControl image_left_padding ("UIButtonImageLeftPadding", 4); + static LLUICachedControl image_right_padding ("UIButtonImageRightPadding", 4); + static LLUICachedControl image_top_padding ("UIButtonImageTopPadding", 2); + static LLUICachedControl image_bottom_padding ("UIButtonImageBottomPadding", 2); - S32 image_overlay_width = tuple->mButton->getImageOverlay().notNull() ? - tuple->mButton->getImageOverlay()->getImage()->getWidth(0) : - 0; + if (!mIsVertical) + { + tuple->mButton->setImageOverlayLeftPad(image_left_padding); + tuple->mButton->setImageOverlayRightPad(image_right_padding); + tuple->mButton->setImageOverlayTopPad(image_top_padding); + tuple->mButton->setImageOverlayBottomPad(image_bottom_padding); - tuple->mPadding = image_overlay_width; + // remove current width from total tab strip width + mTotalTabWidth -= tuple->mButton->getRect().getWidth(); - tuple->mButton->setRightHPad(6); - tuple->mButton->reshape(llclamp(mFont->getWidth(tuple->mButton->getLabelSelected()) + tab_padding + tuple->mPadding, mMinTabWidth, mMaxTabWidth), - tuple->mButton->getRect().getHeight()); - // add back in button width to total tab strip width - mTotalTabWidth += tuple->mButton->getRect().getWidth(); + S32 image_overlay_width = tuple->mButton->getImageOverlay().notNull() ? + tuple->mButton->getImageOverlay()->getImage()->getWidth(0) : 0; - // tabs have changed size, might need to scroll to see current tab - updateMaxScrollPos(); - } + tuple->mPadding = image_overlay_width; + + tuple->mButton->reshape(llclamp(mFont->getWidth(tuple->mButton->getLabelSelected()) + tab_padding + tuple->mPadding, mMinTabWidth, mMaxTabWidth), + tuple->mButton->getRect().getHeight()); + // add back in button width to total tab strip width + mTotalTabWidth += tuple->mButton->getRect().getWidth(); + + // tabs have changed size, might need to scroll to see current tab + updateMaxScrollPos(); } } diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h index 33c49e0d6f..2a55877d3c 100644 --- a/indra/llui/lltabcontainer.h +++ b/indra/llui/lltabcontainer.h @@ -228,6 +228,7 @@ private: // updates tab button images given the tuple, tab position and the corresponding params void update_images(LLTabTuple* tuple, TabParams params, LLTabContainer::TabPosition pos); + void reshape_tuple(LLTabTuple* tuple); // Variables diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 093e4f4894..1ef79aeec0 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9915,6 +9915,50 @@ S32 Value 15 + + UIButtonImageLeftPadding + + Comment + Button Overlay Image Left Padding + Persist + 1 + Type + S32 + Value + 4 + + UIButtonImageRightPadding + + Comment + Button Overlay Image Right Padding + Persist + 1 + Type + S32 + Value + 4 + + UIButtonImageTopPadding + + Comment + Button Overlay Image Top Padding + Persist + 1 + Type + S32 + Value + 2 + + UIButtonImageBottomPadding + + Comment + Button Overlay Image Bottom Padding + Persist + 1 + Type + S32 + Value + 2 UploadBakedTexOld diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index af58e81ca4..8bd0e520c3 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -762,6 +762,14 @@ void LLGroupMgr::addObserver(LLGroupMgrObserver* observer) mObservers.insert(std::pair(observer->getID(), observer)); } +void LLGroupMgr::addObserver(const LLUUID& group_id, LLParticularGroupMgrObserver* observer) +{ + if(group_id.notNull() && observer) + { + mParticularObservers[group_id].insert(observer); + } +} + void LLGroupMgr::removeObserver(LLGroupMgrObserver* observer) { if (!observer) @@ -784,6 +792,23 @@ void LLGroupMgr::removeObserver(LLGroupMgrObserver* observer) } } +void LLGroupMgr::removeObserver(const LLUUID& group_id, LLParticularGroupMgrObserver* observer) +{ + if(group_id.isNull() || !observer) + { + return; + } + + observer_map_t::iterator obs_it = mParticularObservers.find(group_id); + if(obs_it == mParticularObservers.end()) + return; + + obs_it->second.erase(observer); + + if (obs_it->second.size() == 0) + mParticularObservers.erase(obs_it); +} + LLGroupMgrGroupData* LLGroupMgr::getGroupData(const LLUUID& id) { group_map_t::iterator gi = mGroups.find(id); @@ -1325,6 +1350,7 @@ void LLGroupMgr::notifyObservers(LLGroupChange gc) LLUUID group_id = gi->first; if (gi->second->mChanged) { + // notify LLGroupMgrObserver // Copy the map because observers may remove themselves on update observer_multimap_t observers = mObservers; @@ -1336,6 +1362,18 @@ void LLGroupMgr::notifyObservers(LLGroupChange gc) oi->second->changed(gc); } gi->second->mChanged = FALSE; + + + // notify LLParticularGroupMgrObserver + observer_map_t::iterator obs_it = mParticularObservers.find(group_id); + if(obs_it == mParticularObservers.end()) + return; + + observer_set_t& obs = obs_it->second; + for (observer_set_t::iterator ob_it = obs.begin(); ob_it != obs.end(); ++ob_it) + { + (*ob_it)->changed(group_id, gc); + } } } } diff --git a/indra/newview/llgroupmgr.h b/indra/newview/llgroupmgr.h index 487fdd4c5b..588b4a9034 100644 --- a/indra/newview/llgroupmgr.h +++ b/indra/newview/llgroupmgr.h @@ -53,6 +53,13 @@ protected: LLUUID mID; }; +class LLParticularGroupMgrObserver +{ +public: + virtual ~LLParticularGroupMgrObserver(){} + virtual void changed(const LLUUID& group_id, LLGroupChange gc) = 0; +}; + class LLGroupRoleData; class LLGroupMemberData @@ -306,7 +313,9 @@ public: ~LLGroupMgr(); void addObserver(LLGroupMgrObserver* observer); + void addObserver(const LLUUID& group_id, LLParticularGroupMgrObserver* observer); void removeObserver(LLGroupMgrObserver* observer); + void removeObserver(const LLUUID& group_id, LLParticularGroupMgrObserver* observer); LLGroupMgrGroupData* getGroupData(const LLUUID& id); void sendGroupPropertiesRequest(const LLUUID& group_id); @@ -355,13 +364,19 @@ public: private: void notifyObservers(LLGroupChange gc); + void notifyObserver(const LLUUID& group_id, LLGroupChange gc); void addGroup(LLGroupMgrGroupData* group_datap); LLGroupMgrGroupData* createGroupData(const LLUUID &id); typedef std::multimap observer_multimap_t; observer_multimap_t mObservers; + typedef std::map group_map_t; group_map_t mGroups; + + typedef std::set observer_set_t; + typedef std::map observer_map_t; + observer_map_t mParticularObservers; }; diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 06a7b4a29c..784c2eaaf9 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -48,10 +48,7 @@ LLIMFloaterContainer::LLIMFloaterContainer(const LLSD& seed) mAutoResize = FALSE; } -LLIMFloaterContainer::~LLIMFloaterContainer() -{ - LLGroupMgr::getInstance()->removeObserver(this); -} +LLIMFloaterContainer::~LLIMFloaterContainer(){} BOOL LLIMFloaterContainer::postBuild() { @@ -95,11 +92,10 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp, if(gAgent.isInGroup(session_id)) { mSessions[session_id] = floaterp; - mID = session_id; - mGroupID.push_back(session_id); LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(session_id); LLGroupMgr* gm = LLGroupMgr::getInstance(); - gm->addObserver(this); + gm->addObserver(session_id, this); + floaterp->mCloseSignal.connect(boost::bind(&LLIMFloaterContainer::onCloseFloater, this, session_id)); if (group_data && group_data->mInsigniaID.notNull()) { @@ -107,6 +103,7 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp, } else { + mTabContainer->setTabImage(floaterp, "Generic_Group"); gm->sendGroupPropertiesRequest(session_id); } } @@ -119,13 +116,14 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp, mSessions[avatar_id] = floaterp; LLUUID* icon_id_ptr = LLAvatarIconIDCache::getInstance()->get(avatar_id); - if(!icon_id_ptr) + if(icon_id_ptr && icon_id_ptr->notNull()) { - app.sendAvatarPropertiesRequest(avatar_id); + mTabContainer->setTabImage(floaterp, *icon_id_ptr); } else { - mTabContainer->setTabImage(floaterp, *icon_id_ptr); + mTabContainer->setTabImage(floaterp, "Generic_Person"); + app.sendAvatarPropertiesRequest(avatar_id); } } } @@ -134,31 +132,28 @@ void LLIMFloaterContainer::processProperties(void* data, enum EAvatarProcessorTy { if (APT_PROPERTIES == type) { - LLAvatarData* avatar_data = static_cast(data); - if (avatar_data) + LLAvatarData* avatar_data = static_cast(data); + if (avatar_data) + { + LLUUID avatar_id = avatar_data->avatar_id; + LLUUID* cached_avatarId = LLAvatarIconIDCache::getInstance()->get(avatar_id); + if(cached_avatarId && cached_avatarId->notNull() && avatar_data->image_id != *cached_avatarId) { - LLUUID avatar_id = avatar_data->avatar_id; - if(avatar_data->image_id != *LLAvatarIconIDCache::getInstance()->get(avatar_id)) - { - LLAvatarIconIDCache::getInstance()->add(avatar_id,avatar_data->image_id); - } + LLAvatarIconIDCache::getInstance()->add(avatar_id,avatar_data->image_id); mTabContainer->setTabImage(get_ptr_in_map(mSessions, avatar_id), avatar_data->image_id); } + } } } -void LLIMFloaterContainer::changed(LLGroupChange gc) +void LLIMFloaterContainer::changed(const LLUUID& group_id, LLGroupChange gc) { if (GC_PROPERTIES == gc) { - for(groupIDs_t::iterator it = mGroupID.begin(); it!=mGroupID.end(); it++) + LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(group_id); + if (group_data && group_data->mInsigniaID.notNull()) { - LLUUID group_id = *it; - LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(group_id); - if (group_data && group_data->mInsigniaID.notNull()) - { - mTabContainer->setTabImage(get_ptr_in_map(mSessions, group_id), group_data->mInsigniaID); - } + mTabContainer->setTabImage(get_ptr_in_map(mSessions, group_id), group_data->mInsigniaID); } } } @@ -166,6 +161,7 @@ void LLIMFloaterContainer::changed(LLGroupChange gc) void LLIMFloaterContainer::onCloseFloater(LLUUID id) { LLAvatarPropertiesProcessor::instance().removeObserver(id, this); + LLGroupMgr::instance().removeObserver(id, this); } LLIMFloaterContainer* LLIMFloaterContainer::findInstance() diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index 1333b098bc..e4a32dbe1d 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -43,7 +43,7 @@ class LLTabContainer; -class LLIMFloaterContainer : public LLMultiFloater, public LLAvatarPropertiesObserver, public LLGroupMgrObserver +class LLIMFloaterContainer : public LLMultiFloater, public LLAvatarPropertiesObserver, public LLParticularGroupMgrObserver { public: LLIMFloaterContainer(const LLSD& seed); @@ -57,7 +57,7 @@ public: LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END); void processProperties(void* data, EAvatarProcessorType type); - void changed(LLGroupChange gc); + void changed(const LLUUID& group_id, LLGroupChange gc); static LLFloater* getCurrentVoiceFloater(); @@ -69,9 +69,6 @@ private: typedef std::map avatarID_panel_map_t; avatarID_panel_map_t mSessions; - typedef std::vector groupIDs_t; - groupIDs_t mGroupID; - void onCloseFloater(LLUUID avatar_id); }; diff --git a/indra/newview/skins/default/xui/en/widgets/button.xml b/indra/newview/skins/default/xui/en/widgets/button.xml index 51f85e65e2..74d8478551 100644 --- a/indra/newview/skins/default/xui/en/widgets/button.xml +++ b/indra/newview/skins/default/xui/en/widgets/button.xml @@ -7,6 +7,10 @@ image_selected="PushButton_Selected" image_disabled_selected="PushButton_Selected_Disabled" image_disabled="PushButton_Disabled" + image_left_pad="0" + image_right_pad="0" + image_top_pad="0" + image_bottom_pad="0" label_color="ButtonLabelColor" label_color_selected="ButtonLabelSelectedColor" label_color_disabled="ButtonLabelDisabledColor" -- cgit v1.2.3 From 684cfb722e433c7625c7c945aca05e0154915c8f Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Wed, 27 Jan 2010 14:06:44 +0200 Subject: Work on critical bug EXT-4725 (Viewer crashes if try to call from 'Nearby voice' floater) - reverted workaround implemented in the d1e9333a6203 changeset. Bug will be fixed in the correct way. --HG-- branch : product-engine --- indra/newview/llparticipantlist.cpp | 6 ------ indra/newview/skins/default/xui/en/menu_participant_list.xml | 3 +++ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index d54cbfe203..f83f3eba96 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -433,12 +433,6 @@ LLContextMenu* LLParticipantList::LLParticipantListMenu::createMenu() LLContextMenu* main_menu = LLUICtrlFactory::getInstance()->createFromFile( "menu_participant_list.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); - // AD *TODO: This is workaround for EXT-4725- way to properly enable/disable "Call" menu item in - // enableContextMenuItem() should be found. - bool not_agent = mUUIDs.front() != gAgentID; - bool can_call = not_agent && LLVoiceClient::voiceEnabled() && gVoiceClient->voiceWorking(); - main_menu->setItemEnabled("Call", can_call); - // Don't show sort options for P2P chat bool is_sort_visible = (mParent.mAvatarList && mParent.mAvatarList->size() > 1); main_menu->setItemVisible("SortByName", is_sort_visible); 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 04e02d0f6c..805ffbae66 100644 --- a/indra/newview/skins/default/xui/en/menu_participant_list.xml +++ b/indra/newview/skins/default/xui/en/menu_participant_list.xml @@ -57,6 +57,9 @@ name="Call"> + Date: Wed, 27 Jan 2010 14:24:37 +0200 Subject: Fixed critical bug EXT-4725 (Viewer crashes if try to call from 'Nearby voice' floater) - reason: LLContextMenu was not not deleted when LLPanelPeopleMenus::ContextMenu was destroyed. Associated callbacks were called by Menu Holder for last selected menu_item_call for destroyed LLParticipantList::LLParticipantListMenu - fix: added destruction of LLContextMenu when LLPanelPeopleMenus::ContextMenu is destructed. --HG-- branch : product-engine --- indra/newview/llpanelpeoplemenus.cpp | 9 +++++++++ indra/newview/llpanelpeoplemenus.h | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index d9651a6045..501dac5dff 100644 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -55,6 +55,15 @@ ContextMenu::ContextMenu() { } +ContextMenu::~ContextMenu() +{ + // do not forget delete LLContextMenu* mMenu. + // It can have registered Enable callbacks which are called from the LLMenuHolderGL::draw() + // via selected item (menu_item_call) by calling LLMenuItemCallGL::buildDrawLabel. + // we can have a crash via using callbacks of deleted instance of ContextMenu. EXT-4725 + if (mMenu) mMenu->die(); +} + void ContextMenu::show(LLView* spawning_view, const std::vector& uuids, S32 x, S32 y) { if (mMenu) diff --git a/indra/newview/llpanelpeoplemenus.h b/indra/newview/llpanelpeoplemenus.h index 14ae2985f0..7251f6dbbd 100644 --- a/indra/newview/llpanelpeoplemenus.h +++ b/indra/newview/llpanelpeoplemenus.h @@ -45,7 +45,7 @@ class ContextMenu : public LLAvatarListItem::ContextMenu { public: ContextMenu(); - virtual ~ContextMenu() {} + virtual ~ContextMenu(); /** * Show the menu at specified coordinates. -- cgit v1.2.3 From 313e3c92c7f348e0c6856183955e2f34fefa1b0a Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Wed, 27 Jan 2010 14:52:58 +0200 Subject: fixed EXT-4667 color and texture eyedrop selectors do not work in appearance mode --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/floater_color_picker.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/floater_color_picker.xml b/indra/newview/skins/default/xui/en/floater_color_picker.xml index fbecebc363..0daef29bc5 100644 --- a/indra/newview/skins/default/xui/en/floater_color_picker.xml +++ b/indra/newview/skins/default/xui/en/floater_color_picker.xml @@ -181,7 +181,7 @@ image_unselected="eye_button_inactive.tga" layout="topleft" left_pad="50" - name="Pipette" + name="color_pipette" width="28" />