From bf86a697313869627f8b7025ecd68032f2556f6f Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 25 Jun 2012 15:37:18 -0700 Subject: PATH-717: Minor UI changes from Leo. Also, adding a notification when attempting to return or delete multiple items. --- indra/newview/llfloaterpathfindingobjects.cpp | 56 +++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 4 deletions(-) (limited to 'indra/newview/llfloaterpathfindingobjects.cpp') diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp index cd6d0851b9..ea93955a5c 100644 --- a/indra/newview/llfloaterpathfindingobjects.cpp +++ b/indra/newview/llfloaterpathfindingobjects.cpp @@ -41,6 +41,8 @@ #include "llcheckboxctrl.h" #include "llenvmanager.h" #include "llfloater.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" #include "llpathfindingmanager.h" #include "llresmgr.h" #include "llscrolllistctrl.h" @@ -581,14 +583,42 @@ void LLFloaterPathfindingObjects::onTakeCopyClicked() void LLFloaterPathfindingObjects::onReturnClicked() { - handle_object_return(); - requestGetObjects(); + LLNotification::Params params("PathfindingReturnMultipleItems"); + params.functor.function(boost::bind(&LLFloaterPathfindingObjects::handleReturnItemsResponse, this, _1, _2)); + + LLSD substitutions; + int numItems = getNumSelectedObjects(); + substitutions["NUM_ITEMS"] = static_cast(numItems); + params.substitutions = substitutions; + + if (numItems == 1) + { + LLNotifications::getInstance()->forceResponse(params, 0); + } + else if (numItems > 1) + { + LLNotifications::getInstance()->add(params); + } } void LLFloaterPathfindingObjects::onDeleteClicked() { - handle_object_delete(); - requestGetObjects(); + LLNotification::Params params("PathfindingDeleteMultipleItems"); + params.functor.function(boost::bind(&LLFloaterPathfindingObjects::handleDeleteItemsResponse, this, _1, _2)); + + LLSD substitutions; + int numItems = getNumSelectedObjects(); + substitutions["NUM_ITEMS"] = static_cast(numItems); + params.substitutions = substitutions; + + if (numItems == 1) + { + LLNotifications::getInstance()->forceResponse(params, 0); + } + else if (numItems > 1) + { + LLNotifications::getInstance()->add(params); + } } void LLFloaterPathfindingObjects::onTeleportClicked() @@ -768,6 +798,24 @@ void LLFloaterPathfindingObjects::selectScrollListItemsInWorld() } } +void LLFloaterPathfindingObjects::handleReturnItemsResponse(const LLSD &pNotification, const LLSD &pResponse) +{ + if (LLNotificationsUtil::getSelectedOption(pNotification, pResponse) == 0) + { + handle_object_return(); + requestGetObjects(); + } +} + +void LLFloaterPathfindingObjects::handleDeleteItemsResponse(const LLSD &pNotification, const LLSD &pResponse) +{ + if (LLNotificationsUtil::getSelectedOption(pNotification, pResponse) == 0) + { + handle_object_delete(); + requestGetObjects(); + } +} + LLPathfindingObjectPtr LLFloaterPathfindingObjects::findObject(const LLScrollListItem *pListItem) const { LLPathfindingObjectPtr objectPtr; -- cgit v1.2.3 From b3ccf0f2adb666d558cddd3cad1e548a99ea401f Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 25 Jun 2012 18:24:03 -0700 Subject: Correcting a state message when setting values on the linkset floater. --- indra/newview/llfloaterpathfindingobjects.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterpathfindingobjects.cpp') diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp index ea93955a5c..9bfbc582bd 100644 --- a/indra/newview/llfloaterpathfindingobjects.cpp +++ b/indra/newview/llfloaterpathfindingobjects.cpp @@ -283,13 +283,14 @@ void LLFloaterPathfindingObjects::handleNewObjectList(LLPathfindingManager::requ void LLFloaterPathfindingObjects::handleUpdateObjectList(LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::ERequestStatus pRequestStatus, LLPathfindingObjectListPtr pObjectList) { + // We current assume that handleUpdateObjectList is called only when objects are being SET llassert(pRequestId <= mMessagingRequestId); if (pRequestId == mMessagingRequestId) { switch (pRequestStatus) { case LLPathfindingManager::kRequestStarted : - setMessagingState(kMessagingGetRequestSent); + setMessagingState(kMessagingSetRequestSent); break; case LLPathfindingManager::kRequestCompleted : if (mObjectList == NULL) -- cgit v1.2.3