summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorIgor Borovkov <iborovkov@productengine.com>2010-03-16 16:34:41 +0200
committerIgor Borovkov <iborovkov@productengine.com>2010-03-16 16:34:41 +0200
commitd21980df98eba5e936621f4184ce8379ea44f9c0 (patch)
tree8bc5ad6a40e6472e2393a40710daad69315ab081 /indra
parent163077bd98d32166cc0e205607e8dd3247e409de (diff)
fixed showstopper EXT-6289 (Clicking the plus button in the Places side panel only lets you add landmarks not folders)
- PLUS button works as GEAR button and PLUS button on inventory panel (show context menu on click) - "Add a folder" menu item is always enabled (except for received folder) - clicking "Add a folder" menu item creates a folder in My Landmarks tab no matter what has been selected in the Places panel before Reviewed by Mike at https://codereview.productengine.com/secondlife/r/10/ --HG-- branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llpanellandmarks.cpp21
-rw-r--r--indra/newview/llpanellandmarks.h1
2 files changed, 11 insertions, 11 deletions
diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp
index 45a8dc4cbe..879fbba9cd 100644
--- a/indra/newview/llpanellandmarks.cpp
+++ b/indra/newview/llpanellandmarks.cpp
@@ -656,9 +656,6 @@ void LLLandmarksPanel::initListCommandsHandlers()
mListCommands->childSetAction(OPTIONS_BUTTON_NAME, boost::bind(&LLLandmarksPanel::onActionsButtonClick, this));
mListCommands->childSetAction(TRASH_BUTTON_NAME, boost::bind(&LLLandmarksPanel::onTrashButtonClick, this));
- mListCommands->getChild<LLButton>(ADD_BUTTON_NAME)->setHeldDownCallback(boost::bind(&LLLandmarksPanel::onAddButtonHeldDown, this));
- static const LLSD add_landmark_command("add_landmark");
- mListCommands->childSetAction(ADD_BUTTON_NAME, boost::bind(&LLLandmarksPanel::onAddAction, this, add_landmark_command));
LLDragAndDropButton* trash_btn = mListCommands->getChild<LLDragAndDropButton>(TRASH_BUTTON_NAME);
trash_btn->setDragAndDropHandler(boost::bind(&LLLandmarksPanel::handleDragAndDropToTrash, this
@@ -676,6 +673,8 @@ void LLLandmarksPanel::initListCommandsHandlers()
mGearLandmarkMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_places_gear_landmark.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
mGearFolderMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_places_gear_folder.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
mMenuAdd = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_place_add_button.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
+
+ mListCommands->childSetAction(ADD_BUTTON_NAME, boost::bind(&LLLandmarksPanel::showActionMenu, this, mMenuAdd, ADD_BUTTON_NAME));
}
@@ -713,11 +712,6 @@ void LLLandmarksPanel::onActionsButtonClick()
showActionMenu(menu,OPTIONS_BUTTON_NAME);
}
-void LLLandmarksPanel::onAddButtonHeldDown()
-{
- showActionMenu(mMenuAdd,ADD_BUTTON_NAME);
-}
-
void LLLandmarksPanel::showActionMenu(LLMenuGL* menu, std::string spawning_view_name)
{
if (menu)
@@ -777,6 +771,12 @@ void LLLandmarksPanel::onAddAction(const LLSD& userdata) const
"category"), gInventory.findCategoryUUIDForType(
LLFolderType::FT_LANDMARK));
}
+ else
+ {
+ //in case My Landmarks tab is completely empty (thus cannot be determined as being selected)
+ menu_create_inventory_item(mLandmarksInventoryPanel->getRootFolder(), NULL, LLSD("category"),
+ gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK));
+ }
}
}
@@ -917,7 +917,7 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const
return false;
}
}
- else if (!root_folder_view)
+ else if (!root_folder_view && "category" != command_name)
{
return false;
}
@@ -953,7 +953,8 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const
// ... but except Received folder
return !isReceivedFolderSelected();
}
- else return false;
+ //"Add a folder" is enabled by default (case when My Landmarks is empty)
+ else return true;
}
else if("create_pick" == command_name)
{
diff --git a/indra/newview/llpanellandmarks.h b/indra/newview/llpanellandmarks.h
index f1ce1a18b5..2b46ba9933 100644
--- a/indra/newview/llpanellandmarks.h
+++ b/indra/newview/llpanellandmarks.h
@@ -121,7 +121,6 @@ private:
void updateListCommands();
void onActionsButtonClick();
void showActionMenu(LLMenuGL* menu, std::string spawning_view_name);
- void onAddButtonHeldDown();
void onTrashButtonClick() const;
void onAddAction(const LLSD& command_name) const;
void onClipboardAction(const LLSD& command_name) const;