diff options
author | Steven Bennetts <steve@lindenlab.com> | 2009-08-26 20:47:27 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2009-08-26 20:47:27 +0000 |
commit | af98aad98d43ec8b128ecac3089426d6ae6edc3f (patch) | |
tree | 5971f87afc04580df470a003793dcc8c974e29a7 /indra | |
parent | 6a364e6f32c12c1ab2c0f33e8ef07d885a8765a2 (diff) |
svn merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0@1471 https://svn.aws.productengine.com/secondlife/pe/stable-1@1476 -> viewer-2.0.0-3
EXT-65 EXT-270 EXT-359 EXT-361 EXT-367 EXT-367 EXT-368 EXT-455 EXT-468 EXT-530 EXT-539 EXT-540 EXT-542 EXT-545 EXT-555 EXT-557 EXT-558 EXT-559 EXT-559 EXT-560 EXT-561 EXT-562 EXT-563 EXT-564 EXT-566 EXT-568 EXT-569 EXT-570 EXT-571 EXT-581 EXT-590 EXT-594 EXT-596 EXT-597 EXT-601 EXT-602 EXT-603 EXT-613 EXT-620 EXT-624 EXT-628 EXT-630 EXT-631 EXT-632 EXT-639 EXT-640 EXT-641 EXT-642 EXT-662 EXT-671 EXT-672 EXT-676 EXT-682 EXT-692 EXT-703 EXT-717
Diffstat (limited to 'indra')
134 files changed, 2165 insertions, 1299 deletions
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index b6c3ffc61c..4edae46f32 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -1353,23 +1353,26 @@ void LLMenuItemBranchDownGL::openMenu( void ) // set the hover status (called by it's menu) void LLMenuItemBranchDownGL::setHighlight( BOOL highlight ) { - if (highlight == getHighlight()) return; - - LLMenuGL* branch = getBranch(); - if (!branch) return; + if (highlight == getHighlight()) + return; //NOTE: Purposely calling all the way to the base to bypass auto-open. LLMenuItemGL::setHighlight(highlight); + + LLMenuGL* branch = getBranch(); + if (!branch) + return; + if( !highlight) { - if (getBranch()->getTornOff()) + if (branch->getTornOff()) { - ((LLFloater*)getBranch()->getParent())->setFocus(FALSE); - getBranch()->clearHoverItem(); + ((LLFloater*)branch->getParent())->setFocus(FALSE); + branch->clearHoverItem(); } else { - getBranch()->setVisible( FALSE ); + branch->setVisible( FALSE ); } } } @@ -1638,6 +1641,7 @@ LLMenuGL::LLMenuGL(const LLMenuGL::Params& p) mDropShadowed( p.drop_shadow ), mHorizontalLayout( p.horizontal_layout ), mScrollable(mHorizontalLayout ? FALSE : p.scrollable), // Scrolling is supported only for vertical layout + mMaxScrollableItems(p.max_scrollable_items), mKeepFixedSize( p.keep_fixed_size ), mLabel (p.label), mLastMouseX(0), @@ -1911,6 +1915,7 @@ void LLMenuGL::arrange( void ) item_list_t::iterator first_hidden_item_iter = mItems.end(); S32 height_before_first_visible_item = -1; S32 visible_items_height = 0; + U32 scrollable_items_cnt = 0; if (mHorizontalLayout) { @@ -2005,12 +2010,16 @@ void LLMenuGL::arrange( void ) { height_before_first_visible_item = height - (*item_iter)->getNominalHeight(); first_visible_item_iter = item_iter; + scrollable_items_cnt = 0; } - if (-1 != height_before_first_visible_item && 0 == visible_items_height && height - height_before_first_visible_item > max_height - spillover_item_height * 2) + if (-1 != height_before_first_visible_item && 0 == visible_items_height && + (++scrollable_items_cnt > mMaxScrollableItems || + height - height_before_first_visible_item > max_height - spillover_item_height * 2 )) { first_hidden_item_iter = item_iter; visible_items_height = height - height_before_first_visible_item - (*item_iter)->getNominalHeight(); + scrollable_items_cnt--; } } } @@ -2020,16 +2029,16 @@ void LLMenuGL::arrange( void ) { S32 max_items_height = max_height - spillover_item_height * 2; + if (visible_items_height == 0) + visible_items_height = height - height_before_first_visible_item; + // Fix mFirstVisibleItem value, if it doesn't allow to display all items, that can fit - if (visible_items_height < max_items_height) + if (visible_items_height < max_items_height && scrollable_items_cnt < mMaxScrollableItems) { - if (visible_items_height == 0) - { - visible_items_height = height - height_before_first_visible_item; - } - item_list_t::iterator tmp_iter(first_visible_item_iter); - while (visible_items_height < max_items_height && first_visible_item_iter != mItems.begin()) + while (visible_items_height < max_items_height && + scrollable_items_cnt < mMaxScrollableItems && + first_visible_item_iter != mItems.begin()) { if ((*first_visible_item_iter)->getVisible()) { @@ -2043,6 +2052,7 @@ void LLMenuGL::arrange( void ) { visible_items_height += (*first_visible_item_iter)->getNominalHeight(); height_before_first_visible_item -= (*first_visible_item_iter)->getNominalHeight(); + scrollable_items_cnt++; } } @@ -2051,6 +2061,7 @@ void LLMenuGL::arrange( void ) { visible_items_height -= (*first_visible_item_iter)->getNominalHeight(); height_before_first_visible_item += (*first_visible_item_iter)->getNominalHeight(); + scrollable_items_cnt--; first_visible_item_iter = tmp_iter; } if (!(*first_visible_item_iter)->getVisible()) diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index 2e7f61c2dd..44459a6c0e 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -382,6 +382,7 @@ public: create_jump_keys, keep_fixed_size, scrollable; + Optional<U32> max_scrollable_items; Optional<LLUIColor> bg_color; Optional<S32> shortcut_pad; @@ -394,6 +395,7 @@ public: create_jump_keys("create_jump_keys", false), bg_color("bg_color", LLUIColorTable::instance().getColor( "MenuDefaultBgColor" )), scrollable("scrollable", false), + max_scrollable_items("max_scrollable_items", U32_MAX), shortcut_pad("shortcut_pad") { addSynonym(bg_visible, "opaque"); @@ -541,6 +543,7 @@ protected: S32 mLastMouseY; S32 mMouseVelX; S32 mMouseVelY; + U32 mMaxScrollableItems; BOOL mHorizontalLayout; BOOL mScrollable; BOOL mKeepFixedSize; diff --git a/indra/llui/llsearcheditor.h b/indra/llui/llsearcheditor.h index 368b68baa3..cd2867b493 100644 --- a/indra/llui/llsearcheditor.h +++ b/indra/llui/llsearcheditor.h @@ -67,6 +67,8 @@ public: virtual ~LLSearchEditor() {} void setText(const LLStringExplicit &new_text) { mSearchEditor->setText(new_text); } + const std::string& getText() const { return mSearchEditor->getText(); } + // LLUICtrl interface virtual void setValue(const LLSD& value ); @@ -75,6 +77,12 @@ public: virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); virtual void clear(); + void setKeystrokeCallback(LLLineEditor::callback_t callback, void* user_data) + { + if(mSearchEditor) + mSearchEditor->setKeystrokeCallback(callback,user_data); + } + private: LLLineEditor* mSearchEditor; LLButton* mSearchButton; diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index d7eabf33c4..30904bd6c9 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -73,6 +73,7 @@ set(viewer_SOURCE_FILES llagentdata.cpp llagentlanguage.cpp llagentpilot.cpp + llagentui.cpp llagentwearables.cpp llanimstatelabels.cpp llappviewer.cpp @@ -235,6 +236,7 @@ set(viewer_SOURCE_FILES llhudrender.cpp llhudtext.cpp llhudview.cpp + llimhandler.cpp llimpanel.cpp llimview.cpp llimcontrolpanel.cpp @@ -374,6 +376,7 @@ set(viewer_SOURCE_FILES lltoast.cpp lltoastalertpanel.cpp lltoastgroupnotifypanel.cpp + lltoastimpanel.cpp lltoastnotifypanel.cpp lltoastpanel.cpp lltoggleablemenu.cpp @@ -518,6 +521,7 @@ set(viewer_HEADER_FILES llagentdata.h llagentlanguage.h llagentpilot.h + llagentui.h llagentwearables.h llanimstatelabels.h llappearance.h @@ -824,6 +828,7 @@ set(viewer_HEADER_FILES lltoast.h lltoastalertpanel.h lltoastgroupnotifypanel.h + lltoastimpanel.h lltoastnotifypanel.h lltoastpanel.h lltoggleablemenu.h diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 4e7b3e2f68..9835c5a4cf 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7243,17 +7243,6 @@ <key>Value</key> <integer>0</integer> </map> - <key>ShowSearchBar</key> - <map> - <key>Comment</key> - <string>Show the Search Bar in the Status Overlay</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> <key>ShowNetStats</key> <map> <key>Comment</key> @@ -8153,6 +8142,17 @@ <key>Value</key> <string>5748decc-f629-461c-9a36-a35a221fe21f</string> </map> + <key>StartUpChannelUUID</key> + <map> + <key>Comment</key> + <string /> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string>B56AF90D-6684-48E4-B1E4-722D3DEB2CB6</string> + </map> <key>NearByChatChannelUUID</key> <map> <key>Comment</key> @@ -8164,6 +8164,28 @@ <key>Value</key> <string>E1158BD6-661C-4981-9DAD-4DCBFF062502</string> </map> + <key>NotificationChannelUUID</key> + <map> + <key>Comment</key> + <string /> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string>AEED3193-8709-4693-8558-7452CCA97AE5</string> + </map> + <key>AlertChannelUUID</key> + <map> + <key>Comment</key> + <string /> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string>F3E07BC8-A973-476D-8C7F-F3B7293975D1</string> + </map> <key>UIImgWhiteUUID</key> <map> <key>Comment</key> diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 4166d96219..ae30c1959c 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -104,6 +104,7 @@ #include "llcapabilitylistener.h" #include "llnavigationbar.h" //to show/hide navigation bar when changing mouse look state +#include "llagentui.h" using namespace LLVOAvatarDefines; @@ -912,6 +913,8 @@ void LLAgent::setRegion(LLViewerRegion *regionp) mRegionsVisited.insert(handle); LLSelectMgr::getInstance()->updateSelectionCenter(); + + LLFloaterMove::sUpdateFlyingStatus(); } @@ -937,42 +940,6 @@ LLHost LLAgent::getRegionHost() const } //----------------------------------------------------------------------------- -// getSLURL() -// returns empty() if getRegion() == NULL -//----------------------------------------------------------------------------- -std::string LLAgent::getSLURL() const -{ - return buildSLURL(true); -} - -//----------------------------------------------------------------------------- -// getUnescapedSLURL() -// returns empty() if getRegion() == NULL -//----------------------------------------------------------------------------- -std::string LLAgent::getUnescapedSLURL() const -{ - return buildSLURL(false); -} - -std::string LLAgent::buildSLURL(const bool escape) const -{ - std::string slurl; - LLViewerRegion *regionp = getRegion(); - if (regionp) - { - LLVector3d agentPos = getPositionGlobal(); - S32 x = llround( (F32)fmod( agentPos.mdV[VX], (F64)REGION_WIDTH_METERS ) ); - S32 y = llround( (F32)fmod( agentPos.mdV[VY], (F64)REGION_WIDTH_METERS ) ); - S32 z = llround( (F32)agentPos.mdV[VZ] ); - if (escape) - slurl = LLSLURL::buildSLURL(regionp->getName(), x, y, z); - else - slurl = LLSLURL::buildUnescapedSLURL(regionp->getName(), x, y, z); - } - return slurl; -} - -//----------------------------------------------------------------------------- // inPrelude() //----------------------------------------------------------------------------- BOOL LLAgent::inPrelude() @@ -2854,6 +2821,8 @@ void LLAgent::endAnimationUpdateUI() LLSideTray::getInstance()->setVisible(TRUE); + LLPanelStandStopFlying::getInstance()->setVisible(TRUE); + LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); LLFloaterCamera::toPrevModeIfInAvatarViewMode(); @@ -2946,6 +2915,8 @@ void LLAgent::endAnimationUpdateUI() LLSideTray::getInstance()->setVisible(FALSE); + LLPanelStandStopFlying::getInstance()->setVisible(FALSE); + // clear out camera lag effect mCameraLag.clearVec(); @@ -5062,14 +5033,7 @@ void LLAgent::handleMaturity(const LLSD& newvalue) //---------------------------------------------------------------------------- -void LLAgent::buildFullname(std::string& name) const -{ - if (mAvatarObject.notNull()) - { - name = mAvatarObject->getFullname(); - } -} - +//*TODO remove, is not used anywhere as of August 20, 2009 void LLAgent::buildFullnameAndTitle(std::string& name) const { if (isGroupMember()) @@ -5223,97 +5187,6 @@ BOOL LLAgent::setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOO return FALSE; } -// utility to build a location string -BOOL LLAgent::buildLocationString(std::string& str, ELocationFormat fmt) -{ - LLViewerRegion* region = getRegion(); - LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - - if (!region || !parcel) - return FALSE; - - const LLVector3& agent_pos_region = getPositionAgent(); - S32 pos_x = S32(agent_pos_region.mV[VX]); - S32 pos_y = S32(agent_pos_region.mV[VY]); - S32 pos_z = S32(agent_pos_region.mV[VZ]); - - // Round the numbers based on the velocity - LLVector3 agent_velocity = getVelocity(); - F32 velocity_mag_sq = agent_velocity.magVecSquared(); - - const F32 FLY_CUTOFF = 6.f; // meters/sec - const F32 FLY_CUTOFF_SQ = FLY_CUTOFF * FLY_CUTOFF; - const F32 WALK_CUTOFF = 1.5f; // meters/sec - const F32 WALK_CUTOFF_SQ = WALK_CUTOFF * WALK_CUTOFF; - - if (velocity_mag_sq > FLY_CUTOFF_SQ) - { - pos_x -= pos_x % 4; - pos_y -= pos_y % 4; - } - else if (velocity_mag_sq > WALK_CUTOFF_SQ) - { - pos_x -= pos_x % 2; - pos_y -= pos_y % 2; - } - - // create a defult name and description for the landmark - std::string parcel_name = LLViewerParcelMgr::getInstance()->getAgentParcelName(); - std::string region_name = region->getName(); - std::string buffer; - if( LLViewerParcelMgr::getInstance()->getAgentParcelName().empty() ) - { - // the parcel doesn't have a name - switch (fmt) - { - case LOCATION_FORMAT_LANDMARK: - buffer = llformat("%.100s", region_name.c_str()); - break; - case LOCATION_FORMAT_NORMAL: - buffer = llformat("%s", region_name.c_str()); - break; - case LOCATION_FORMAT_WITHOUT_SIM: - case LOCATION_FORMAT_FULL: - buffer = llformat("%s (%d, %d, %d)", - region_name.c_str(), - pos_x, pos_y, pos_z); - break; - } - } - else - { - // the parcel has a name, so include it in the landmark name - switch (fmt) - { - case LOCATION_FORMAT_LANDMARK: - buffer = llformat("%.100s", parcel_name.c_str()); - break; - case LOCATION_FORMAT_NORMAL: - buffer = llformat("%s, %s", - region_name.c_str(), - parcel_name.c_str()); - break; - case LOCATION_FORMAT_WITHOUT_SIM: - buffer = llformat("%s, %s (%d, %d, %d)", - region_name.c_str(), - parcel_name.c_str(), - pos_x, pos_y, pos_z); - break; - case LOCATION_FORMAT_FULL: - std::string sim_access_string = region->getSimAccessString(); - buffer = llformat("%s, %s (%d, %d, %d)%s%s", - region_name.c_str(), - parcel_name.c_str(), - pos_x, pos_y, pos_z, - sim_access_string.empty() ? "" : " - ", - sim_access_string.c_str()); - break; - } - } - str = buffer; - return TRUE; -} - LLQuaternion LLAgent::getHeadRotation() { if (mAvatarObject.isNull() || !mAvatarObject->mPelvisp || !mAvatarObject->mHeadp) @@ -5475,30 +5348,6 @@ BOOL LLAgent::allowOperation(PermissionBit op, return perm.allowOperationBy(op, agent_proxy, group_proxy); } - -void LLAgent::getName(std::string& name) const -{ - name.clear(); - - if (mAvatarObject.notNull()) - { - LLNameValue *first_nv = mAvatarObject->getNVPair("FirstName"); - LLNameValue *last_nv = mAvatarObject->getNVPair("LastName"); - if (first_nv && last_nv) - { - name = first_nv->printData() + " " + last_nv->printData(); - } - else - { - llwarns << "Agent is missing FirstName and/or LastName nv pair." << llendl; - } - } - else - { - name = gSavedSettings.getString("FirstName") + " " + gSavedSettings.getString("LastName"); - } -} - const LLColor4 &LLAgent::getEffectColor() { return mEffectColor; @@ -6308,12 +6157,12 @@ void LLAgent::setTeleportState(ETeleportState state) if (mTeleportState == TELEPORT_MOVING) { // We're outa here. Save "back" slurl. - mTeleportSourceSLURL = getSLURL(); + mTeleportSourceSLURL = LLAgentUI::buildSLURL(); } else if(mTeleportState == TELEPORT_ARRIVING) { // Let the interested parties know we've teleported. - LLViewerParcelMgr::getInstance()->onTeleportFinished(); + LLViewerParcelMgr::getInstance()->onTeleportFinished(false, getPositionGlobal()); } } diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 3a8cf5fd97..9f71def63e 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -169,8 +169,7 @@ public: // Name //-------------------------------------------------------------------- public: - void getName(std::string& name) const; - void buildFullname(std::string &name) const; + //*TODO remove, is not used as of August 20, 2009 void buildFullnameAndTitle(std::string &name) const; //-------------------------------------------------------------------- @@ -274,13 +273,9 @@ public: void setRegion(LLViewerRegion *regionp); LLViewerRegion *getRegion() const; LLHost getRegionHost() const; - std::string getSLURL() const; - std::string getUnescapedSLURL() const; BOOL inPrelude(); - BOOL buildLocationString(std::string& str, ELocationFormat fmt = LOCATION_FORMAT_LANDMARK); // Utility to build a location string private: LLViewerRegion *mRegionp; - std::string buildSLURL(const bool escape) const; //-------------------------------------------------------------------- // History diff --git a/indra/newview/llagentui.cpp b/indra/newview/llagentui.cpp new file mode 100644 index 0000000000..93d88bf3df --- /dev/null +++ b/indra/newview/llagentui.cpp @@ -0,0 +1,179 @@ +/** + * @file llagentui.cpp + * @brief Utility methods to process agent's data as slurl's etc. before displaying + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 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$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llagentui.h" + +// Library includes +#include "llparcel.h" + +// Viewer includes +#include "llagent.h" +#include "llviewercontrol.h" +#include "llviewerregion.h" +#include "llviewerparcelmgr.h" +#include "llvoavatarself.h" +#include "llslurl.h" + +//static +void LLAgentUI::buildName(std::string& name) +{ + name.clear(); + + LLVOAvatarSelf* avatar_object = gAgent.getAvatarObject(); + if (avatar_object) + { + LLNameValue *first_nv = avatar_object->getNVPair("FirstName"); + LLNameValue *last_nv = avatar_object->getNVPair("LastName"); + if (first_nv && last_nv) + { + name = first_nv->printData() + " " + last_nv->printData(); + } + else + { + llwarns << "Agent is missing FirstName and/or LastName nv pair." << llendl; + } + } + else + { + name = gSavedSettings.getString("FirstName") + " " + gSavedSettings.getString("LastName"); + } +} + +//static +void LLAgentUI::buildFullname(std::string& name) +{ + if (gAgent.getAvatarObject()) name = gAgent.getAvatarObject()->getFullname(); +} + +//static +std::string LLAgentUI::buildSLURL(const bool escaped /*= true*/) +{ + std::string slurl; + LLViewerRegion *regionp = gAgent.getRegion(); + if (regionp) + { + LLVector3d agentPos = gAgent.getPositionGlobal(); + slurl = LLSLURL::buildSLURLfromPosGlobal(regionp->getName(), agentPos, escaped); + } + return slurl; +} + +BOOL LLAgentUI::buildLocationString(std::string& str, LLAgent::ELocationFormat fmt,const LLVector3& agent_pos_region) +{ + LLViewerRegion* region = gAgent.getRegion(); + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + + if (!region || !parcel) return FALSE; + + S32 pos_x = S32(agent_pos_region.mV[VX]); + S32 pos_y = S32(agent_pos_region.mV[VY]); + S32 pos_z = S32(agent_pos_region.mV[VZ]); + + // Round the numbers based on the velocity + F32 velocity_mag_sq = gAgent.getVelocity().magVecSquared(); + + const F32 FLY_CUTOFF = 6.f; // meters/sec + const F32 FLY_CUTOFF_SQ = FLY_CUTOFF * FLY_CUTOFF; + const F32 WALK_CUTOFF = 1.5f; // meters/sec + const F32 WALK_CUTOFF_SQ = WALK_CUTOFF * WALK_CUTOFF; + + if (velocity_mag_sq > FLY_CUTOFF_SQ) + { + pos_x -= pos_x % 4; + pos_y -= pos_y % 4; + } + else if (velocity_mag_sq > WALK_CUTOFF_SQ) + { + pos_x -= pos_x % 2; + pos_y -= pos_y % 2; + } + + // create a default name and description for the landmark + std::string parcel_name = LLViewerParcelMgr::getInstance()->getAgentParcelName(); + std::string region_name = region->getName(); + std::string buffer; + if( parcel_name.empty() ) + { + // the parcel doesn't have a name + switch (fmt) + { + case LLAgent::LOCATION_FORMAT_LANDMARK: + buffer = llformat("%.100s", region_name.c_str()); + break; + case LLAgent::LOCATION_FORMAT_NORMAL: + buffer = llformat("%s", region_name.c_str()); + break; + case LLAgent::LOCATION_FORMAT_WITHOUT_SIM: + case LLAgent::LOCATION_FORMAT_FULL: + buffer = llformat("%s (%d, %d, %d)", + region_name.c_str(), + pos_x, pos_y, pos_z); + break; + } + } + else + { + // the parcel has a name, so include it in the landmark name + switch (fmt) + { + case LLAgent::LOCATION_FORMAT_LANDMARK: + buffer = llformat("%.100s", parcel_name.c_str()); + break; + case LLAgent::LOCATION_FORMAT_NORMAL: + buffer = llformat("%s, %s", region_name.c_str(), parcel_name.c_str()); + break; + case LLAgent::LOCATION_FORMAT_WITHOUT_SIM: + buffer = llformat("%s, %s (%d, %d, %d)", + region_name.c_str(), + parcel_name.c_str(), + pos_x, pos_y, pos_z); + break; + case LLAgent::LOCATION_FORMAT_FULL: + std::string sim_access_string = region->getSimAccessString(); + buffer = llformat("%s, %s (%d, %d, %d)%s%s", + region_name.c_str(), + parcel_name.c_str(), + pos_x, pos_y, pos_z, + sim_access_string.empty() ? "" : " - ", + sim_access_string.c_str()); + break; + } + } + str = buffer; + return TRUE; +} +BOOL LLAgentUI::buildLocationString(std::string& str, LLAgent::ELocationFormat fmt) +{ + return buildLocationString(str,fmt, gAgent.getPositionAgent()); +} diff --git a/indra/newview/llagentui.h b/indra/newview/llagentui.h new file mode 100644 index 0000000000..c3bc58d791 --- /dev/null +++ b/indra/newview/llagentui.h @@ -0,0 +1,51 @@ +/** + * @file llagentui.h + * @brief Utility methods to process agent's data as slurl's etc. before displaying + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 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 LLAGENTUI_H +#define LLAGENTUI_H + +#include "llagent.h" + +class LLAgentUI +{ +public: + static void buildName(std::string& name); + static void buildFullname(std::string &name); + + static std::string buildSLURL(const bool escaped = true); + //build location string using the current position of gAgent. + static BOOL buildLocationString(std::string& str, LLAgent::ELocationFormat fmt = LLAgent::LOCATION_FORMAT_LANDMARK); + //build location string using a region position of the avatar. + static BOOL buildLocationString(std::string& str, LLAgent::ELocationFormat fmt,const LLVector3& agent_pos_region); +}; + +#endif //LLAGENTUI_H diff --git a/indra/newview/llchannelmanager.cpp b/indra/newview/llchannelmanager.cpp index 57ea6064a4..a8373491cf 100644 --- a/indra/newview/llchannelmanager.cpp +++ b/indra/newview/llchannelmanager.cpp @@ -36,6 +36,7 @@ #include "llappviewer.h" #include "llviewercontrol.h" +#include "llimview.h" #include <algorithm> @@ -62,44 +63,66 @@ void LLChannelManager::onLoginCompleted() for(std::vector<ChannelElem>::iterator it = mChannelList.begin(); it != mChannelList.end(); ++it) { + if((*it).channel->getChannelID() == LLUUID(gSavedSettings.getString("NearByChatChannelUUID"))) + { + continue; + } + if(!(*it).channel->getDisplayToastsAlways()) { away_notifications +=(*it).channel->getNumberOfHiddenToasts(); } } + // *TODO: calculate IM notifications + away_notifications += gIMMgr->getNumberOfUnreadIM(); + if(!away_notifications) { - LLScreenChannel::setStartUpToastShown(); + onStartUpToastClose(); return; } LLChannelManager::Params p; - p.id = LLUUID(STARTUP_CHANNEL_ID); + p.id = LLUUID(gSavedSettings.getString("StartUpChannelUUID")); p.channel_right_bound = getRootView()->getRect().mRight - gSavedSettings.getS32("NotificationChannelRightMargin"); p.channel_width = gSavedSettings.getS32("NotifyBoxWidth"); mStartUpChannel = createChannel(p); if(!mStartUpChannel) + { + onStartUpToastClose(); return; + } - static_cast<LLUICtrl*>(mStartUpChannel)->setCommitCallback(boost::bind(&LLChannelManager::removeStartUpChannel, this)); + mStartUpChannel->setShowToasts(true); + static_cast<LLUICtrl*>(mStartUpChannel)->setCommitCallback(boost::bind(&LLChannelManager::onStartUpToastClose, this)); mStartUpChannel->createStartUpToast(away_notifications, gSavedSettings.getS32("ChannelBottomPanelMargin"), gSavedSettings.getS32("StartUpToastTime")); } //-------------------------------------------------------------------------- -void LLChannelManager::removeStartUpChannel() +void LLChannelManager::onStartUpToastClose() { - if(!mStartUpChannel) - return; + if(mStartUpChannel) + { + mStartUpChannel->setVisible(FALSE); + mStartUpChannel->closeStartUpToast(); + getRootView()->removeChild(mStartUpChannel); + removeChannelByID(LLUUID(gSavedSettings.getString("StartUpChannelUUID"))); + delete mStartUpChannel; + mStartUpChannel = NULL; + } - mStartUpChannel->setVisible(FALSE); - mStartUpChannel->closeStartUpToast(); - getRootView()->removeChild(mStartUpChannel); - delete mStartUpChannel; - mStartUpChannel = NULL; + // set StartUp Toast Flag + LLScreenChannel::setStartUpToastShown(); + + // allow all other channels to show incoming toasts + for(std::vector<ChannelElem>::iterator it = mChannelList.begin(); it != mChannelList.end(); ++it) + { + (*it).channel->setShowToasts(true); + } - //force NEARBY CHAT CHANNEL to repost all toasts if present + // force NEARBY CHAT CHANNEL to repost all toasts if present LLScreenChannel* nearby_channel = getChannelByID(LLUUID(gSavedSettings.getString("NearByChatChannelUUID"))); nearby_channel->loadStoredToastsToChannel(); nearby_channel->setCanStoreToasts(false); @@ -122,7 +145,7 @@ LLScreenChannel* LLChannelManager::createChannel(LLChannelManager::Params& p) if(new_channel) return new_channel; - new_channel = new LLScreenChannel(); + new_channel = new LLScreenChannel(p.id); getRootView()->addChild(new_channel); new_channel->init(p.channel_right_bound - p.channel_width, p.channel_right_bound); new_channel->setToastAlignment(p.align); @@ -179,15 +202,26 @@ void LLChannelManager::reshape(S32 width, S32 height, BOOL called_from_parent) } //-------------------------------------------------------------------------- - -LLScreenChannel* LLChannelManager::getStartUpChannel() +void LLChannelManager::removeChannelByID(const LLUUID id) { - return mStartUpChannel; + std::vector<ChannelElem>::iterator it = find(mChannelList.begin(), mChannelList.end(), id); + if(it != mChannelList.end()) + { + mChannelList.erase(it); + } } //-------------------------------------------------------------------------- +void LLChannelManager::removeChannelByChiclet(const LLChiclet* chiclet) +{ + std::vector<ChannelElem>::iterator it = find(mChannelList.begin(), mChannelList.end(), chiclet); + if(it != mChannelList.end()) + { + mChannelList.erase(it); + } +} - +//-------------------------------------------------------------------------- diff --git a/indra/newview/llchannelmanager.h b/indra/newview/llchannelmanager.h index dbd2e0b422..e26c96b62e 100644 --- a/indra/newview/llchannelmanager.h +++ b/indra/newview/llchannelmanager.h @@ -44,9 +44,6 @@ namespace LLNotificationsUI { - -#define STARTUP_CHANNEL_ID "AEED3193-8709-4693-8558-7452CCA97AE5" - /** * Manager for screen channels. * Responsible for instantiating and retrieving screen channels. @@ -56,19 +53,16 @@ class LLChannelManager : public LLUICtrl, public LLSingleton<LLChannelManager> public: struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> { - Optional<LLUUID> id; - Optional<LLChiclet*> chiclet; - Optional<S32> channel_right_bound; - Optional<S32> channel_width; - Optional<bool> display_toasts_always; - Optional<EToastAlignment> align; - - Params(): id("id", LLUUID("")), - chiclet("chiclet", NULL), - channel_right_bound("channel_right_bound", 0), - channel_width("channel_width", 0), - display_toasts_always("display_toasts_always", false), - align("align", NA_BOTTOM) + LLUUID id; + LLChiclet* chiclet; + S32 channel_right_bound; + S32 channel_width; + bool display_toasts_always; + EToastAlignment align; + + Params(): id(LLUUID("")), chiclet(NULL), + channel_right_bound(0), channel_width(0), + display_toasts_always(false), align(NA_BOTTOM) {} }; @@ -104,7 +98,8 @@ public: // On LoginCompleted - show StartUp toast void onLoginCompleted(); - void removeStartUpChannel(); + // removes a channel intended for the startup toast and allows other channels to show their toasts + void onStartUpToastClose(); //TODO: make protected? in order to be shure that channels are created only by notification handlers LLScreenChannel* createChannel(LLChannelManager::Params& p); @@ -112,9 +107,11 @@ public: LLScreenChannel* getChannelByID(const LLUUID id); LLScreenChannel* getChannelByChiclet(const LLChiclet* chiclet); - void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + // remove channel methods + void removeChannelByID(const LLUUID id); + void removeChannelByChiclet(const LLChiclet* chiclet); - LLScreenChannel* getStartUpChannel(); + void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); private: diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index c844d70d89..6b4dfa73a4 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -55,6 +55,10 @@ static LLDefaultChildRegistry::Register<LLTalkButton> t2("chiclet_talk"); static LLDefaultChildRegistry::Register<LLNotificationChiclet> t3("chiclet_notification"); static LLDefaultChildRegistry::Register<LLIMChiclet> t4("chiclet_im"); +S32 LLNotificationChiclet::mUreadSystemNotifications = 0; +S32 LLNotificationChiclet::mUreadIMNotifications = 0; + + boost::signals2::signal<LLChiclet* (const LLUUID&), LLIMChiclet::CollectChicletCombiner<std::list<LLChiclet*> > > LLIMChiclet::sFindChicletsSignal; @@ -115,6 +119,12 @@ boost::signals2::connection LLNotificationChiclet::setClickCallback( return mButton->setClickedCallback(cb); } +void LLNotificationChiclet::updateUreadIMNotifications() +{ + mUreadIMNotifications = gIMMgr->getNumberOfUnreadIM(); + setCounter(mUreadSystemNotifications + mUreadIMNotifications); +} + ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// @@ -269,6 +279,12 @@ void LLIMChiclet::setCounter(S32 counter) } } +void LLIMChiclet::onMouseDown() +{ + LLIMFloater::toggle(getSessionId()); + setCounter(0); +} + LLRect LLIMChiclet::getRequiredRect() { LLRect rect(0, 0, mAvatarCtrl->getRect().getWidth(), 0); @@ -296,6 +312,38 @@ void LLIMChiclet::setShowCounter(bool show) } } + +void LLIMChiclet::setSessionId(const LLUUID& session_id) +{ + LLChiclet::setSessionId(session_id); + + //for a group chat session_id = group_id + LLFloaterIMPanel* im = LLIMMgr::getInstance()->findFloaterBySession(session_id); + if (!im) return; //should never happen + + EInstantMessage type = im->getDialogType(); + if (type == IM_SESSION_INVITE || type == IM_SESSION_GROUP_START) + { + if (!gAgent.isInGroup(session_id)) return; + + if (mGroupInsignia) { + LLGroupMgr* grp_mgr = LLGroupMgr::getInstance(); + LLGroupMgrGroupData* group_data = grp_mgr->getGroupData(session_id); + if (group_data && group_data->mInsigniaID.notNull()) + { + mGroupInsignia->setVisible(TRUE); + mGroupInsignia->setValue(group_data->mInsigniaID); + } + else + { + mID = session_id; //needed for LLGroupMgrObserver + grp_mgr->addObserver(this); + grp_mgr->sendGroupPropertiesRequest(session_id); + } + } + } +} + void LLIMChiclet::setIMSessionName(const std::string& name) { setToolTip(name); @@ -311,48 +359,13 @@ void LLIMChiclet::setOtherParticipantId(const LLUUID& other_participant_id) //all alive sessions have alive floater, haven't they? llassert(floater); - //in case participant id is being replaced with different id for a group chat - if (mOtherParticipantId.notNull() && mOtherParticipantId != other_participant_id && - mID.notNull() && mGroupInsignia->getValue().isUUID()) - { - LLGroupMgr::getInstance()->removeObserver(this); - } - mOtherParticipantId = other_participant_id; - switch (floater->getDialogType()) + if (mAvatarCtrl && floater->getDialogType() == IM_NOTHING_SPECIAL) { - case IM_NOTHING_SPECIAL: - if (mAvatarCtrl) { - mAvatarCtrl->setVisible(TRUE); - mAvatarCtrl->setValue(other_participant_id); - } - break; - case IM_SESSION_GROUP_START: - { - if (mGroupInsignia) { - LLGroupMgr* grp_mgr = LLGroupMgr::getInstance(); - LLGroupMgrGroupData* group_data = grp_mgr->getGroupData(other_participant_id); - if (group_data && group_data->mInsigniaID.notNull()) - { - mGroupInsignia->setVisible(TRUE); - mGroupInsignia->setValue(group_data->mInsigniaID); - } - else - { - mID = mOtherParticipantId; //needed for LLGroupMgrObserver - grp_mgr->addObserver(this); - grp_mgr->sendGroupPropertiesRequest(mOtherParticipantId); - } - } - } - - break; - default: - llwarning("Unsupported dialog type", 0); - break; + mAvatarCtrl->setVisible(TRUE); + mAvatarCtrl->setValue(other_participant_id); } - } @@ -363,7 +376,7 @@ void LLIMChiclet::changed(LLGroupChange gc) if (GC_PROPERTIES == gc) { - LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(mOtherParticipantId); + LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(getSessionId()); if (group_data && group_data->mInsigniaID.notNull()) { mGroupInsignia->setVisible(TRUE); @@ -395,8 +408,7 @@ void LLIMChiclet::updateMenuItems() BOOL LLIMChiclet::handleMouseDown(S32 x, S32 y, MASK mask) { - LLIMFloater::toggle(getSessionId()); - setCounter(0); + onMouseDown(); return LLChiclet::handleMouseDown(x, y, mask); } diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index c83caf8ff9..b1e73c9d8d 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -256,6 +256,8 @@ public: /*virtual*/ ~LLIMChiclet(); + virtual void setSessionId(const LLUUID& session_id); + /* * Sets IM session name. This name will be displayed in chiclet tooltip. */ @@ -303,6 +305,14 @@ public: */ /*virtual*/ void draw(); + /** + * The action taken on mouse down event. + * + * Made public so that it can be triggered from outside + * (more specifically, from the Active IM window). + */ + void onMouseDown(); + /* * Returns rect, required to display chiclet. * Width is the only valid value. @@ -407,12 +417,20 @@ public: // Notification Chiclet Window void setNotificationChicletWindow(LLFloater* wnd) { mNotificationChicletWindow = wnd; } + // methods for updating a number of unread System or IM notifications + void incUreadSystemNotifications() { setCounter(++mUreadSystemNotifications + mUreadIMNotifications); } + void decUreadSystemNotifications() { setCounter(--mUreadSystemNotifications + mUreadIMNotifications); } + void updateUreadIMNotifications(); + protected: LLNotificationChiclet(const Params& p); friend class LLUICtrlFactory; LLFloater* mNotificationChicletWindow; + static S32 mUreadSystemNotifications; + static S32 mUreadIMNotifications; + protected: LLButton* mButton; LLChicletNotificationCounterCtrl* mCounterCtrl; diff --git a/indra/newview/llclassifiedstatsresponder.cpp b/indra/newview/llclassifiedstatsresponder.cpp index a218e2b4e5..ecd1879090 100644 --- a/indra/newview/llclassifiedstatsresponder.cpp +++ b/indra/newview/llclassifiedstatsresponder.cpp @@ -33,7 +33,6 @@ #include "llviewerprecompiledheaders.h" -#include "llagent.h" #include "llclassifiedstatsresponder.h" #include "llpanelclassified.h" diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index de97e2406d..88f79fc1b9 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -42,7 +42,6 @@ #include "llcubemap.h" #include "llsky.h" -#include "llagent.h" #include "lldrawable.h" #include "llface.h" #include "llviewercamera.h" diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index a2d8c965ec..565f906a3b 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -38,7 +38,6 @@ #include "llvoavatar.h" #include "m3math.h" -#include "llagent.h" #include "lldrawable.h" #include "llface.h" #include "llsky.h" diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index 2cb4d5d6d5..331ba67d36 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -43,7 +43,6 @@ #include "llglheaders.h" #include "llrender.h" -#include "llagent.h" #include "llcubemap.h" #include "lldrawable.h" #include "llface.h" diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp index d084bda2ea..331536fdca 100644 --- a/indra/newview/lldrawpoolsimple.cpp +++ b/indra/newview/lldrawpoolsimple.cpp @@ -35,7 +35,6 @@ #include "lldrawpoolsimple.h" #include "llviewercamera.h" -#include "llagent.h" #include "lldrawable.h" #include "llface.h" #include "llsky.h" diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index 9b52ddb73c..c14ca2473b 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -42,7 +42,6 @@ #include "llwlparammanager.h" #include "llsky.h" #include "llvowlsky.h" -#include "llagent.h" #include "llviewerregion.h" #include "llface.h" #include "llrender.h" diff --git a/indra/newview/llemote.cpp b/indra/newview/llemote.cpp index bacf3daf5a..c83846215e 100644 --- a/indra/newview/llemote.cpp +++ b/indra/newview/llemote.cpp @@ -39,7 +39,6 @@ #include "llcharacter.h" #include "m3math.h" #include "llvoavatar.h" -#include "llagent.h" //----------------------------------------------------------------------------- // Constants diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 9c1a7ecb04..70ee5d395e 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -38,6 +38,8 @@ #include "llfloaterreg.h" #include "llfocusmgr.h" #include "llinventory.h" +#include "lllandmarkactions.h" +#include "lltrans.h" #include "lluictrlfactory.h" #include "llmenugl.h" @@ -56,6 +58,71 @@ static LLDefaultChildRegistry::Register<LLFavoritesBarCtrl> r("favorites_bar"); +const S32 DROP_DOWN_MENU_WIDTH = 250; + +/** + * This class is needed to override LLButton default handleToolTip function and + * show SLURL as button tooltip. + * *NOTE: dzaporozhan: This is a workaround. We could set tooltips for buttons + * in createButtons function but landmark data is not available when Favorites Bar is + * created. Thats why we are requesting landmark data after + */ +class LLFavoriteLandmarkButton : public LLButton +{ +public: + + /** + * Requests landmark data from server and shows landmark SLURL as tooltip. + */ + BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect) + { + if(LLUI::sShowXUINames) + { + return LLButton::handleToolTip(x, y, msg, sticky_rect); + } + + if(!mLoaded) + { + LLVector3d g_pos; + if(LLLandmarkActions::getLandmarkGlobalPos(mLandmarkID, g_pos)) + { + LLLandmarkActions::getSLURLfromPosGlobal(g_pos, + boost::bind(&LLFavoriteLandmarkButton::landmarkNameCallback, this, _1), false); + } + } + + msg = mSLURL; + return TRUE; + } + + void landmarkNameCallback(const std::string& name) + { + mSLURL = name; + mLoaded = true; + } + + void setLandmarkID(const LLUUID& id){ mLandmarkID = id; } + +protected: + + LLFavoriteLandmarkButton(const LLButton::Params& p) + : LLButton(p) + , mLandmarkID(LLUUID::null) + , mSLURL("(Loading...)") + , mLoaded(false) + { + static std::string loading_tooltip = LLTrans::getString("favorite_landmark_loading_tooltip"); + mSLURL = loading_tooltip; + } + + friend class LLUICtrlFactory; + +private: + LLUUID mLandmarkID; + std::string mSLURL; + bool mLoaded; +}; + // updateButtons's helper struct LLFavoritesSort { @@ -353,13 +420,15 @@ void LLFavoritesBarCtrl::createButtons(const LLInventoryModel::item_array_t &ite { LLInventoryItem* item = items.get(i); - LLButton* fav_btn = LLUICtrlFactory::defaultBuilder<LLButton>(buttonXMLNode, this, NULL); + LLFavoriteLandmarkButton* fav_btn = LLUICtrlFactory::defaultBuilder<LLFavoriteLandmarkButton>(buttonXMLNode, this, NULL); if (NULL == fav_btn) { llwarns << "Unable to create button for landmark: " << item->getName() << llendl; continue; } + fav_btn->setLandmarkID(item->getUUID()); + // change only left and save bottom fav_btn->setOrigin(curr_x, fav_btn->getRect().mBottom); fav_btn->setFont(mFont); @@ -413,6 +482,7 @@ void LLFavoritesBarCtrl::showDropDownMenu() menu_p.can_tear_off(false); menu_p.visible(false); menu_p.scrollable(true); + menu_p.max_scrollable_items = 10; LLToggleableMenu* menu = LLUICtrlFactory::create<LLToggleableMenu>(menu_p); @@ -471,10 +541,8 @@ void LLFavoritesBarCtrl::showDropDownMenu() menu->empty(); - U32 max_width = 0; - - // Menu will not be wider, than bar - S32 bar_width = getRect().getWidth(); + U32 max_width = llmin(DROP_DOWN_MENU_WIDTH, getRect().getWidth()); + U32 widest_item = 0; for(S32 i = mFirstDropDownItem; i < count; i++) { @@ -489,12 +557,12 @@ void LLFavoritesBarCtrl::showDropDownMenu() LLMenuItemCallGL *menu_item = LLUICtrlFactory::create<LLMenuItemCallGL>(item_params); menu_item->setRightMouseDownCallback(boost::bind(&LLFavoritesBarCtrl::onButtonRightClick, this,item->getUUID(),_1,_2,_3,_4)); // Check whether item name wider than menu - if ((S32) menu_item->getNominalWidth() > bar_width) + if (menu_item->getNominalWidth() > max_width) { S32 chars_total = item_name.length(); S32 chars_fitted = 1; menu_item->setLabel(LLStringExplicit("")); - S32 label_space = bar_width - menu_item->getFont()->getWidth("...") - + S32 label_space = max_width - menu_item->getFont()->getWidth("...") - menu_item->getNominalWidth(); // This returns width of menu item with empty label (pad pixels) while (chars_fitted < chars_total && menu_item->getFont()->getWidth(item_name, 0, chars_fitted) < label_space) @@ -505,21 +573,17 @@ void LLFavoritesBarCtrl::showDropDownMenu() menu_item->setLabel(item_name.substr(0, chars_fitted) + "..."); } - - max_width = llmax(max_width, menu_item->getNominalWidth()); + widest_item = llmax(widest_item, menu_item->getNominalWidth()); menu->addChild(menu_item); } - // Menu will not be wider, than bar - max_width = llmin((S32)max_width, bar_width); - menu->buildDrawLabels(); menu->updateParent(LLMenuGL::sMenuContainer); menu->setButtonRect(mChevronRect, this); - LLMenuGL::showPopup(this, menu, getRect().getWidth() - max_width, 0); + LLMenuGL::showPopup(this, menu, getRect().getWidth() - widest_item, 0); } } diff --git a/indra/newview/llfloatergroups.cpp b/indra/newview/llfloatergroups.cpp index f49f854620..7a88612f1a 100644 --- a/indra/newview/llfloatergroups.cpp +++ b/indra/newview/llfloatergroups.cpp @@ -81,7 +81,18 @@ void LLFloaterGroupPicker::setPowersMask(U64 powers_mask) BOOL LLFloaterGroupPicker::postBuild() { - init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID(), mPowersMask); + LLScrollListCtrl* list_ctrl = getChild<LLScrollListCtrl>("group list"); + init_group_list(list_ctrl, gAgent.getGroupID(), mPowersMask); + + // Remove group "none" from list. Group "none" is added in init_group_list(). + // Some UI elements use group "none", we need to manually delete it here. + // Group "none" ID is LLUUID:null. + LLCtrlListInterface* group_list = list_ctrl->getListInterface(); + if(group_list) + { + group_list->selectByValue(LLUUID::null); + group_list->operateOnSelection(LLCtrlListInterface::OP_DELETE); + } childSetAction("OK", onBtnOK, this); diff --git a/indra/newview/llfloateropenobject.cpp b/indra/newview/llfloateropenobject.cpp index ba23a58b37..aa82dc34b7 100644 --- a/indra/newview/llfloateropenobject.cpp +++ b/indra/newview/llfloateropenobject.cpp @@ -43,7 +43,6 @@ #include "llbutton.h" #include "lltextbox.h" -#include "llagent.h" // for agent id #include "llalertdialog.h" #include "llinventorybridge.h" #include "llfloaterinventory.h" diff --git a/indra/newview/llfloaterpostcard.cpp b/indra/newview/llfloaterpostcard.cpp index ac687ed3e9..a27070de39 100644 --- a/indra/newview/llfloaterpostcard.cpp +++ b/indra/newview/llfloaterpostcard.cpp @@ -64,6 +64,7 @@ #include "llvfs.h" #include "llviewertexture.h" #include "llassetuploadresponders.h" +#include "llagentui.h" #include <boost/regex.hpp> //boost.regex lib @@ -101,7 +102,7 @@ BOOL LLFloaterPostcard::postBuild() childDisable("from_form"); std::string name_string; - gAgent.buildFullname(name_string); + LLAgentUI::buildFullname(name_string); childSetValue("name_form", LLSD(name_string)); // For the first time a user focusess to .the msg box, all text will be selected. diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index a50bcaa098..10276ba36d 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -84,6 +84,7 @@ #include "llviewerwindow.h" #include "llvlcomposition.h" #include "lltrans.h" +#include "llagentui.h" #define ELAR_ENABLED 0 // Enable when server support is implemented @@ -714,7 +715,7 @@ bool LLPanelRegionGeneralInfo::onMessageCommit(const LLSD& notification, const L gAgent.getID().toString(buffer); strings.push_back(buffer); std::string name; - gAgent.buildFullname(name); + LLAgentUI::buildFullname(name); strings.push_back(strings_t::value_type(name)); strings.push_back(strings_t::value_type(text)); LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); @@ -2659,7 +2660,7 @@ bool LLPanelEstateInfo::onMessageCommit(const LLSD& notification, const LLSD& re strings_t strings; //integers_t integers; std::string name; - gAgent.buildFullname(name); + LLAgentUI::buildFullname(name); strings.push_back(strings_t::value_type(name)); strings.push_back(strings_t::value_type(text)); LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index e2176350c9..818381b561 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -85,6 +85,7 @@ #include "llviewernetwork.h" #include "llassetuploadresponders.h" +#include "llagentui.h" const U32 INCLUDE_SCREENSHOT = 0x01 << 0; @@ -137,7 +138,7 @@ void LLFloaterReporter::processRegionInfo(LLMessageSystem* msg) // virtual BOOL LLFloaterReporter::postBuild() { - childSetText("abuse_location_edit", gAgent.getSLURL() ); + childSetText("abuse_location_edit", LLAgentUI::buildSLURL()); enableControls(TRUE); @@ -190,7 +191,7 @@ BOOL LLFloaterReporter::postBuild() // grab the user's name std::string fullname; - gAgent.buildFullname(fullname); + LLAgentUI::buildFullname(fullname); childSetText("reporter_field", fullname); center(); @@ -499,7 +500,7 @@ void LLFloaterReporter::showFromObject(const LLUUID& object_id) // grab the user's name std::string fullname; - gAgent.buildFullname(fullname); + LLAgentUI::buildFullname(fullname); f->childSetText("reporter_field", fullname); // Request info for this object diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 814395395c..dd73ebbd8f 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -59,6 +59,7 @@ #include "lltoolfocus.h" #include "lltoolmgr.h" #include "llworld.h" +#include "llagentui.h" // Linden library includes #include "llfontgl.h" @@ -967,9 +968,9 @@ void LLSnapshotLivePreview::saveTexture() { LLVFile::writeFile(formatted->getData(), formatted->getDataSize(), gVFS, new_asset_id, LLAssetType::AT_TEXTURE); std::string pos_string; - gAgent.buildLocationString(pos_string, LLAgent::LOCATION_FORMAT_FULL); + LLAgentUI::buildLocationString(pos_string, LLAgent::LOCATION_FORMAT_FULL); std::string who_took_it; - gAgent.buildFullname(who_took_it); + LLAgentUI::buildFullname(who_took_it); LLAssetStorage::LLStoreAssetCallback callback = NULL; S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); void *userdata = NULL; diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp index f61d5cb077..c20b3f34b2 100644 --- a/indra/newview/llfloatertos.cpp +++ b/indra/newview/llfloatertos.cpp @@ -35,7 +35,6 @@ #include "llfloatertos.h" // viewer includes -#include "llagent.h" #include "llappviewer.h" #include "llstartup.h" #include "llviewerstats.h" diff --git a/indra/newview/llfloatervoicedevicesettings.cpp b/indra/newview/llfloatervoicedevicesettings.cpp index 37da4a6ba6..a7658d90e9 100644 --- a/indra/newview/llfloatervoicedevicesettings.cpp +++ b/indra/newview/llfloatervoicedevicesettings.cpp @@ -36,7 +36,6 @@ #include "llfloatervoicedevicesettings.h" // Viewer includes -#include "llagent.h" #include "llbutton.h" #include "llcombobox.h" #include "llfocusmgr.h" diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index d1f0f94fa0..2a29566120 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -34,7 +34,6 @@ #include "llfolderview.h" -#include "llagent.h" #include "llcallbacklist.h" #include "llinventorybridge.h" #include "llinventoryclipboard.h" // *TODO: remove this once hack below gone. diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index 7af77e2056..24e9615f0d 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -37,6 +37,7 @@ #include "llagent.h" #include "llfloaterreg.h" +#include "llgroupmgr.h" #include "llimview.h" // for gIMMgr #include "llsidetray.h" @@ -162,6 +163,19 @@ void LLGroupActions::show(const LLUUID& group_id) LLSideTray::getInstance()->showPanel("panel_group_info_sidetray", params); } +void LLGroupActions::refresh_notices() +{ + if(!isGroupUIVisible()) + return; + + LLSD params; + params["group_id"] = LLUUID::null; + params["open_tab_name"] = "panel_group_info_sidetray"; + params["action"] = "refresh_notices"; + + LLSideTray::getInstance()->showPanel("panel_group_info_sidetray", params); +} + //static void LLGroupActions::refresh(const LLUUID& group_id) { @@ -225,6 +239,28 @@ void LLGroupActions::startChat(const LLUUID& group_id) } } +// static +bool LLGroupActions::isAvatarMemberOfGroup(const LLUUID& group_id, const LLUUID& avatar_id) +{ + if(group_id.isNull() || avatar_id.isNull()) + { + return false; + } + + LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(group_id); + if(!group_data) + { + return false; + } + + if(group_data->mMembers.end() == group_data->mMembers.find(avatar_id)) + { + return false; + } + + return true; +} + //-- Private methods ---------------------------------------------------------- // static diff --git a/indra/newview/llgroupactions.h b/indra/newview/llgroupactions.h index eb366bd779..9fe1da8af2 100644 --- a/indra/newview/llgroupactions.h +++ b/indra/newview/llgroupactions.h @@ -68,6 +68,11 @@ public: static void refresh(const LLUUID& group_id); /** + * Refresh group notices panel. + */ + static void refresh_notices(); + + /** * Refresh group information panel. */ static void createGroup(); @@ -81,6 +86,15 @@ public: * Start group instant messaging session. */ static void startChat(const LLUUID& group_id); + + /** + * Returns true if avatar is in group. + * + * Note that data about group members is loaded from server. + * If data has not been loaded yet, function will return inaccurate result. + * See LLGroupMgr::sendGroupMembersRequest + */ + static bool isAvatarMemberOfGroup(const LLUUID& group_id, const LLUUID& avatar_id); private: static bool onLeaveGroup(const LLSD& notification, const LLSD& response); diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 0ba1019765..5e50fad008 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -809,7 +809,7 @@ static void formatDateString(std::string &date_string) std::string day = result[2]; // ISO 8601 date format - date_string = llformat("%04s-%02s-%02s", year.c_str(), month.c_str(), day.c_str()); + date_string = llformat("%02s/%02s/%04s", month.c_str(), day.c_str(), year.c_str()); } } diff --git a/indra/newview/llhudview.cpp b/indra/newview/llhudview.cpp index 6f22a68327..0a6938f4f8 100644 --- a/indra/newview/llhudview.cpp +++ b/indra/newview/llhudview.cpp @@ -39,7 +39,6 @@ #include "llcoord.h" // viewer includes -#include "llagent.h" #include "llcallingcard.h" #include "llviewercontrol.h" #include "llfloaterworldmap.h" diff --git a/indra/newview/llimhandler.cpp b/indra/newview/llimhandler.cpp new file mode 100644 index 0000000000..0262e40803 --- /dev/null +++ b/indra/newview/llimhandler.cpp @@ -0,0 +1,127 @@ +/** + * @file llimhandler.cpp + * @brief Notification Handler Class for IM notifications + * + * $LicenseInfo:firstyear=2000&license=viewergpl$ + * + * Copyright (c) 2000-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$ + */ + + +#include "llviewerprecompiledheaders.h" // must be first include + +#include "llnotificationhandler.h" + +#include "llbottomtray.h" +#include "llviewercontrol.h" +#include "lltoastimpanel.h" + +using namespace LLNotificationsUI; + +//-------------------------------------------------------------------------- +LLIMHandler::LLIMHandler() +{ + + // getting a Chiclet and creating params for a channel + LLBottomTray* tray = LLBottomTray::getInstance(); + mChiclet = tray->getSysWell(); + + LLChannelManager::Params p; + // *TODO: createNotificationChannel method + p.id = LLUUID(gSavedSettings.getString("NotificationChannelUUID")); + p.channel_right_bound = tray->getRect().mRight - gSavedSettings.getS32("NotificationChannelRightMargin"); + p.channel_width = gSavedSettings.getS32("NotifyBoxWidth"); + + // Getting a Channel for our notifications + mChannel = LLChannelManager::getInstance()->createChannel(p); + +} + +//-------------------------------------------------------------------------- +LLIMHandler::~LLIMHandler() +{ +} + +//-------------------------------------------------------------------------- +void LLIMHandler::processNotification(const LLSD& notify) +{ + LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID()); + + if(!notification) + return; + + if(notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "change") + { + LLSD substitutions = notification->getSubstitutions(); + + LLToastIMPanel::Params im_p; + im_p.notification = notification; + im_p.avatar_id = substitutions["FROM_ID"].asUUID(); + im_p.from = substitutions["FROM"].asString(); + im_p.time = substitutions["TIME"].asString(); + im_p.message = substitutions["MESSAGE"].asString(); + im_p.session_id = substitutions["SESSION_ID"].asUUID(); + + LLToastIMPanel* im_box = new LLToastIMPanel(im_p); + + LLToast::Params p; + p.id = notification->getID(); + p.notification = notification; + p.panel = im_box; + p.can_be_stored = false; + p.on_toast_destroy = boost::bind(&LLIMHandler::onToastDestroy, this, _1); + mChannel->addToast(p); + + + static_cast<LLNotificationChiclet*>(mChiclet)->updateUreadIMNotifications(); + } + else if (notify["sigtype"].asString() == "delete") + { + mChannel->killToastByNotificationID(notification->getID()); + } +} + +//-------------------------------------------------------------------------- +void LLIMHandler::onToastDestroy(LLToast* toast) +{ + toast->closeFloater(); + static_cast<LLNotificationChiclet*>(mChiclet)->updateUreadIMNotifications(); +} + +//-------------------------------------------------------------------------- +void LLIMHandler::onChicletClick(void) +{ +} + +//-------------------------------------------------------------------------- +void LLIMHandler::onChicletClose(void) +{ +} + +//-------------------------------------------------------------------------- + + + diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 72e2bb02d5..8c24962897 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -2235,6 +2235,8 @@ bool LLIMFloater::toggle(const LLUUID& session_id) { // ensure the list of messages is updated when floater is made visible show(session_id); + // update number of unread notifications in the SysWell + LLBottomTray::getInstance()->getSysWell()->updateUreadIMNotifications(); return true; } } diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index e3902bffa0..4cbf88f3da 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -72,6 +72,7 @@ #include "lltrans.h" #include "llfirstuse.h" +#include "llagentui.h" // // Globals @@ -104,6 +105,8 @@ void toast_callback(const LLSD& msg){ args["MESSAGE"] = msg["message"]; args["TIME"] = msg["time"]; args["FROM"] = msg["from"]; + args["FROM_ID"] = msg["from_id"]; + args["SESSION_ID"] = msg["session_id"]; LLNotifications::instance().add("IMToast", args, LLSD(), boost::bind(&LLFloaterChatterBox::onOpen, LLFloaterChatterBox::getInstance(), msg["session_id"].asUUID())); } @@ -124,7 +127,7 @@ void LLIMModel::testMessages() bot1_session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, bot1_id); newSession(bot1_session_id, from, IM_NOTHING_SPECIAL, bot1_id); - addMessage(bot1_session_id, from, "Test Message: Hi from testerbot land!"); + addMessage(bot1_session_id, from, bot1_id, "Test Message: Hi from testerbot land!"); LLUUID bot2_id; std::string firstname[] = {"Roflcopter", "Joe"}; @@ -137,8 +140,8 @@ void LLIMModel::testMessages() bot2_id.generate(from); LLUUID bot2_session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, bot2_id); newSession(bot2_session_id, from, IM_NOTHING_SPECIAL, bot2_id); - addMessage(bot2_session_id, from, "Test Message: Can I haz bear? "); - addMessage(bot2_session_id, from, "Test Message: OMGWTFBBQ."); + addMessage(bot2_session_id, from, bot2_id, "Test Message: Can I haz bear? "); + addMessage(bot2_session_id, from, bot2_id, "Test Message: OMGWTFBBQ."); } @@ -218,7 +221,7 @@ bool LLIMModel::addToHistory(LLUUID session_id, std::string from, std::string ut } -bool LLIMModel::addMessage(LLUUID session_id, std::string from, std::string utf8_text) { +bool LLIMModel::addMessage(LLUUID session_id, std::string from, LLUUID from_id, std::string utf8_text) { LLIMSession* session = get_if_there(sSessionsMap, session_id, (LLIMSession*)NULL); @@ -231,7 +234,7 @@ bool LLIMModel::addMessage(LLUUID session_id, std::string from, std::string utf8 addToHistory(session_id, from, utf8_text); std::string agent_name; - gAgent.buildFullname(agent_name); + LLAgentUI::buildFullname(agent_name); session->mNumUnread++; @@ -240,6 +243,9 @@ bool LLIMModel::addMessage(LLUUID session_id, std::string from, std::string utf8 arg["session_id"] = session_id; arg["num_unread"] = session->mNumUnread; arg["message"] = utf8_text; + arg["from"] = from; + arg["from_id"] = from_id; + arg["time"] = LLLogChat::timestamp(false); mChangedSignal(arg); return true; @@ -264,7 +270,7 @@ const std::string& LLIMModel::getName(LLUUID session_id) void LLIMModel::sendTypingState(LLUUID session_id, LLUUID other_participant_id, BOOL typing) { std::string name; - gAgent.buildFullname(name); + LLAgentUI::buildFullname(name); pack_instant_message( gMessageSystem, @@ -285,7 +291,7 @@ void LLIMModel::sendLeaveSession(LLUUID session_id, LLUUID other_participant_id) if(session_id.notNull()) { std::string name; - gAgent.buildFullname(name); + LLAgentUI::buildFullname(name); pack_instant_message( gMessageSystem, gAgent.getID(), @@ -310,7 +316,7 @@ void LLIMModel::sendMessage(const std::string& utf8_text, { std::string name; bool sent = false; - gAgent.buildFullname(name); + LLAgentUI::buildFullname(name); const LLRelationship* info = NULL; info = LLAvatarTracker::instance().getBuddyInfo(other_participant_id); @@ -377,13 +383,13 @@ void LLIMModel::sendMessage(const std::string& utf8_text, { // Do we have to replace the /me's here? std::string from; - gAgent.buildFullname(from); + LLAgentUI::buildFullname(from); LLIMModel::instance().addToHistory(im_session_id, from, utf8_text); //local echo for the legacy communicate panel std::string history_echo; std::string utf8_copy = utf8_text; - gAgent.buildFullname(history_echo); + LLAgentUI::buildFullname(history_echo); // Look for IRC-style emotes here. @@ -433,7 +439,7 @@ void session_starter_helper( msg->addU32Fast(_PREHASH_Timestamp, NO_TIMESTAMP); // no timestamp necessary std::string name; - gAgent.buildFullname(name); + LLAgentUI::buildFullname(name); msg->addStringFast(_PREHASH_FromAgentName, name); msg->addStringFast(_PREHASH_Message, LLStringUtil::null); @@ -1231,7 +1237,7 @@ void LLIMMgr::addMessage( //<< "*** position: " << position << std::endl; floater->addHistoryLine(bonus_info.str(), LLUIColorTable::instance().getColor("SystemChatColor")); - LLIMModel::instance().addMessage(new_session_id, from, bonus_info.str()); + LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, bonus_info.str()); } make_ui_sound("UISndNewIncomingIMSession"); @@ -1251,7 +1257,7 @@ void LLIMMgr::addMessage( floater->addHistoryLine(msg, color, true, other_participant_id, from); // Insert linked name to front of message } - LLIMModel::instance().addMessage(new_session_id, from, msg); + LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, msg); if( !LLFloaterReg::instanceVisible("communicate") && !floater->getVisible()) { @@ -1311,6 +1317,19 @@ void LLIMMgr::notifyNewIM() } } +S32 LLIMMgr::getNumberOfUnreadIM() +{ + std::map<LLUUID, LLIMModel::LLIMSession*>::iterator it; + + S32 num = 0; + for(it = LLIMModel::sSessionsMap.begin(); it != LLIMModel::sSessionsMap.end(); ++it) + { + num += (*it).second->mNumUnread; + } + + return num; +} + void LLIMMgr::clearNewIMNotification() { mIMReceived = FALSE; @@ -1356,44 +1375,9 @@ LLUUID LLIMMgr::addSession( EInstantMessage dialog, const LLUUID& other_participant_id) { - LLUUID session_id = computeSessionID(dialog, other_participant_id); - - LLFloaterIMPanel* floater = findFloaterBySession(session_id); - if(!floater) - { - LLDynamicArray<LLUUID> ids; - ids.put(other_participant_id); - - floater = createFloater( - session_id, - other_participant_id, - name, - ids, - dialog, - TRUE); - - noteOfflineUsers(floater, ids); - //LLFloaterReg::showInstance("communicate", session_id); - // *NOTE: Is this right? Or should we only do it for - // dialog == IM_NOTHING_SPECIAL and some group types? - - // Only warn for regular IMs - not group IMs - if( dialog == IM_NOTHING_SPECIAL ) - { - noteMutedUsers(floater, ids); - } - } - else - { - // *TODO: Remove this? Otherwise old communicate window opens on - // second initiation of IM session from People panel? - // floater->openFloater(); - } - //mTabContainer->selectTabPanel(panel); - floater->setInputFocus(TRUE); - LLIMFloater::show(session_id); - notifyObserverSessionAdded(floater->getSessionID(), name, other_participant_id); - return floater->getSessionID(); + LLDynamicArray<LLUUID> ids; + ids.put(other_participant_id); + return addSession(name, dialog, other_participant_id, ids); } // Adds a session using the given session_id. If the session already exists @@ -1409,9 +1393,7 @@ LLUUID LLIMMgr::addSession( return LLUUID::null; } - LLUUID session_id = computeSessionID( - dialog, - other_participant_id); + LLUUID session_id = computeSessionID(dialog,other_participant_id); LLFloaterIMPanel* floater = findFloaterBySession(session_id); if(!floater) @@ -1422,15 +1404,13 @@ LLUUID LLIMMgr::addSession( session_id, other_participant_id, name, - ids, dialog, - TRUE); + TRUE, + ids); if ( !floater ) return LLUUID::null; noteOfflineUsers(floater, ids); - // *BUG: Is this correct? What do we want to spawn for group IMs? - // LLFloaterReg::showInstance("communicate", session_id); // Only warn for regular IMs - not group IMs if( dialog == IM_NOTHING_SPECIAL ) @@ -1440,10 +1420,13 @@ LLUUID LLIMMgr::addSession( } else { - floater->openFloater(); + // *TODO: Remove this? Otherwise old communicate window opens on + // second initiation of IM session from People panel? + // floater->openFloater(); } //mTabContainer->selectTabPanel(panel); floater->setInputFocus(TRUE); + LLIMFloater::show(session_id); notifyObserverSessionAdded(floater->getSessionID(), name, other_participant_id); return floater->getSessionID(); } @@ -1772,35 +1755,8 @@ LLFloaterIMPanel* LLIMMgr::createFloater( const LLUUID& other_participant_id, const std::string& session_label, EInstantMessage dialog, - BOOL user_initiated) -{ - if (session_id.isNull()) - { - llwarns << "Creating LLFloaterIMPanel with null session ID" << llendl; - } - - llinfos << "LLIMMgr::createFloater: from " << other_participant_id - << " in session " << session_id << llendl; - std::vector<LLUUID> ids; - LLFloaterIMPanel* floater = new LLFloaterIMPanel(session_label, - session_id, - other_participant_id, - ids, - dialog); - LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END; - LLFloaterChatterBox::getInstance()->addFloater(floater, FALSE, i_pt); - mFloaters.insert(floater->getHandle()); - LLIMModel::instance().newSession(session_id, session_label, dialog, other_participant_id); - return floater; -} - -LLFloaterIMPanel* LLIMMgr::createFloater( - const LLUUID& session_id, - const LLUUID& other_participant_id, - const std::string& session_label, - const LLDynamicArray<LLUUID>& ids, - EInstantMessage dialog, - BOOL user_initiated) + BOOL user_initiated, + const LLDynamicArray<LLUUID>& ids) { if (session_id.isNull()) { diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index b3b821f2ac..777d68978e 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -71,7 +71,7 @@ public: bool newSession(LLUUID session_id, std::string name, EInstantMessage type, LLUUID other_participant_id); std::list<LLSD> getMessages(LLUUID session_id, int start_index = 0); - bool addMessage(LLUUID session_id, std::string from, std::string utf8_text); + bool addMessage(LLUUID session_id, std::string from, LLUUID other_participant_id, std::string utf8_text); bool addToHistory(LLUUID session_id, std::string from, std::string utf8_text); //used to get the name of the session, for use as the title //currently just the other avatar name @@ -189,6 +189,9 @@ public: // IM received that you haven't seen yet BOOL getIMReceived() const; + // Calc number of unread IMs + S32 getNumberOfUnreadIM(); + // This method is used to go through all active sessions and // disable all of them. This method is usally called when you are // forced to log out or similar situations where you do not have a @@ -231,14 +234,8 @@ private: const LLUUID& target_id, const std::string& name, EInstantMessage dialog, - BOOL user_initiated = FALSE); - - LLFloaterIMPanel* createFloater(const LLUUID& session_id, - const LLUUID& target_id, - const std::string& name, - const LLDynamicArray<LLUUID>& ids, - EInstantMessage dialog, - BOOL user_initiated = FALSE); + BOOL user_initiated = FALSE, + const LLDynamicArray<LLUUID>& ids = LLDynamicArray<LLUUID>()); // This simple method just iterates through all of the ids, and // prints a simple message if they are not online. Used to help diff --git a/indra/newview/lllandmarkactions.cpp b/indra/newview/lllandmarkactions.cpp index aa5432740c..2c56a70ced 100644 --- a/indra/newview/lllandmarkactions.cpp +++ b/indra/newview/lllandmarkactions.cpp @@ -50,6 +50,7 @@ #include "llworldmap.h" #include "lllandmark.h" #include "llinventorymodel.h" +#include "llagentui.h" // Returns true if the given inventory item is a landmark pointing to the current parcel. // Used to filter inventory items. @@ -78,6 +79,8 @@ class LLFetchLandmarksByName : public LLInventoryCollectFunctor private: std::string name; BOOL use_substring; + //this member will be contain copy of founded items to keep the result unique + std::set<std::string> check_duplicate; public: LLFetchLandmarksByName(std::string &landmark_name, BOOL if_use_substring) @@ -97,28 +100,35 @@ public: if (!landmark) // the landmark not been loaded yet return false; + bool acceptable = false; std::string landmark_name = item->getName(); LLStringUtil::toLower(landmark_name); if(use_substring) { - if ( landmark_name.find( name ) != std::string::npos) - return true; + acceptable = landmark_name.find( name ) != std::string::npos; } else { - if ( landmark_name == name ) - return true; + acceptable = landmark_name == name; + } + if(acceptable){ + if(check_duplicate.find(landmark_name) != check_duplicate.end()){ + // we have duplicated items in landmarks + acceptable = false; + }else{ + check_duplicate.insert(landmark_name); + } } - return false; + return acceptable; } }; -LLInventoryModel::item_array_t LLLandmarkActions::fetchLandmarksByName(std::string& name, BOOL if_starts_with) +LLInventoryModel::item_array_t LLLandmarkActions::fetchLandmarksByName(std::string& name, BOOL use_substring) { LLInventoryModel::cat_array_t cats; LLInventoryModel::item_array_t items; - LLFetchLandmarksByName fetchLandmarks(name, if_starts_with); + LLFetchLandmarksByName fetchLandmarks(name, use_substring); gInventory.collectDescendentsIf(gInventory.getRootFolderID(), cats, items, @@ -135,6 +145,27 @@ bool LLLandmarkActions::landmarkAlreadyExists() return !items.empty(); } + +LLViewerInventoryItem* LLLandmarkActions::findLandmarkForAgentParcel() +{ + // Determine whether there are landmarks pointing to the current parcel. + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + LLIsAgentParcelLandmark is_current_parcel_landmark; + gInventory.collectDescendentsIf(gInventory.getRootFolderID(), + cats, + items, + LLInventoryModel::EXCLUDE_TRASH, + is_current_parcel_landmark); + + if(items.empty()) + { + return NULL; + } + + return items[0]; +} + bool LLLandmarkActions::canCreateLandmarkHere() { LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); @@ -187,21 +218,20 @@ void LLLandmarkActions::createLandmarkHere() { std::string landmark_name, landmark_desc; - gAgent.buildLocationString(landmark_name, LLAgent::LOCATION_FORMAT_LANDMARK); - gAgent.buildLocationString(landmark_desc, LLAgent::LOCATION_FORMAT_FULL); + LLAgentUI::buildLocationString(landmark_name, LLAgent::LOCATION_FORMAT_LANDMARK); + LLAgentUI::buildLocationString(landmark_desc, LLAgent::LOCATION_FORMAT_FULL); LLUUID folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK); createLandmarkHere(landmark_name, landmark_desc, folder_id); } -void LLLandmarkActions::getSLURLfromPosGlobal(const LLVector3d& global_pos, slurl_callback_t cb) +void LLLandmarkActions::getSLURLfromPosGlobal(const LLVector3d& global_pos, slurl_callback_t cb, bool escaped /* = true */) { std::string sim_name; bool gotSimName = LLWorldMap::getInstance()->simNameFromPosGlobal(global_pos, sim_name); if (gotSimName) { - std::string slurl = LLSLURL::buildSLURLfromPosGlobal(sim_name, global_pos); - + std::string slurl = LLSLURL::buildSLURLfromPosGlobal(sim_name, global_pos, escaped); cb(slurl); return; @@ -213,6 +243,7 @@ void LLLandmarkActions::getSLURLfromPosGlobal(const LLVector3d& global_pos, slur LLWorldMap::url_callback_t url_cb = boost::bind(&LLLandmarkActions::onRegionResponse, cb, global_pos, + escaped, _1, _2, _3, _4); LLWorldMap::getInstance()->sendHandleRegionRequest(new_region_handle, url_cb, std::string("unused"), false); @@ -221,6 +252,7 @@ void LLLandmarkActions::getSLURLfromPosGlobal(const LLVector3d& global_pos, slur void LLLandmarkActions::onRegionResponse(slurl_callback_t cb, const LLVector3d& global_pos, + bool escaped, U64 region_handle, const std::string& url, const LLUUID& snapshot_id, @@ -231,7 +263,7 @@ void LLLandmarkActions::onRegionResponse(slurl_callback_t cb, bool gotSimName = LLWorldMap::getInstance()->simNameFromPosGlobal(global_pos, sim_name); if (gotSimName) { - slurl = LLSLURL::buildSLURLfromPosGlobal(sim_name, global_pos); + slurl = LLSLURL::buildSLURLfromPosGlobal(sim_name, global_pos, escaped); } else { diff --git a/indra/newview/lllandmarkactions.h b/indra/newview/lllandmarkactions.h index 3c2a0a5522..c74072c0f4 100644 --- a/indra/newview/lllandmarkactions.h +++ b/indra/newview/lllandmarkactions.h @@ -53,6 +53,14 @@ public: static bool landmarkAlreadyExists(); /** + * @brief Searches landmark for parcel agent is currently in. + * @return Returns landmark for agent parcel or NULL. + * + * *TODO: dzaporozhan: There can be many landmarks for single parcel. + */ + static LLViewerInventoryItem* findLandmarkForAgentParcel(); + + /** * @brief Checks whether agent has rights to create landmark for current parcel. */ static bool canCreateLandmarkHere(); @@ -80,7 +88,7 @@ public: /** * @brief Creates SLURL for given global position. */ - static void getSLURLfromPosGlobal(const LLVector3d& global_pos, slurl_callback_t cb); + static void getSLURLfromPosGlobal(const LLVector3d& global_pos, slurl_callback_t cb, bool escaped = true); /** * @brief Gets landmark global position specified by inventory LLUUID. @@ -98,6 +106,7 @@ private: static void onRegionResponse(slurl_callback_t cb, const LLVector3d& global_pos, + bool escaped, U64 region_handle, const std::string& url, const LLUUID& snapshot_id, diff --git a/indra/newview/lllocationhistory.cpp b/indra/newview/lllocationhistory.cpp index 03d6953521..c83cde9d83 100644 --- a/indra/newview/lllocationhistory.cpp +++ b/indra/newview/lllocationhistory.cpp @@ -49,8 +49,15 @@ void LLLocationHistory::addItem(const std::string & item, const std::string & to static LLUICachedControl<S32> max_items("LocationHistoryMaxSize", 100); // check if this item doesn't duplicate any existing one - if (touchItem(item)) { - return; + std::vector<std::string>::iterator item_iter = std::find_if(mItems.begin(), mItems.end(), + boost::bind(&LLLocationHistory::equalByRegionParcel,this,_1,item)); + if(item_iter != mItems.end()){ + /*replace duplicate. + * If an item's region and item's parcel are equal. + */ + mToolTips.erase(*item_iter); + mItems.erase(item_iter); + } mItems.push_back(item); @@ -65,6 +72,21 @@ void LLLocationHistory::addItem(const std::string & item, const std::string & to } } +/** + * check if the history item is equal. + * @return true - if region name and parcel is equal. + */ +bool LLLocationHistory::equalByRegionParcel(const std::string& item, const std::string& newItem){ + + + S32 itemIndex = item.find('('); + S32 newItemIndex = newItem.find('('); + + std::string region_parcel = item.substr(0,itemIndex); + std::string new_region_parcel = newItem.substr(0,newItemIndex); + + return region_parcel == new_region_parcel; +} bool LLLocationHistory::touchItem(const std::string & item) { bool result = false; std::vector<std::string>::iterator item_iter = std::find(mItems.begin(), mItems.end(), item); @@ -135,7 +157,13 @@ void LLLocationHistory::save() const } for (location_list_t::const_iterator it = mItems.begin(); it != mItems.end(); ++it) - file << (*it) << delimiter << mToolTips.find(*it)->second << std::endl; + { + std::string tooltip = getToolTip(*it); + if(!tooltip.empty()) + { + file << (*it) << delimiter << tooltip << std::endl; + } + } file.close(); } diff --git a/indra/newview/lllocationhistory.h b/indra/newview/lllocationhistory.h index 67eabcdaca..060a6b2fe8 100644 --- a/indra/newview/lllocationhistory.h +++ b/indra/newview/lllocationhistory.h @@ -65,6 +65,7 @@ public: void dump() const; private: + bool equalByRegionParcel(const std::string& item, const std::string& item_to_add); const static char delimiter; std::vector<std::string> mItems; std::map<std::string, std::string> mToolTips; diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 63a40e40a0..1542c7483a 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -40,6 +40,7 @@ #include "llfocusmgr.h" #include "llmenugl.h" #include "llstring.h" +#include "lltrans.h" #include "lluictrlfactory.h" // newview includes @@ -56,6 +57,8 @@ #include "llviewercontrol.h" #include "llviewermenu.h" #include "llurllineeditorctrl.h" +#include "llagentui.h" + //============================================================================ /* * "ADD LANDMARK" BUTTON UPDATING LOGIC @@ -151,6 +154,8 @@ static LLDefaultChildRegistry::Register<LLLocationInputCtrl> r("location_input") LLLocationInputCtrl::Params::Params() : add_landmark_image_enabled("add_landmark_image_enabled"), add_landmark_image_disabled("add_landmark_image_disabled"), + add_landmark_image_hover("add_landmark_image_hover"), + add_landmark_image_selected("add_landmark_image_selected"), add_landmark_button("add_landmark_button"), add_landmark_hpad("add_landmark_hpad", 0), info_button("info_button") @@ -162,7 +167,9 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p) mAddLandmarkHPad(p.add_landmark_hpad), mInfoBtn(NULL), mLocationContextMenu(NULL), - mAddLandmarkBtn(NULL) + mAddLandmarkBtn(NULL), + mLandmarkImageOn(NULL), + mLandmarkImageOff(NULL) { // Lets replace default LLLineEditor with LLLocationLineEditor // to make needed escaping while copying and cutting url @@ -198,16 +205,27 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p) // "Add landmark" button. LLButton::Params al_params = p.add_landmark_button; + + // Image for unselected state will be set in updateAddLandmarkButton(), + // it will be either mLandmarkOn or mLandmarkOff if (p.add_landmark_image_enabled()) { - al_params.image_unselected = p.add_landmark_image_enabled; - al_params.image_selected = p.add_landmark_image_enabled; + mLandmarkImageOn = p.add_landmark_image_enabled; } if (p.add_landmark_image_disabled()) { - al_params.image_disabled = p.add_landmark_image_disabled; - al_params.image_disabled_selected = p.add_landmark_image_disabled; + mLandmarkImageOff = p.add_landmark_image_disabled; + } + + if(p.add_landmark_image_selected) + { + al_params.image_selected = p.add_landmark_image_selected; + } + if (p.add_landmark_image_hover()) + { + al_params.image_hover_unselected = p.add_landmark_image_hover; } + al_params.click_callback.function(boost::bind(&LLLocationInputCtrl::onAddLandmarkButtonClicked, this)); mAddLandmarkBtn = LLUICtrlFactory::create<LLButton>(al_params); enableAddLandmarkButton(true); @@ -233,7 +251,7 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p) // - Make the "Add landmark" button updated when either current parcel gets changed // or a landmark gets created or removed from the inventory. // - Update the location string on parcel change. - mParcelMgrConnection = LLViewerParcelMgr::getInstance()->setAgentParcelChangedCallback( + mParcelMgrConnection = LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback( boost::bind(&LLLocationInputCtrl::onAgentParcelChange, this)); mLocationHistoryConnection = LLLocationHistory::getInstance()->setLoadedCallback( @@ -243,6 +261,9 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p) mAddLandmarkObserver = new LLAddLandmarkObserver(this); gInventory.addObserver(mRemoveLandmarkObserver); gInventory.addObserver(mAddLandmarkObserver); + + mAddLandmarkTooltip = LLTrans::getString("location_ctrl_add_landmark"); + mEditLandmarkTooltip = LLTrans::getString("location_ctrl_edit_landmark"); } LLLocationInputCtrl::~LLLocationInputCtrl() @@ -389,7 +410,21 @@ void LLLocationInputCtrl::onInfoButtonClicked() void LLLocationInputCtrl::onAddLandmarkButtonClicked() { - LLSideTray::getInstance()->showPanel("panel_places", LLSD().insert("type", "create_landmark")); + LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentParcel(); + + // Landmark exists, open it for preview and edit + if(landmark && landmark->getUUID().notNull()) + { + LLSD key; + key["type"] = "landmark"; + key["id"] = landmark->getUUID(); + + LLSideTray::getInstance()->showPanel("panel_places", key); + } + else + { + LLSideTray::getInstance()->showPanel("panel_places", LLSD().insert("type", "create_landmark")); + } } void LLLocationInputCtrl::onAgentParcelChange() @@ -414,11 +449,14 @@ void LLLocationInputCtrl::onLocationPrearrange(const LLSD& data) rebuildLocationHistory(filter); //Let's add landmarks to the top of the list if any - LLInventoryModel::item_array_t landmark_items = LLLandmarkActions::fetchLandmarksByName(filter, TRUE); - - for(U32 i=0; i < landmark_items.size(); i++) + if( filter.size() !=0 ) { - mList->addSimpleElement(landmark_items[i]->getName(), ADD_TOP); + LLInventoryModel::item_array_t landmark_items = LLLandmarkActions::fetchLandmarksByName(filter, TRUE); + + for(U32 i=0; i < landmark_items.size(); i++) + { + mList->addSimpleElement(landmark_items[i]->getName(), ADD_TOP); + } } mList->mouseOverHighlightNthItem(-1); // Clear highlight on the last selected item. } @@ -459,9 +497,7 @@ void LLLocationInputCtrl::refreshLocation() LLAgent::ELocationFormat format = (gSavedSettings.getBOOL("ShowCoordinatesOption") ? LLAgent::LOCATION_FORMAT_WITHOUT_SIM: LLAgent::LOCATION_FORMAT_NORMAL); - if (!gAgent.buildLocationString(location_name,format)) - location_name = "Unknown"; - + if (!LLAgentUI::buildLocationString(location_name, format)) location_name = "Unknown"; setText(location_name); } @@ -499,15 +535,32 @@ void LLLocationInputCtrl::focusTextEntry() void LLLocationInputCtrl::enableAddLandmarkButton(bool val) { - // Enable/disable the button. - mAddLandmarkBtn->setEnabled(val); + // We don't want to disable the button because it should be click able at any time, + // instead switch images. + LLUIImage* img = val ? mLandmarkImageOn : mLandmarkImageOff; + if(img) + { + mAddLandmarkBtn->setImageUnselected(img); + } } // Change the "Add landmark" button image // depending on whether current parcel has been landmarked. void LLLocationInputCtrl::updateAddLandmarkButton() { - enableAddLandmarkButton(!LLLandmarkActions::landmarkAlreadyExists()); + bool landmark_exists = LLLandmarkActions::landmarkAlreadyExists(); + enableAddLandmarkButton(!landmark_exists); + + std::string tooltip; + if(landmark_exists) + { + tooltip = mEditLandmarkTooltip; + } + else + { + tooltip = mAddLandmarkTooltip; + } + mAddLandmarkBtn->setToolTip(tooltip); } void LLLocationInputCtrl::updateContextMenu(){ @@ -554,7 +607,8 @@ void LLLocationInputCtrl::changeLocationPresentation() if(mTextEntry && !mTextEntry->hasSelection() && !LLSLURL::isSLURL(mTextEntry->getText())) { - mTextEntry->setText(gAgent.getUnescapedSLURL()); + //needs unescaped one + mTextEntry->setText(LLAgentUI::buildSLURL(false)); mTextEntry->selectAll(); } } diff --git a/indra/newview/lllocationinputctrl.h b/indra/newview/lllocationinputctrl.h index 1b26a07d83..d967df8257 100644 --- a/indra/newview/lllocationinputctrl.h +++ b/indra/newview/lllocationinputctrl.h @@ -59,7 +59,9 @@ public: : public LLInitParam::Block<Params, LLComboBox::Params> { Optional<LLUIImage*> add_landmark_image_enabled, - add_landmark_image_disabled; + add_landmark_image_disabled, + add_landmark_image_hover, + add_landmark_image_selected; Optional<S32> add_landmark_hpad; Optional<LLButton::Params> add_landmark_button, info_button; @@ -93,6 +95,10 @@ private: virtual ~LLLocationInputCtrl(); void focusTextEntry(); + /** + * Changes the "Add landmark" button image + * depending on whether current parcel has been landmarked. + */ void enableAddLandmarkButton(bool val); void refresh(); void refreshLocation(); @@ -124,6 +130,11 @@ private: boost::signals2::connection mParcelMgrConnection; boost::signals2::connection mLocationHistoryConnection; + LLUIImage* mLandmarkImageOn; + LLUIImage* mLandmarkImageOff; + + std::string mAddLandmarkTooltip; + std::string mEditLandmarkTooltip; }; #endif diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index 92b1ecfd16..11c8b03f7f 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -36,6 +36,7 @@ // Library includes #include "indra_constants.h" +#include "llparcel.h" // Viewer includes @@ -51,6 +52,8 @@ #include "llviewerwindow.h" #include "llviewercontrol.h" #include "llselectmgr.h" +#include "llviewerparcelmgr.h" +#include "llviewerregion.h" // // Constants @@ -137,6 +140,8 @@ BOOL LLFloaterMove::postBuild() initMovementMode(); + LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(LLFloaterMove::sUpdateFlyingStatus); + return TRUE; } @@ -385,6 +390,15 @@ void LLFloaterMove::updatePosition() } setOrigin(x, y); } + +//static +void LLFloaterMove::sUpdateFlyingStatus() +{ + LLFloaterMove *floater = LLFloaterReg::findTypedInstance<LLFloaterMove>("moveview"); + if (floater) floater->mModeControlButtonMap[MM_FLY]->setEnabled(gAgent.canFly()); + +} + void LLFloaterMove::showModeButtons(BOOL bShow) { if (mModeActionsPanel->getVisible() == bShow) @@ -421,6 +435,8 @@ void LLFloaterMove::enableInstance(BOOL bEnable) void LLFloaterMove::onOpen(const LLSD& key) { updatePosition(); + + sUpdateFlyingStatus(); } void LLFloaterMove::showQuickTips(const EMovementMode mode) @@ -476,11 +492,12 @@ inline LLPanelStandStopFlying* LLPanelStandStopFlying::getInstance() void LLPanelStandStopFlying::setStandStopFlyingMode(EStandStopFlyingMode mode) { LLPanelStandStopFlying* panel = getInstance(); - panel->setVisible(TRUE); - BOOL standVisible = SSFM_STAND == mode; - panel->mStandButton->setVisible(standVisible); - panel->mStopFlyingButton->setVisible(!standVisible); + panel->mStandButton->setVisible(SSFM_STAND == mode); + panel->mStopFlyingButton->setVisible(SSFM_STOP_FLYING == mode); + + //visibility of it should be updated after updating visibility of the buttons + panel->setVisible(TRUE); } //static @@ -505,11 +522,12 @@ BOOL LLPanelStandStopFlying::postBuild() mStandButton = getChild<LLButton>("stand_btn"); mStandButton->setCommitCallback(boost::bind(&LLPanelStandStopFlying::onStandButtonClick, this)); mStandButton->setCommitCallback(boost::bind(&LLFloaterMove::enableInstance, TRUE)); + mStandButton->setVisible(FALSE); mStopFlyingButton = getChild<LLButton>("stop_fly_btn"); mStopFlyingButton->setCommitCallback(boost::bind(&LLFloaterMove::setFlyingMode, FALSE)); mStopFlyingButton->setCommitCallback(boost::bind(&LLPanelStandStopFlying::onStopFlyingButtonClick, this)); - + mStopFlyingButton->setVisible(FALSE); return TRUE; } @@ -517,6 +535,11 @@ BOOL LLPanelStandStopFlying::postBuild() //virtual void LLPanelStandStopFlying::setVisible(BOOL visible) { + //we dont need to show the panel if these buttons are not activated + if (visible && !mStandButton->getVisible() && !mStopFlyingButton->getVisible()) visible = false; + + if (gAgent.getCameraMode() == CAMERA_MODE_MOUSELOOK) visible = false; + if (visible) { updatePosition(); diff --git a/indra/newview/llmoveview.h b/indra/newview/llmoveview.h index fd9cf9f4c1..6e6af9b693 100644 --- a/indra/newview/llmoveview.h +++ b/indra/newview/llmoveview.h @@ -67,6 +67,7 @@ public: // let update its position in each frame /*virtual*/ void draw(){updatePosition(); LLFloater::draw();} + static void sUpdateFlyingStatus(); protected: void turnLeft(); diff --git a/indra/newview/llnamebox.cpp b/indra/newview/llnamebox.cpp index 56648d3218..2f4a266198 100644 --- a/indra/newview/llnamebox.cpp +++ b/indra/newview/llnamebox.cpp @@ -41,7 +41,6 @@ #include "lluuid.h" #include "llcachename.h" -#include "llagent.h" // statics std::set<LLNameBox*> LLNameBox::sInstances; diff --git a/indra/newview/llnameeditor.cpp b/indra/newview/llnameeditor.cpp index ccb33c770a..65601da7da 100644 --- a/indra/newview/llnameeditor.cpp +++ b/indra/newview/llnameeditor.cpp @@ -34,7 +34,6 @@ #include "llnameeditor.h" #include "llcachename.h" -#include "llagent.h" #include "llfontgl.h" diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index 087fdda14a..1b82c2dc18 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -37,7 +37,6 @@ #include "llnamelistctrl.h" #include "llcachename.h" -#include "llagent.h" #include "llinventory.h" #include "llscrolllistitem.h" #include "llscrolllistcell.h" diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index 713c44d366..7cb0456e8a 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -40,6 +40,7 @@ #include <llmenugl.h> #include "llagent.h" +#include "llviewerregion.h" #include "lllocationhistory.h" #include "lllocationinputctrl.h" #include "llteleporthistory.h" @@ -57,6 +58,7 @@ #include "lllandmarkactions.h" #include "llfavoritesbar.h" +#include "llagentui.h" //-- LLTeleportHistoryMenuItem ----------------------------------------------- @@ -180,19 +182,15 @@ LLNavigationBar::LLNavigationBar() mBtnHome(NULL), mCmbLocation(NULL), mLeSearch(NULL), - mPurgeTPHistoryItems(false), - mUpdateTypedLocationHistory(false) + mPurgeTPHistoryItems(false) { setIsChrome(TRUE); - mParcelMgrConnection = LLViewerParcelMgr::getInstance()->setAgentParcelChangedCallback( - boost::bind(&LLNavigationBar::onTeleportFinished, this)); + mParcelMgrConnection = LLViewerParcelMgr::getInstance()->setTeleportFinishedCallback( + boost::bind(&LLNavigationBar::onTeleportFinished, this, _1)); LLUICtrlFactory::getInstance()->buildPanel(this, "panel_navigation_bar.xml"); - // navigation bar can never get a tab - setFocusRoot(FALSE); - // set a listener function for LoginComplete event LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLNavigationBar::handleLoginComplete, this)); @@ -314,19 +312,18 @@ void LLNavigationBar::onLocationSelection() } else { + //If it is not slurl let's look for landmarks LLInventoryModel::item_array_t landmark_items = LLLandmarkActions::fetchLandmarksByName(typed_location, FALSE); if ( !landmark_items.empty() ) { - mUpdateTypedLocationHistory = true; gAgent.teleportViaLandmark(landmark_items[0]->getAssetUUID()); return; } - else - { - region_name = extractLocalCoordsFromRegName(typed_location, &x, &y, &z); - if (region_name != typed_location) - local_coords.set(x, y, z); - } + //No landmark match, check if it is a region name + region_name = parseLocation(typed_location, &x, &y, &z); + if (region_name != typed_location) + local_coords.set(x, y, z); + // Treat it as region name. // region_name = typed_location; } @@ -339,31 +336,30 @@ void LLNavigationBar::onLocationSelection() LLWorldMap::getInstance()->sendNamedRegionRequest(region_name, cb, std::string("unused"), false); } -void LLNavigationBar::onTeleportFinished() +void LLNavigationBar::onTeleportFinished(const LLVector3d& global_agent_pos) { + // Location is valid. Add it to the typed locations history. + LLLocationHistory* lh = LLLocationHistory::getInstance(); - if (mUpdateTypedLocationHistory) { - LLLocationHistory* lh = LLLocationHistory::getInstance(); - - // Location is valid. Add it to the typed locations history. - // If user has typed text this variable will contain -1. - if (mCmbLocation->getCurrentIndex() != -1) { - lh->touchItem(mCmbLocation->getSelectedItemLabel()); - } else { - std::string region_name; - std::string url = gAgent.getSLURL(); - S32 x = 0, y = 0, z = 0; - - if (LLSLURL::isSLURL(url)) { - LLURLSimString::parse(LLSLURL::stripProtocol(url), ®ion_name, &x, &y, &z); - appendLocalCoordsToRegName(®ion_name, x, y, z); - lh->addItem(region_name, url); - } - } - - lh->save(); - mUpdateTypedLocationHistory = false; + std::string location; + /*NOTE: + * We can't use gAgent.getPositionAgent() in case of local teleport to build location. + * At this moment gAgent.getPositionAgent() contains previous coordinates. + * according to EXT-65 agent position is being reseted on each frame. + */ + LLAgentUI::buildLocationString(location, LLAgent::LOCATION_FORMAT_WITHOUT_SIM, + gAgent.getPosAgentFromGlobal(global_agent_pos)); + + //Touch it, if it is at list already, add new location otherwise + if ( !lh->touchItem(location) ) { + std::string tooltip = LLSLURL::buildSLURLfromPosGlobal( + gAgent.getRegion()->getName(), global_agent_pos, false); + + lh->addItem(location, tooltip); } + llinfos << "Saving after on teleport finish" << llendl; + lh->save(); + } void LLNavigationBar::onTeleportHistoryChanged() @@ -436,7 +432,6 @@ void LLNavigationBar::onRegionNameResponse( LLVector3d region_pos = from_region_handle(region_handle); LLVector3d global_pos = region_pos + (LLVector3d) local_coords; - mUpdateTypedLocationHistory = true; llinfos << "Teleporting to: " << global_pos << llendl; gAgent.teleportViaLocation(global_pos); } @@ -475,12 +470,7 @@ void LLNavigationBar::invokeSearch(std::string search_text) LLFloaterReg::showInstance("search", LLSD().insert("panel", "all").insert("id", LLSD(search_text))); } -void LLNavigationBar::appendLocalCoordsToRegName(std::string* reg_name, S32 x, S32 y, S32 z) { - std::string fmt = *reg_name + " (%d, %d, %d)"; - *reg_name = llformat(fmt.c_str(), x, y, z); -} - -std::string LLNavigationBar::extractLocalCoordsFromRegName(const std::string & reg_name, S32* x, S32* y, S32* z) { +std::string LLNavigationBar::parseLocation(const std::string & location, S32* x, S32* y, S32* z) { /* * This regular expression extracts numbers from the following string * construct: "(num1, num2, num3)", where num1, num2 and num3 are decimal @@ -489,7 +479,7 @@ std::string LLNavigationBar::extractLocalCoordsFromRegName(const std::string & r const boost::regex re("\\s*\\((\\d+),\\s*(\\d+),\\s*(\\d+)\\)\\s*"); boost::smatch m; - if (boost::regex_search(reg_name, m, re)) { + if (boost::regex_search(location, m, re)) { // string representations of parsed by regex++ numbers std::string xstr(m[1].first, m[1].second); std::string ystr(m[2].first, m[2].second); @@ -498,13 +488,15 @@ std::string LLNavigationBar::extractLocalCoordsFromRegName(const std::string & r *x = atoi(xstr.c_str()); *y = atoi(ystr.c_str()); *z = atoi(zstr.c_str()); - - return boost::regex_replace(reg_name, re, ""); + //erase commas in coordinates + std::string region_parcel = boost::regex_replace(location, re, ""); + // cut region name + return region_parcel.substr(0, region_parcel.find_first_of(',')); } *x = *y = *z = 0; - return reg_name; + return location; } void LLNavigationBar::clearHistoryCache() diff --git a/indra/newview/llnavigationbar.h b/indra/newview/llnavigationbar.h index eeaec4e668..6932847854 100644 --- a/indra/newview/llnavigationbar.h +++ b/indra/newview/llnavigationbar.h @@ -70,8 +70,10 @@ private: void showTeleportHistoryMenu(); void invokeSearch(std::string search_text); - static void appendLocalCoordsToRegName(std::string* reg_name, S32 x, S32 y, S32 z); - static std::string extractLocalCoordsFromRegName(const std::string & reg_name, S32* x, S32* y, S32* z); + /** + * Get region name and local coordinates from typed location + */ + static std::string parseLocation(const std::string & location, S32* x, S32* y, S32* z); // callbacks void onTeleportHistoryMenuItemClicked(const LLSD& userdata); @@ -84,7 +86,7 @@ private: void onLocationSelection(); void onLocationPrearrange(const LLSD& data); void onSearchCommit(); - void onTeleportFinished(); + void onTeleportFinished(const LLVector3d& global_agent_pos); void onRegionNameResponse( std::string typed_location, std::string region_name, @@ -104,7 +106,6 @@ private: LLRect mDefaultFpRect; boost::signals2::connection mParcelMgrConnection; bool mPurgeTPHistoryItems; - bool mUpdateTypedLocationHistory; }; #endif diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index da9f50a2bc..3856a86da0 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -211,7 +211,17 @@ void nearbychat_add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, cons edit->appendStyledText(start_line, false, prepend_newline, LLStyleMap::instance().lookup(chat.mFromID,chat.mURL)); prepend_newline = false; } - edit->appendColoredText(line, false, prepend_newline, color); + + S32 font_size = gSavedSettings.getS32("ChatFontSize"); + + std::string font_name = ""; + + if (0 == font_size) + font_name = "small"; + else if (2 == font_size) + font_name = "sansserifbig"; + + edit->appendColoredText(line, false, prepend_newline, color, font_name); } diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index 8124d4b36a..a1912655a3 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -97,20 +97,15 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg) LLToast::Params p; p.id = id; p.panel = item; - p.on_mouse_enter = boost::bind(&LLNearbyChatHandler::onToastDestroy, this, _1); + p.on_toast_destroy = boost::bind(&LLNearbyChatHandler::onToastDestroy, this, _1); + p.on_mouse_enter = boost::bind(&LLNearbyChatHandler::removeNearbyToastsAndShowChat, this); mChannel->addToast(p); } void LLNearbyChatHandler::onToastDestroy(LLToast* toast) { - //TODO: what should be done to toasts here? may be htey are to be destroyed? - //toast->hide(); - if(mChannel) - mChannel->removeToastsFromChannel(); - else if(toast) - toast->hide(); - - LLFloaterReg::showTypedInstance<LLNearbyChat>("nearby_chat", LLSD()); + if(toast) + toast->closeFloater(); } void LLNearbyChatHandler::onChicletClick(void) @@ -118,7 +113,16 @@ void LLNearbyChatHandler::onChicletClick(void) } void LLNearbyChatHandler::onChicletClose(void) { +} +void LLNearbyChatHandler::removeNearbyToastsAndShowChat() +{ + /* + if(mChannel) + mChannel->removeToastsFromChannel(); + + LLFloaterReg::showTypedInstance<LLNearbyChat>("nearby_chat", LLSD()); + */ } } diff --git a/indra/newview/llnearbychathandler.h b/indra/newview/llnearbychathandler.h index 53436a92b0..8fcd03689d 100644 --- a/indra/newview/llnearbychathandler.h +++ b/indra/newview/llnearbychathandler.h @@ -51,6 +51,7 @@ public: virtual void onChicletClose(void); protected: + void removeNearbyToastsAndShowChat(); }; } diff --git a/indra/newview/llnotificationalerthandler.cpp b/indra/newview/llnotificationalerthandler.cpp index f485152d3a..bd6c6b2308 100644 --- a/indra/newview/llnotificationalerthandler.cpp +++ b/indra/newview/llnotificationalerthandler.cpp @@ -49,7 +49,7 @@ LLAlertHandler::LLAlertHandler(e_notification_type type, const LLSD& id) : mIsMo LLBottomTray* tray = LLBottomTray::getInstance(); LLChannelManager::Params p; - p.id = LLUUID(ALERT_CHANNEL_ID); + p.id = LLUUID(gSavedSettings.getString("AlertChannelUUID")); p.channel_right_bound = tray->getRect().getWidth() / 2; p.channel_width = 0; p.display_toasts_always = true; @@ -58,6 +58,7 @@ LLAlertHandler::LLAlertHandler(e_notification_type type, const LLSD& id) : mIsMo // Getting a Channel for our notifications mChannel = LLChannelManager::getInstance()->createChannel(p); mChannel->setFollows(FOLLOWS_BOTTOM | FOLLOWS_TOP); + mChannel->setShowToasts(true); } //-------------------------------------------------------------------------- @@ -98,7 +99,7 @@ void LLAlertHandler::processNotification(const LLSD& notify) void LLAlertHandler::onToastDestroy(LLToast* toast) { - toast->close(); + toast->closeFloater(); } //-------------------------------------------------------------------------- diff --git a/indra/newview/llnotificationgrouphandler.cpp b/indra/newview/llnotificationgrouphandler.cpp index 9a6a041c35..31753efec9 100644 --- a/indra/newview/llnotificationgrouphandler.cpp +++ b/indra/newview/llnotificationgrouphandler.cpp @@ -34,8 +34,8 @@ #include "llnotificationhandler.h" #include "lltoastgroupnotifypanel.h" -#include "llagent.h" #include "llbottomtray.h" +#include "llgroupactions.h" #include "llviewercontrol.h" #include "llfloaterreg.h" #include "llsyswellwindow.h" @@ -51,7 +51,7 @@ LLGroupHandler::LLGroupHandler(e_notification_type type, const LLSD& id) LLBottomTray* tray = LLBottomTray::getInstance(); mChiclet = tray->getSysWell(); LLChannelManager::Params p; - p.chiclet = mChiclet; + p.id = LLUUID(gSavedSettings.getString("NotificationChannelUUID")); p.channel_right_bound = tray->getRect().mRight - gSavedSettings.getS32("NotificationChannelRightMargin"); p.channel_width = gSavedSettings.getS32("NotifyBoxWidth"); @@ -77,7 +77,10 @@ void LLGroupHandler::processNotification(const LLSD& notify) p.panel = notify_box; p.on_toast_destroy = boost::bind(&LLGroupHandler::onToastDestroy, this, _1); mChannel->addToast(p); - mChiclet->setCounter(mChiclet->getCounter() + 1); + static_cast<LLNotificationChiclet*>(mChiclet)->incUreadSystemNotifications(); + + LLGroupActions::refresh_notices(); + } else if (notify["sigtype"].asString() == "delete") { @@ -88,7 +91,7 @@ void LLGroupHandler::processNotification(const LLSD& notify) //-------------------------------------------------------------------------- void LLGroupHandler::onToastDestroy(LLToast* toast) { - mChiclet->setCounter(mChiclet->getCounter() - 1); + static_cast<LLNotificationChiclet*>(mChiclet)->decUreadSystemNotifications(); LLToastPanel* panel = dynamic_cast<LLToastPanel*>(toast->getPanel()); LLFloaterReg::getTypedInstance<LLSysWellWindow>("syswell_window")->removeItemByID(panel->getID()); @@ -97,7 +100,7 @@ void LLGroupHandler::onToastDestroy(LLToast* toast) if(toast->hasFocus()) mChannel->setHovering(false); - toast->close(); + toast->closeFloater(); } //-------------------------------------------------------------------------- @@ -113,14 +116,3 @@ void LLGroupHandler::onChicletClose(void) //-------------------------------------------------------------------------- -//-------------------------------------------------------------------------- - - -//-------------------------------------------------------------------------- - - -//-------------------------------------------------------------------------- - - -//-------------------------------------------------------------------------- - diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h index 2e5fdd9ed5..6982ab7096 100644 --- a/indra/newview/llnotificationhandler.h +++ b/indra/newview/llnotificationhandler.h @@ -42,9 +42,6 @@ namespace LLNotificationsUI { -// ID for channel that displays Alert Notifications -#define ALERT_CHANNEL_ID "F3E07BC8-A973-476D-8C7F-F3B7293975D1" - // ENotificationType enumerates all possible types of notifications that could be met // typedef enum e_notification_type @@ -118,6 +115,25 @@ public: }; /** + * Handler for IM notifications. + * It manages life time of tip and script notices. + */ +class LLIMHandler : public LLSysHandler +{ +public: + LLIMHandler(); + virtual ~LLIMHandler(); + + // base interface functions + virtual void processNotification(const LLSD& notify); + virtual void onToastDestroy(LLToast* toast); + virtual void onChicletClick(void); + virtual void onChicletClose(void); + +protected: +}; + +/** * Handler for system informational notices. * It manages life time of tip and script notices. */ @@ -135,6 +151,7 @@ public: // own handlers void onStoreToast(LLPanel* info_panel, LLUUID id); + void onRejectToast(LLToast::Params p); protected: }; diff --git a/indra/newview/llnotificationmanager.cpp b/indra/newview/llnotificationmanager.cpp index 3eda0d0d14..31266fdecf 100644 --- a/indra/newview/llnotificationmanager.cpp +++ b/indra/newview/llnotificationmanager.cpp @@ -62,18 +62,21 @@ void LLNotificationManager::init() LLNotificationChannel::buildChannel("Group Notifications", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "groupnotify")); LLNotificationChannel::buildChannel("Alerts", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "alert")); LLNotificationChannel::buildChannel("AlertModal", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "alertmodal")); + LLNotificationChannel::buildChannel("IM Notifications", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "notifytoast")); LLNotifications::instance().getChannel("Notifications")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1)); LLNotifications::instance().getChannel("NotificationTips")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1)); LLNotifications::instance().getChannel("Group Notifications")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1)); LLNotifications::instance().getChannel("Alerts")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1)); LLNotifications::instance().getChannel("AlertModal")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1)); + LLNotifications::instance().getChannel("IM Notifications")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1)); mNotifyHandlers["notify"] = boost::shared_ptr<LLEventHandler>(new LLInfoHandler(NT_NOTIFY, LLSD())); mNotifyHandlers["notifytip"] = mNotifyHandlers["notify"]; mNotifyHandlers["groupnotify"] = boost::shared_ptr<LLEventHandler>(new LLGroupHandler(NT_GROUPNOTIFY, LLSD())); mNotifyHandlers["alert"] = boost::shared_ptr<LLEventHandler>(new LLAlertHandler(NT_ALERT, LLSD())); mNotifyHandlers["alertmodal"] = mNotifyHandlers["alert"]; + mNotifyHandlers["notifytoast"] = boost::shared_ptr<LLEventHandler>(new LLIMHandler()); mNotifyHandlers["nearbychat"] = boost::shared_ptr<LLEventHandler>(new LLNearbyChatHandler(NT_NEARBYCHAT, LLSD())); } diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h index a6cf2a2d27..51bd619901 100644 --- a/indra/newview/llpanelavatar.h +++ b/indra/newview/llpanelavatar.h @@ -75,6 +75,16 @@ public: virtual void onOpen(const LLSD& key); /** + * Profile tabs should close any opened panels here. + * + * Called from LLPanelProfile::onOpen() before opening new profile. + * See LLPanelpicks::onClose for example. LLPanelPicks closes picture info panel + * before new profile is displayed, otherwise new profile will + * be hidden behind picture info panel. + */ + virtual void onClose() {} + + /** * Resets controls visibility, state, etc. */ virtual void resetControls(){}; diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index a7c05af50b..2e87f0b65b 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -33,7 +33,6 @@ #include "llpanelgroup.h" -#include "llagent.h" #include "llbutton.h" #include "lltabcontainer.h" #include "lltextbox.h" @@ -116,6 +115,9 @@ LLPanelGroup::~LLPanelGroup() void LLPanelGroup::onOpen(const LLSD& key) { + if(!key.has("group_id")) + return; + LLUUID group_id = key["group_id"]; if(!key.has("action")) { @@ -127,7 +129,7 @@ void LLPanelGroup::onOpen(const LLSD& key) if(str_action == "refresh") { - if(mID == group_id) + if(mID == group_id || group_id == LLUUID::null) refreshData(); } else if(str_action == "close") @@ -138,6 +140,12 @@ void LLPanelGroup::onOpen(const LLSD& key) { setGroupID(LLUUID::null); } + else if(str_action == "refresh_notices") + { + LLPanelGroupNotices* panel_notices = findChild<LLPanelGroupNotices>("group_notices_tab_panel"); + if(panel_notices) + panel_notices->refreshNotices(); + } } @@ -314,6 +322,15 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) } else { + if(!tab_general->getDisplayChildren()) + tab_general->changeOpenClose(tab_general->getDisplayChildren()); + if(!tab_roles->getDisplayChildren()) + tab_roles->changeOpenClose(tab_roles->getDisplayChildren()); + if(!tab_notices->getDisplayChildren()) + tab_notices->changeOpenClose(tab_notices->getDisplayChildren()); + if(!tab_land->getDisplayChildren()) + tab_land->changeOpenClose(tab_land->getDisplayChildren()); + tab_roles->canOpenClose(true); tab_notices->canOpenClose(true); tab_land->canOpenClose(true); diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index 1e6eb8ed44..c5eaa34204 100644 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -37,6 +37,7 @@ #include "llfloateravatarpicker.h" #include "llbutton.h" #include "llcombobox.h" +#include "llgroupactions.h" #include "llgroupmgr.h" #include "llnamelistctrl.h" #include "llscrolllistitem.h" @@ -80,6 +81,7 @@ public: LLButton *mRemoveButton; LLTextBox *mGroupName; std::string mOwnerWarning; + std::string mAlreadyInGroup; bool mConfirmedOwnerInvite; void (*mCloseCallback)(void* data); @@ -167,16 +169,29 @@ void LLPanelGroupInvite::impl::submitInvitations() } } + bool already_in_group = false; //loop over the users std::vector<LLScrollListItem*> items = mInvitees->getAllData(); for (std::vector<LLScrollListItem*>::iterator iter = items.begin(); iter != items.end(); ++iter) { LLScrollListItem* item = *iter; + if(LLGroupActions::isAvatarMemberOfGroup(mGroupID, item->getUUID())) + { + already_in_group = true; + continue; + } role_member_pairs[item->getUUID()] = role_id; } - + LLGroupMgr::getInstance()->sendGroupMemberInvites(mGroupID, role_member_pairs); + + if(already_in_group) + { + LLSD msg; + msg["MESSAGE"] = mAlreadyInGroup; + LLNotifications::instance().add("GenericAlert", msg); + } //then close (*mCloseCallback)(mCloseCallbackUserData); @@ -550,6 +565,7 @@ BOOL LLPanelGroupInvite::postBuild() } mImplementation->mOwnerWarning = getString("confirm_invite_owner_str"); + mImplementation->mAlreadyInGroup = getString("already_in_group"); update(); diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp index 8caa7d85eb..e40fa19bb6 100644 --- a/indra/newview/llpanelgrouplandmoney.cpp +++ b/indra/newview/llpanelgrouplandmoney.cpp @@ -1515,16 +1515,15 @@ void LLPanelGroupLandMoney::setGroupID(const LLUUID& id) mImplementationp->mGroupOverLimitIconp->setVisible(FALSE); } - if ( !can_view ) + if ( mImplementationp->mGroupParcelsp ) { - if ( mImplementationp->mGroupParcelsp ) - { - mImplementationp->mGroupParcelsp->setCommentText( - mImplementationp->mCantViewParcelsText); - mImplementationp->mGroupParcelsp->setEnabled(FALSE); - } + mImplementationp->mGroupParcelsp->setEnabled(can_view); } + if ( !can_view && mImplementationp->mGroupParcelsp ) + { + mImplementationp->mGroupParcelsp->setEnabled(FALSE); + } LLButton* earlierp, *laterp; diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index 56042f6bff..0ce85818dd 100644 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -41,6 +41,7 @@ #include "llinventorymodel.h" #include "llfloaterinventory.h" #include "llagent.h" +#include "llagentui.h" #include "lltooldraganddrop.h" #include "lllineeditor.h" @@ -379,13 +380,38 @@ void LLPanelGroupNotices::onClickSendMessage(void* data) self->mCreateMessage->getText(), self->mInventoryItem); + + //instantly add new notice. actual notice will be added after ferreshNotices call + LLUUID id = LLUUID::generateNewID(); + std::string subj = self->mCreateSubject->getText(); + std::string name ; + LLAgentUI::buildFullname(name); + U32 timestamp = 0; + + LLSD row; + row["id"] = id; + + row["columns"][0]["column"] = "icon"; + + row["columns"][1]["column"] = "subject"; + row["columns"][1]["value"] = subj; + + row["columns"][2]["column"] = "from"; + row["columns"][2]["value"] = name; + + row["columns"][3]["column"] = "date"; + row["columns"][3]["value"] = build_notice_date(timestamp); + + row["columns"][4]["column"] = "sort"; + row["columns"][4]["value"] = llformat( "%u", timestamp); + + self->mNoticesList->addElement(row, ADD_BOTTOM); + self->mCreateMessage->clear(); self->mCreateSubject->clear(); onClickRemoveAttachment(data); self->arrangeNoticeView(VIEW_PAST_NOTICE); - onClickRefreshNotices(self); - } //static @@ -407,6 +433,26 @@ void LLPanelGroupNotices::onClickNewMessage(void* data) self->mNoticesList->deselectAllItems(TRUE); // TRUE == don't commit on chnage } +void LLPanelGroupNotices::refreshNotices() +{ + onClickRefreshNotices(this); + /* + lldebugs << "LLPanelGroupNotices::onClickGetPastNotices" << llendl; + + mNoticesList->deleteAllItems(); + + LLMessageSystem* msg = gMessageSystem; + msg->newMessage("GroupNoticesListRequest"); + msg->nextBlock("AgentData"); + msg->addUUID("AgentID",gAgent.getID()); + msg->addUUID("SessionID",gAgent.getSessionID()); + msg->nextBlock("Data"); + msg->addUUID("GroupID",self->mGroupID); + gAgent.sendReliableMessage(); + */ + +} + void LLPanelGroupNotices::onClickRefreshNotices(void* data) { lldebugs << "LLPanelGroupNotices::onClickGetPastNotices" << llendl; diff --git a/indra/newview/llpanelgroupnotices.h b/indra/newview/llpanelgroupnotices.h index c41a5f501b..4bda38c897 100644 --- a/indra/newview/llpanelgroupnotices.h +++ b/indra/newview/llpanelgroupnotices.h @@ -69,6 +69,8 @@ public: const std::string& inventory_name, LLOfferInfo* inventory_offer); + void refreshNotices(); + virtual void setGroupID(const LLUUID& id); private: diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index ab614fea53..4618b49df4 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -49,6 +49,7 @@ #include "lltabcontainer.h" #include "lltextbox.h" #include "lltexteditor.h" +#include "llsearcheditor.h" #include "llviewertexturelist.h" #include "llviewerwindow.h" #include "llfocusmgr.h" @@ -464,9 +465,7 @@ LLPanelGroupSubTab::LLPanelGroupSubTab() : LLPanelGroupTab(), mHeader(NULL), mFooter(NULL), - mSearchLineEditor(NULL), - mSearchButton(NULL), - mShowAllButton(NULL) + mSearchEditor(NULL) { } @@ -478,22 +477,14 @@ BOOL LLPanelGroupSubTab::postBuild() { // Hook up the search widgets. bool recurse = true; - mSearchLineEditor = getChild<LLLineEditor>("search_text", recurse); + mSearchEditor = getChild<LLSearchEditor>("filter_input", recurse); - if (!mSearchLineEditor) return FALSE; - mSearchLineEditor->setKeystrokeCallback(onSearchKeystroke, this); - - mSearchButton = getChild<LLButton>("search_button", recurse); - - if (!mSearchButton) return FALSE; - mSearchButton->setClickedCallback(onClickSearch, this); - mSearchButton->setEnabled(FALSE); + if (!mSearchEditor) + return FALSE; - mShowAllButton = getChild<LLButton>("show_all_button", recurse); + mSearchEditor->setCommitCallback(boost::bind(&LLPanelGroupSubTab::onClickSearch, this)); + mSearchEditor->setKeystrokeCallback(onSearchKeystroke, this); - if (!mShowAllButton) return FALSE; - mShowAllButton->setClickedCallback(onClickShowAll, this); - mShowAllButton->setEnabled(FALSE); // Get icons for later use. mActionIcons.clear(); @@ -516,63 +507,35 @@ BOOL LLPanelGroupSubTab::postBuild() return LLPanelGroupTab::postBuild(); } -// static -void LLPanelGroupSubTab::onSearchKeystroke(LLLineEditor* caller, void* user_data) -{ - LLPanelGroupSubTab* self = static_cast<LLPanelGroupSubTab*>(user_data); - self->handleSearchKeystroke(caller); -} - -void LLPanelGroupSubTab::handleSearchKeystroke(LLLineEditor* caller) +void LLPanelGroupSubTab::setGroupID(const LLUUID& id) { - if (caller->getText().size()) - { - setDefaultBtn( mSearchButton ); - mSearchButton->setEnabled(TRUE); - } - else + LLPanelGroupTab::setGroupID(id); + if(mSearchEditor) { - setDefaultBtn( NULL ); - mSearchButton->setEnabled(FALSE); + mSearchEditor->clear(); + setSearchFilter(""); } } -// static -void LLPanelGroupSubTab::onClickSearch(void* user_data) +// static +void LLPanelGroupSubTab::onSearchKeystroke(LLLineEditor* caller, void* user_data) { LLPanelGroupSubTab* self = static_cast<LLPanelGroupSubTab*>(user_data); - self->handleClickSearch(); -} - -void LLPanelGroupSubTab::handleClickSearch() -{ - lldebugs << "LLPanelGroupSubTab::handleClickSearch()" << llendl; - - if (0 == mSearchLineEditor->getText().size()) - { - // No search text. (This shouldn't happen... the search button should have been disabled). - llwarns << "handleClickSearch with no search text!" << llendl; - mSearchButton->setEnabled(FALSE); - return; - } + self->handleSearchKeystroke(caller); - setSearchFilter( mSearchLineEditor->getText() ); - mShowAllButton->setEnabled(TRUE); } -// static -void LLPanelGroupSubTab::onClickShowAll(void* user_data) +void LLPanelGroupSubTab::handleSearchKeystroke(LLLineEditor* caller) { - LLPanelGroupSubTab* self = static_cast<LLPanelGroupSubTab*>(user_data); - self->handleClickShowAll(); + setSearchFilter( caller->getText() ); } -void LLPanelGroupSubTab::handleClickShowAll() +// static +void LLPanelGroupSubTab::onClickSearch() { - lldebugs << "LLPanelGroupSubTab::handleClickShowAll()" << llendl; - setSearchFilter( LLStringUtil::null ); - mShowAllButton->setEnabled(FALSE); + setSearchFilter( mSearchEditor->getText() ); } + void LLPanelGroupSubTab::setSearchFilter(const std::string& filter) { @@ -892,6 +855,12 @@ BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root) return TRUE; } +void LLPanelGroupMembersSubTab::setGroupID(const LLUUID& id) +{ + LLPanelGroupSubTab::setGroupID(id); + +} + // static void LLPanelGroupMembersSubTab::onMemberSelect(LLUICtrl* ctrl, void* user_data) @@ -2583,19 +2552,15 @@ void LLPanelGroupRoles::setGroupID(const LLUUID& id) if(group_members_tab) group_members_tab->setGroupID(id); if(group_roles_tab) group_roles_tab->setGroupID(id); if(group_actions_tab) group_actions_tab->setGroupID(id); - - activate(); - if (!mSubTabContainer) return ; + LLButton* button = getChild<LLButton>("member_invite"); + if ( button ) + button->setEnabled(gAgent.hasPowerInGroup(mGroupID, GP_MEMBER_INVITE)); - // Hook up each sub-tabs callback and widgets. - for (S32 i = 0; i < mSubTabContainer->getTabCount(); ++i) - { - LLPanel* panel = mSubTabContainer->getPanelByIndex(i); - LLPanelGroupSubTab* subtabp = dynamic_cast<LLPanelGroupSubTab*>(panel); - if (subtabp) - subtabp->postBuildSubTab(this); - } + if(mSubTabContainer) + mSubTabContainer->selectTab(0); + + activate(); } diff --git a/indra/newview/llpanelgrouproles.h b/indra/newview/llpanelgrouproles.h index 9519263bba..2a0f31fa0f 100644 --- a/indra/newview/llpanelgrouproles.h +++ b/indra/newview/llpanelgrouproles.h @@ -43,6 +43,7 @@ class LLPanelGroupActionsSubTab; class LLScrollListCtrl; class LLScrollListItem; class LLTextEditor; +class LLSearchEditor; // Forward declare for friend usage. //virtual BOOL LLPanelGroupSubTab::postBuildSubTab(LLView*); @@ -113,10 +114,7 @@ public: static void onSearchKeystroke(LLLineEditor* caller, void* user_data); void handleSearchKeystroke(LLLineEditor* caller); - static void onClickSearch(void*); - void handleClickSearch(); - static void onClickShowAll(void*); - void handleClickShowAll(); + void onClickSearch(); virtual void setSearchFilter( const std::string& filter ); @@ -144,13 +142,13 @@ public: BOOL is_owner_role); void setFooterEnabled(BOOL enable); + + virtual void setGroupID(const LLUUID& id); protected: LLPanel* mHeader; LLPanel* mFooter; - LLLineEditor* mSearchLineEditor; - LLButton* mSearchButton; - LLButton* mShowAllButton; + LLSearchEditor* mSearchEditor; std::string mSearchFilter; @@ -196,6 +194,8 @@ public: virtual void draw(); + virtual void setGroupID(const LLUUID& id); + protected: typedef std::map<LLUUID, LLRoleMemberChangeType> role_change_data_map_t; typedef std::map<LLUUID, role_change_data_map_t*> member_role_changes_map_t; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 8770abcee3..698f442d7c 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -373,7 +373,6 @@ BOOL LLPanelPeople::postBuild() buttonSetAction("call_btn", boost::bind(&LLPanelPeople::onCallButtonClicked, this)); buttonSetAction("teleport_btn", boost::bind(&LLPanelPeople::onTeleportButtonClicked, this)); buttonSetAction("share_btn", boost::bind(&LLPanelPeople::onShareButtonClicked, this)); - buttonSetAction("more_btn", boost::bind(&LLPanelPeople::onMoreButtonClicked, this)); getChild<LLPanel>(NEARBY_TAB_NAME)->childSetAction("nearby_view_sort_btn",boost::bind(&LLPanelPeople::onNearbyViewSortButtonClicked, this)); getChild<LLPanel>(RECENT_TAB_NAME)->childSetAction("recent_viewsort_btn",boost::bind(&LLPanelPeople::onRecentViewSortButtonClicked, this)); diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp index cda1a9e7e7..f7ca54c732 100644 --- a/indra/newview/llpanelpick.cpp +++ b/indra/newview/llpanelpick.cpp @@ -66,7 +66,7 @@ LLPanelPick::LLPanelPick(BOOL edit_mode/* = FALSE */) -: LLPanel(), LLAvatarPropertiesObserver(), +: LLPanel(), LLAvatarPropertiesObserver(), LLRemoteParcelInfoObserver(), mEditMode(edit_mode), mSnapshotCtrl(NULL), mPickId(LLUUID::null), @@ -111,6 +111,8 @@ void LLPanelPick::reset() mDataReceived = FALSE; mPosGlobal.clearVec(); + + childSetValue("maturity", ""); } BOOL LLPanelPick::postBuild() @@ -211,6 +213,12 @@ void LLPanelPick::createNewPick() init(pick_data); mDataReceived = TRUE; LLAvatarPropertiesProcessor::instance().removeObserver(mCreatorId, this); + + if (!mEditMode) + { + LLRemoteParcelInfoProcessor::getInstance()->addObserver(pick_data->parcel_id, this); + LLRemoteParcelInfoProcessor::getInstance()->sendParcelInfoRequest(pick_data->parcel_id); + } } @@ -450,3 +458,24 @@ void LLPanelPick::showOnMap(const LLVector3d& position) LLFloaterWorldMap::getInstance()->trackLocation(position); LLFloaterReg::showInstance("world_map", "center"); } + +void LLPanelPick::processParcelInfo(const LLParcelData& parcel_data) +{ + if (mEditMode) return; + + // HACK: Flag 0x2 == adult region, + // Flag 0x1 == mature region, otherwise assume PG + std::string rating_icon = "icon_event.tga"; + if (parcel_data.flags & 0x2) + { + rating_icon = "icon_event_adult.tga"; + } + else if (parcel_data.flags & 0x1) + { + rating_icon = "icon_event_mature.tga"; + } + + childSetValue("maturity", rating_icon); + + //*NOTE we don't removeObserver(...) ourselves cause LLRemoveParcelProcessor does it for us +} diff --git a/indra/newview/llpanelpick.h b/indra/newview/llpanelpick.h index 15b0d6c541..2cd4706dfe 100644 --- a/indra/newview/llpanelpick.h +++ b/indra/newview/llpanelpick.h @@ -38,12 +38,13 @@ #define LL_LLPANELPICK_H #include "llpanel.h" +#include "llremoteparcelrequest.h" class LLTextureCtrl; class LLMessageSystem; class LLAvatarPropertiesObserver; -class LLPanelPick : public LLPanel, public LLAvatarPropertiesObserver +class LLPanelPick : public LLPanel, public LLAvatarPropertiesObserver, LLRemoteParcelInfoObserver { LOG_CLASS(LLPanelPick); public: @@ -79,6 +80,10 @@ public: static void teleport(const LLVector3d& position); static void showOnMap(const LLVector3d& position); + //This stuff we got from LLRemoteParcelObserver, in the last two we intentionally do nothing + /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); + /*virtual*/ void setParcelID(const LLUUID& parcel_id) {}; + /*virtual*/ void setErrorStatus(U32 status, const std::string& reason) {}; protected: diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index 45a00b7fd2..973afae73b 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -593,3 +593,11 @@ void LLPickItem::processProperties(void *data, EAvatarProcessorType type) LLAvatarPropertiesProcessor::instance().removeObserver(mCreatorID, this); } +void LLPanelPicks::onClose() +{ + // Toggle off Pick Info panel if it is visible. + if(mPickPanel && mPickPanel->getVisible()) + { + getProfilePanel()->togglePanel(mPickPanel); + } +} diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h index e0e7f69532..da7bc32ab1 100644 --- a/indra/newview/llpanelpicks.h +++ b/indra/newview/llpanelpicks.h @@ -83,6 +83,11 @@ public: // parent panels failed to work (picks related code was in me profile panel) void setProfilePanel(LLPanelProfile* profile_panel); + /** + * Closes LLPanelPick if it is visible. + */ + /*virtual*/ void onClose(); + private: void onClickDelete(); void onClickTeleport(); diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index c8e0a53764..a01977c9b5 100644 --- a/indra/newview/llpanelplaceinfo.cpp +++ b/indra/newview/llpanelplaceinfo.cpp @@ -98,6 +98,10 @@ BOOL LLPanelPlaceInfo::postBuild() mDescEditor = getChild<LLTextEditor>("description"); mRating = getChild<LLIconCtrl>("maturity"); + mRegionInfoDrillIn = getChild<LLButton>("region_info_drill_in"); + mMediaDrillIn = getChild<LLButton>("media_drill_in"); + mMediaDrillIn->setClickedCallback(boost::bind(&LLPanelPlaceInfo::toggleMediaPanel, this, TRUE)); + mOwner = getChild<LLTextBox>("owner"); mCreator = getChild<LLTextBox>("creator"); mCreated = getChild<LLTextBox>("created"); @@ -241,13 +245,18 @@ void LLPanelPlaceInfo::setParcelID(const LLUUID& parcel_id) } void LLPanelPlaceInfo::setInfoType(INFO_TYPE type) -{ - bool is_landmark_info_type = type == LANDMARK; +{ LLPanel* landmark_info_panel = getChild<LLPanel>("landmark_info_panel"); - if (landmark_info_panel) - { - landmark_info_panel->setVisible(is_landmark_info_type); - } + LLPanel* landmark_edit_panel = getChild<LLPanel>("landmark_edit_panel"); + + bool is_info_type_agent = type == AGENT; + bool is_info_type_landmark = type == LANDMARK; + + landmark_info_panel->setVisible(is_info_type_landmark); + landmark_edit_panel->setVisible(is_info_type_landmark || type == CREATE_LANDMARK); + + mRegionInfoDrillIn->setVisible(is_info_type_agent); + mMediaDrillIn->setVisible(is_info_type_agent); switch(type) { @@ -255,6 +264,7 @@ void LLPanelPlaceInfo::setInfoType(INFO_TYPE type) mCurrentTitle = getString("title_create_landmark"); break; + case AGENT: case PLACE: mCurrentTitle = getString("title_place"); @@ -366,6 +376,11 @@ void LLPanelPlaceInfo::processParcelInfo(const LLParcelData& parcel_data) } mRating->setValue(rating_icon); + //update for_sale banner, here we should use DFQ_FOR_SALE instead of PF_FOR_SALE + //because we deal with remote parcel response format + bool isForSale = (parcel_data.flags & DFQ_FOR_SALE)? TRUE : FALSE; + getChild<LLIconCtrl>("icon_for_sale")->setVisible(isForSale); + // Just use given region position for display S32 region_x = llround(mPosRegion.mV[0]); S32 region_y = llround(mPosRegion.mV[1]); @@ -436,8 +451,28 @@ void LLPanelPlaceInfo::displayAgentParcelInfo() return; LLParcelData parcel_data; + + // HACK: Converting sim access flags to the format + // returned by remote parcel response. + switch(region->getSimAccess()) + { + case SIM_ACCESS_MATURE: + parcel_data.flags = 0x1; + + case SIM_ACCESS_ADULT: + parcel_data.flags = 0x2; + + default: + parcel_data.flags = 0; + } + + // Adding "For Sale" flag in remote parcel response format. + if (parcel->getForSale()) + { + parcel_data.flags |= DFQ_FOR_SALE; + } + parcel_data.desc = parcel->getDesc(); - parcel_data.flags = region->getSimAccess(); parcel_data.name = parcel->getName(); parcel_data.sim_name = gAgent.getRegion()->getName(); parcel_data.snapshot_id = parcel->getSnapshotID(); @@ -446,6 +481,8 @@ void LLPanelPlaceInfo::displayAgentParcelInfo() parcel_data.global_y = global_pos.mdV[1]; parcel_data.global_z = global_pos.mdV[2]; + + processParcelInfo(parcel_data); } diff --git a/indra/newview/llpanelplaceinfo.h b/indra/newview/llpanelplaceinfo.h index 71c268c6c4..77ce2c6619 100644 --- a/indra/newview/llpanelplaceinfo.h +++ b/indra/newview/llpanelplaceinfo.h @@ -55,9 +55,10 @@ class LLPanelPlaceInfo : public LLPanel, LLRemoteParcelInfoObserver public: enum INFO_TYPE { + AGENT, CREATE_LANDMARK, - PLACE, LANDMARK, + PLACE, TELEPORT_HISTORY }; @@ -133,6 +134,8 @@ private: LLTextBox* mParcelName; LLTextEditor* mDescEditor; LLIconCtrl* mRating; + LLButton* mRegionInfoDrillIn; + LLButton* mMediaDrillIn; LLTextBox* mOwner; LLTextBox* mCreator; LLTextBox* mCreated; diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index cf91972e8b..a712c9b9cf 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -55,6 +55,7 @@ #include "llviewerparcelmgr.h" #include "llviewerregion.h" +static const S32 LANDMARK_FOLDERS_MENU_WIDTH = 250; 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"; @@ -84,7 +85,7 @@ LLPanelPlaces::LLPanelPlaces() { gInventory.addObserver(this); - LLViewerParcelMgr::getInstance()->setAgentParcelChangedCallback( + LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback( boost::bind(&LLPanelPlaces::onAgentParcelChange, this)); //LLUICtrlFactory::getInstance()->buildPanel(this, "panel_places.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder() @@ -174,7 +175,7 @@ void LLPanelPlaces::onOpen(const LLSD& key) if (mPlaceInfoType == AGENT_INFO_TYPE) { - mPlaceInfo->setInfoType(LLPanelPlaceInfo::PLACE); + mPlaceInfo->setInfoType(LLPanelPlaceInfo::AGENT); mPlaceInfo->displayAgentParcelInfo(); mPosGlobal = gAgent.getPositionGlobal(); @@ -218,12 +219,12 @@ void LLPanelPlaces::onOpen(const LLSD& key) const LLTeleportHistory::slurl_list_t& hist_items = LLTeleportHistory::getInstance()->getItems(); - LLVector3d pos_global = hist_items[index].mGlobalPos; + mPosGlobal = hist_items[index].mGlobalPos; mPlaceInfo->setInfoType(LLPanelPlaceInfo::TELEPORT_HISTORY); - mPlaceInfo->displayParcelInfo(get_pos_local_from_global(pos_global), + mPlaceInfo->displayParcelInfo(get_pos_local_from_global(mPosGlobal), hist_items[index].mRegionID, - pos_global); + mPosGlobal); } @@ -312,7 +313,9 @@ void LLPanelPlaces::onTeleportButtonClicked() payload["asset_id"] = mItem->getAssetUUID(); LLNotifications::instance().add("TeleportFromLandmark", LLSD(), payload); } - else if (mPlaceInfoType == AGENT_INFO_TYPE || mPlaceInfoType == REMOTE_PLACE_INFO_TYPE) + else if (mPlaceInfoType == AGENT_INFO_TYPE || + mPlaceInfoType == REMOTE_PLACE_INFO_TYPE || + mPlaceInfoType == TELEPORT_HISTORY_INFO_TYPE) { LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance(); if (!mPosGlobal.isExactlyZero() && worldmap_instance) @@ -341,7 +344,8 @@ void LLPanelPlaces::onShowOnMapButtonClicked() if (mPlaceInfoType == AGENT_INFO_TYPE || mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE || - mPlaceInfoType == REMOTE_PLACE_INFO_TYPE) + mPlaceInfoType == REMOTE_PLACE_INFO_TYPE || + mPlaceInfoType == TELEPORT_HISTORY_INFO_TYPE) { if (!mPosGlobal.isExactlyZero()) { @@ -374,16 +378,22 @@ void LLPanelPlaces::onShowOnMapButtonClicked() void LLPanelPlaces::onOverflowButtonClicked() { - bool is_agent_place_info_visible = mPlaceInfoType == AGENT_INFO_TYPE; - bool is_landmark_info_visible = mPlaceInfoType == LANDMARK_INFO_TYPE; - LLToggleableMenu* menu; - if (is_agent_place_info_visible && mPlaceMenu != NULL) + bool is_agent_place_info_visible = mPlaceInfoType == AGENT_INFO_TYPE; + + if ((is_agent_place_info_visible || + mPlaceInfoType == "remote_place" || + mPlaceInfoType == "teleport_history") && mPlaceMenu != NULL) { menu = mPlaceMenu; + + // Enable adding a landmark only for agent current parcel and if + // there is no landmark already pointing to that parcel in agent's inventory. + menu->getChild<LLMenuItemCallGL>("landmark")->setEnabled(is_agent_place_info_visible && + !LLLandmarkActions::landmarkAlreadyExists()); } - else if (is_landmark_info_visible && mLandmarkMenu != NULL) + else if (mPlaceInfoType == LANDMARK_INFO_TYPE && mLandmarkMenu != NULL) { menu = mLandmarkMenu; @@ -446,17 +456,24 @@ void LLPanelPlaces::onCreateLandmarkButtonClicked(const LLUUID& folder_id) return; mPlaceInfo->createLandmark(folder_id); - - onBackButtonClicked(); - LLSideTray::getInstance()->collapseSideBar(); } void LLPanelPlaces::onBackButtonClicked() { - togglePlaceInfoPanel(FALSE); + if (!mPlaceInfo) + return; + + if (mPlaceInfo->isMediaPanelVisible()) + { + toggleMediaPanel(); + } + else + { + togglePlaceInfoPanel(FALSE); - // Resetting mPlaceInfoType when Place Info panel is closed. - mPlaceInfoType = LLStringUtil::null; + // Resetting mPlaceInfoType when Place Info panel is closed. + mPlaceInfoType = LLStringUtil::null; + } updateVerbs(); } @@ -578,6 +595,14 @@ void LLPanelPlaces::updateVerbs() !mPosGlobal.isExactlyZero() && !LLViewerParcelMgr::getInstance()->inAgentParcel(mPosGlobal)); } + else if (is_create_landmark_visible) + { + // Enable "Create Landmark" only if there is no landmark + // for the current parcel. + bool no_landmark = !LLLandmarkActions::landmarkAlreadyExists(); + mCreateLandmarkBtn->setEnabled(no_landmark); + mFolderMenuBtn->setEnabled(no_landmark); + } else if (mPlaceInfoType == LANDMARK_INFO_TYPE || mPlaceInfoType == REMOTE_PLACE_INFO_TYPE) { mTeleportBtn->setEnabled(TRUE); @@ -600,6 +625,7 @@ void LLPanelPlaces::showLandmarkFoldersMenu() menu_p.can_tear_off(false); menu_p.visible(false); menu_p.scrollable(true); + menu_p.max_scrollable_items = 10; LLToggleableMenu* menu = LLUICtrlFactory::create<LLToggleableMenu>(menu_p); @@ -666,7 +692,6 @@ void LLPanelPlaces::showLandmarkFoldersMenu() mLandmarkFoldersCache = folders; menu->empty(); - U32 max_width = 0; // Menu width must not exceed the root view limits, // so we assume the space between the left edge of @@ -674,6 +699,7 @@ void LLPanelPlaces::showLandmarkFoldersMenu() LLRect screen_btn_rect; localRectToScreen(btn_rect, &screen_btn_rect); S32 free_space = screen_btn_rect.mRight; + U32 max_width = llmin(LANDMARK_FOLDERS_MENU_WIDTH, free_space); for(folder_vec_t::const_iterator it = mLandmarkFoldersCache.begin(); it != mLandmarkFoldersCache.end(); it++) { @@ -687,13 +713,14 @@ void LLPanelPlaces::showLandmarkFoldersMenu() LLMenuItemCallGL *menu_item = LLUICtrlFactory::create<LLMenuItemCallGL>(item_params); + // *TODO: Use a separate method for menu width calculation. // Check whether item name wider than menu - if ((S32) menu_item->getNominalWidth() > free_space) + if (menu_item->getNominalWidth() > max_width) { S32 chars_total = item_name.length(); S32 chars_fitted = 1; menu_item->setLabel(LLStringExplicit("")); - S32 label_space = free_space - menu_item->getFont()->getWidth("...") - + S32 label_space = max_width - menu_item->getFont()->getWidth("...") - menu_item->getNominalWidth(); // This returns width of menu item with empty label (pad pixels) while (chars_fitted < chars_total && menu_item->getFont()->getWidth(item_name, 0, chars_fitted) < label_space) @@ -705,8 +732,6 @@ void LLPanelPlaces::showLandmarkFoldersMenu() menu_item->setLabel(item_name.substr(0, chars_fitted) + "..."); } - max_width = llmax(max_width, menu_item->getNominalWidth()); - menu->addChild(menu_item); } diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 0af996fac0..2895a68683 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -95,6 +95,8 @@ void LLPanelProfile::onOpen(const LLSD& key) { if (key.has("open_tab_name")) { + getTabContainer()[PANEL_PICKS]->onClose(); + // onOpen from selected panel will be called from onTabSelected callback getTabCtrl()->selectTabByName(key["open_tab_name"]); } @@ -139,6 +141,7 @@ void LLPanelProfile::togglePanel(LLPanel* panel) else { this->setAllChildrenVisible(TRUE); + panel->setVisible(FALSE); if (panel->getParent() == this) { removeChild(panel); diff --git a/indra/newview/llpanelprofileview.cpp b/indra/newview/llpanelprofileview.cpp index 1235340f57..18184a6476 100644 --- a/indra/newview/llpanelprofileview.cpp +++ b/indra/newview/llpanelprofileview.cpp @@ -41,6 +41,7 @@ static LLRegisterPanelClassWrapper<LLPanelProfileView> t_panel_target_profile("panel_profile_view"); static std::string PANEL_NOTES = "panel_notes"; +static const std::string PANEL_PROFILE = "panel_profile"; LLPanelProfileView::LLPanelProfileView() : LLPanelProfile() @@ -72,6 +73,10 @@ BOOL LLPanelProfileView::postBuild() LLPanelProfile::postBuild(); getTabContainer()[PANEL_NOTES] = getChild<LLPanelAvatarNotes>(PANEL_NOTES); + + //*TODO remove this, according to style guide we don't use status combobox + getTabContainer()[PANEL_PROFILE]->childSetVisible("online_me_status_text", FALSE); + getTabContainer()[PANEL_PROFILE]->childSetVisible("status_combo", FALSE); childSetCommitCallback("back",boost::bind(&LLPanelProfileView::onBackBtnClick,this),NULL); diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 1e44a294b0..ce16b95bc0 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -49,7 +49,6 @@ #include "material_codes.h" // project includes -#include "llagent.h" #include "llbutton.h" #include "llcheckboxctrl.h" #include "llcolorswatch.h" diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 50110da70c..68996673be 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -49,15 +49,14 @@ using namespace LLNotificationsUI; bool LLScreenChannel::mWasStartUpToastShown = false; //-------------------------------------------------------------------------- -LLScreenChannel::LLScreenChannel(): mOverflowToastPanel(NULL), - mStartUpToastPanel(NULL), - mToastAlignment(NA_BOTTOM), - mCanStoreToasts(true), - mHiddenToastsNum(0), - mOverflowToastHidden(false), - mIsHovering(false), - mControlHovering(false) +LLScreenChannel::LLScreenChannel(LLUUID& id): mOverflowToastPanel(NULL), mStartUpToastPanel(NULL), + mToastAlignment(NA_BOTTOM), mCanStoreToasts(true), + mHiddenToastsNum(0), mOverflowToastHidden(false), + mIsHovering(false), mControlHovering(false), + mShowToasts(false) { + mID = id; + setFollows(FOLLOWS_RIGHT | FOLLOWS_BOTTOM | FOLLOWS_TOP); mOverflowFormatString = LLTrans::getString("OverflowInfoChannelString"); @@ -89,22 +88,11 @@ void LLScreenChannel::reshape(S32 width, S32 height, BOOL called_from_parent) //-------------------------------------------------------------------------- void LLScreenChannel::addToast(LLToast::Params p) { - bool isSysWellWndShown = LLFloaterReg::getInstance("syswell_window")->getVisible(); - // we show toast in the following cases: - // - the StartUp Toast is already hidden and the SysWell's window is hidden - // - the SysWell's window is shown, but notification is a tip. We can't store it, so we show it - // - the channel is intended for displaying of toasts always, e.g. alerts - bool show_toast = (mWasStartUpToastShown && !isSysWellWndShown) || (isSysWellWndShown && p.is_tip) || mDisplayToastsAlways; - bool store_toast = !show_toast && !p.is_tip && mCanStoreToasts; - - // if we can't show or store a toast, then do nothing, just send ignore to a notification - if(!show_toast && !store_toast) + bool store_toast = !mShowToasts && p.can_be_stored && mCanStoreToasts; + + if(!mShowToasts && !store_toast) { - if(p.notification) - { - p.notification->setIgnored(TRUE); - p.notification->respond(p.notification->getResponseTemplate()); - } + mOnRejectToast(p); return; } @@ -112,14 +100,13 @@ void LLScreenChannel::addToast(LLToast::Params p) mOverflowToastHidden = false; - getRootView()->addChild(new_toast_elem.toast); new_toast_elem.toast->setOnFadeCallback(boost::bind(&LLScreenChannel::onToastFade, this, new_toast_elem.toast)); if(mControlHovering) { new_toast_elem.toast->setOnToastHoverCallback(boost::bind(&LLScreenChannel::onToastHover, this, _1, _2)); } - if(show_toast) + if(mShowToasts) { mToastList.push_back(new_toast_elem); showToasts(); @@ -393,7 +380,6 @@ void LLScreenChannel::createOverflowToast(S32 bottom, F32 timer) mOverflowToastPanel->reshape(getRect().getWidth(), toast_rect.getHeight(), true); toast_rect.setLeftTopAndSize(getRect().mLeft, bottom + toast_rect.getHeight()+gSavedSettings.getS32("ToastMargin"), getRect().getWidth(), toast_rect.getHeight()); mOverflowToastPanel->setRect(toast_rect); - getRootView()->addChild(mOverflowToastPanel); text_box->setValue(text); text_box->setVisible(TRUE); @@ -406,7 +392,6 @@ void LLScreenChannel::createOverflowToast(S32 bottom, F32 timer) void LLScreenChannel::onOverflowToastHide() { mOverflowToastHidden = true; - // *TODO: check whether it is needed: closeOverflowToastPanel(); } //-------------------------------------------------------------------------- @@ -414,7 +399,7 @@ void LLScreenChannel::closeOverflowToastPanel() { if(mOverflowToastPanel != NULL) { - mOverflowToastPanel->close(); + mOverflowToastPanel->closeFloater(); mOverflowToastPanel = NULL; } } @@ -453,7 +438,6 @@ void LLScreenChannel::createStartUpToast(S32 notif_num, S32 bottom, F32 timer) mStartUpToastPanel->reshape(getRect().getWidth(), toast_rect.getHeight(), true); toast_rect.setLeftTopAndSize(getRect().mLeft, bottom + toast_rect.getHeight()+gSavedSettings.getS32("ToastMargin"), getRect().getWidth(), toast_rect.getHeight()); mStartUpToastPanel->setRect(toast_rect); - getRootView()->addChild(mStartUpToastPanel); text_box->setValue(text); text_box->setVisible(TRUE); @@ -479,8 +463,7 @@ void LLScreenChannel::closeStartUpToast() { if(mStartUpToastPanel != NULL) { - LLScreenChannel::setStartUpToastShown(); - mStartUpToastPanel->close(); + mStartUpToastPanel->closeFloater(); mStartUpToastPanel = NULL; } } @@ -499,8 +482,8 @@ void LLScreenChannel::removeToastsFromChannel() hideToastsFromScreen(); for(std::vector<ToastElem>::iterator it = mToastList.begin(); it != mToastList.end(); it++) { - (*it).toast->close(); - //toast->mOnToastDestroy(toast, LLSD()); //TODO: check OnToastDestroy handler for chat + // *TODO: ivestigate mOnToastDestroy callback - change name or/and place + (*it).toast->mOnToastDestroy((*it).toast); } mToastList.clear(); } diff --git a/indra/newview/llscreenchannel.h b/indra/newview/llscreenchannel.h index 0845c32ee5..746580b574 100644 --- a/indra/newview/llscreenchannel.h +++ b/indra/newview/llscreenchannel.h @@ -56,7 +56,7 @@ class LLScreenChannel : public LLUICtrl { friend class LLChannelManager; public: - LLScreenChannel(); + LLScreenChannel(LLUUID& id); virtual ~LLScreenChannel(); // Channel's outfit-functions @@ -96,11 +96,11 @@ public: // Channel's behavior-functions // set whether a channel will control hovering inside itself or not - void setControlHovering(bool control) { mControlHovering = control; } + void setControlHovering(bool control) { mControlHovering = control; } // set Hovering flag for a channel - void setHovering(bool hovering) { mIsHovering = hovering; } + void setHovering(bool hovering) { mIsHovering = hovering; } // set whether a channel will store faded toasts or not - void setCanStoreToasts(bool store) { mCanStoreToasts = store; } + void setCanStoreToasts(bool store) { mCanStoreToasts = store; } // tell all channels that the StartUp toast was shown and allow them showing of toasts static void setStartUpToastShown() { mWasStartUpToastShown = true; } // get StartUp Toast's state @@ -109,13 +109,20 @@ public: void setDisplayToastsAlways(bool display_toasts) { mDisplayToastsAlways = display_toasts; } // get mode for dislaying of toasts bool getDisplayToastsAlways() { return mDisplayToastsAlways; } + // tell a channel to show toasts or not + void setShowToasts(bool show) { mShowToasts = show; } + // determine whether channel shows toasts or not + bool getShowToasts() { return mShowToasts; } // Channel's other interface functions functions // get number of hidden notifications from a channel S32 getNumberOfHiddenToasts() { return mHiddenToastsNum;} // update number of notifications in the StartUp Toast void updateStartUpString(S32 num); + // get toast allignment preset for a channel e_notification_toast_alignment getToastAlignment() {return mToastAlignment;} + // get ID of a channel + LLUUID getChannelID() { return mID; } // Channel's callbacks // callback for storing of faded toasts @@ -123,6 +130,11 @@ public: typedef boost::signals2::signal<void (LLPanel* info_panel, const LLUUID id)> store_tost_signal_t; store_tost_signal_t mOnStoreToast; boost::signals2::connection setOnStoreToastCallback(store_tost_callback_t cb) { return mOnStoreToast.connect(cb); } + // callback for discarding of a rejected toast + typedef boost::function<void (LLToast::Params p)> reject_tost_callback_t; + typedef boost::signals2::signal<void (LLToast::Params p)> reject_tost_signal_t; + reject_tost_signal_t mOnRejectToast; + boost::signals2::connection setOnRejectToastCallback(reject_tost_callback_t cb) { return mOnRejectToast.connect(cb); } private: struct ToastElem @@ -179,6 +191,8 @@ private: bool mCanStoreToasts; bool mDisplayToastsAlways; bool mOverflowToastHidden; + // controls whether a channel shows toasts or not + bool mShowToasts; // e_notification_toast_alignment mToastAlignment; @@ -190,6 +204,9 @@ private: // attributes for the StartUp Toast LLToast* mStartUpToastPanel; + // channel's ID + LLUUID mID; + std::vector<ToastElem> mToastList; std::vector<ToastElem> mStoredToastList; std::map<LLToast*, bool> mToastEventStack; diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 2e005834b5..5e5608460c 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -110,12 +110,15 @@ bool LLSideTray::instanceCreated () } LLSideTrayTab::LLSideTrayTab(const Params& params):mMainPanel(0) - { mImagePath = params.image_path; mTabTitle = params.tab_title; mDescription = params.description; + + // Necessary for focus movement among child controls + setFocusRoot(TRUE); } + LLSideTrayTab::~LLSideTrayTab() { } diff --git a/indra/newview/llsidetraypanelcontainer.cpp b/indra/newview/llsidetraypanelcontainer.cpp index 21061a802a..3024492ab9 100644 --- a/indra/newview/llsidetraypanelcontainer.cpp +++ b/indra/newview/llsidetraypanelcontainer.cpp @@ -85,5 +85,9 @@ BOOL LLSideTrayPanelContainer::handleKeyHere(KEY key, MASK mask) { // No key press handling code for Panel Container - this disables // Tab Container's Alt + Left/Right Button tab switching. - return TRUE; + + // Let default handler process key presses, don't simply return TRUE or FALSE + // as this may brake some functionality as it did with Copy/Paste for + // text_editor (ticket EXT-642). + return LLPanel::handleKeyHere(key, mask); } diff --git a/indra/newview/llsky.cpp b/indra/newview/llsky.cpp index b779aa0f83..a49b07c5d9 100644 --- a/indra/newview/llsky.cpp +++ b/indra/newview/llsky.cpp @@ -52,7 +52,6 @@ #include "llviewerobject.h" #include "llviewercamera.h" #include "pipeline.h" -#include "llagent.h" #include "lldrawpool.h" #include "llvosky.h" @@ -422,20 +421,6 @@ void LLSky::updateFog(const F32 distance) void LLSky::updateCull() { - /*if (mVOSkyp.notNull() && mVOSkyp->mDrawable.notNull()) - { - gPipeline.markVisible(mVOSkyp->mDrawable); - } - else - { - llinfos << "No sky drawable!" << llendl; - }*/ - - /*if (mVOGroundp.notNull() && mVOGroundp->mDrawable.notNull()) - { - gPipeline.markVisible(mVOGroundp->mDrawable); - }*/ - // *TODO: do culling for wl sky properly -Brad } diff --git a/indra/newview/llslurl.cpp b/indra/newview/llslurl.cpp index f6c4710d60..836fe9729d 100644 --- a/indra/newview/llslurl.cpp +++ b/indra/newview/llslurl.cpp @@ -114,15 +114,19 @@ std::string LLSLURL::buildUnescapedSLURL(const std::string& regionname, S32 x, S // static std::string LLSLURL::buildSLURLfromPosGlobal(const std::string& regionname, - const LLVector3d& global_pos) + const LLVector3d& global_pos, + bool escaped /*= true*/) { - F32 region_x = (F32)fmod(global_pos.mdV[VX], (F64)REGION_WIDTH_METERS); - F32 region_y = (F32)fmod(global_pos.mdV[VY], (F64)REGION_WIDTH_METERS); - - return buildSLURL(regionname, - llround(region_x), - llround(region_y), - llround((F32)global_pos.mdV[VZ])); + S32 x, y, z; + globalPosToXYZ(global_pos, x, y, z); + if(escaped) + { + return buildSLURL(regionname, x, y, z); + } + else + { + return buildUnescapedSLURL(regionname, x, y, z); + } } // static @@ -132,3 +136,10 @@ bool LLSLURL::matchPrefix(const std::string& url, const std::string& prefix) LLStringUtil::toLower(test_prefix); return test_prefix == prefix; } + +void LLSLURL::globalPosToXYZ(const LLVector3d& pos, S32& x, S32& y, S32& z) +{ + x = llround((F32)fmod(pos.mdV[VX], (F64)REGION_WIDTH_METERS)); + y = llround((F32)fmod(pos.mdV[VY], (F64)REGION_WIDTH_METERS)); + z = llround((F32)pos.mdV[VZ]); +} diff --git a/indra/newview/llslurl.h b/indra/newview/llslurl.h index cb1b8cca9e..8af2bdfb83 100644 --- a/indra/newview/llslurl.h +++ b/indra/newview/llslurl.h @@ -79,17 +79,25 @@ public: static std::string buildUnescapedSLURL(const std::string& regionname, S32 x, S32 y, S32 z); /** - * builds SLURL from global position escaping result url. + * builds SLURL from global position. Returns escaped or unescaped url. + * Returns escaped url by default. */ static std::string buildSLURLfromPosGlobal(const std::string& regionname, - const LLVector3d& global_pos); + const LLVector3d& global_pos, + bool escaped = true); /** * Strip protocol part from the URL. */ static std::string stripProtocol(const std::string& url); + /** + * Convert global position to X, Y Z + */ + static void globalPosToXYZ(const LLVector3d& pos, S32& x, S32& y, S32& z); + private: static bool matchPrefix(const std::string& url, const std::string& prefix); + }; #endif diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index c2fce08ae4..dea9af0657 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -41,7 +41,6 @@ #include "llviewercamera.h" #include "llface.h" #include "llviewercontrol.h" -#include "llagent.h" #include "llviewerregion.h" #include "llcamera.h" #include "pipeline.h" diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index bcaf5f2947..2975053289 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1003,6 +1003,8 @@ bool idle_startup() // Load URL History File LLURLHistory::loadFile("url_history.xml"); + // Load location history + LLLocationHistory::getInstance()->load(); //------------------------------------------------- // Handle startup progress screen @@ -2571,7 +2573,7 @@ bool idle_startup() // reset timers now that we are running "logged in" logic LLFastTimer::reset(); - LLLocationHistory::getInstance()->load(); + return TRUE; } diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 8a5de61280..b3a820080f 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -43,7 +43,6 @@ #include "llfloaterchat.h" #include "llfloaterdirectory.h" // to spawn search #include "llfloaterlagmeter.h" -#include "llfloaterland.h" #include "llfloaterregioninfo.h" #include "llfloaterscriptdebug.h" #include "llhudicon.h" @@ -70,7 +69,6 @@ #include "llviewerparcelmgr.h" #include "llviewerthrottle.h" #include "lluictrlfactory.h" -#include "llvoiceclient.h" // for gVoiceClient #include "lltoolmgr.h" #include "llfocusmgr.h" @@ -112,12 +110,6 @@ const S32 TEXT_HEIGHT = 18; static void onClickBuyCurrency(void*); static void onClickHealth(void*); -static void onClickFly(void*); -static void onClickPush(void*); -static void onClickVoice(void*); -static void onClickBuild(void*); -static void onClickScripts(void*); -static void onClickBuyLand(void*); static void onClickScriptDebug(void*); std::vector<std::string> LLStatusBar::sDays; @@ -160,19 +152,6 @@ LLStatusBar::LLStatusBar(const LLRect& rect) childSetAction("scriptout", onClickScriptDebug, this); childSetAction("health", onClickHealth, this); - childSetAction("no_fly", onClickFly, this); - childSetAction("buyland", onClickBuyLand, this ); - childSetAction("no_build", onClickBuild, this ); - childSetAction("no_scripts", onClickScripts, this ); - childSetAction("restrictpush", onClickPush, this ); - childSetAction("status_no_voice", onClickVoice, this ); - - childSetCommitCallback("search_editor", onCommitSearch, this); - childSetAction("search_btn", onClickSearch, this); - - childSetVisible("search_editor", gSavedSettings.getBOOL("ShowSearchBar")); - childSetVisible("search_btn", gSavedSettings.getBOOL("ShowSearchBar")); - childSetVisible("menubar_search_bevel_bg", gSavedSettings.getBOOL("ShowSearchBar")); // Adding Net Stat Graph S32 x = getRect().getWidth() - 2; @@ -331,8 +310,8 @@ void LLStatusBar::refresh() childSetVisible("scriptout", false); } - if ((region && region->getAllowDamage()) || - (parcel && parcel->getAllowDamage()) ) + if (gAgent.getCameraMode() == CAMERA_MODE_MOUSELOOK && + ((region && region->getAllowDamage()) || (parcel && parcel->getAllowDamage()))) { // set visibility based on flashing if( mHealthTimer->hasExpired() ) @@ -364,116 +343,6 @@ void LLStatusBar::refresh() mTextHealth->setVisible(FALSE); } - if ((region && region->getBlockFly()) || - (parcel && !parcel->getAllowFly()) ) - { - // No Fly Zone - childGetRect( "no_fly", buttonRect ); - childSetVisible( "no_fly", true ); - r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight()); - childSetRect( "no_fly", r ); - x += buttonRect.getWidth(); - } - else - { - // Fly Zone - childSetVisible("no_fly", false); - } - - BOOL no_build = parcel && !parcel->getAllowModify(); - if (no_build) - { - childSetVisible("no_build", TRUE); - childGetRect( "no_build", buttonRect ); - // No Build Zone - r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight()); - childSetRect( "no_build", r ); - x += buttonRect.getWidth(); - } - else - { - childSetVisible("no_build", FALSE); - } - - BOOL no_scripts = FALSE; - if((region - && ((region->getRegionFlags() & REGION_FLAGS_SKIP_SCRIPTS) - || (region->getRegionFlags() & REGION_FLAGS_ESTATE_SKIP_SCRIPTS))) - || (parcel && !parcel->getAllowOtherScripts())) - { - no_scripts = TRUE; - } - if (no_scripts) - { - // No scripts - childSetVisible("no_scripts", TRUE); - childGetRect( "no_scripts", buttonRect ); - r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight()); - childSetRect( "no_scripts", r ); - x += buttonRect.getWidth(); - } - else - { - // Yes scripts - childSetVisible("no_scripts", FALSE); - } - - BOOL no_region_push = (region && region->getRestrictPushObject()); - BOOL no_push = no_region_push || (parcel && parcel->getRestrictPushObject()); - if (no_push) - { - childSetVisible("restrictpush", TRUE); - childGetRect( "restrictpush", buttonRect ); - r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight()); - childSetRect( "restrictpush", r ); - x += buttonRect.getWidth(); - } - else - { - childSetVisible("restrictpush", FALSE); - } - - BOOL have_voice = parcel && parcel->getParcelFlagAllowVoice(); - if (have_voice) - { - childSetVisible("status_no_voice", FALSE); - } - else - { - childSetVisible("status_no_voice", TRUE); - childGetRect( "status_no_voice", buttonRect ); - r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight()); - childSetRect( "status_no_voice", r ); - x += buttonRect.getWidth(); - } - - BOOL canBuyLand = parcel - && !parcel->isPublic() - && LLViewerParcelMgr::getInstance()->canAgentBuyParcel(parcel, false); - childSetVisible("buyland", canBuyLand); - if (canBuyLand) - { - //HACK: layout tweak until this is all xml - x += 9; - childGetRect( "buyland", buttonRect ); - r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight()); - childSetRect( "buyland", r ); - x += buttonRect.getWidth(); - } - - bool search_visible = gSavedSettings.getBOOL("ShowSearchBar"); - - // Set search bar visibility - - if (gAgent.getCameraMode() != CAMERA_MODE_MOUSELOOK) - { - // don't monkey with search visibility in mouselook - it will be set - // with setVisibleForMouselook() below - childSetVisible("search_editor", search_visible); - childSetVisible("search_btn", search_visible); - childSetVisible("menubar_search_bevel_bg", search_visible); - } - mSGBandwidth->setVisible(net_stats_visible); mSGPacketLoss->setVisible(net_stats_visible); childSetEnabled("stat_btn", net_stats_visible); @@ -483,9 +352,6 @@ void LLStatusBar::setVisibleForMouselook(bool visible) { mTextTime->setVisible(visible); mBtnBuyCurrency->setVisible(visible); - childSetVisible("search_editor", visible); - childSetVisible("search_btn", visible); - childSetVisible("menubar_search_bevel_bg", visible); mSGBandwidth->setVisible(visible); mSGPacketLoss->setVisible(visible); setBackgroundVisible(visible); @@ -635,49 +501,6 @@ static void onClickScriptDebug(void*) LLFloaterScriptDebug::show(LLUUID::null); } -static void onClickFly(void* ) -{ - LLNotifications::instance().add("NoFly"); -} - -static void onClickPush(void* ) -{ - LLNotifications::instance().add("PushRestricted"); -} - -static void onClickVoice(void* ) -{ - LLNotifications::instance().add("NoVoice"); -} - -static void onClickBuild(void*) -{ - LLNotifications::instance().add("NoBuild"); -} - -static void onClickScripts(void*) -{ - LLViewerRegion* region = gAgent.getRegion(); - if(region && region->getRegionFlags() & REGION_FLAGS_ESTATE_SKIP_SCRIPTS) - { - LLNotifications::instance().add("ScriptsStopped"); - } - else if(region && region->getRegionFlags() & REGION_FLAGS_SKIP_SCRIPTS) - { - LLNotifications::instance().add("ScriptsNotRunning"); - } - else - { - LLNotifications::instance().add("NoOutsideScripts"); - } -} - -static void onClickBuyLand(void*) -{ - LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal()); - LLViewerParcelMgr::getInstance()->startBuyLand(); -} - // sets the static variables necessary for the date void LLStatusBar::setupDate() { @@ -784,21 +607,6 @@ void LLStatusBar::onMainMenuRightClicked(LLUICtrl* ctrl, S32 x, S32 y, MASK mask } // static -void LLStatusBar::onCommitSearch(LLUICtrl*, void* data) -{ - // committing is the same as clicking "search" - onClickSearch(data); -} - -// static -void LLStatusBar::onClickSearch(void* data) -{ - LLStatusBar* self = (LLStatusBar*)data; - std::string search_text = self->childGetText("search_editor"); - LLFloaterReg::showInstance("search", LLSD().insert("panel", "all").insert("id", LLSD(search_text))); -} - -// static void LLStatusBar::onClickStatGraph(void* data) { LLFloaterReg::showInstance("lagmeter"); diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index a26b1c14af..2bbb5a2767 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -131,7 +131,8 @@ void LLSysWellWindow::removeItemByID(const LLUUID& id) void LLSysWellWindow::onItemClick(LLSysWellItem* item) { LLUUID id = item->getID(); - mChannel->loadStoredToastByIDToChannel(id); + if(mChannel) + mChannel->loadStoredToastByIDToChannel(id); } //--------------------------------------------------------------------------------- @@ -139,7 +140,8 @@ void LLSysWellWindow::onItemClose(LLSysWellItem* item) { LLUUID id = item->getID(); removeItemByID(id); - mChannel->killToastByNotificationID(id); + if(mChannel) + mChannel->killToastByNotificationID(id); } //--------------------------------------------------------------------------------- @@ -154,10 +156,15 @@ void LLSysWellWindow::setVisible(BOOL visible) // on Show adjust position of SysWell chiclet's window if(visible) { - mChannel->removeAndStoreAllVisibleToasts(); + if(mChannel) + mChannel->removeAndStoreAllVisibleToasts(); + adjustWindowPosition(); // *TODO: won't be necessary after docking is realized } + if(mChannel) + mChannel->setShowToasts(!visible); + LLFloater::setVisible(visible); } diff --git a/indra/newview/llteleporthistory.cpp b/indra/newview/llteleporthistory.cpp index 9754568f56..5235dc9358 100644 --- a/indra/newview/llteleporthistory.cpp +++ b/indra/newview/llteleporthistory.cpp @@ -43,6 +43,7 @@ #include "llviewerparcelmgr.h" #include "llviewerregion.h" #include "llworldmap.h" +#include "llagentui.h" ////////////////////////////////////////////////////////////////////////////// // LLTeleportHistoryItem @@ -74,7 +75,7 @@ LLTeleportHistory::LLTeleportHistory(): mGotInitialUpdate(false) { mTeleportFinishedConn = LLViewerParcelMgr::getInstance()-> - setTeleportFinishedCallback(boost::bind(&LLTeleportHistory::updateCurrentLocation, this)); + setTeleportFinishedCallback(boost::bind(&LLTeleportHistory::updateCurrentLocation, this, _1)); mTeleportFailedConn = LLViewerParcelMgr::getInstance()-> setTeleportFailedCallback(boost::bind(&LLTeleportHistory::onTeleportFailed, this)); } @@ -118,7 +119,7 @@ void LLTeleportHistory::onTeleportFailed() } } -void LLTeleportHistory::updateCurrentLocation() +void LLTeleportHistory::updateCurrentLocation(const LLVector3d& new_pos) { if (mRequestedItem != -1) // teleport within the history in progress? { @@ -149,7 +150,7 @@ void LLTeleportHistory::updateCurrentLocation() return; } mItems[mCurrentItem].mTitle = getCurrentLocationTitle(); - mItems[mCurrentItem].mGlobalPos = gAgent.getPositionGlobal(); + mItems[mCurrentItem].mGlobalPos = new_pos; mItems[mCurrentItem].mRegionID = gAgent.getRegion()->getRegionID(); } @@ -184,10 +185,7 @@ void LLTeleportHistory::purgeItems() std::string LLTeleportHistory::getCurrentLocationTitle() { std::string location_name; - - if (!gAgent.buildLocationString(location_name, LLAgent::LOCATION_FORMAT_NORMAL)) - location_name = "Unknown"; - + if (!LLAgentUI::buildLocationString(location_name, LLAgent::LOCATION_FORMAT_NORMAL)) location_name = "Unknown"; return location_name; } @@ -201,6 +199,7 @@ void LLTeleportHistory::dump() const line << ((i == mCurrentItem) ? " * " : " "); line << i << ": " << mItems[i].mTitle; line << " REGION_ID: " << mItems[i].mRegionID; + line << ", pos: " << mItems[i].mGlobalPos; llinfos << line.str() << llendl; } } diff --git a/indra/newview/llteleporthistory.h b/indra/newview/llteleporthistory.h index 775b21e24c..060534635d 100644 --- a/indra/newview/llteleporthistory.h +++ b/indra/newview/llteleporthistory.h @@ -147,6 +147,10 @@ private: /** * Update current location. * + * @param new_pos Current agent global position. After local teleports we + * cannot rely on gAgent.getPositionGlobal(), + * so the new position gets passed explicitly. + * * Called when a teleport finishes. * Called via callback set on the LLViewerParcelMgr "teleport finished" signal. * @@ -158,7 +162,7 @@ private: * @see mRequestedItem * @see mGotInitialUpdate */ - void updateCurrentLocation(); + void updateCurrentLocation(const LLVector3d& new_pos); /** * Invokes the "history changed" callback(s). diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index 07f802cf54..85814a98c9 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -225,7 +225,6 @@ void LLToast::onMouseEnter(S32 x, S32 y, MASK mask) { mOnToastHover(this, MOUSE_ENTER); - setVisibleAndFrontmost(); setBackgroundOpaque(TRUE); if(mCanFade) { diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index f1a9f2ec46..969f3fd1cb 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -107,8 +107,6 @@ public: // void stopTimer() { mTimer.stop(); } // - void close() { die(); } - // virtual void draw(); // virtual void setVisible(BOOL show); diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp index 69c384835d..4309f56710 100644 --- a/indra/newview/lltoastalertpanel.cpp +++ b/indra/newview/lltoastalertpanel.cpp @@ -66,8 +66,7 @@ static const S32 HPAD = 25; static const S32 BTN_HPAD = 8; LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal) - : LLFloater(LLSD()), - LLToastPanel(notification), + : LLToastPanel(notification), mDefaultOption( 0 ), mCheck(NULL), mCaution(notification->getPriority() >= NOTIFICATION_PRIORITY_HIGH), @@ -304,8 +303,8 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal setCheckBox(LLNotifications::instance().getGlobalString("alwayschoose"), ignore_label); } - gFloaterView->adjustToFitScreen(this, FALSE); - LLFloater::setFocus(TRUE); + // *TODO: check necessity of this code + //gFloaterView->adjustToFitScreen(this, FALSE); if (mLineEditor) { mLineEditor->setFocus(TRUE); @@ -368,9 +367,13 @@ LLToastAlertPanel::~LLToastAlertPanel() BOOL LLToastAlertPanel::hasTitleBar() const { + // *TODO: check necessity of this code + /* return (getCurrentTitle() != "" && getCurrentTitle() != " ") // has title || isMinimizeable() || isCloseable(); + */ + return false; } BOOL LLToastAlertPanel::handleKeyHere(KEY key, MASK mask ) @@ -455,7 +458,6 @@ void LLToastAlertPanel::onButtonPressed( const LLSD& data, S32 button ) } mNotification->respond(response); // new notification reponse - closeFloater(); // deletes self } void LLToastAlertPanel::onClickIgnore(LLUICtrl* ctrl) diff --git a/indra/newview/lltoastalertpanel.h b/indra/newview/lltoastalertpanel.h index 543c14d404..af0c9a9ddd 100644 --- a/indra/newview/lltoastalertpanel.h +++ b/indra/newview/lltoastalertpanel.h @@ -52,8 +52,7 @@ class LLLineEditor; */ class LLToastAlertPanel - : public LLToastPanel, - public LLFloater + : public LLToastPanel { public: typedef bool (*display_callback_t)(S32 modal); diff --git a/indra/newview/lltoastimpanel.cpp b/indra/newview/lltoastimpanel.cpp new file mode 100644 index 0000000000..e41181c9e1 --- /dev/null +++ b/indra/newview/lltoastimpanel.cpp @@ -0,0 +1,94 @@ +/** + * @file lltoastimpanel.cpp + * @brief Panel for IM toasts. + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-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$ + */ + +#include "llviewerprecompiledheaders.h" +#include "lltoastimpanel.h" +#include "llimpanel.h" + +const S32 LLToastIMPanel::MAX_MESSAGE_HEIGHT = 50; +const S32 LLToastIMPanel::CAPTION_HEIGHT = 30; +const S32 LLToastIMPanel::TOP_PAD = 5; + +//-------------------------------------------------------------------------- +LLToastIMPanel::LLToastIMPanel(LLToastIMPanel::Params &p) : LLToastPanel(p.notification), + mAvatar(NULL), mUserName(NULL), + mTime(NULL), mMessage(NULL), + mReplyBtn(NULL) +{ + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_instant_message.xml"); + + mAvatar = getChild<LLAvatarIconCtrl>("avatar"); + mUserName = getChild<LLTextBox>("user_name"); + mTime = getChild<LLTextBox>("time_box"); + mMessage = getChild<LLTextBox>("message"); + mReplyBtn = getChild<LLButton>("reply"); + + mMessage->setValue(p.message); + mAvatar->setValue(p.avatar_id); + mUserName->setValue(p.from); + mTime->setValue(p.time); + mSessionID = p.session_id; + + mReplyBtn->setClickedCallback(boost::bind(&LLToastIMPanel::onClickReplyBtn, this)); + + snapToMessageHeight(); +} + +//-------------------------------------------------------------------------- +LLToastIMPanel::~LLToastIMPanel() +{ +} + +//-------------------------------------------------------------------------- +void LLToastIMPanel::snapToMessageHeight() +{ + S32 required_text_height = mMessage->getTextPixelHeight(); + S32 text_height = llmin(required_text_height, MAX_MESSAGE_HEIGHT); + LLRect text_rect = mMessage->getRect(); + LLRect btn_rect = mReplyBtn->getRect(); + + + mMessage->reshape( text_rect.getWidth(), text_height, TRUE); + mMessage->setValue(mMessage->getText()); + + S32 panel_height = CAPTION_HEIGHT + text_height + btn_rect.getHeight() + TOP_PAD*5; + reshape( getRect().getWidth(), panel_height, TRUE); +} + +//-------------------------------------------------------------------------- +void LLToastIMPanel::onClickReplyBtn() +{ + LLIMFloater::toggle(mSessionID); +} + +//-------------------------------------------------------------------------- + diff --git a/indra/newview/lltoastimpanel.h b/indra/newview/lltoastimpanel.h new file mode 100644 index 0000000000..7f5d6eca1d --- /dev/null +++ b/indra/newview/lltoastimpanel.h @@ -0,0 +1,79 @@ +/** + * @file lltoastimpanel.h + * @brief Panel for IM toasts. + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-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 LLTOASTIMPANEL_H_ +#define LLTOASTIMPANEL_H_ + + +#include "lltoastpanel.h" +#include "lltextbox.h" +#include "llbutton.h" +#include "llavatariconctrl.h" + + +class LLToastIMPanel: public LLToastPanel +{ +public: + struct Params : public LLInitParam::Block<Params> + { + LLNotificationPtr notification; + LLUUID avatar_id; + LLUUID session_id; + std::string from; + std::string time; + std::string message; + + Params() {} + }; + + LLToastIMPanel(LLToastIMPanel::Params &p); + virtual ~LLToastIMPanel(); + +private: + static const S32 MAX_MESSAGE_HEIGHT; + static const S32 CAPTION_HEIGHT; + static const S32 TOP_PAD; + + void onClickReplyBtn(); + void snapToMessageHeight(); + + LLUUID mSessionID; + LLAvatarIconCtrl* mAvatar; + LLTextBox* mUserName; + LLTextBox* mTime; + LLTextBox* mMessage; + LLButton* mReplyBtn; +}; + +#endif // LLTOASTIMPANEL_H_ + + diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 70fa2f715b..b5dd34df15 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -72,7 +72,7 @@ #include "object_flags.h" #include "llimview.h" #include "llrootview.h" - +#include "llagentui.h" // MAX ITEMS is based on (sizeof(uuid)+2) * count must be < MTUBYTES // or 18 * count < 1200 => count < 1200/18 => 66. I've cut it down a @@ -1563,7 +1563,7 @@ void LLToolDragAndDrop::commitGiveInventoryItem(const LLUUID& to_agent, { if(!item) return; std::string name; - gAgent.buildFullname(name); + LLAgentUI::buildFullname(name); LLUUID transaction_id; transaction_id.generate(); const S32 BUCKET_SIZE = sizeof(U8) + UUID_BYTES; @@ -1762,7 +1762,7 @@ void LLToolDragAndDrop::commitGiveInventoryCategory(const LLUUID& to_agent, else { std::string name; - gAgent.buildFullname(name); + LLAgentUI::buildFullname(name); LLUUID transaction_id; transaction_id.generate(); S32 bucket_size = (sizeof(U8) + UUID_BYTES) * (count + 1); diff --git a/indra/newview/lltoolface.cpp b/indra/newview/lltoolface.cpp index b335d7125a..1d78dc5019 100644 --- a/indra/newview/lltoolface.cpp +++ b/indra/newview/lltoolface.cpp @@ -40,7 +40,6 @@ #include "v3math.h" // Viewer includes -#include "llagent.h" #include "llviewercontrol.h" #include "llselectmgr.h" #include "llviewerobject.h" diff --git a/indra/newview/lltoolselectland.cpp b/indra/newview/lltoolselectland.cpp index 07c996a84f..5c8b08db3b 100644 --- a/indra/newview/lltoolselectland.cpp +++ b/indra/newview/lltoolselectland.cpp @@ -38,7 +38,6 @@ #include "llparcel.h" // Viewer includes -#include "llagent.h" #include "llviewercontrol.h" #include "llfloatertools.h" #include "llselectmgr.h" diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index 8fbb59bc74..28f883312a 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -39,7 +39,6 @@ #include "llfasttimer.h" #include "llrender.h" -#include "llagent.h" #include "llapr.h" #include "llbox.h" #include "lldrawable.h" diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index d83f3d9207..7303605915 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -101,6 +101,7 @@ #include "llnotify.h" #include "llpanelgrouplandmoney.h" #include "llselectmgr.h" +#include "llsidetray.h" #include "llstartup.h" #include "llsky.h" #include "llstatenums.h" @@ -136,6 +137,7 @@ #include "llviewerdisplay.h" #include "llkeythrottle.h" #include "llgroupactions.h" +#include "llagentui.h" #include <boost/tokenizer.hpp> #include <boost/algorithm/string/split.hpp> @@ -902,12 +904,17 @@ void open_offer(const std::vector<LLUUID>& items, const std::string& from_name) break; case LLAssetType::AT_LANDMARK: { - // *TODO: Embed a link to the Places panel so that user can edit the landmark right away. LLInventoryCategory* parent_folder = gInventory.getCategory(item->getParentUUID()); LLSD args; args["LANDMARK_NAME"] = item->getName(); args["FOLDER_NAME"] = std::string(parent_folder ? parent_folder->getName() : "unnkown"); LLNotifications::instance().add("LandmarkCreated", args); + + // Open new landmark for editing in Places panel. + LLSD key; + key["type"] = "landmark"; + key["id"] = item->getUUID(); + LLSideTray::getInstance()->showPanel("panel_places", key); } break; case LLAssetType::AT_TEXTURE: @@ -1079,7 +1086,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& msg->addUUIDFast(_PREHASH_ID, mTransactionID); msg->addU32Fast(_PREHASH_Timestamp, NO_TIMESTAMP); // no timestamp necessary std::string name; - gAgent.buildFullname(name); + LLAgentUI::buildFullname(name); msg->addStringFast(_PREHASH_FromAgentName, name); msg->addStringFast(_PREHASH_Message, ""); msg->addU32Fast(_PREHASH_ParentEstateID, 0); @@ -1526,7 +1533,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // if there is not a panel for this conversation (i.e. it is a new IM conversation // initiated by the other party) then... std::string my_name; - gAgent.buildFullname(my_name); + LLAgentUI::buildFullname(my_name); std::string response = gSavedPerAccountSettings.getString("BusyModeResponse2"); pack_instant_message( gMessageSystem, @@ -2131,7 +2138,7 @@ void busy_message (LLMessageSystem* msg, LLUUID from_id) if (gAgent.getBusy()) { std::string my_name; - gAgent.buildFullname(my_name); + LLAgentUI::buildFullname(my_name); std::string response = gSavedPerAccountSettings.getString("BusyModeResponse2"); pack_instant_message( gMessageSystem, @@ -4735,7 +4742,7 @@ void process_script_question(LLMessageSystem *msg, void **user_data) // so we'll reuse the same namespace for both throttle types. std::string throttle_name = owner_name; std::string self_name; - gAgent.getName( self_name ); + LLAgentUI::buildName( self_name ); if( owner_name == self_name ) { throttle_name = taskid.getString(); @@ -5040,9 +5047,6 @@ void process_teleport_local(LLMessageSystem *msg,void**) gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); } - // Let the interested parties know we've teleported. - LLViewerParcelMgr::getInstance()->onTeleportFinished(); - // Sim tells us whether the new position is off the ground if (teleport_flags & TELEPORT_FLAGS_IS_FLYING) { @@ -5063,6 +5067,11 @@ void process_teleport_local(LLMessageSystem *msg,void**) gAgent.updateCamera(); send_agent_update(TRUE, TRUE); + + // Let the interested parties know we've teleported. + // Vadim *HACK: Agent position seems to get reset (to render position?) + // on each frame, so we have to pass the new position manually. + LLViewerParcelMgr::getInstance()->onTeleportFinished(true, gAgent.getPosGlobalFromAgent(pos)); } void send_simple_im(const LLUUID& to_id, @@ -5071,7 +5080,7 @@ void send_simple_im(const LLUUID& to_id, const LLUUID& id) { std::string my_name; - gAgent.buildFullname(my_name); + LLAgentUI::buildFullname(my_name); send_improved_im(to_id, my_name, message, @@ -5092,7 +5101,7 @@ void send_group_notice(const LLUUID& group_id, // This will mean converting the item to a binary bucket, // and the subject/message into a single field. std::string my_name; - gAgent.buildFullname(my_name); + LLAgentUI::buildFullname(my_name); // Combine subject + message into a single string. std::ostringstream subject_and_message; diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 8497a45466..9dafc4b9f5 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1530,7 +1530,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use if (instance->mTeleportInProgress) { instance->mTeleportInProgress = FALSE; - instance->mTeleportFinishedSignal(); + instance->mTeleportFinishedSignal(gAgent.getPositionGlobal()); } } } @@ -2398,12 +2398,19 @@ LLViewerTexture* LLViewerParcelMgr::getPassImage() const return sPassImage; } -boost::signals2::connection LLViewerParcelMgr::setAgentParcelChangedCallback(parcel_changed_callback_t cb) +boost::signals2::connection LLViewerParcelMgr::addAgentParcelChangedCallback(parcel_changed_callback_t cb) { return mAgentParcelChangedSignal.connect(cb); } - -boost::signals2::connection LLViewerParcelMgr::setTeleportFinishedCallback(parcel_changed_callback_t cb) +/* + * Set finish teleport callback. You can use it to observe all teleport events. + * NOTE: + * After local( in one region) teleports we + * cannot rely on gAgent.getPositionGlobal(), + * so the new position gets passed explicitly. + * Use args of this callback to get global position of avatar after teleport event. + */ +boost::signals2::connection LLViewerParcelMgr::setTeleportFinishedCallback(teleport_finished_callback_t cb) { return mTeleportFinishedSignal.connect(cb); } @@ -2416,12 +2423,22 @@ boost::signals2::connection LLViewerParcelMgr::setTeleportFailedCallback(parcel_ /* Ok, we're notified that teleport has been finished. * We should now propagate the notification via mTeleportFinishedSignal * to all interested parties. - * However the agent parcel data has not been updated yet. - * Let's wait for the update and then emit the signal. */ -void LLViewerParcelMgr::onTeleportFinished() +void LLViewerParcelMgr::onTeleportFinished(bool local, const LLVector3d& new_pos) { - mTeleportInProgress = TRUE; + if (local) + { + // Local teleport. We already have the agent parcel data. + // Emit the signal immediately. + getInstance()->mTeleportFinishedSignal(new_pos); + } + else + { + // Non-local teleport. + // The agent parcel data has not been updated yet. + // Let's wait for the update and then emit the signal. + mTeleportInProgress = TRUE; + } } void LLViewerParcelMgr::onTeleportFailed() diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index 427ed4a6f2..917f28fd29 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -82,6 +82,8 @@ class LLViewerParcelMgr : public LLSingleton<LLViewerParcelMgr> { public: + typedef boost::function<void (const LLVector3d&)> teleport_finished_callback_t; + typedef boost::signals2::signal<void (const LLVector3d&)> teleport_finished_signal_t; typedef boost::function<void()> parcel_changed_callback_t; typedef boost::signals2::signal<void()> parcel_changed_signal_t; @@ -262,10 +264,10 @@ public: // the agent is banned or not in the allowed group BOOL isCollisionBanned(); - boost::signals2::connection setAgentParcelChangedCallback(parcel_changed_callback_t cb); - boost::signals2::connection setTeleportFinishedCallback(parcel_changed_callback_t cb); + boost::signals2::connection addAgentParcelChangedCallback(parcel_changed_callback_t cb); + boost::signals2::connection setTeleportFinishedCallback(teleport_finished_callback_t cb); boost::signals2::connection setTeleportFailedCallback(parcel_changed_callback_t cb); - void onTeleportFinished(); + void onTeleportFinished(bool local, const LLVector3d& new_pos); void onTeleportFailed(); static BOOL isParcelOwnedByAgent(const LLParcel* parcelp, U64 group_proxy_power); @@ -316,7 +318,7 @@ private: LLDynamicArray<LLParcelObserver*> mObservers; BOOL mTeleportInProgress; - parcel_changed_signal_t mTeleportFinishedSignal; + teleport_finished_signal_t mTeleportFinishedSignal; parcel_changed_signal_t mTeleportFailedSignal; parcel_changed_signal_t mAgentParcelChangedSignal; diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 83442dc2bb..1b926e2db6 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -53,7 +53,6 @@ #include "llxmltree.h" #include "message.h" -#include "llagent.h" #include "lltexturecache.h" #include "lltexturefetch.h" #include "llviewercontrol.h" diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 74ed5b12fe..01756a0d82 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -186,6 +186,7 @@ #include "llpostprocess.h" #include "llbottomtray.h" #include "llnearbychatbar.h" +#include "llagentui.h" #include "llnotificationmanager.h" @@ -1105,7 +1106,7 @@ BOOL LLViewerWindow::handlePaint(LLWindow *window, S32 x, S32 y, S32 width, S FillRect(hdc, &wnd_rect, CreateSolidBrush(RGB(255, 255, 255))); std::string name_str; - gAgent.getName(name_str); + LLAgentUI::buildName(name_str); std::string temp_str; temp_str = llformat( "%s FPS %3.1f Phy FPS %2.1f Time Dil %1.3f", /* Flawfinder: ignore */ diff --git a/indra/newview/llvlmanager.cpp b/indra/newview/llvlmanager.cpp index 177093c4d1..07ef262668 100644 --- a/indra/newview/llvlmanager.cpp +++ b/indra/newview/llvlmanager.cpp @@ -40,7 +40,6 @@ #include "patch_dct.h" #include "llviewerregion.h" #include "llframetimer.h" -#include "llagent.h" #include "llsurface.h" LLVLManager gVLManager; diff --git a/indra/newview/llvoground.cpp b/indra/newview/llvoground.cpp index fe19e18151..ac2484ddfd 100644 --- a/indra/newview/llvoground.cpp +++ b/indra/newview/llvoground.cpp @@ -37,7 +37,6 @@ #include "llviewercontrol.h" -#include "llagent.h" #include "lldrawable.h" #include "llface.h" #include "llsky.h" diff --git a/indra/newview/llvotextbubble.cpp b/indra/newview/llvotextbubble.cpp index 9871965458..f5094c025e 100644 --- a/indra/newview/llvotextbubble.cpp +++ b/indra/newview/llvotextbubble.cpp @@ -39,7 +39,6 @@ #include "llprimitive.h" #include "llrendersphere.h" -#include "llagent.h" #include "llbox.h" #include "lldrawable.h" #include "llface.h" diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index f7a16571d1..6a209ecabf 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -47,7 +47,7 @@ #include "material_codes.h" #include "message.h" #include "object_flags.h" -#include "llagent.h" +#include "llagentconstants.h" #include "lldrawable.h" #include "lldrawpoolbump.h" #include "llface.h" diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp index 332c9dd952..e2357957ab 100644 --- a/indra/newview/llvowater.cpp +++ b/indra/newview/llvowater.cpp @@ -37,7 +37,6 @@ #include "imageids.h" #include "llviewercontrol.h" -#include "llagent.h" #include "lldrawable.h" #include "lldrawpoolwater.h" #include "llface.h" diff --git a/indra/newview/llwind.cpp b/indra/newview/llwind.cpp index ae98bead98..cbee4ddae1 100644 --- a/indra/newview/llwind.cpp +++ b/indra/newview/llwind.cpp @@ -49,7 +49,6 @@ // viewer #include "noise.h" #include "v4color.h" -#include "llagent.h" #include "llworld.h" diff --git a/indra/newview/llwlparammanager.cpp b/indra/newview/llwlparammanager.cpp index ae476c88c9..7d9d0a6191 100644 --- a/indra/newview/llwlparammanager.cpp +++ b/indra/newview/llwlparammanager.cpp @@ -52,7 +52,6 @@ #include "llviewercontrol.h" #include "llviewerwindow.h" #include "lldrawpoolwater.h" -#include "llagent.h" #include "llviewerregion.h" #include "llwlparamset.h" diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index ad208806b7..29492ebbdf 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -381,6 +381,7 @@ <texture name="icon_groupnoticeinventory.tga"/> <texture name="icon_lock.tga"/> <texture name="icon_place.tga"/> + <texture name="icon_place_for_sale.tga"/> <texture name="icon_popular.tga"/> <texture name="icon_top_pick.tga"/> diff --git a/indra/newview/skins/default/xui/en/panel_edit_pick.xml b/indra/newview/skins/default/xui/en/panel_edit_pick.xml index a74f560753..28cb3bc551 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_pick.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_pick.xml @@ -19,7 +19,7 @@ left="10" name="title" text_color="white" - top="0" + top="17" width="250"> Edit Pick </text> @@ -28,11 +28,11 @@ bg_alpha_color="DkGray2" width="280" follows="left|right|top|bottom" - height="570" + height="560" layout="topleft" left="10" right="-10" - top="30"> + top_pad="5"> <panel follows="left|top|right" height="150" diff --git a/indra/newview/skins/default/xui/en/panel_edit_profile.xml b/indra/newview/skins/default/xui/en/panel_edit_profile.xml index b336c86e95..c870e24e59 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_profile.xml @@ -13,8 +13,8 @@ top="10" width="305"> <text - top="0" - left="9" + top="16" + left="11" height="20" follows="left|top" font="SansSerifHugeBold" @@ -28,7 +28,7 @@ background_visible="true" bg_alpha_color="DkGray2" follows="left|top|right|bottom" - height="620" + height="604" layout="topleft" left="9" name="data_panel" diff --git a/indra/newview/skins/default/xui/en/panel_group_general.xml b/indra/newview/skins/default/xui/en/panel_group_general.xml index a38d7eee36..2243df951e 100644 --- a/indra/newview/skins/default/xui/en/panel_group_general.xml +++ b/indra/newview/skins/default/xui/en/panel_group_general.xml @@ -2,7 +2,7 @@ <panel border="true" follows="all" - height="500" + height="470" label="General" class="panel_group_general" layout="topleft" @@ -43,39 +43,17 @@ Hover your mouse over the options for more help. <text_editor type="string" follows="left|top" - left="10" + left="95" height="75" hide_scrollbar="true" layout="topleft" max_length="511" name="charter" - top_pad="4" - width="260" + top="30" + width="170" word_wrap="true"> Group Charter </text_editor> - <!--<button - follows="left|top" - height="20" - font="SansSerifSmall" - label="Join (L$0)" - label_selected="Join (L$0)" - layout="topleft" - left="10" - name="join_button" - top_pad="10" - width="85" /> - <button - follows="left|top" - height="20" - font="SansSerifSmall" - label="Details" - label_selected="Detailed View" - layout="topleft" - left_delta="0" - name="info_button" - top_delta="0" - width="85" /> --> <text follows="left|top" type="string" @@ -83,7 +61,7 @@ Hover your mouse over the options for more help. tool_tip="Owners are shown in bold." height="16" layout="topleft" - left_delta="0" + left="5" name="text_owners_and_visible_members" top_pad="10" width="270"> diff --git a/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml b/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml index be68187eaf..65d1e3c3a7 100644 --- a/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml +++ b/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml @@ -16,26 +16,25 @@ name="want_apply_text"> Do you want to apply these changes? </panel.string> - - <button + + <button layout="topleft" name="back" - left="5" - top="5" - width="20" - height="20" + right="-9" + top="0" + width="25" + height="25" label="" follows="top|left" - image_selected="navbar_bg_button.tga" - image_unselected="navbar_bg_button.tga" - image_overlay="navbar_back.tga"/> + image_overlay="BackArrow_Off" + tab_stop="false" /> <text layout="topleft" - top="5" - left_pad="15" - width="200" + top="0" + left="10" + width="250" height="20" - font="SansSerifBold" + font="SansSerifHugeBold" text_color="white" follows="top|left|right" mouse_opaque="true" @@ -100,7 +99,7 @@ left="5" visible="false" width="65" /> - <accordion layout="topleft" left="2" width="296" top="135" height="600" follows="all" name="panel_me_profile"> + <accordion layout="topleft" left="2" width="296" top="135" height="600" follows="all" name="group_accordion"> <accordion_tab min_height="515" title="Group General" name="group_general_tab"> <panel class="panel_group_general" filename="panel_group_general.xml" name="group_general_tab_panel"/> </accordion_tab> diff --git a/indra/newview/skins/default/xui/en/panel_group_invite.xml b/indra/newview/skins/default/xui/en/panel_group_invite.xml index 43457ddd61..68b30faa1c 100644 --- a/indra/newview/skins/default/xui/en/panel_group_invite.xml +++ b/indra/newview/skins/default/xui/en/panel_group_invite.xml @@ -15,6 +15,10 @@ name="loading"> (loading...) </panel.string> + <panel.string + name="already_in_group"> + Some avatars are already in group and were not invited. + </panel.string> <text type="string" length="1" diff --git a/indra/newview/skins/default/xui/en/panel_group_land_money.xml b/indra/newview/skins/default/xui/en/panel_group_land_money.xml index 4d373fbf3a..069cf1d7bd 100644 --- a/indra/newview/skins/default/xui/en/panel_group_land_money.xml +++ b/indra/newview/skins/default/xui/en/panel_group_land_money.xml @@ -2,7 +2,7 @@ <panel border="true" follows="all" - height="490" + height="410" label="Land & L$" layout="topleft" left="1" @@ -59,7 +59,7 @@ heading_height="14" height="100" layout="topleft" - left_delta="0" + left="5" name="group_parcel_list" top_pad="10" width="265"> diff --git a/indra/newview/skins/default/xui/en/panel_group_notify.xml b/indra/newview/skins/default/xui/en/panel_group_notify.xml index a39a681f83..8ebf1b69a7 100644 --- a/indra/newview/skins/default/xui/en/panel_group_notify.xml +++ b/indra/newview/skins/default/xui/en/panel_group_notify.xml @@ -9,7 +9,7 @@ top="5" left="5" mouse_opaque="true" name="group_icon"/> <text type="string" length="1" follows="left|top|right|bottom" font="SansSerifBigBold" height="20" layout="topleft" left="60" name="title" - text_color="GroupNotifyTextColor" top="20" width="300"> + text_color="GroupNotifyTextColor" top="20" width="275" use_ellipses="true"> Sender Name / Group Name </text> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_group_roles.xml b/indra/newview/skins/default/xui/en/panel_group_roles.xml index 37c332b2b7..9ae165cbb9 100644 --- a/indra/newview/skins/default/xui/en/panel_group_roles.xml +++ b/indra/newview/skins/default/xui/en/panel_group_roles.xml @@ -193,7 +193,7 @@ clicking on their names. height="20" follows="left|top|right" max_length="250" - label="Filter Roles" + label="Filter People" name="filter_input" font="SansSerif" background_image="TextField_Search_Off" @@ -326,7 +326,7 @@ including the Everyone and Owner Roles. height="20" follows="left|top|right" max_length="250" - label="Filter People" + label="Filter Roles" name="filter_input" font="SansSerif" background_image="TextField_Search_Off" @@ -507,7 +507,7 @@ things in this group. There's a broad variety of Abilities. </panel> </tab_container> <panel - height="50" + height="170" layout="topleft" follows="left|top" left="10" @@ -540,7 +540,6 @@ things in this group. There's a broad variety of Abilities. </text> <scroll_list draw_stripes="false" - enabled="false" follows="left|top" height="150" layout="topleft" @@ -559,7 +558,6 @@ things in this group. There's a broad variety of Abilities. </scroll_list> <scroll_list draw_stripes="false" - enabled="false" height="150" layout="topleft" follows="left|top" @@ -686,7 +684,6 @@ things in this group. There's a broad variety of Abilities. </text> <name_list draw_stripes="false" - enabled="false" height="150" layout="topleft" left="0" @@ -783,7 +780,6 @@ things in this group. There's a broad variety of Abilities. Members with Ability </text> <scroll_list - enabled="false" height="150" layout="topleft" left="0" @@ -791,7 +787,6 @@ things in this group. There's a broad variety of Abilities. top="90" width="130" /> <name_list - enabled="false" height="150" layout="topleft" left_pad="5" diff --git a/indra/newview/skins/default/xui/en/panel_instant_message.xml b/indra/newview/skins/default/xui/en/panel_instant_message.xml new file mode 100644 index 0000000000..169fde7b47 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_instant_message.xml @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + background_visible="true" + bevel_style="in" + bg_alpha_color="0.3 0.3 0.3 0" + height="140" + label="im_panel" + layout="topleft" + left="0" + name="im_panel" + top="0" + width="350"> + <panel + background_visible="true" + bevel_style="in" + bg_alpha_color="black" + follows="top" + height="30" + label="im_header" + layout="topleft" + left="5" + name="im_header" + top="5" + width="340"> + <avatar_icon + follows="right" + height="20" + image_name="icon_avatar_online.tga" + layout="topleft" + left="5" + mouse_opaque="true" + name="avatar" + top="5" + width="20" /> + <text + follows="left|right" + font="SansSerifBigBold" + height="20" + layout="topleft" + left_pad="10" + name="user_name" + text_color="white" + top="5" + value="Darth Vader" + width="250" /> + <text + follows="right" + font="SansSerifBig" + height="20" + layout="topleft" + left_pad="10" + name="time_box" + text_color="white" + top="5" + value="23:30" + width="50" /> + </panel> + <text + follows="left|bottom|right" + height="60" + layout="topleft" + left="10" + name="message" + text_color="white" + top="40" + use_ellipses="true" + value="MESSAGE" + width="330" + word_wrap="true" /> + <button + follows="bottom" + font="SansSerifBigBold" + height="25" + label="reply" + layout="topleft" + left="120" + name="reply" + top="110" + width="110" /> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml index f821dcd839..dee911a45d 100644 --- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml @@ -116,12 +116,12 @@ follows="right|top" halign="right" height="22" - label="Search All" + label="Search" layout="topleft" left_pad="7" mouse_opaque="false" name="search_input" - tool_tip="Search All" + tool_tip="Search" top_delta="0" width="200" /> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_notes.xml b/indra/newview/skins/default/xui/en/panel_notes.xml index 188f405e13..12badfccf0 100644 --- a/indra/newview/skins/default/xui/en/panel_notes.xml +++ b/indra/newview/skins/default/xui/en/panel_notes.xml @@ -9,114 +9,136 @@ name="panel_notes" top="0" width="285"> - <scroll_container - color="DkGray2" - follows="left|top|right|bottom" - height="350" + <layout_stack + name="layout" + orientation="vertical" + follows="all" layout="topleft" - left="2" - name="profile_scroll" - opaque="true" + left="0" top="0" - width="284"> - <panel - height="350" - layout="topleft" - name="profile_scroll_panel" - top="0" - width="284"> - <text - follows="left|top" - font="SansSerifBold" - height="16" + height="420" + width="285" + border_size="0"> + <panel + name="notes_stack" + follows="all" layout="topleft" - left="10" - name="status_message" - text_color="white" top="0" - value="My private notes:" - width="230" /> - <text_editor - follows="left|top" - height="200" - hide_scrollbar="true" - layout="topleft" - left="10" - max_length="1000" - name="notes_edit" - text_color="black" - top_pad="10" - width="255" - word_wrap="true" /> - <text - follows="left|top" - font="SansSerifBold" - height="16" - layout="topleft" - left="10" - name="status_message2" - text_color="white" - top_pad="10" - value="Let this person:" - width="225" /> - <check_box - enabled="false" - height="20" - label="See my online status" - layout="topleft" - left="20" - name="status_check" - top_pad="0" - width="230" /> - <check_box - enabled="false" - height="20" - label="See me on the map" - layout="topleft" - left="20" - name="map_check" - top_pad="0" - width="230" /> - <check_box - enabled="false" - height="20" - label="Edit, delete or take my objects" - layout="topleft" - left="20" - name="objects_check" - top_pad="0" - width="230" /> - </panel> - </scroll_container> - <panel - follows="bottom|left" - height="30" - layout="topleft" - left="10" - name="notes_buttons_panel" - top_pad="5" - width="280"> - <button - enabled="false" - follows="bottom|left" - font="SansSerifSmallBold" - height="25" - label="Teleport" - layout="topleft" left="0" - name="teleport_btn" - top="0" - width="75" /> - <button - enabled="false" - follows="bottom|left" - font="SansSerifSmallBold" - height="25" - label="Map" + height="390" + width="285"> + <scroll_container + color="DkGray2" + follows="left|top|right|bottom" + height="390" + layout="topleft" + left="0" + name="profile_scroll" + opaque="true" + top="0" + width="285"> + <panel + height="350" + layout="topleft" + name="profile_scroll_panel" + top="0" + left="0" + width="240"> + <text + follows="left|top" + font="SansSerifBold" + height="16" + layout="topleft" + left="10" + name="status_message" + text_color="white" + top="0" + value="My private notes:" + width="230" /> + <text_editor + follows="left|top" + height="200" + hide_scrollbar="true" + layout="topleft" + left="10" + max_length="1000" + name="notes_edit" + text_color="black" + top_pad="10" + width="235" + word_wrap="true" /> + <text + follows="left|top" + font="SansSerifBold" + height="16" + layout="topleft" + left="10" + name="status_message2" + text_color="white" + top_pad="10" + value="Let this person:" + width="225" /> + <check_box + enabled="false" + height="20" + label="See my online status" + layout="topleft" + left="20" + name="status_check" + top_pad="0" + width="230" /> + <check_box + enabled="false" + height="20" + label="See me on the map" + layout="topleft" + left="20" + name="map_check" + top_pad="0" + width="230" /> + <check_box + enabled="false" + height="20" + label="Edit, delete or take my objects" + layout="topleft" + left="20" + name="objects_check" + top_pad="0" + width="230" /> + </panel> + </scroll_container> + </panel> + <panel + follows="bottom" + height="30" layout="topleft" - name="show_on_map_btn" - top="0" - left_pad="5" - width="85" /> - </panel> + left="10" + name="notes_buttons_panel" + top_pad="5" + width="280" + auto_resize="false"> + <button + enabled="false" + follows="bottom|left" + font="SansSerifSmallBold" + height="25" + label="Teleport" + layout="topleft" + left="0" + name="teleport_btn" + top="0" + width="75" /> + <button + enabled="false" + follows="bottom|left" + font="SansSerifSmallBold" + height="25" + label="Map" + layout="topleft" + name="show_on_map_btn" + top="0" + left_pad="5" + width="85" /> + </panel> + </layout_stack> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index a62d2a5cdb..fce31a2c68 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -102,6 +102,7 @@ left="20" name="nearby_view_sort_btn" picture_style="true" + tool_tip="Change sort and view of Residents list" top="7" width="18" /> </panel> @@ -195,6 +196,7 @@ left="20" name="friends_viewsort_btn" picture_style="true" + tool_tip="Change sort and view of Friends list" top="7" width="18" /> <button @@ -207,6 +209,7 @@ left_pad="5" name="add_btn" picture_style="true" + tool_tip="Offer friendship to a resident" top_delta="0" width="18" /> <button @@ -219,6 +222,7 @@ left_pad="180" name="del_btn" picture_style="true" + tool_tip="Remove selected person from your Friends list" top_delta="0" width="18" /> </panel> @@ -262,6 +266,7 @@ left="20" name="gear_btn" picture_style="true" + tool_tip="Change sort and view of Groups list" top="7" width="18" /> <button @@ -274,6 +279,7 @@ left_pad="5" name="plus_btn" picture_style="true" + tool_tip="Join group/Create new group" top_delta="0" width="18" /> <button @@ -287,6 +293,7 @@ left_pad="24" name="activate_btn" picture_style="true" + tool_tip="Activate selected group" top_delta="5" width="10" /> <button @@ -299,6 +306,7 @@ left_pad="146" name="minus_btn" picture_style="true" + tool_tip="Leave selected group" top_delta="-5" width="18" /> </panel> @@ -341,6 +349,7 @@ left="20" name="recent_viewsort_btn" picture_style="true" + tool_tip="Change sort and view of Residents list" top="7" width="18" /> </panel> @@ -372,6 +381,7 @@ label="Profile" layout="topleft" name="view_profile_btn" + tool_tip="Show picture, groups, and other residents information" width="65" /> </layout_panel> <layout_panel @@ -391,6 +401,7 @@ label="Add Friend" layout="topleft" name="add_friend_btn" + tool_tip="Add selected resident to your Friends List" width="85" /> </layout_panel> <layout_panel @@ -408,6 +419,7 @@ label="Group Profile" layout="topleft" name="group_info_btn" + tool_tip="Show group information" width="80" /> </layout_panel> <layout_panel @@ -426,6 +438,7 @@ label="Chat" layout="topleft" name="chat_btn" + tool_tip="Open chat session" width="45" /> </layout_panel> <layout_panel @@ -444,6 +457,7 @@ label="IM" layout="topleft" name="im_btn" + tool_tip="Open instant message session" width="35" /> </layout_panel> <layout_panel @@ -482,6 +496,7 @@ label="Teleport" layout="topleft" name="teleport_btn" + tool_tip="Offer teleport" width="65" /> </layout_panel> <layout_panel diff --git a/indra/newview/skins/default/xui/en/panel_pick_info.xml b/indra/newview/skins/default/xui/en/panel_pick_info.xml index b4d2bbb194..c8bde77a94 100644 --- a/indra/newview/skins/default/xui/en/panel_pick_info.xml +++ b/indra/newview/skins/default/xui/en/panel_pick_info.xml @@ -2,7 +2,7 @@ <panel bevel_style="in" follows="left|top|right|bottom" - height="625" + height="480" layout="topleft" left="0" name="panel_pick_info" @@ -16,29 +16,41 @@ left="10" name="title" text_color="white" - top="5" + top="16" value="Pick Info" width="150" /> <button follows="top|right" - height="20" + height="25" image_overlay="BackArrow_Off" layout="topleft" name="back_btn" picture_style="true" - right="-20" - top="7" - width="20" /> + right="-11" + top="16" + width="25" + tab_stop="false" /> + + <scroll_container + color="DkGray2" + follows="left|top|right|bottom" + height="400" + layout="topleft" + left="0" + name="pick_info_scroll" + opaque="true" + reserve_scroll_corner="true" + width="265"> <panel background_visible="true" bg_alpha_color="DkGray2" - follows="left|right|top|bottom" + follows="left|right|top" height="550" layout="topleft" left="0" - min_height="300" - top="30" - width="265"> + min_height="550" + top_pad="0" + width="263"> <texture_picker enabled="false" follows="left|top|right" @@ -110,7 +122,16 @@ text_color="white" valign="center" value="[loading...]" /> + <icon + follows="top|left" + height="15" + image_name="" + layout="topleft" + mouse_opaque="true" + name="maturity" + width="15" /> </panel> + </scroll_container> <panel follows="left|right|bottom" height="30" diff --git a/indra/newview/skins/default/xui/en/panel_picks.xml b/indra/newview/skins/default/xui/en/panel_picks.xml index 47cfd8e129..ff161cc2ab 100644 --- a/indra/newview/skins/default/xui/en/panel_picks.xml +++ b/indra/newview/skins/default/xui/en/panel_picks.xml @@ -8,92 +8,105 @@ name="panel_picks" top="0" width="285"> - <scroll_container - color="DkGray2" - follows="left|top|right|bottom" - height="350" + <layout_stack + name="layout" + orientation="vertical" + follows="all" layout="topleft" - left="2" - name="profile_scroll" - opaque="true" + left="0" top="0" - width="284"> - <panel - height="115" + height="420" + width="284" + border_size="0"> + <scroll_container + color="DkGray2" + follows="left|top|right|bottom" + height="350" layout="topleft" - left="0" - name="back_panel" + left="2" + name="profile_scroll" + opaque="true" top="0" - width="284" /> - </scroll_container> - <panel - background_visible="true" - bevel_style="none" - enabled="false" - follows="left|right|bottom" - height="30" - label="bottom_panel" - layout="topleft" - name="edit_panel" - top_pad="5" - width="284"> - <button + width="284"> + <panel + height="115" + layout="topleft" + left="0" + name="back_panel" + top="0" + width="284" /> + </scroll_container> + <panel + background_visible="true" + bevel_style="none" enabled="false" - follows="bottom|left" - font="SansSerifBigBold" - height="18" - image_selected="OptionsMenu_Press" - image_unselected="OptionsMenu_Off" - layout="topleft" - left="10" - name="gear_menu_btn" - picture_style="true" - top="5" - width="18" /> - <button - follows="bottom|left" - font="SansSerifBigBold" - height="18" - image_disabled="AddItem_Off" - image_disabled_selected="AddItem_Press" - image_selected="AddItem_Press" - image_unselected="AddItem_Off" + auto_resize="false" + follows="bottom" + height="30" + label="bottom_panel" layout="topleft" - left="35" - name="new_btn" - picture_style="true" - tool_tip="Create New Pick at Current Location" - top="5" - width="18" /> - <button - follows="bottom|right" - font="SansSerifBigBold" - height="18" - image_disabled="TrashItem_Off" - image_disabled_selected="TrashItem_Press" - image_selected="TrashItem_Press" - image_unselected="TrashItem_Off" - layout="topleft" - name="trash_btn" - picture_style="true" - right="-10" - top="5" - width="18" /> - </panel> - <panel - follows="bottom|left" - height="30" - layout="topleft" - name="buttons_cucks" - width="284"> - <button - enabled="false" - follows="bottom|left" - font="SansSerifSmallBold" - height="25" - label="Map" + name="edit_panel" + top_pad="5" + width="284"> + <button + enabled="false" + follows="bottom|left" + font="SansSerifBigBold" + height="18" + image_selected="OptionsMenu_Press" + image_unselected="OptionsMenu_Off" + layout="topleft" + left="10" + name="gear_menu_btn" + picture_style="true" + top="5" + width="18" /> + <button + follows="bottom|left" + font="SansSerifBigBold" + height="18" + image_disabled="AddItem_Off" + image_disabled_selected="AddItem_Press" + image_selected="AddItem_Press" + image_unselected="AddItem_Off" + layout="topleft" + left="35" + name="new_btn" + picture_style="true" + tool_tip="Create New Pick at Current Location" + top="5" + width="18" /> + <button + follows="bottom|right" + font="SansSerifBigBold" + height="18" + image_disabled="TrashItem_Off" + image_disabled_selected="TrashItem_Press" + image_selected="TrashItem_Press" + image_unselected="TrashItem_Off" + layout="topleft" + name="trash_btn" + picture_style="true" + right="-10" + top="5" + width="18" /> + </panel> + <panel + follows="bottom" + height="30" + auto_resize="false" layout="topleft" - name="show_on_map_btn" - width="85" /> - </panel> + name="buttons_cucks" + width="284"> + <button + enabled="false" + follows="bottom|left" + font="SansSerifSmallBold" + height="25" + label="Map" + layout="topleft" + name="show_on_map_btn" + width="85" /> + </panel> + </layout_stack> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_profile_view.xml b/indra/newview/skins/default/xui/en/panel_profile_view.xml index 6d7cabc5c0..e710774232 100644 --- a/indra/newview/skins/default/xui/en/panel_profile_view.xml +++ b/indra/newview/skins/default/xui/en/panel_profile_view.xml @@ -40,33 +40,53 @@ tab_stop="false" top="0" width="25" /> - <tab_container - follows="left|top|right|bottom" - height="420" - layout="topleft" - left="10" - name="tabs" - tab_min_width="75" - tab_position="top" - top_pad="15" - width="285"> - <panel - class="panel_profile" - filename="panel_profile.xml" - label="Profile" - layout="topleft" - name="panel_profile" /> - <panel - class="panel_picks" - filename="panel_picks.xml" - label="Picks" - layout="topleft" - name="panel_picks" /> - <panel - class="panel_notes" - filename="panel_notes.xml" - label="Notes & Privacy" + <layout_stack + name="layout_stack" + orientation="vertical" layout="topleft" - name="panel_notes" /> - </tab_container> + follows="all" + left="0" + top="50" + height="500" + width="305" + border_size="0"> + <panel + name="stack_panel" + follows="all" + layout="topleft" + top="0" + left="0" + height="500" + width="305"> + <tab_container + follows="all" + height="500" + layout="topleft" + left="10" + name="tabs" + tab_min_width="75" + tab_position="top" + top="0" + width="280"> + <panel + class="panel_profile" + filename="panel_profile.xml" + label="Profile" + layout="topleft" + name="panel_profile" /> + <panel + class="panel_picks" + filename="panel_picks.xml" + label="Picks" + layout="topleft" + name="panel_picks" /> + <panel + class="panel_notes" + filename="panel_notes.xml" + label="Notes & Privacy" + layout="topleft" + name="panel_notes" /> + </tab_container> + </panel> + </layout_stack> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_stand_stop_flying.xml b/indra/newview/skins/default/xui/en/panel_stand_stop_flying.xml index 445c9cc288..4d91a544c3 100644 --- a/indra/newview/skins/default/xui/en/panel_stand_stop_flying.xml +++ b/indra/newview/skins/default/xui/en/panel_stand_stop_flying.xml @@ -15,6 +15,7 @@ name="stand_btn" tool_tip="Click here to stand up." top="2" + visible="false" width="115" /> <button follows="left|bottom" @@ -24,5 +25,6 @@ name="stop_fly_btn" tool_tip="Stop Flying" top="2" + visible="false" width="115" /> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml index 3ad5cbe018..f597211ec9 100644 --- a/indra/newview/skins/default/xui/en/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml @@ -197,52 +197,6 @@ top_delta="-3" visible="false" width="16" /> - <button - follows="right|bottom" - height="16" - image_disabled="sm_rounded_corners_simple.tga" - image_disabled_selected="sm_rounded_corners_simple.tga" - image_hover_selected="sm_rounded_corners_simple.tga" - image_hover_unselected="sm_rounded_corners_simple.tga" - image_selected="sm_rounded_corners_simple.tga" - image_unselected="sm_rounded_corners_simple.tga" - layout="topleft" - left_pad="313" - mouse_opaque="false" - name="menubar_search_bevel_bg" - picture_style="true" - top_delta="0" - width="94" /> - <line_editor - bevel_style="none" - border_style="line" - commit_on_focus_lost="false" - follows="right|bottom" - height="11" - label="Search" - layout="topleft" - left_delta="1" - name="search_editor" - tab_group="1" - tool_tip="Search [SECOND_LIFE]" - top_delta="4" - width="78" /> - <button - follows="right|bottom" - font="SansSerifSmall" - height="16" - image_disabled="status_search_btn.png" - image_disabled_selected="status_search_btn_pressed.png" - image_selected="status_search_btn_pressed.png" - image_unselected="status_search_btn.png" - layout="topleft" - left_delta="78" - name="search_btn" - picture_style="true" - scale_image="false" - tool_tip="Search [SECOND_LIFE]" - top_delta="-4" - width="16" /> <text enabled="false" follows="right|bottom" diff --git a/indra/newview/skins/default/xui/en/panel_sys_well_item.xml b/indra/newview/skins/default/xui/en/panel_sys_well_item.xml index 3c49ce311a..3ac15fe550 100644 --- a/indra/newview/skins/default/xui/en/panel_sys_well_item.xml +++ b/indra/newview/skins/default/xui/en/panel_sys_well_item.xml @@ -54,6 +54,7 @@ name="close_btn" mouse_opaque="true" label="" + tab_stop="false" image_unselected="toast_hide_btn.tga" image_disabled="toast_hide_btn.tga" image_selected="toast_hide_btn.tga" diff --git a/indra/newview/skins/default/xui/en/panel_toast.xml b/indra/newview/skins/default/xui/en/panel_toast.xml index f7d8cf948e..441caffa28 100644 --- a/indra/newview/skins/default/xui/en/panel_toast.xml +++ b/indra/newview/skins/default/xui/en/panel_toast.xml @@ -62,6 +62,7 @@ mouse_opaque="true" name="hide_btn" label="" + tab_stop="false" image_unselected="toast_hide_btn.tga" image_disabled="toast_hide_btn.tga" image_selected="toast_hide_btn.tga" diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 655cf2b40f..df328118a2 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -937,6 +937,11 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. <string name="tight skirt">tight skirt</string> <string name="wrinkles">wrinkles</string> + <!-- Favorites Bar --> + <string name="location_ctrl_add_landmark">Add to My Landmarks</string> + <string name="location_ctrl_edit_landmark">Edit My Landmark</string> + <string name="favorite_landmark_loading_tooltip">(Loading...)</string> + <!-- Strings used by the (currently Linux) auto-updater app --> <string name="UpdaterWindowTitle"> [SECOND_LIFE_VIEWER] Update diff --git a/indra/newview/skins/default/xui/en/widgets/location_input.xml b/indra/newview/skins/default/xui/en/widgets/location_input.xml index b249451247..8f4d0edf95 100644 --- a/indra/newview/skins/default/xui/en/widgets/location_input.xml +++ b/indra/newview/skins/default/xui/en/widgets/location_input.xml @@ -9,6 +9,8 @@ <location_input font="SansSerifSmall" add_landmark_image_enabled="Favorite_Star_Active" add_landmark_image_disabled="Favorite_Star_Off" + add_landmark_image_hover="Favorite_Star_Over" + add_landmark_image_selected="Favorite_Star_Press" add_landmark_hpad="2" allow_text_entry="true" list_position="below" |