From b9e650a3a1b83045e612088f2c4349e58c9a380d Mon Sep 17 00:00:00 2001 From: "davep@spiral.lindenlab.com" Date: Thu, 9 Aug 2012 11:47:14 -0700 Subject: MAINT-113 Fix for flashing property lines when selecting objects. --- indra/newview/llviewerparcelmgr.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index ae9c31bfe7..2bb2e92279 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -545,9 +545,6 @@ LLParcelSelectionHandle LLViewerParcelMgr::selectLand(const LLVector3d &corner1, mRequestResult = PARCEL_RESULT_NO_DATA; - // clear the list of segments to prevent flashing - resetSegments(mHighlightSegments); - mFloatingParcelSelection->setParcel(mCurrentParcel); mCurrentParcelSelection->setParcel(NULL); mCurrentParcelSelection = new LLParcelSelection(mCurrentParcel); -- cgit v1.2.3 From 5f1230e911623d77dbc3353819bed338c514f671 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 9 Aug 2012 11:52:48 -0700 Subject: MAINT-1342: correct initial login location handling, clarify the two related persistent settings --- indra/newview/app_settings/settings.xml | 4 +- indra/newview/llappviewer.cpp | 27 +++++++----- indra/newview/llpanellogin.cpp | 50 +++++++++++++++++++--- indra/newview/llstartup.cpp | 35 +++++++++------ indra/newview/llstartup.h | 2 +- .../newview/skins/default/xui/en/notifications.xml | 2 +- indra/newview/tests/lllogininstance_test.cpp | 1 + 7 files changed, 88 insertions(+), 33 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 2af71d98b8..1bf773bb9e 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5023,7 +5023,7 @@ LoginLocation Comment - Login location ('last', 'home') + Default Login location ('last', 'home') preference Persist 1 Type @@ -6123,7 +6123,7 @@ NextLoginLocation Comment - Location to log into by default. + Location to log into for this session - set from command line or the login panel, cleared following a successfull login. Persist 1 Type diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 63737c78d0..cb69048c60 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2665,14 +2665,6 @@ bool LLAppViewer::initConfiguration() } } - // If automatic login from command line with --login switch - // init StartSLURL location. In interactive login, LLPanelLogin - // will take care of it. - if ((clp.hasOption("login") || clp.hasOption("autologin")) && !clp.hasOption("url") && !clp.hasOption("slurl")) - { - LLStartUp::setStartSLURL(LLSLURL(gSavedSettings.getString("LoginLocation"))); - } - if (!gSavedSettings.getBOOL("AllowMultipleViewers")) { // @@ -2720,12 +2712,27 @@ bool LLAppViewer::initConfiguration() } } - // need to do this here - need to have initialized global settings first + // NextLoginLocation is set from the command line option std::string nextLoginLocation = gSavedSettings.getString( "NextLoginLocation" ); if ( !nextLoginLocation.empty() ) { + LL_DEBUGS("AppInit")<<"set start from NextLoginLocation: "<("start_location_combo"); updateLocationSelectorsVisibility(); // separate so that it can be called from preferences @@ -182,6 +176,29 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, ADD_TOP); server_choice_combo->selectFirstItem(); + LLSLURL start_slurl(LLStartUp::getStartSLURL()); + if ( !start_slurl.isSpatial() ) // has a start been established by the command line or NextLoginLocation ? + { + // no, so get the preference setting + std::string defaultStartLocation = gSavedSettings.getString("LoginLocation"); + LL_INFOS("AppInit")<<"default LoginLocation '"<("login")->setDefaultBtn("connect_btn"); @@ -645,8 +662,11 @@ void LLPanelLogin::onUpdateStartSLURL(const LLSLURL& new_start_slurl) * specify a particular grid; in those cases we want to change the grid * and the grid selector to match the new value. */ - if ( LLSLURL::LOCATION == new_start_slurl.getType() ) + enum LLSLURL::SLURL_TYPE new_slurl_type = new_start_slurl.getType(); + switch ( new_slurl_type ) { + case LLSLURL::LOCATION: + { std::string slurl_grid = LLGridManager::getInstance()->getGrid(new_start_slurl.getGrid()); if ( ! slurl_grid.empty() ) // is that a valid grid? { @@ -668,8 +688,24 @@ void LLPanelLogin::onUpdateStartSLURL(const LLSLURL& new_start_slurl) { // the grid specified by the slurl is not known LLNotificationsUtil::add("InvalidLocationSLURL"); + LL_WARNS("AppInit")<<"invalid LoginLocation:"<setTextEntry(LLStringUtil::null); } + } + break; + + case LLSLURL::HOME_LOCATION: + location_combo->setCurrentByIndex(1); // home location + break; + + case LLSLURL::LAST_LOCATION: + location_combo->setCurrentByIndex(0); // last location + break; + + default: + LL_WARNS("AppInit")<<"invalid login slurl, using home"<setCurrentByIndex(1); // home location + break; } } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index a28d8d3546..218c35029e 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2823,22 +2823,33 @@ bool LLStartUp::dispatchURL() void LLStartUp::setStartSLURL(const LLSLURL& slurl) { - sStartSLURL = slurl; - LL_DEBUGS("AppInit")< fail -Your last location is not currently available. +Your requested location is not currently available. You have been moved into a nearby region. diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index b7e81c4199..7705b4c567 100644 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -60,6 +60,7 @@ static LLEventStream gTestPump("test_pump"); #include "../llslurl.h" #include "../llstartup.h" LLSLURL LLStartUp::sStartSLURL; +LLSLURL& LLStartUp::getStartSLURL() { return sStartSLURL; } #include "lllogin.h" -- cgit v1.2.3 From c63dea6b91508bc87dc1423260ce1ebab3910f27 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 9 Aug 2012 16:26:37 -0700 Subject: MAINT-1197 : Fix inventory deselection/reselection when cutting items --- indra/newview/llfolderview.cpp | 23 +++++++++++++++++++++-- indra/newview/llfolderview.h | 2 ++ indra/newview/llfolderviewitem.cpp | 4 ++++ indra/newview/llfolderviewitem.h | 1 + indra/newview/llinventorybridge.cpp | 6 ++++++ 5 files changed, 34 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 7d047ec67e..3ffa08ec32 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -2254,7 +2254,7 @@ void LLFolderView::doIdle() LLFastTimer t3(FTM_AUTO_SELECT); // select new item only if a filtered item not currently selected LLFolderViewItem* selected_itemp = mSelectedItems.empty() ? NULL : mSelectedItems.back(); - if (!mAutoSelectOverride && (!selected_itemp || !selected_itemp->potentiallyFiltered())) + if (!mAutoSelectOverride && (!selected_itemp || !selected_itemp->potentiallyVisible())) { // these are named variables to get around gcc not binding non-const references to rvalues // and functor application is inherently non-const to allow for stateful functors @@ -2264,7 +2264,7 @@ void LLFolderView::doIdle() // Open filtered folders for folder views with mAutoSelectOverride=TRUE. // Used by LLPlacesFolderView. - if (mAutoSelectOverride && !mFilter->getFilterSubString().empty()) + if (!mFilter->getFilterSubString().empty()) { // these are named variables to get around gcc not binding non-const references to rvalues // and functor application is inherently non-const to allow for stateful functors @@ -2556,6 +2556,25 @@ void LLFolderView::onRenamerLost() } } +LLFolderViewItem* LLFolderView::getNextUnselectedItem() +{ + LLFolderViewItem* last_item = *mSelectedItems.rbegin(); + LLFolderViewItem* new_selection = last_item->getNextOpenNode(FALSE); + while(new_selection && new_selection->isSelected()) + { + new_selection = new_selection->getNextOpenNode(FALSE); + } + if (!new_selection) + { + new_selection = last_item->getPreviousOpenNode(FALSE); + while (new_selection && (new_selection->isInSelection())) + { + new_selection = new_selection->getPreviousOpenNode(FALSE); + } + } + return new_selection; +} + LLInventoryFilter* LLFolderView::getFilter() { return mFilter; diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index da8bb15f8e..3f78312a98 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -207,6 +207,8 @@ public: virtual void doDelete(); virtual BOOL canDoDelete() const; + LLFolderViewItem* getNextUnselectedItem(); + // Public rename functionality - can only start the process void startRenamingSelectedItem( void ); diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 515e544452..3aa16b4413 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -1098,6 +1098,10 @@ void LLFolderViewItem::draw() } } +bool LLFolderViewItem::isInSelection() const +{ + return mIsSelected || (mParentFolder && mParentFolder->isInSelection()); +} ///---------------------------------------------------------------------------- /// Class LLFolderViewFolder diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index 3c7592046a..577b6b54a2 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -243,6 +243,7 @@ public: virtual void destroyView(); BOOL isSelected() const { return mIsSelected; } + bool isInSelection() const; void setUnselected() { mIsSelected = FALSE; } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index b86c453d61..b819100b9b 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1355,7 +1355,10 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action) else if ("cut" == action) { cutToClipboard(); + // MAINT-1197: This is temp code to work around a deselection/reselection bug. Please discard when merging CHUI. + LLFolderViewItem* item_to_select = mRoot->getNextUnselectedItem(); LLFolderView::removeCutItems(); + mRoot->setSelection(item_to_select, item_to_select ? item_to_select->isOpen() : false, false); return; } else if ("copy" == action) @@ -2743,7 +2746,10 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) else if ("cut" == action) { cutToClipboard(); + // MAINT-1197: This is temp code to work around a deselection/reselection bug. Please discard when merging CHUI. + LLFolderViewItem* item_to_select = mRoot->getNextUnselectedItem(); LLFolderView::removeCutItems(); + mRoot->setSelection(item_to_select, item_to_select ? item_to_select->isOpen() : false, false); return; } else if ("copy" == action) -- cgit v1.2.3 From 1b639c33c59bb460881e6ef9dcd5fcfabbd21e18 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 10 Aug 2012 15:35:48 -0700 Subject: VWR-29358 : Fix auto scroll to selection when the filter is active --- indra/newview/llfolderview.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 3ffa08ec32..d4080ab3f7 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -2235,14 +2235,9 @@ void LLFolderView::doIdle() arrangeAll(); } - mNeedsAutoSelect = mFilter->hasFilterString() && - !(gFocusMgr.childHasKeyboardFocus(this) || gFocusMgr.getMouseCapture()); - - - if (mFilter->isModified() && mFilter->isNotDefault()) - { - mNeedsAutoSelect = TRUE; - } + BOOL filter_modified_and_active = mFilter->isModified() && mFilter->isNotDefault(); + mNeedsAutoSelect = filter_modified_and_active && + !(gFocusMgr.childHasKeyboardFocus(this) || gFocusMgr.getMouseCapture()); mFilter->clearModified(); // filter to determine visibility before arranging -- cgit v1.2.3 From 7cbbdbd896d1e54d2d54cb4ec1ed5bd14491a629 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 13 Aug 2012 16:55:51 -0700 Subject: PATH-849: CRASHFIX This should fix the crash caused by LLPathfindingObject::handleAvatarNameFetch being called after the corresponding LLPathfindingObject has been deleted. --- indra/newview/llpathfindingobject.cpp | 15 ++++++++++++++- indra/newview/llpathfindingobject.h | 19 +++++++++++-------- indra/newview/llpathfindingobjectlist.cpp | 10 ++++++++++ indra/newview/llpathfindingobjectlist.h | 3 ++- 4 files changed, 37 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpathfindingobject.cpp b/indra/newview/llpathfindingobject.cpp index 916eceb4c8..39fc3903b4 100644 --- a/indra/newview/llpathfindingobject.cpp +++ b/indra/newview/llpathfindingobject.cpp @@ -55,6 +55,7 @@ LLPathfindingObject::LLPathfindingObject() mOwnerUUID(), mHasOwnerName(false), mOwnerName(), + mAvatarNameCacheConnection(), mIsGroupOwned(false), mLocation() { @@ -67,6 +68,7 @@ LLPathfindingObject::LLPathfindingObject(const std::string &pUUID, const LLSD &p mOwnerUUID(), mHasOwnerName(false), mOwnerName(), + mAvatarNameCacheConnection(), mIsGroupOwned(false), mLocation() { @@ -80,6 +82,7 @@ LLPathfindingObject::LLPathfindingObject(const LLPathfindingObject& pOther) mOwnerUUID(pOther.mOwnerUUID), mHasOwnerName(false), mOwnerName(), + mAvatarNameCacheConnection(), mIsGroupOwned(pOther.mIsGroupOwned), mLocation(pOther.mLocation) { @@ -88,6 +91,7 @@ LLPathfindingObject::LLPathfindingObject(const LLPathfindingObject& pOther) LLPathfindingObject::~LLPathfindingObject() { + disconnectAvatarNameCacheConnection(); } LLPathfindingObject &LLPathfindingObject::operator =(const LLPathfindingObject& pOther) @@ -149,7 +153,7 @@ void LLPathfindingObject::fetchOwnerName() mHasOwnerName = LLAvatarNameCache::get(mOwnerUUID, &mOwnerName); if (!mHasOwnerName) { - LLAvatarNameCache::get(mOwnerUUID, boost::bind(&LLPathfindingObject::handleAvatarNameFetch, this, _1, _2)); + mAvatarNameCacheConnection = LLAvatarNameCache::get(mOwnerUUID, boost::bind(&LLPathfindingObject::handleAvatarNameFetch, this, _1, _2)); } } } @@ -159,4 +163,13 @@ void LLPathfindingObject::handleAvatarNameFetch(const LLUUID &pOwnerUUID, const llassert(mOwnerUUID == pOwnerUUID); mOwnerName = pAvatarName; mHasOwnerName = true; + disconnectAvatarNameCacheConnection(); +} + +void LLPathfindingObject::disconnectAvatarNameCacheConnection() +{ + if (mAvatarNameCacheConnection.connected()) + { + mAvatarNameCacheConnection.disconnect(); + } } diff --git a/indra/newview/llpathfindingobject.h b/indra/newview/llpathfindingobject.h index d45cc554fd..f3191053a8 100644 --- a/indra/newview/llpathfindingobject.h +++ b/indra/newview/llpathfindingobject.h @@ -32,6 +32,7 @@ #include #include "llavatarname.h" +#include "llavatarnamecache.h" #include "lluuid.h" #include "v3math.h" @@ -66,15 +67,17 @@ private: void fetchOwnerName(); void handleAvatarNameFetch(const LLUUID &pOwnerUUID, const LLAvatarName &pAvatarName); + void disconnectAvatarNameCacheConnection(); - LLUUID mUUID; - std::string mName; - std::string mDescription; - LLUUID mOwnerUUID; - bool mHasOwnerName; - LLAvatarName mOwnerName; - BOOL mIsGroupOwned; - LLVector3 mLocation; + LLUUID mUUID; + std::string mName; + std::string mDescription; + LLUUID mOwnerUUID; + bool mHasOwnerName; + LLAvatarName mOwnerName; + LLAvatarNameCache::callback_connection_t mAvatarNameCacheConnection; + BOOL mIsGroupOwned; + LLVector3 mLocation; }; #endif // LL_LLPATHFINDINGOBJECT_H diff --git a/indra/newview/llpathfindingobjectlist.cpp b/indra/newview/llpathfindingobjectlist.cpp index 68a7e736e6..f1ecb45fc0 100644 --- a/indra/newview/llpathfindingobjectlist.cpp +++ b/indra/newview/llpathfindingobjectlist.cpp @@ -45,6 +45,7 @@ LLPathfindingObjectList::LLPathfindingObjectList() LLPathfindingObjectList::~LLPathfindingObjectList() { + clear(); } bool LLPathfindingObjectList::isEmpty() const @@ -52,6 +53,15 @@ bool LLPathfindingObjectList::isEmpty() const return mObjectMap.empty(); } +void LLPathfindingObjectList::clear() +{ + for (LLPathfindingObjectMap::iterator objectIter = mObjectMap.begin(); objectIter != mObjectMap.end(); ++objectIter) + { + objectIter->second.reset(); + } + mObjectMap.clear(); +} + void LLPathfindingObjectList::update(LLPathfindingObjectPtr pUpdateObjectPtr) { if (pUpdateObjectPtr != NULL) diff --git a/indra/newview/llpathfindingobjectlist.h b/indra/newview/llpathfindingobjectlist.h index 3ad8e8b096..61580582d3 100644 --- a/indra/newview/llpathfindingobjectlist.h +++ b/indra/newview/llpathfindingobjectlist.h @@ -47,6 +47,8 @@ public: bool isEmpty() const; + void clear(); + void update(LLPathfindingObjectPtr pUpdateObjectPtr); void update(LLPathfindingObjectListPtr pUpdateObjectListPtr); @@ -56,7 +58,6 @@ public: const_iterator begin() const; const_iterator end() const; - protected: LLPathfindingObjectMap &getObjectMap(); -- cgit v1.2.3 From 9e2db5a173a0e25001bd330421c8738776410481 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 13 Aug 2012 18:28:34 -0700 Subject: PATH-852: BUGFIX Adding the custom pathfinding cursors to the mac and linux builds as apparently they never worked there. --- indra/newview/cursors_mac/UI_CURSOR_PATHFINDING.tif | Bin 0 -> 504 bytes indra/newview/cursors_mac/UI_CURSOR_PATHFINDING_END.tif | Bin 0 -> 556 bytes .../cursors_mac/UI_CURSOR_PATHFINDING_END_ADD.tif | Bin 0 -> 570 bytes .../newview/cursors_mac/UI_CURSOR_PATHFINDING_START.tif | Bin 0 -> 532 bytes .../cursors_mac/UI_CURSOR_PATHFINDING_START_ADD.tif | Bin 0 -> 550 bytes indra/newview/res-sdl/lltoolpathfinding.BMP | Bin 0 -> 4150 bytes indra/newview/res-sdl/lltoolpathfindingpathend.BMP | Bin 0 -> 4150 bytes indra/newview/res-sdl/lltoolpathfindingpathendadd.BMP | Bin 0 -> 4150 bytes indra/newview/res-sdl/lltoolpathfindingpathstart.BMP | Bin 0 -> 4150 bytes indra/newview/res-sdl/lltoolpathfindingpathstartadd.BMP | Bin 0 -> 4150 bytes 10 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 indra/newview/cursors_mac/UI_CURSOR_PATHFINDING.tif create mode 100644 indra/newview/cursors_mac/UI_CURSOR_PATHFINDING_END.tif create mode 100644 indra/newview/cursors_mac/UI_CURSOR_PATHFINDING_END_ADD.tif create mode 100644 indra/newview/cursors_mac/UI_CURSOR_PATHFINDING_START.tif create mode 100644 indra/newview/cursors_mac/UI_CURSOR_PATHFINDING_START_ADD.tif create mode 100644 indra/newview/res-sdl/lltoolpathfinding.BMP create mode 100644 indra/newview/res-sdl/lltoolpathfindingpathend.BMP create mode 100644 indra/newview/res-sdl/lltoolpathfindingpathendadd.BMP create mode 100644 indra/newview/res-sdl/lltoolpathfindingpathstart.BMP create mode 100644 indra/newview/res-sdl/lltoolpathfindingpathstartadd.BMP (limited to 'indra/newview') diff --git a/indra/newview/cursors_mac/UI_CURSOR_PATHFINDING.tif b/indra/newview/cursors_mac/UI_CURSOR_PATHFINDING.tif new file mode 100644 index 0000000000..ba6f30fa0e Binary files /dev/null and b/indra/newview/cursors_mac/UI_CURSOR_PATHFINDING.tif differ diff --git a/indra/newview/cursors_mac/UI_CURSOR_PATHFINDING_END.tif b/indra/newview/cursors_mac/UI_CURSOR_PATHFINDING_END.tif new file mode 100644 index 0000000000..830d5692fd Binary files /dev/null and b/indra/newview/cursors_mac/UI_CURSOR_PATHFINDING_END.tif differ diff --git a/indra/newview/cursors_mac/UI_CURSOR_PATHFINDING_END_ADD.tif b/indra/newview/cursors_mac/UI_CURSOR_PATHFINDING_END_ADD.tif new file mode 100644 index 0000000000..e05284214a Binary files /dev/null and b/indra/newview/cursors_mac/UI_CURSOR_PATHFINDING_END_ADD.tif differ diff --git a/indra/newview/cursors_mac/UI_CURSOR_PATHFINDING_START.tif b/indra/newview/cursors_mac/UI_CURSOR_PATHFINDING_START.tif new file mode 100644 index 0000000000..c4822adf64 Binary files /dev/null and b/indra/newview/cursors_mac/UI_CURSOR_PATHFINDING_START.tif differ diff --git a/indra/newview/cursors_mac/UI_CURSOR_PATHFINDING_START_ADD.tif b/indra/newview/cursors_mac/UI_CURSOR_PATHFINDING_START_ADD.tif new file mode 100644 index 0000000000..5166af6e05 Binary files /dev/null and b/indra/newview/cursors_mac/UI_CURSOR_PATHFINDING_START_ADD.tif differ diff --git a/indra/newview/res-sdl/lltoolpathfinding.BMP b/indra/newview/res-sdl/lltoolpathfinding.BMP new file mode 100644 index 0000000000..ad68c684a0 Binary files /dev/null and b/indra/newview/res-sdl/lltoolpathfinding.BMP differ diff --git a/indra/newview/res-sdl/lltoolpathfindingpathend.BMP b/indra/newview/res-sdl/lltoolpathfindingpathend.BMP new file mode 100644 index 0000000000..d558473ecf Binary files /dev/null and b/indra/newview/res-sdl/lltoolpathfindingpathend.BMP differ diff --git a/indra/newview/res-sdl/lltoolpathfindingpathendadd.BMP b/indra/newview/res-sdl/lltoolpathfindingpathendadd.BMP new file mode 100644 index 0000000000..855397b9b4 Binary files /dev/null and b/indra/newview/res-sdl/lltoolpathfindingpathendadd.BMP differ diff --git a/indra/newview/res-sdl/lltoolpathfindingpathstart.BMP b/indra/newview/res-sdl/lltoolpathfindingpathstart.BMP new file mode 100644 index 0000000000..bffa73b887 Binary files /dev/null and b/indra/newview/res-sdl/lltoolpathfindingpathstart.BMP differ diff --git a/indra/newview/res-sdl/lltoolpathfindingpathstartadd.BMP b/indra/newview/res-sdl/lltoolpathfindingpathstartadd.BMP new file mode 100644 index 0000000000..55a037c8d1 Binary files /dev/null and b/indra/newview/res-sdl/lltoolpathfindingpathstartadd.BMP differ -- cgit v1.2.3 From 683a96a5f1e9111d62710fe621d52192d34079ed Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 14 Aug 2012 14:54:29 -0700 Subject: PATH-849: Refactoring the behavior after loading the owner name of a pathfinding object into the avatar name cache so that each object can simply update its respective row in the scroll list rather than rebuilding from scratch after all names are loaded. --- indra/newview/llfloaterpathfindingcharacters.cpp | 28 ++--- indra/newview/llfloaterpathfindingcharacters.h | 4 +- indra/newview/llfloaterpathfindinglinksets.cpp | 42 +++----- indra/newview/llfloaterpathfindinglinksets.h | 4 +- indra/newview/llfloaterpathfindingobjects.cpp | 124 ++++++++++++----------- indra/newview/llfloaterpathfindingobjects.h | 16 +-- indra/newview/llpathfindingobject.cpp | 30 +++++- indra/newview/llpathfindingobject.h | 9 ++ 8 files changed, 141 insertions(+), 116 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterpathfindingcharacters.cpp b/indra/newview/llfloaterpathfindingcharacters.cpp index 99d262344c..4cf82d162c 100644 --- a/indra/newview/llfloaterpathfindingcharacters.cpp +++ b/indra/newview/llfloaterpathfindingcharacters.cpp @@ -134,26 +134,20 @@ void LLFloaterPathfindingCharacters::requestGetObjects() LLPathfindingManager::getInstance()->requestGetCharacters(getNewRequestId(), boost::bind(&LLFloaterPathfindingCharacters::handleNewObjectList, this, _1, _2, _3)); } -LLSD LLFloaterPathfindingCharacters::convertObjectsIntoScrollListData(const LLPathfindingObjectListPtr pObjectListPtr) +void LLFloaterPathfindingCharacters::buildObjectsScrollList(const LLPathfindingObjectListPtr pObjectListPtr) { llassert(pObjectListPtr != NULL); llassert(!pObjectListPtr->isEmpty()); - LLSD scrollListData = LLSD::emptyArray(); - for (LLPathfindingObjectList::const_iterator objectIter = pObjectListPtr->begin(); objectIter != pObjectListPtr->end(); ++objectIter) { - const LLPathfindingCharacter *characterPtr = dynamic_cast(objectIter->second.get()); - LLSD element = buildCharacterScrollListData(characterPtr); - scrollListData.append(element); + const LLPathfindingObjectPtr objectPtr = objectIter->second; + const LLPathfindingCharacter *characterPtr = dynamic_cast(objectPtr.get()); + llassert(characterPtr != NULL); - if (characterPtr->hasOwner() && !characterPtr->hasOwnerName()) - { - rebuildScrollListAfterAvatarNameLoads(characterPtr->getUUID()); - } + LLSD scrollListItemData = buildCharacterScrollListItemData(characterPtr); + addObjectToScrollList(objectPtr, scrollListItemData); } - - return scrollListData; } void LLFloaterPathfindingCharacters::updateControlsOnScrollListChange() @@ -201,9 +195,9 @@ void LLFloaterPathfindingCharacters::onShowPhysicsCapsuleClicked() } } -LLSD LLFloaterPathfindingCharacters::buildCharacterScrollListData(const LLPathfindingCharacter *pCharacterPtr) const +LLSD LLFloaterPathfindingCharacters::buildCharacterScrollListItemData(const LLPathfindingCharacter *pCharacterPtr) const { - LLSD columns; + LLSD columns = LLSD::emptyArray(); columns[0]["column"] = "name"; columns[0]["value"] = pCharacterPtr->getName(); @@ -231,11 +225,7 @@ LLSD LLFloaterPathfindingCharacters::buildCharacterScrollListData(const LLPathfi columns[4]["column"] = "altitude"; columns[4]["value"] = llformat("%1.0f m", pCharacterPtr->getLocation()[2]); - LLSD element; - element["id"] = pCharacterPtr->getUUID().asString(); - element["column"] = columns; - - return element; + return columns; } void LLFloaterPathfindingCharacters::updateStateOnDisplayControls() diff --git a/indra/newview/llfloaterpathfindingcharacters.h b/indra/newview/llfloaterpathfindingcharacters.h index ef389ad428..72974f283d 100644 --- a/indra/newview/llfloaterpathfindingcharacters.h +++ b/indra/newview/llfloaterpathfindingcharacters.h @@ -62,7 +62,7 @@ protected: virtual void requestGetObjects(); - virtual LLSD convertObjectsIntoScrollListData(const LLPathfindingObjectListPtr pObjectListPtr); + virtual void buildObjectsScrollList(const LLPathfindingObjectListPtr pObjectListPtr); virtual void updateControlsOnScrollListChange(); @@ -74,7 +74,7 @@ protected: private: void onShowPhysicsCapsuleClicked(); - LLSD buildCharacterScrollListData(const LLPathfindingCharacter *pCharacterPtr) const; + LLSD buildCharacterScrollListItemData(const LLPathfindingCharacter *pCharacterPtr) const; void updateStateOnDisplayControls(); void showSelectedCharacterCapsules(); diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp index 877bd0822d..dd28f82db1 100644 --- a/indra/newview/llfloaterpathfindinglinksets.cpp +++ b/indra/newview/llfloaterpathfindinglinksets.cpp @@ -215,7 +215,7 @@ void LLFloaterPathfindingLinksets::requestGetObjects() LLPathfindingManager::getInstance()->requestGetLinksets(getNewRequestId(), boost::bind(&LLFloaterPathfindingLinksets::handleNewObjectList, this, _1, _2, _3)); } -LLSD LLFloaterPathfindingLinksets::convertObjectsIntoScrollListData(const LLPathfindingObjectListPtr pObjectListPtr) +void LLFloaterPathfindingLinksets::buildObjectsScrollList(const LLPathfindingObjectListPtr pObjectListPtr) { llassert(pObjectListPtr != NULL); llassert(!pObjectListPtr->isEmpty()); @@ -227,7 +227,6 @@ LLSD LLFloaterPathfindingLinksets::convertObjectsIntoScrollListData(const LLPath bool isFilteringDescription = !descriptionFilter.empty(); bool isFilteringLinksetUse = (linksetUseFilter != LLPathfindingLinkset::kUnknown); - LLSD scrollListData = LLSD::emptyArray(); const LLVector3& avatarPosition = gAgent.getPositionAgent(); if (isFilteringName || isFilteringDescription || isFilteringLinksetUse) @@ -236,22 +235,21 @@ LLSD LLFloaterPathfindingLinksets::convertObjectsIntoScrollListData(const LLPath LLStringUtil::toUpper(descriptionFilter); for (LLPathfindingObjectList::const_iterator objectIter = pObjectListPtr->begin(); objectIter != pObjectListPtr->end(); ++objectIter) { - const LLPathfindingLinkset *linksetPtr = dynamic_cast(objectIter->second.get()); + const LLPathfindingObjectPtr objectPtr = objectIter->second; + const LLPathfindingLinkset *linksetPtr = dynamic_cast(objectPtr.get()); + llassert(linksetPtr != NULL); + std::string linksetName = (linksetPtr->isTerrain() ? getString("linkset_terrain_name") : linksetPtr->getName()); std::string linksetDescription = linksetPtr->getDescription(); LLStringUtil::toUpper(linksetName); LLStringUtil::toUpper(linksetDescription); + if ((!isFilteringName || (linksetName.find(nameFilter) != std::string::npos)) && (!isFilteringDescription || (linksetDescription.find(descriptionFilter) != std::string::npos)) && (!isFilteringLinksetUse || (linksetPtr->getLinksetUse() == linksetUseFilter))) { - LLSD element = buildLinksetScrollListData(linksetPtr, avatarPosition); - scrollListData.append(element); - - if (linksetPtr->hasOwner() && !linksetPtr->hasOwnerName()) - { - rebuildScrollListAfterAvatarNameLoads(linksetPtr->getUUID()); - } + LLSD scrollListItemData = buildLinksetScrollListItemData(linksetPtr, avatarPosition); + addObjectToScrollList(objectPtr, scrollListItemData); } } } @@ -259,18 +257,14 @@ LLSD LLFloaterPathfindingLinksets::convertObjectsIntoScrollListData(const LLPath { for (LLPathfindingObjectList::const_iterator objectIter = pObjectListPtr->begin(); objectIter != pObjectListPtr->end(); ++objectIter) { - const LLPathfindingLinkset *linksetPtr = dynamic_cast(objectIter->second.get()); - LLSD element = buildLinksetScrollListData(linksetPtr, avatarPosition); - scrollListData.append(element); + const LLPathfindingObjectPtr objectPtr = objectIter->second; + const LLPathfindingLinkset *linksetPtr = dynamic_cast(objectPtr.get()); + llassert(linksetPtr != NULL); - if (linksetPtr->hasOwner() && !linksetPtr->hasOwnerName()) - { - rebuildScrollListAfterAvatarNameLoads(linksetPtr->getUUID()); - } + LLSD scrollListItemData = buildLinksetScrollListItemData(linksetPtr, avatarPosition); + addObjectToScrollList(objectPtr, scrollListItemData); } } - - return scrollListData; } void LLFloaterPathfindingLinksets::updateControlsOnScrollListChange() @@ -373,10 +367,10 @@ void LLFloaterPathfindingLinksets::updateEditFieldValues() } } -LLSD LLFloaterPathfindingLinksets::buildLinksetScrollListData(const LLPathfindingLinkset *pLinksetPtr, const LLVector3 &pAvatarPosition) const +LLSD LLFloaterPathfindingLinksets::buildLinksetScrollListItemData(const LLPathfindingLinkset *pLinksetPtr, const LLVector3 &pAvatarPosition) const { llassert(pLinksetPtr != NULL); - LLSD columns; + LLSD columns = LLSD::emptyArray(); if (pLinksetPtr->isTerrain()) { @@ -451,11 +445,7 @@ LLSD LLFloaterPathfindingLinksets::buildLinksetScrollListData(const LLPathfindin columns[9]["column"] = "d_percent"; columns[9]["value"] = llformat("%3d", pLinksetPtr->getWalkabilityCoefficientD()); - LLSD element; - element["id"] = pLinksetPtr->getUUID().asString(); - element["column"] = columns; - - return element; + return columns; } LLSD LLFloaterPathfindingLinksets::buildLinksetUseScrollListData(const std::string &pLabel, S32 pValue) const diff --git a/indra/newview/llfloaterpathfindinglinksets.h b/indra/newview/llfloaterpathfindinglinksets.h index 342a64fc77..0877a427b3 100644 --- a/indra/newview/llfloaterpathfindinglinksets.h +++ b/indra/newview/llfloaterpathfindinglinksets.h @@ -58,7 +58,7 @@ protected: virtual void requestGetObjects(); - virtual LLSD convertObjectsIntoScrollListData(const LLPathfindingObjectListPtr pObjectListPtr); + virtual void buildObjectsScrollList(const LLPathfindingObjectListPtr pObjectListPtr); virtual void updateControlsOnScrollListChange(); @@ -78,7 +78,7 @@ private: void clearFilters(); void updateEditFieldValues(); - LLSD buildLinksetScrollListData(const LLPathfindingLinkset *pLinksetPtr, const LLVector3 &pAvatarPosition) const; + LLSD buildLinksetScrollListItemData(const LLPathfindingLinkset *pLinksetPtr, const LLVector3 &pAvatarPosition) const; LLSD buildLinksetUseScrollListData(const std::string &pLabel, S32 pValue) const; bool isShowUnmodifiablePhantomWarning(LLPathfindingLinkset::ELinksetUse pLinksetUse) const; diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp index e246265be9..b3ac18e106 100644 --- a/indra/newview/llfloaterpathfindingobjects.cpp +++ b/indra/newview/llfloaterpathfindingobjects.cpp @@ -29,6 +29,8 @@ #include "llfloaterpathfindingobjects.h" +#include +#include #include #include @@ -96,7 +98,6 @@ void LLFloaterPathfindingObjects::onOpen(const LLSD &pKey) void LLFloaterPathfindingObjects::onClose(bool pIsAppQuitting) { - if (mGodLevelChangeSlot.connected()) { mGodLevelChangeSlot.disconnect(); @@ -119,6 +120,11 @@ void LLFloaterPathfindingObjects::onClose(bool pIsAppQuitting) { mObjectsSelection.clear(); } + + if (pIsAppQuitting) + { + clearAllObjects(); + } } void LLFloaterPathfindingObjects::draw() @@ -168,13 +174,13 @@ LLFloaterPathfindingObjects::LLFloaterPathfindingObjects(const LLSD &pSeed) mReturnButton(NULL), mDeleteButton(NULL), mTeleportButton(NULL), - mLoadingAvatarNames(), mDefaultBeaconColor(), mDefaultBeaconTextColor(), mErrorTextColor(), mWarningTextColor(), mMessagingState(kMessagingUnknown), mMessagingRequestId(0U), + mMissingNameObjectsScrollListItems(), mObjectList(), mObjectsSelection(), mHasObjectsToBeSelected(false), @@ -186,6 +192,7 @@ LLFloaterPathfindingObjects::LLFloaterPathfindingObjects(const LLSD &pSeed) LLFloaterPathfindingObjects::~LLFloaterPathfindingObjects() { + clearAllObjects(); } BOOL LLFloaterPathfindingObjects::postBuild() @@ -343,54 +350,21 @@ void LLFloaterPathfindingObjects::rebuildObjectsScrollList() S32 origScrollPosition = mObjectsScrollList->getScrollPos(); mObjectsScrollList->deleteAllItems(); + mMissingNameObjectsScrollListItems.clear(); if ((mObjectList != NULL) && !mObjectList->isEmpty()) { - LLSD scrollListData = convertObjectsIntoScrollListData(mObjectList); - llassert(scrollListData.isArray()); + buildObjectsScrollList(mObjectList); - LLScrollListCell::Params cellParams; - cellParams.font = LLFontGL::getFontSansSerif(); - - for (LLSD::array_const_iterator rowElementIter = scrollListData.beginArray(); rowElementIter != scrollListData.endArray(); ++rowElementIter) + mObjectsScrollList->selectMultiple(mObjectsToBeSelected); + if (mHasObjectsToBeSelected) { - const LLSD &rowElement = *rowElementIter; - - LLScrollListItem::Params rowParams; - llassert(rowElement.has("id")); - llassert(rowElement.get("id").isString()); - rowParams.value = rowElement.get("id"); - - llassert(rowElement.has("column")); - llassert(rowElement.get("column").isArray()); - const LLSD &columnElement = rowElement.get("column"); - for (LLSD::array_const_iterator cellIter = columnElement.beginArray(); cellIter != columnElement.endArray(); ++cellIter) - { - const LLSD &cellElement = *cellIter; - - llassert(cellElement.has("column")); - llassert(cellElement.get("column").isString()); - cellParams.column = cellElement.get("column").asString(); - - llassert(cellElement.has("value")); - llassert(cellElement.get("value").isString()); - cellParams.value = cellElement.get("value").asString(); - - rowParams.columns.add(cellParams); - } - - mObjectsScrollList->addRow(rowParams); + mObjectsScrollList->scrollToShowSelected(); + } + else + { + mObjectsScrollList->setScrollPos(origScrollPosition); } - } - - mObjectsScrollList->selectMultiple(mObjectsToBeSelected); - if (mHasObjectsToBeSelected) - { - mObjectsScrollList->scrollToShowSelected(); - } - else - { - mObjectsScrollList->setScrollPos(origScrollPosition); } mObjectsToBeSelected.clear(); @@ -399,20 +373,42 @@ void LLFloaterPathfindingObjects::rebuildObjectsScrollList() updateControlsOnScrollListChange(); } -LLSD LLFloaterPathfindingObjects::convertObjectsIntoScrollListData(const LLPathfindingObjectListPtr pObjectListPtr) +void LLFloaterPathfindingObjects::buildObjectsScrollList(const LLPathfindingObjectListPtr pObjectListPtr) { llassert(0); - LLSD nullObjs = LLSD::emptyArray(); - return nullObjs; } -void LLFloaterPathfindingObjects::rebuildScrollListAfterAvatarNameLoads(const LLUUID &pAvatarId) +void LLFloaterPathfindingObjects::addObjectToScrollList(const LLPathfindingObjectPtr pObjectPtr, const LLSD &pScrollListItemData) { - std::set::const_iterator iter = mLoadingAvatarNames.find(pAvatarId); - if (iter == mLoadingAvatarNames.end()) + LLScrollListCell::Params cellParams; + cellParams.font = LLFontGL::getFontSansSerif(); + + LLScrollListItem::Params rowParams; + rowParams.value = pObjectPtr->getUUID().asString(); + + llassert(pScrollListItemData.isArray()); + for (LLSD::array_const_iterator cellIter = pScrollListItemData.beginArray(); + cellIter != pScrollListItemData.endArray(); ++cellIter) + { + const LLSD &cellElement = *cellIter; + + llassert(cellElement.has("column")); + llassert(cellElement.get("column").isString()); + cellParams.column = cellElement.get("column").asString(); + + llassert(cellElement.has("value")); + llassert(cellElement.get("value").isString()); + cellParams.value = cellElement.get("value").asString(); + + rowParams.columns.add(cellParams); + } + + LLScrollListItem *scrollListItem = mObjectsScrollList->addRow(rowParams); + + if (pObjectPtr->hasOwner() && !pObjectPtr->hasOwnerName()) { - mLoadingAvatarNames.insert(pAvatarId); - LLAvatarNameCache::get(pAvatarId, boost::bind(&LLFloaterPathfindingObjects::handleAvatarNameLoads, this, _1, _2)); + mMissingNameObjectsScrollListItems.insert(std::make_pair(pObjectPtr->getUUID().asString(), scrollListItem)); + pObjectPtr->registerOwnerNameListener(boost::bind(&LLFloaterPathfindingObjects::handleObjectNameResponse, this, _1, _2)); } } @@ -434,6 +430,11 @@ S32 LLFloaterPathfindingObjects::getNameColumnIndex() const return 0; } +S32 LLFloaterPathfindingObjects::getOwnerNameColumnIndex() const +{ + return 2; +} + const LLColor4 &LLFloaterPathfindingObjects::getBeaconColor() const { return mDefaultBeaconColor; @@ -496,6 +497,7 @@ void LLFloaterPathfindingObjects::clearAllObjects() { selectNoneObjects(); mObjectsScrollList->deleteAllItems(); + mMissingNameObjectsScrollListItems.clear(); mObjectList.reset(); } @@ -683,13 +685,21 @@ void LLFloaterPathfindingObjects::onGodLevelChange(U8 pGodLevel) requestGetObjects(); } -void LLFloaterPathfindingObjects::handleAvatarNameLoads(const LLUUID &pAvatarId, const LLAvatarName &pAvatarName) +void LLFloaterPathfindingObjects::handleObjectNameResponse(const LLUUID &pObjectUUID, const std::string &pOwnerName) { - llassert(mLoadingAvatarNames.find(pAvatarId) != mLoadingAvatarNames.end()); - mLoadingAvatarNames.erase(pAvatarId); - if (mLoadingAvatarNames.empty()) + const std::string uuid = pObjectUUID.asString(); + scroll_list_item_map::iterator scrollListItemIter = mMissingNameObjectsScrollListItems.find(uuid); + if (scrollListItemIter != mMissingNameObjectsScrollListItems.end()) { - rebuildObjectsScrollList(); + LLScrollListItem *scrollListItem = scrollListItemIter->second; + llassert(scrollListItem != NULL); + + LLScrollListCell *scrollListCell = scrollListItem->getColumn(getOwnerNameColumnIndex()); + LLSD ownerName = pOwnerName; + + scrollListCell->setValue(ownerName); + + mMissingNameObjectsScrollListItems.erase(scrollListItemIter); } } diff --git a/indra/newview/llfloaterpathfindingobjects.h b/indra/newview/llfloaterpathfindingobjects.h index e8d446b598..b7fd4340ed 100644 --- a/indra/newview/llfloaterpathfindingobjects.h +++ b/indra/newview/llfloaterpathfindingobjects.h @@ -27,7 +27,8 @@ #ifndef LL_LLFLOATERPATHFINDINGOBJECTS_H #define LL_LLFLOATERPATHFINDINGOBJECTS_H -#include +#include +#include #include @@ -80,14 +81,14 @@ protected: void handleUpdateObjectList(LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::ERequestStatus pRequestStatus, LLPathfindingObjectListPtr pObjectList); void rebuildObjectsScrollList(); - virtual LLSD convertObjectsIntoScrollListData(const LLPathfindingObjectListPtr pObjectListPtr); - - void rebuildScrollListAfterAvatarNameLoads(const LLUUID &pAvatarId); + virtual void buildObjectsScrollList(const LLPathfindingObjectListPtr pObjectListPtr); + void addObjectToScrollList(const LLPathfindingObjectPtr pObjectPr, const LLSD &pScrollListItemData); virtual void updateControlsOnScrollListChange(); virtual void updateControlsOnInWorldSelectionChange(); virtual S32 getNameColumnIndex() const; + virtual S32 getOwnerNameColumnIndex() const; virtual const LLColor4 &getBeaconColor() const; virtual const LLColor4 &getBeaconTextColor() const; virtual S32 getBeaconWidth() const; @@ -126,7 +127,7 @@ private: void onRegionBoundaryCrossed(); void onGodLevelChange(U8 pGodLevel); - void handleAvatarNameLoads(const LLUUID &pAvatarId, const LLAvatarName &pAvatarName); + void handleObjectNameResponse(const LLUUID &pObjectUUID, const std::string &pOwnerName); void updateMessagingStatus(); void updateStateOnListControls(); @@ -151,8 +152,6 @@ private: LLButton *mDeleteButton; LLButton *mTeleportButton; - std::set mLoadingAvatarNames; - LLColor4 mDefaultBeaconColor; LLColor4 mDefaultBeaconTextColor; LLColor4 mErrorTextColor; @@ -161,6 +160,9 @@ private: EMessagingState mMessagingState; LLPathfindingManager::request_id_t mMessagingRequestId; + typedef std::map scroll_list_item_map; + scroll_list_item_map mMissingNameObjectsScrollListItems; + LLPathfindingObjectListPtr mObjectList; LLObjectSelectionHandle mObjectsSelection; diff --git a/indra/newview/llpathfindingobject.cpp b/indra/newview/llpathfindingobject.cpp index 39fc3903b4..95da05740d 100644 --- a/indra/newview/llpathfindingobject.cpp +++ b/indra/newview/llpathfindingobject.cpp @@ -57,7 +57,8 @@ LLPathfindingObject::LLPathfindingObject() mOwnerName(), mAvatarNameCacheConnection(), mIsGroupOwned(false), - mLocation() + mLocation(), + mOwnerNameSignal() { } @@ -70,7 +71,8 @@ LLPathfindingObject::LLPathfindingObject(const std::string &pUUID, const LLSD &p mOwnerName(), mAvatarNameCacheConnection(), mIsGroupOwned(false), - mLocation() + mLocation(), + mOwnerNameSignal() { parseObjectData(pObjectData); } @@ -84,7 +86,8 @@ LLPathfindingObject::LLPathfindingObject(const LLPathfindingObject& pOther) mOwnerName(), mAvatarNameCacheConnection(), mIsGroupOwned(pOther.mIsGroupOwned), - mLocation(pOther.mLocation) + mLocation(pOther.mLocation), + mOwnerNameSignal() { fetchOwnerName(); } @@ -119,6 +122,23 @@ std::string LLPathfindingObject::getOwnerName() const return ownerName; } +LLPathfindingObject::name_connection_t LLPathfindingObject::registerOwnerNameListener(name_callback_t pOwnerNameCallback) +{ + llassert(hasOwner()); + + name_connection_t connection; + if (hasOwnerName()) + { + pOwnerNameCallback(getUUID(), getOwnerName()); + } + else + { + connection = mOwnerNameSignal.connect(pOwnerNameCallback); + } + + return connection; +} + void LLPathfindingObject::parseObjectData(const LLSD &pObjectData) { llassert(pObjectData.has(PATHFINDING_OBJECT_NAME_FIELD)); @@ -161,9 +181,13 @@ void LLPathfindingObject::fetchOwnerName() void LLPathfindingObject::handleAvatarNameFetch(const LLUUID &pOwnerUUID, const LLAvatarName &pAvatarName) { llassert(mOwnerUUID == pOwnerUUID); + mOwnerName = pAvatarName; mHasOwnerName = true; + disconnectAvatarNameCacheConnection(); + + mOwnerNameSignal(getUUID(), getOwnerName()); } void LLPathfindingObject::disconnectAvatarNameCacheConnection() diff --git a/indra/newview/llpathfindingobject.h b/indra/newview/llpathfindingobject.h index f3191053a8..81b6a2402f 100644 --- a/indra/newview/llpathfindingobject.h +++ b/indra/newview/llpathfindingobject.h @@ -30,6 +30,8 @@ #include #include +#include +#include #include "llavatarname.h" #include "llavatarnamecache.h" @@ -60,6 +62,12 @@ public: inline BOOL isGroupOwned() const {return mIsGroupOwned;}; inline const LLVector3& getLocation() const {return mLocation;}; + typedef boost::function name_callback_t; + typedef boost::signals2::signal name_signal_t; + typedef boost::signals2::connection name_connection_t; + + name_connection_t registerOwnerNameListener(name_callback_t pOwnerNameCallback); + protected: private: @@ -78,6 +86,7 @@ private: LLAvatarNameCache::callback_connection_t mAvatarNameCacheConnection; BOOL mIsGroupOwned; LLVector3 mLocation; + name_signal_t mOwnerNameSignal; }; #endif // LL_LLPATHFINDINGOBJECT_H -- cgit v1.2.3 From fddaf38f892aa608f9db9c034f6c583d638b6fcf Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 14 Aug 2012 16:04:12 -0700 Subject: PATH-849: Group objects were losing their [group] identifier following the last commit. This should fix that issue. --- indra/newview/llfloaterpathfindingcharacters.cpp | 24 +++++++++++++++++------- indra/newview/llfloaterpathfindingcharacters.h | 2 ++ indra/newview/llfloaterpathfindinglinksets.cpp | 24 +++++++++++++++++------- indra/newview/llfloaterpathfindinglinksets.h | 2 ++ indra/newview/llfloaterpathfindingobjects.cpp | 16 ++++++++++++---- indra/newview/llfloaterpathfindingobjects.h | 3 ++- indra/newview/llpathfindingobject.cpp | 4 ++-- indra/newview/llpathfindingobject.h | 6 +++--- 8 files changed, 57 insertions(+), 24 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterpathfindingcharacters.cpp b/indra/newview/llfloaterpathfindingcharacters.cpp index 4cf82d162c..69c9d94dfa 100644 --- a/indra/newview/llfloaterpathfindingcharacters.cpp +++ b/indra/newview/llfloaterpathfindingcharacters.cpp @@ -162,6 +162,22 @@ S32 LLFloaterPathfindingCharacters::getNameColumnIndex() const return 0; } +S32 LLFloaterPathfindingCharacters::getOwnerNameColumnIndex() const +{ + return 2; +} + +std::string LLFloaterPathfindingCharacters::getOwnerName(const LLPathfindingObject *pObject) const +{ + return (pObject->hasOwner() + ? (pObject->hasOwnerName() + ? (pObject->isGroupOwned() + ? (pObject->getOwnerName() + " " + getString("character_owner_group")) + : pObject->getOwnerName()) + : getString("character_owner_loading")) + : getString("character_owner_unknown")); +} + const LLColor4 &LLFloaterPathfindingCharacters::getBeaconColor() const { return mBeaconColor; @@ -206,13 +222,7 @@ LLSD LLFloaterPathfindingCharacters::buildCharacterScrollListItemData(const LLPa columns[1]["value"] = pCharacterPtr->getDescription(); columns[2]["column"] = "owner"; - columns[2]["value"] = (pCharacterPtr->hasOwner() - ? (pCharacterPtr->hasOwnerName() - ? (pCharacterPtr->isGroupOwned() - ? (pCharacterPtr->getOwnerName() + " " + getString("character_owner_group")) - : pCharacterPtr->getOwnerName()) - : getString("character_owner_loading")) - : getString("character_owner_unknown")); + columns[2]["value"] = getOwnerName(pCharacterPtr); S32 cpuTime = llround(pCharacterPtr->getCPUTime()); std::string cpuTimeString = llformat("%d", cpuTime); diff --git a/indra/newview/llfloaterpathfindingcharacters.h b/indra/newview/llfloaterpathfindingcharacters.h index 72974f283d..4021f4f119 100644 --- a/indra/newview/llfloaterpathfindingcharacters.h +++ b/indra/newview/llfloaterpathfindingcharacters.h @@ -67,6 +67,8 @@ protected: virtual void updateControlsOnScrollListChange(); virtual S32 getNameColumnIndex() const; + virtual S32 getOwnerNameColumnIndex() const; + virtual std::string getOwnerName(const LLPathfindingObject *pObject) const; virtual const LLColor4 &getBeaconColor() const; virtual LLPathfindingObjectListPtr getEmptyObjectList() const; diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp index dd28f82db1..4d3b7fca91 100644 --- a/indra/newview/llfloaterpathfindinglinksets.cpp +++ b/indra/newview/llfloaterpathfindinglinksets.cpp @@ -280,6 +280,22 @@ S32 LLFloaterPathfindingLinksets::getNameColumnIndex() const return 0; } +S32 LLFloaterPathfindingLinksets::getOwnerNameColumnIndex() const +{ + return 2; +} + +std::string LLFloaterPathfindingLinksets::getOwnerName(const LLPathfindingObject *pObject) const +{ + return (pObject->hasOwner() + ? (pObject->hasOwnerName() + ? (pObject->isGroupOwned() + ? (pObject->getOwnerName() + " " + getString("linkset_owner_group")) + : pObject->getOwnerName()) + : getString("linkset_owner_loading")) + : getString("linkset_owner_unknown")); +} + const LLColor4 &LLFloaterPathfindingLinksets::getBeaconColor() const { return mBeaconColor; @@ -398,13 +414,7 @@ LLSD LLFloaterPathfindingLinksets::buildLinksetScrollListItemData(const LLPathfi columns[1]["value"] = pLinksetPtr->getDescription(); columns[2]["column"] = "owner"; - columns[2]["value"] = (pLinksetPtr->hasOwner() - ? (pLinksetPtr->hasOwnerName() - ? (pLinksetPtr->isGroupOwned() - ? (pLinksetPtr->getOwnerName() + " " + getString("linkset_owner_group")) - : pLinksetPtr->getOwnerName()) - : getString("linkset_owner_loading")) - : getString("linkset_owner_unknown")); + columns[2]["value"] = getOwnerName(pLinksetPtr); columns[3]["column"] = "land_impact"; columns[3]["value"] = llformat("%1d", pLinksetPtr->getLandImpact()); diff --git a/indra/newview/llfloaterpathfindinglinksets.h b/indra/newview/llfloaterpathfindinglinksets.h index 0877a427b3..d371f36ac3 100644 --- a/indra/newview/llfloaterpathfindinglinksets.h +++ b/indra/newview/llfloaterpathfindinglinksets.h @@ -63,6 +63,8 @@ protected: virtual void updateControlsOnScrollListChange(); virtual S32 getNameColumnIndex() const; + virtual S32 getOwnerNameColumnIndex() const; + virtual std::string getOwnerName(const LLPathfindingObject *pObject) const; virtual const LLColor4 &getBeaconColor() const; virtual LLPathfindingObjectListPtr getEmptyObjectList() const; diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp index b3ac18e106..20c1215bcb 100644 --- a/indra/newview/llfloaterpathfindingobjects.cpp +++ b/indra/newview/llfloaterpathfindingobjects.cpp @@ -408,7 +408,7 @@ void LLFloaterPathfindingObjects::addObjectToScrollList(const LLPathfindingObjec if (pObjectPtr->hasOwner() && !pObjectPtr->hasOwnerName()) { mMissingNameObjectsScrollListItems.insert(std::make_pair(pObjectPtr->getUUID().asString(), scrollListItem)); - pObjectPtr->registerOwnerNameListener(boost::bind(&LLFloaterPathfindingObjects::handleObjectNameResponse, this, _1, _2)); + pObjectPtr->registerOwnerNameListener(boost::bind(&LLFloaterPathfindingObjects::handleObjectNameResponse, this, _1)); } } @@ -435,6 +435,13 @@ S32 LLFloaterPathfindingObjects::getOwnerNameColumnIndex() const return 2; } +std::string LLFloaterPathfindingObjects::getOwnerName(const LLPathfindingObject *pObject) const +{ + llassert(0); + std::string returnVal; + return returnVal; +} + const LLColor4 &LLFloaterPathfindingObjects::getBeaconColor() const { return mDefaultBeaconColor; @@ -685,9 +692,10 @@ void LLFloaterPathfindingObjects::onGodLevelChange(U8 pGodLevel) requestGetObjects(); } -void LLFloaterPathfindingObjects::handleObjectNameResponse(const LLUUID &pObjectUUID, const std::string &pOwnerName) +void LLFloaterPathfindingObjects::handleObjectNameResponse(const LLPathfindingObject *pObject) { - const std::string uuid = pObjectUUID.asString(); + llassert(pObject != NULL); + const std::string uuid = pObject->getUUID().asString(); scroll_list_item_map::iterator scrollListItemIter = mMissingNameObjectsScrollListItems.find(uuid); if (scrollListItemIter != mMissingNameObjectsScrollListItems.end()) { @@ -695,7 +703,7 @@ void LLFloaterPathfindingObjects::handleObjectNameResponse(const LLUUID &pObject llassert(scrollListItem != NULL); LLScrollListCell *scrollListCell = scrollListItem->getColumn(getOwnerNameColumnIndex()); - LLSD ownerName = pOwnerName; + LLSD ownerName = getOwnerName(pObject); scrollListCell->setValue(ownerName); diff --git a/indra/newview/llfloaterpathfindingobjects.h b/indra/newview/llfloaterpathfindingobjects.h index b7fd4340ed..4024e15fd6 100644 --- a/indra/newview/llfloaterpathfindingobjects.h +++ b/indra/newview/llfloaterpathfindingobjects.h @@ -89,6 +89,7 @@ protected: virtual S32 getNameColumnIndex() const; virtual S32 getOwnerNameColumnIndex() const; + virtual std::string getOwnerName(const LLPathfindingObject *pObject) const; virtual const LLColor4 &getBeaconColor() const; virtual const LLColor4 &getBeaconTextColor() const; virtual S32 getBeaconWidth() const; @@ -127,7 +128,7 @@ private: void onRegionBoundaryCrossed(); void onGodLevelChange(U8 pGodLevel); - void handleObjectNameResponse(const LLUUID &pObjectUUID, const std::string &pOwnerName); + void handleObjectNameResponse(const LLPathfindingObject *pObject); void updateMessagingStatus(); void updateStateOnListControls(); diff --git a/indra/newview/llpathfindingobject.cpp b/indra/newview/llpathfindingobject.cpp index 95da05740d..858d3203c0 100644 --- a/indra/newview/llpathfindingobject.cpp +++ b/indra/newview/llpathfindingobject.cpp @@ -129,7 +129,7 @@ LLPathfindingObject::name_connection_t LLPathfindingObject::registerOwnerNameLis name_connection_t connection; if (hasOwnerName()) { - pOwnerNameCallback(getUUID(), getOwnerName()); + pOwnerNameCallback(this); } else { @@ -187,7 +187,7 @@ void LLPathfindingObject::handleAvatarNameFetch(const LLUUID &pOwnerUUID, const disconnectAvatarNameCacheConnection(); - mOwnerNameSignal(getUUID(), getOwnerName()); + mOwnerNameSignal(this); } void LLPathfindingObject::disconnectAvatarNameCacheConnection() diff --git a/indra/newview/llpathfindingobject.h b/indra/newview/llpathfindingobject.h index 81b6a2402f..b8d3ca2364 100644 --- a/indra/newview/llpathfindingobject.h +++ b/indra/newview/llpathfindingobject.h @@ -62,9 +62,9 @@ public: inline BOOL isGroupOwned() const {return mIsGroupOwned;}; inline const LLVector3& getLocation() const {return mLocation;}; - typedef boost::function name_callback_t; - typedef boost::signals2::signal name_signal_t; - typedef boost::signals2::connection name_connection_t; + typedef boost::function name_callback_t; + typedef boost::signals2::signal name_signal_t; + typedef boost::signals2::connection name_connection_t; name_connection_t registerOwnerNameListener(name_callback_t pOwnerNameCallback); -- cgit v1.2.3 From 0517f5f487550f0616bc2ca062f94c3ccf63374e Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 14 Aug 2012 16:39:43 -0700 Subject: PATH-854: Adding support to display whether linksets are scripted or not in the pathfinding linksets floater. --- indra/newview/llfloaterpathfindinglinksets.cpp | 46 +++++++++++++--------- indra/newview/llpathfindinglinkset.cpp | 16 ++++++++ indra/newview/llpathfindinglinkset.h | 5 +++ .../xui/en/floater_pathfinding_linksets.xml | 34 ++++++++++------ 4 files changed, 70 insertions(+), 31 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp index 4d3b7fca91..651be274d9 100644 --- a/indra/newview/llfloaterpathfindinglinksets.cpp +++ b/indra/newview/llfloaterpathfindinglinksets.cpp @@ -399,11 +399,14 @@ LLSD LLFloaterPathfindingLinksets::buildLinksetScrollListItemData(const LLPathfi columns[2]["column"] = "owner"; columns[2]["value"] = getString("linkset_terrain_owner"); - columns[3]["column"] = "land_impact"; - columns[3]["value"] = getString("linkset_terrain_land_impact"); + columns[3]["column"] = "scripted"; + columns[3]["value"] = getString("linkset_terrain_scripted"); - columns[4]["column"] = "dist_from_you"; - columns[4]["value"] = getString("linkset_terrain_dist_from_you"); + columns[4]["column"] = "land_impact"; + columns[4]["value"] = getString("linkset_terrain_land_impact"); + + columns[5]["column"] = "dist_from_you"; + columns[5]["value"] = getString("linkset_terrain_dist_from_you"); } else { @@ -416,14 +419,21 @@ LLSD LLFloaterPathfindingLinksets::buildLinksetScrollListItemData(const LLPathfi columns[2]["column"] = "owner"; columns[2]["value"] = getOwnerName(pLinksetPtr); - columns[3]["column"] = "land_impact"; - columns[3]["value"] = llformat("%1d", pLinksetPtr->getLandImpact()); + columns[3]["column"] = "scripted"; + columns[3]["value"] = (pLinksetPtr->hasIsScripted() + ? (pLinksetPtr->isScripted() + ? getString("linkset_is_scripted") + : getString("linkset_is_not_scripted")) + : getString("linkset_is_unknown_scripted")); + + columns[4]["column"] = "land_impact"; + columns[4]["value"] = llformat("%1d", pLinksetPtr->getLandImpact()); - columns[4]["column"] = "dist_from_you"; - columns[4]["value"] = llformat("%1.0f m", dist_vec(pAvatarPosition, pLinksetPtr->getLocation())); + columns[5]["column"] = "dist_from_you"; + columns[5]["value"] = llformat("%1.0f m", dist_vec(pAvatarPosition, pLinksetPtr->getLocation())); } - columns[5]["column"] = "linkset_use"; + columns[6]["column"] = "linkset_use"; std::string linksetUse = getLinksetUseString(pLinksetPtr->getLinksetUse()); if (pLinksetPtr->isTerrain()) { @@ -441,19 +451,19 @@ LLSD LLFloaterPathfindingLinksets::buildLinksetScrollListItemData(const LLPathfi { linksetUse += (" " + getString("linkset_is_restricted_non_volume_state")); } - columns[5]["value"] = linksetUse; + columns[6]["value"] = linksetUse; - columns[6]["column"] = "a_percent"; - columns[6]["value"] = llformat("%3d", pLinksetPtr->getWalkabilityCoefficientA()); + columns[7]["column"] = "a_percent"; + columns[7]["value"] = llformat("%3d", pLinksetPtr->getWalkabilityCoefficientA()); - columns[7]["column"] = "b_percent"; - columns[7]["value"] = llformat("%3d", pLinksetPtr->getWalkabilityCoefficientB()); + columns[8]["column"] = "b_percent"; + columns[8]["value"] = llformat("%3d", pLinksetPtr->getWalkabilityCoefficientB()); - columns[8]["column"] = "c_percent"; - columns[8]["value"] = llformat("%3d", pLinksetPtr->getWalkabilityCoefficientC()); + columns[9]["column"] = "c_percent"; + columns[9]["value"] = llformat("%3d", pLinksetPtr->getWalkabilityCoefficientC()); - columns[9]["column"] = "d_percent"; - columns[9]["value"] = llformat("%3d", pLinksetPtr->getWalkabilityCoefficientD()); + columns[10]["column"] = "d_percent"; + columns[10]["value"] = llformat("%3d", pLinksetPtr->getWalkabilityCoefficientD()); return columns; } diff --git a/indra/newview/llpathfindinglinkset.cpp b/indra/newview/llpathfindinglinkset.cpp index fe4daabd89..779db5512e 100644 --- a/indra/newview/llpathfindinglinkset.cpp +++ b/indra/newview/llpathfindinglinkset.cpp @@ -39,6 +39,7 @@ #define LINKSET_MODIFIABLE_FIELD "modifiable" #define LINKSET_CATEGORY_FIELD "navmesh_category" #define LINKSET_CAN_BE_VOLUME "can_be_volume" +#define LINKSET_IS_SCRIPTED_FIELD "is_scripted" #define LINKSET_PHANTOM_FIELD "phantom" #define LINKSET_WALKABILITY_A_FIELD "A" #define LINKSET_WALKABILITY_B_FIELD "B" @@ -62,6 +63,8 @@ LLPathfindingLinkset::LLPathfindingLinkset(const LLSD& pTerrainData) mLandImpact(0U), mIsModifiable(FALSE), mCanBeVolume(FALSE), + mIsScripted(FALSE), + mHasIsScripted(TRUE), mLinksetUse(kUnknown), mWalkabilityCoefficientA(MIN_WALKABILITY_VALUE), mWalkabilityCoefficientB(MIN_WALKABILITY_VALUE), @@ -77,6 +80,8 @@ LLPathfindingLinkset::LLPathfindingLinkset(const std::string &pUUID, const LLSD& mLandImpact(0U), mIsModifiable(TRUE), mCanBeVolume(TRUE), + mIsScripted(FALSE), + mHasIsScripted(FALSE), mLinksetUse(kUnknown), mWalkabilityCoefficientA(MIN_WALKABILITY_VALUE), mWalkabilityCoefficientB(MIN_WALKABILITY_VALUE), @@ -93,6 +98,8 @@ LLPathfindingLinkset::LLPathfindingLinkset(const LLPathfindingLinkset& pOther) mLandImpact(pOther.mLandImpact), mIsModifiable(pOther.mIsModifiable), mCanBeVolume(pOther.mCanBeVolume), + mIsScripted(pOther.mIsScripted), + mHasIsScripted(pOther.mHasIsScripted), mLinksetUse(pOther.mLinksetUse), mWalkabilityCoefficientA(pOther.mWalkabilityCoefficientA), mWalkabilityCoefficientB(pOther.mWalkabilityCoefficientB), @@ -113,6 +120,8 @@ LLPathfindingLinkset& LLPathfindingLinkset::operator =(const LLPathfindingLinkse mLandImpact = pOther.mLandImpact; mIsModifiable = pOther.mIsModifiable; mCanBeVolume = pOther.mCanBeVolume; + mIsScripted = pOther.mIsScripted; + mHasIsScripted = pOther.mHasIsScripted; mLinksetUse = pOther.mLinksetUse; mWalkabilityCoefficientA = pOther.mWalkabilityCoefficientA; mWalkabilityCoefficientB = pOther.mWalkabilityCoefficientB; @@ -193,6 +202,13 @@ void LLPathfindingLinkset::parseLinksetData(const LLSD &pLinksetData) llassert(pLinksetData.has(LINKSET_MODIFIABLE_FIELD)); llassert(pLinksetData.get(LINKSET_MODIFIABLE_FIELD).isBoolean()); mIsModifiable = pLinksetData.get(LINKSET_MODIFIABLE_FIELD).asBoolean(); + + mHasIsScripted = pLinksetData.has(LINKSET_IS_SCRIPTED_FIELD); + if (mHasIsScripted) + { + llassert(pLinksetData.get(LINKSET_IS_SCRIPTED_FIELD).isBoolean()); + mIsScripted = pLinksetData.get(LINKSET_IS_SCRIPTED_FIELD).asBoolean(); + } } void LLPathfindingLinkset::parsePathfindingData(const LLSD &pLinksetData) diff --git a/indra/newview/llpathfindinglinkset.h b/indra/newview/llpathfindinglinkset.h index 73b4d6bad4..98675fccc4 100644 --- a/indra/newview/llpathfindinglinkset.h +++ b/indra/newview/llpathfindinglinkset.h @@ -63,6 +63,9 @@ public: inline ELinksetUse getLinksetUse() const {return mLinksetUse;}; + inline BOOL isScripted() const {return mIsScripted;}; + inline BOOL hasIsScripted() const {return mHasIsScripted;}; + inline S32 getWalkabilityCoefficientA() const {return mWalkabilityCoefficientA;}; inline S32 getWalkabilityCoefficientB() const {return mWalkabilityCoefficientB;}; inline S32 getWalkabilityCoefficientC() const {return mWalkabilityCoefficientC;}; @@ -98,6 +101,8 @@ private: U32 mLandImpact; BOOL mIsModifiable; BOOL mCanBeVolume; + BOOL mIsScripted; + BOOL mHasIsScripted; ELinksetUse mLinksetUse; S32 mWalkabilityCoefficientA; S32 mWalkabilityCoefficientB; diff --git a/indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml b/indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml index eaed92ac55..9bc5c7d5a4 100644 --- a/indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml +++ b/indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml @@ -4,9 +4,9 @@ can_resize="true" can_tear_off="false" height="395" - width="1015" + width="1075" min_height="395" - min_width="1015" + min_width="1075" layout="topleft" name="floater_pathfinding_linksets" help_topic="floater_pathfinding_linksets" @@ -25,11 +25,15 @@ [Terrain] -- -- + -- -- -- [Loading] [Unknown] [group] + Yes + No + Unknown Walkable Static obstacle Movable obstacle @@ -47,7 +51,7 @@ follows="left|top|right|bottom" layout="topleft" height="226" - width="999"> + width="1059">