diff options
| author | maxim_productengine <mnikolenko@productengine.com> | 2012-08-08 17:32:47 +0300 |
|---|---|---|
| committer | maxim_productengine <mnikolenko@productengine.com> | 2012-08-08 17:32:47 +0300 |
| commit | e5e8652e2c8c7dd8b22bc49dc8d422fff714624a (patch) | |
| tree | ef9114de2e396c562fdcbdd1d0e957e17c7ac164 /indra/newview/llpanellandmarks.cpp | |
| parent | f02ec7b00cdbac7ba8be3baac5a12646a85235b6 (diff) | |
MAINT-403 FIXED Trash button is now disabled if neither landmark nor folder isn't selected.
Diffstat (limited to 'indra/newview/llpanellandmarks.cpp')
| -rw-r--r-- | indra/newview/llpanellandmarks.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 68a3b6d1cd..d6fccb9705 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -418,12 +418,13 @@ void LLLandmarksPanel::setItemSelected(const LLUUID& obj_id, BOOL take_keyboard_ bool LLLandmarksPanel::isLandmarkSelected() const { LLFolderViewItem* current_item = getCurSelectedItem(); - if(current_item && current_item->getListener()->getInventoryType() == LLInventoryType::IT_LANDMARK) - { - return true; - } + return current_item && current_item->getListener()->getInventoryType() == LLInventoryType::IT_LANDMARK; +} - return false; +bool LLLandmarksPanel::isFolderSelected() const +{ + LLFolderViewItem* current_item = getCurSelectedItem(); + return current_item && current_item->getListener()->getInventoryType() == LLInventoryType::IT_CATEGORY; } bool LLLandmarksPanel::isReceivedFolderSelected() const @@ -720,7 +721,7 @@ void LLLandmarksPanel::initListCommandsHandlers() void LLLandmarksPanel::updateListCommands() { bool add_folder_enabled = isActionEnabled("category"); - bool trash_enabled = isActionEnabled("delete"); + bool trash_enabled = isActionEnabled("delete") && (isFolderSelected() || isLandmarkSelected()); // keep Options & Add Landmark buttons always enabled mListCommands->getChildView(ADD_FOLDER_BUTTON_NAME)->setEnabled(add_folder_enabled); |
