From a1e401c626ba4f0a46e86e31ab91d1cbecf07942 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Wed, 18 Aug 2010 20:42:11 +0300 Subject: 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 --- indra/newview/llpanellandmarks.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanellandmarks.cpp') 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, -- cgit v1.2.3 From 1fe7dd2fd7f0f9b7d15e0090e9e14708edbebde9 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Thu, 19 Aug 2010 16:16:10 +0300 Subject: EXT-8697 FIXED Disabled "Cut" context menu item for folders in 'My Landmarks'. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/867/. --HG-- branch : product-engine --- indra/newview/llpanellandmarks.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanellandmarks.cpp') diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 650a806c00..b4d19408f1 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -1120,7 +1120,8 @@ bool LLLandmarksPanel::canSelectedBeModified(const std::string& command_name) co if ("cut" == command_name) { - can_be_modified = root_folder->canCut(); + // "Cut" disabled for folders. See EXT-8697. + can_be_modified = root_folder->canCut() && listenerp->getInventoryType() != LLInventoryType::IT_CATEGORY; } else if ("rename" == command_name) { -- cgit v1.2.3 From e416840f85dc4a367894036b9fe483f17d959c54 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 24 Aug 2010 19:22:00 +0100 Subject: Backed out changeset c3d41f18ce2b back-out the back-out for this branch. yay. --- indra/newview/llpanellandmarks.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanellandmarks.cpp') diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index d825071825..43814ac652 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -716,8 +716,8 @@ void LLLandmarksPanel::updateListCommands() bool trash_enabled = isActionEnabled("delete"); // keep Options & Add Landmark buttons always enabled - mListCommands->childSetEnabled(ADD_FOLDER_BUTTON_NAME, add_folder_enabled); - mListCommands->childSetEnabled(TRASH_BUTTON_NAME, trash_enabled); + mListCommands->getChildView(ADD_FOLDER_BUTTON_NAME)->setEnabled(add_folder_enabled); + mListCommands->getChildView(TRASH_BUTTON_NAME)->setEnabled(trash_enabled); } void LLLandmarksPanel::onActionsButtonClick() -- cgit v1.2.3