diff options
Diffstat (limited to 'indra/newview/llpanellandmarks.cpp')
-rw-r--r-- | indra/newview/llpanellandmarks.cpp | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 93e58f3441..f05029582c 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -458,20 +458,8 @@ void LLLandmarksPanel::initListCommandsHandlers() void LLLandmarksPanel::updateListCommands() { - // TODO: should be false when "Received" folder is selected - bool add_folder_enabled = mCurrentSelectedList == mLandmarksInventoryPanel; - bool trash_enabled = false; // TODO: should be false when "Received" folder is selected - - LLFolderViewItem* current_item = getCurSelectedItem(); - - if (current_item) - { - LLFolderViewEventListener* listenerp = current_item->getListener(); - if (listenerp->getInventoryType() == LLInventoryType::IT_LANDMARK) - { - trash_enabled = mCurrentSelectedList != mLibraryInventoryPanel; - } - } + bool add_folder_enabled = isActionEnabled("category"); + bool trash_enabled = isActionEnabled("delete"); // keep Options & Add Landmark buttons always enabled mListCommands->childSetEnabled(ADD_FOLDER_BUTTON_NAME, add_folder_enabled); @@ -635,7 +623,13 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const if("category" == command_name) { - return mCurrentSelectedList == mLandmarksInventoryPanel; + // we can add folder only in Landmarks Accordion + if (mCurrentSelectedList == mLandmarksInventoryPanel) + { + // ... but except Received folder + return !isReceivedFolderSelected(); + } + else return false; } else if("paste" == command_name || "rename" == command_name || "cut" == command_name || "delete" == command_name) { @@ -650,11 +644,6 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const { return rootFolderView->getSelectedCount() == 1; } - // we can add folder, or change item/folder only in Landmarks Accordion - else if ("add_folder" == command_name) - { - return mLandmarksInventoryPanel == mCurrentSelectedList; - } else { llwarns << "Unprocessed command has come: " << command_name << llendl; |