diff options
author | Sergei Litovchuk <slitovchuk@productengine.com> | 2010-08-18 20:42:11 +0300 |
---|---|---|
committer | Sergei Litovchuk <slitovchuk@productengine.com> | 2010-08-18 20:42:11 +0300 |
commit | a1e401c626ba4f0a46e86e31ab91d1cbecf07942 (patch) | |
tree | ff927c86f3c8456bad697ff447b1bf265c6abf40 | |
parent | a668e155f239f30f86b6c73b02524f2ded714839 (diff) |
EXT-7325 FIXED Disabled "Show on Map" context menu item in My Landmarks while landmark coordinates are being downloaded from landmarks list.
Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/866/.
--HG--
branch : product-engine
-rw-r--r-- | indra/newview/lllandmarklist.cpp | 5 | ||||
-rw-r--r-- | indra/newview/lllandmarklist.h | 4 | ||||
-rw-r--r-- | indra/newview/llpanellandmarks.cpp | 24 |
3 files changed, 32 insertions, 1 deletions
diff --git a/indra/newview/lllandmarklist.cpp b/indra/newview/lllandmarklist.cpp index 87257832b6..dd402de394 100644 --- a/indra/newview/lllandmarklist.cpp +++ b/indra/newview/lllandmarklist.cpp @@ -159,6 +159,11 @@ void LLLandmarkList::processGetAssetReply( } +BOOL LLLandmarkList::isAssetInLoadedCallbackMap(const LLUUID& asset_uuid) +{ + return mLoadedCallbackMap.find(asset_uuid) != mLoadedCallbackMap.end(); +} + BOOL LLLandmarkList::assetExists(const LLUUID& asset_uuid) { return mList.count(asset_uuid) != 0 || mBadList.count(asset_uuid) != 0; diff --git a/indra/newview/lllandmarklist.h b/indra/newview/lllandmarklist.h index 6d32f0e75b..3356f866ce 100644 --- a/indra/newview/lllandmarklist.h +++ b/indra/newview/lllandmarklist.h @@ -59,6 +59,10 @@ public: S32 status, LLExtStat ext_status ); + // Returns TRUE if loading the landmark with given asset_uuid has been requested + // but is not complete yet. + BOOL isAssetInLoadedCallbackMap(const LLUUID& asset_uuid); + protected: void onRegionHandle(const LLUUID& landmark_id); void makeCallbacks(const LLUUID& landmark_id); diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index d825071825..650a806c00 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -974,7 +974,28 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const ) { // disable some commands for multi-selection. EXT-1757 - return root_folder_view && root_folder_view->getSelectedCount() == 1; + bool is_single_selection = root_folder_view && root_folder_view->getSelectedCount() == 1; + if (!is_single_selection) + { + return false; + } + + if ("show_on_map" == command_name) + { + LLFolderViewItem* cur_item = root_folder_view->getCurSelectedItem(); + if (!cur_item) return false; + + LLViewerInventoryItem* inv_item = cur_item->getInventoryItem(); + if (!inv_item) return false; + + LLUUID asset_uuid = inv_item->getAssetUUID(); + if (asset_uuid.isNull()) return false; + + // Disable "Show on Map" if landmark loading is in progress. + return !gLandmarkList.isAssetInLoadedCallbackMap(asset_uuid); + } + + return true; } else if ("rename" == command_name) { @@ -1188,6 +1209,7 @@ void LLLandmarksPanel::doShowOnMap(LLLandmark* landmark) } mShowOnMapBtn->setEnabled(TRUE); + mGearLandmarkMenu->setItemEnabled("show_on_map", TRUE); } void LLLandmarksPanel::doProcessParcelInfo(LLLandmark* landmark, |