summaryrefslogtreecommitdiff
path: root/indra/newview/llpanellandmarks.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanellandmarks.cpp')
-rw-r--r--indra/newview/llpanellandmarks.cpp36
1 files changed, 30 insertions, 6 deletions
diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp
index 8d8c996374..67d40a39b1 100644
--- a/indra/newview/llpanellandmarks.cpp
+++ b/indra/newview/llpanellandmarks.cpp
@@ -280,6 +280,17 @@ void LLLandmarksPanel::onShowOnMap()
doActionOnCurSelectedLandmark(boost::bind(&LLLandmarksPanel::doShowOnMap, this, _1));
}
+//virtual
+void LLLandmarksPanel::onShowProfile()
+{
+ LLFolderViewItem* cur_item = getCurSelectedItem();
+
+ if(!cur_item)
+ return;
+
+ cur_item->getListener()->performAction(mCurrentSelectedList->getModel(),"about");
+}
+
// virtual
void LLLandmarksPanel::onTeleport()
{
@@ -306,6 +317,7 @@ void LLLandmarksPanel::updateVerbs()
bool landmark_selected = isLandmarkSelected();
mTeleportBtn->setEnabled(landmark_selected && isActionEnabled("teleport"));
mShowOnMapBtn->setEnabled(landmark_selected && isActionEnabled("show_on_map"));
+ mShowProfile->setEnabled(landmark_selected && isActionEnabled("more_info"));
// TODO: mantipov: Uncomment when mShareBtn is supported
// Share button should be enabled when neither a folder nor a landmark is selected
@@ -663,6 +675,7 @@ void LLLandmarksPanel::initListCommandsHandlers()
trash_btn->setDragAndDropHandler(boost::bind(&LLLandmarksPanel::handleDragAndDropToTrash, this
, _4 // BOOL drop
, _5 // EDragAndDropType cargo_type
+ , _6 // void* cargo_data
, _7 // EAcceptance* accept
));
@@ -977,13 +990,10 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const
void LLLandmarksPanel::onCustomAction(const LLSD& userdata)
{
- LLFolderViewItem* cur_item = getCurSelectedItem();
- if(!cur_item)
- return;
std::string command_name = userdata.asString();
if("more_info" == command_name)
{
- cur_item->getListener()->performAction(mCurrentSelectedList->getModel(),"about");
+ onShowProfile();
}
else if ("teleport" == command_name)
{
@@ -1100,7 +1110,7 @@ void LLLandmarksPanel::onPickPanelExit( LLPanelPickEdit* pick_panel, LLView* own
pick_panel = NULL;
}
-bool LLLandmarksPanel::handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, EAcceptance* accept)
+bool LLLandmarksPanel::handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, void* cargo_data , EAcceptance* accept)
{
*accept = ACCEPT_NO;
@@ -1116,7 +1126,21 @@ bool LLLandmarksPanel::handleDragAndDropToTrash(BOOL drop, EDragAndDropType carg
if (is_enabled && drop)
{
- onClipboardAction("delete");
+ // don't call onClipboardAction("delete")
+ // this lead to removing (N * 2 - 1) items if drag N>1 items into trash. EXT-6757
+ // So, let remove items one by one.
+ LLInventoryItem* item = static_cast<LLInventoryItem*>(cargo_data);
+ if (item)
+ {
+ LLFolderViewItem* fv_item = (mCurrentSelectedList && mCurrentSelectedList->getRootFolder()) ?
+ mCurrentSelectedList->getRootFolder()->getItemByID(item->getUUID()) : NULL;
+
+ if (fv_item)
+ {
+ // is Item Removable checked inside of remove()
+ fv_item->remove();
+ }
+ }
}
}
break;