summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaxim_productengine <mnikolenko@productengine.com>2012-08-08 17:32:47 +0300
committermaxim_productengine <mnikolenko@productengine.com>2012-08-08 17:32:47 +0300
commite5e8652e2c8c7dd8b22bc49dc8d422fff714624a (patch)
treeef9114de2e396c562fdcbdd1d0e957e17c7ac164
parentf02ec7b00cdbac7ba8be3baac5a12646a85235b6 (diff)
MAINT-403 FIXED Trash button is now disabled if neither landmark nor folder isn't selected.
-rw-r--r--indra/newview/llpanellandmarks.cpp13
-rw-r--r--indra/newview/llpanellandmarks.h1
2 files changed, 8 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);
diff --git a/indra/newview/llpanellandmarks.h b/indra/newview/llpanellandmarks.h
index b2f4e92473..4e787317ba 100644
--- a/indra/newview/llpanellandmarks.h
+++ b/indra/newview/llpanellandmarks.h
@@ -84,6 +84,7 @@ protected:
* @return true - if current selected panel is not null and selected item is a landmark
*/
bool isLandmarkSelected() const;
+ bool isFolderSelected() const;
bool isReceivedFolderSelected() const;
void doActionOnCurSelectedLandmark(LLLandmarkList::loaded_callback_t cb);
LLFolderViewItem* getCurSelectedItem() const;