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.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp
index 220ea2813d..6ff784db0a 100644
--- a/indra/newview/llpanellandmarks.cpp
+++ b/indra/newview/llpanellandmarks.cpp
@@ -534,7 +534,7 @@ void LLLandmarksPanel::initLandmarksInventoryPanel()
// subscribe to have auto-rename functionality while creating New Folder
mLandmarksInventoryPanel->setSelectCallback(boost::bind(&LLInventoryPanel::onSelectionChange, mLandmarksInventoryPanel, _1, _2));
- initAccordion("tab_landmarks", mLandmarksInventoryPanel, true);
+ mMyLandmarksAccordionTab = initAccordion("tab_landmarks", mLandmarksInventoryPanel, true);
}
void LLLandmarksPanel::initMyInventoryPanel()
@@ -588,7 +588,7 @@ void LLLandmarksPanel::initLandmarksPanel(LLPlacesInventoryPanel* inventory_list
inventory_list->saveFolderState();
}
-void LLLandmarksPanel::initAccordion(const std::string& accordion_tab_name, LLPlacesInventoryPanel* inventory_list, bool expand_tab)
+LLAccordionCtrlTab* LLLandmarksPanel::initAccordion(const std::string& accordion_tab_name, LLPlacesInventoryPanel* inventory_list, bool expand_tab)
{
LLAccordionCtrlTab* accordion_tab = getChild<LLAccordionCtrlTab>(accordion_tab_name);
@@ -596,6 +596,7 @@ void LLLandmarksPanel::initAccordion(const std::string& accordion_tab_name, LLPl
accordion_tab->setDropDownStateChangedCallback(
boost::bind(&LLLandmarksPanel::onAccordionExpandedCollapsed, this, _2, inventory_list));
accordion_tab->setDisplayChildren(expand_tab);
+ return accordion_tab;
}
void LLLandmarksPanel::onAccordionExpandedCollapsed(const LLSD& param, LLPlacesInventoryPanel* inventory_list)
@@ -776,6 +777,11 @@ void LLLandmarksPanel::onAddAction(const LLSD& userdata) const
//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));
+
+ if (mMyLandmarksAccordionTab)
+ {
+ mMyLandmarksAccordionTab->changeOpenClose(false);
+ }
}
}
}
@@ -917,10 +923,6 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const
return false;
}
}
- else if (!root_folder_view && "category" != command_name)
- {
- return false;
- }
else if ( "paste" == command_name
|| "cut" == command_name
|| "copy" == command_name
@@ -938,11 +940,11 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const
)
{
// disable some commands for multi-selection. EXT-1757
- return root_folder_view->getSelectedCount() == 1;
+ return root_folder_view && root_folder_view->getSelectedCount() == 1;
}
else if ("rename" == command_name)
{
- return root_folder_view->getSelectedCount() == 1 && canSelectedBeModified(command_name);
+ return root_folder_view && root_folder_view->getSelectedCount() == 1 && canSelectedBeModified(command_name);
}
else if("category" == command_name)
{