summaryrefslogtreecommitdiff
path: root/indra/newview/llpanellandmarks.cpp
diff options
context:
space:
mode:
authorSergei Litovchuk <slitovchuk@productengine.com>2010-01-21 16:58:05 +0200
committerSergei Litovchuk <slitovchuk@productengine.com>2010-01-21 16:58:05 +0200
commite2443ace9568406993f207721cf6dd9b2223a7a8 (patch)
treeadfaba348101ce1f5344d7f4f5e26134fc37f41f /indra/newview/llpanellandmarks.cpp
parent26384d7489b94de28169952fd3f0ef1677e94c59 (diff)
Fixed low bug (EXT-4221) Select and display just created landmark in the
Landmarks panel after closing Create Landmark panel - Added selecting landmark in landmarks panel after it was added or edited. - Added expanding accordion tab containing the selected landmark. --HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llpanellandmarks.cpp')
-rw-r--r--indra/newview/llpanellandmarks.cpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp
index d6e407a0ed..47feef496a 100644
--- a/indra/newview/llpanellandmarks.cpp
+++ b/indra/newview/llpanellandmarks.cpp
@@ -305,6 +305,29 @@ void LLLandmarksPanel::updateShowFolderState()
);
}
+void LLLandmarksPanel::setItemSelected(const LLUUID& obj_id, BOOL take_keyboard_focus)
+{
+ if (selectItemInAccordionTab(mFavoritesInventoryPanel, "tab_favorites", obj_id, take_keyboard_focus))
+ {
+ return;
+ }
+
+ if (selectItemInAccordionTab(mLandmarksInventoryPanel, "tab_landmarks", obj_id, take_keyboard_focus))
+ {
+ return;
+ }
+
+ if (selectItemInAccordionTab(mMyInventoryPanel, "tab_inventory", obj_id, take_keyboard_focus))
+ {
+ return;
+ }
+
+ if (selectItemInAccordionTab(mLibraryInventoryPanel, "tab_library", obj_id, take_keyboard_focus))
+ {
+ return;
+ }
+}
+
//////////////////////////////////////////////////////////////////////////
// PROTECTED METHODS
//////////////////////////////////////////////////////////////////////////
@@ -350,6 +373,36 @@ LLFolderViewItem* LLLandmarksPanel::getCurSelectedItem() const
return mCurrentSelectedList ? mCurrentSelectedList->getRootFolder()->getCurSelectedItem() : NULL;
}
+LLFolderViewItem* LLLandmarksPanel::selectItemInAccordionTab(LLPlacesInventoryPanel* inventory_list,
+ const std::string& tab_name,
+ const LLUUID& obj_id,
+ BOOL take_keyboard_focus) const
+{
+ if (!inventory_list)
+ return NULL;
+
+ LLFolderView* folder_view = inventory_list->getRootFolder();
+
+ LLFolderViewItem* item = folder_view->getItemByID(obj_id);
+ if (!item)
+ return NULL;
+
+ LLAccordionCtrlTab* tab = getChild<LLAccordionCtrlTab>(tab_name);
+ if (!tab->isExpanded())
+ {
+ tab->changeOpenClose(false);
+ }
+
+ folder_view->setSelection(item, FALSE, take_keyboard_focus);
+
+ LLAccordionCtrl* accordion = getChild<LLAccordionCtrl>("landmarks_accordion");
+ LLRect screen_rc;
+ localRectToScreen(item->getRect(), &screen_rc);
+ accordion->notifyParent(LLSD().with("scrollToShowRect", screen_rc.getValue()));
+
+ return item;
+}
+
void LLLandmarksPanel::updateSortOrder(LLInventoryPanel* panel, bool byDate)
{
if(!panel) return;