summaryrefslogtreecommitdiff
path: root/indra/newview/llpanellandmarks.cpp
diff options
context:
space:
mode:
authorCallum Prentice <callum@lindenlab.com>2010-04-02 14:57:12 -0700
committerCallum Prentice <callum@lindenlab.com>2010-04-02 14:57:12 -0700
commit98e46e28e05c22c02da41603a056c0caf34f5ad0 (patch)
treea24352a4ce377d91428554aab15f96f887b24514 /indra/newview/llpanellandmarks.cpp
parent9e1b600d9b41afea62b2ba68fa8d5bc5861d1111 (diff)
parent2c5c563319d5ba8eaeae93b627536321956d347e (diff)
Merge with tip
Diffstat (limited to 'indra/newview/llpanellandmarks.cpp')
-rw-r--r--indra/newview/llpanellandmarks.cpp26
1 files changed, 10 insertions, 16 deletions
diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp
index 4cde02c1ce..8d8c996374 100644
--- a/indra/newview/llpanellandmarks.cpp
+++ b/indra/newview/llpanellandmarks.cpp
@@ -435,9 +435,9 @@ LLFolderViewItem* LLLandmarksPanel::selectItemInAccordionTab(LLPlacesInventoryPa
if (!inventory_list)
return NULL;
- LLFolderView* folder_view = inventory_list->getRootFolder();
+ LLFolderView* root = inventory_list->getRootFolder();
- LLFolderViewItem* item = folder_view->getItemByID(obj_id);
+ LLFolderViewItem* item = root->getItemByID(obj_id);
if (!item)
return NULL;
@@ -447,7 +447,7 @@ LLFolderViewItem* LLLandmarksPanel::selectItemInAccordionTab(LLPlacesInventoryPa
tab->changeOpenClose(false);
}
- folder_view->setSelection(item, FALSE, take_keyboard_focus);
+ root->setSelection(item, FALSE, take_keyboard_focus);
LLAccordionCtrl* accordion = getChild<LLAccordionCtrl>("landmarks_accordion");
LLRect screen_rc;
@@ -924,12 +924,7 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const
return false;
}
}
- else if (!root_folder_view && "category" != command_name)
- {
- return false;
- }
else if ( "paste" == command_name
- || "rename" == command_name
|| "cut" == command_name
|| "copy" == command_name
|| "delete" == command_name
@@ -941,17 +936,16 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const
}
else if ( "teleport" == command_name
|| "more_info" == command_name
- || "rename" == command_name
|| "show_on_map" == command_name
|| "copy_slurl" == command_name
)
{
// disable some commands for multi-selection. EXT-1757
- if (root_folder_view &&
- root_folder_view->getSelectedCount() > 1)
- {
- return false;
- }
+ return root_folder_view && root_folder_view->getSelectedCount() == 1;
+ }
+ else if ("rename" == command_name)
+ {
+ return root_folder_view && root_folder_view->getSelectedCount() == 1 && canSelectedBeModified(command_name);
}
else if("category" == command_name)
{
@@ -989,7 +983,7 @@ void LLLandmarksPanel::onCustomAction(const LLSD& userdata)
std::string command_name = userdata.asString();
if("more_info" == command_name)
{
- cur_item->getListener()->performAction(mCurrentSelectedList->getRootFolder(),mCurrentSelectedList->getModel(),"about");
+ cur_item->getListener()->performAction(mCurrentSelectedList->getModel(),"about");
}
else if ("teleport" == command_name)
{
@@ -1080,7 +1074,7 @@ bool LLLandmarksPanel::canSelectedBeModified(const std::string& command_name) co
}
else if ("delete" == command_name)
{
- can_be_modified = listenerp ? listenerp->isItemRemovable() : false;
+ can_be_modified = listenerp ? listenerp->isItemRemovable() && !listenerp->isItemInTrash() : false;
}
else if("paste" == command_name)
{