summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorypanel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llinventorypanel.cpp')
-rw-r--r--indra/newview/llinventorypanel.cpp56
1 files changed, 55 insertions, 1 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 9141d50829..ca9b942629 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -143,6 +143,7 @@ BOOL LLInventoryPanel::postBuild()
addChild(mScroller);
mScroller->addChild(mFolders);
mFolders->setScrollContainer(mScroller);
+ mFolders->addChild(mFolders->mStatusTextBox);
}
// Set up the callbacks from the inventory we're viewing, and then build everything.
@@ -432,7 +433,26 @@ void LLInventoryPanel::initializeViews()
rebuildViewsFor(mStartFolderID);
mViewsInitialized = true;
+
openStartFolderOrMyInventory();
+
+ // Special case for new user login
+ if (gAgent.isFirstLogin())
+ {
+ // Auto open the user's library
+ LLFolderViewFolder* lib_folder = mFolders->getFolderByID(gInventory.getLibraryRootFolderID());
+ if (lib_folder)
+ {
+ lib_folder->setOpen(TRUE);
+ }
+
+ // Auto close the user's my inventory folder
+ LLFolderViewFolder* my_inv_folder = mFolders->getFolderByID(gInventory.getRootFolderID());
+ if (my_inv_folder)
+ {
+ my_inv_folder->setOpenArrangeRecursively(FALSE, LLFolderViewFolder::RECURSE_DOWN);
+ }
+ }
}
void LLInventoryPanel::rebuildViewsFor(const LLUUID& id)
@@ -503,6 +523,11 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id)
{
folderp->setHidden(TRUE);
}
+ const LLViewerInventoryCategory *cat = dynamic_cast<LLViewerInventoryCategory *>(objectp);
+ if (cat && getIsHiddenFolderType(cat->getPreferredType()))
+ {
+ folderp->setHidden(TRUE);
+ }
}
}
else
@@ -534,6 +559,12 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id)
if (itemp)
{
itemp->addToFolder(parent_folder, mFolders);
+
+ // Don't add children of hidden folders unless this is the panel's root folder.
+ if (itemp->getHidden() && (id != mStartFolderID))
+ {
+ return;
+ }
}
}
@@ -682,6 +713,14 @@ void LLInventoryPanel::setSelection(const LLUUID& obj_id, BOOL take_keyboard_foc
mFolders->setSelectionByID(obj_id, take_keyboard_focus);
}
+void LLInventoryPanel::setSelectCallback(const LLFolderView::signal_t::slot_type& cb)
+{
+ if (mFolders)
+ {
+ mFolders->setSelectCallback(cb);
+ }
+}
+
void LLInventoryPanel::clearSelection()
{
mFolders->clearSelection();
@@ -751,7 +790,9 @@ bool LLInventoryPanel::beginIMSession()
S32 count = item_array.count();
if(count > 0)
{
- LLFloaterReg::showInstance("communicate");
+ //*TODO by what to replace that?
+ //LLFloaterReg::showInstance("communicate");
+
// create the session
LLAvatarTracker& at = LLAvatarTracker::instance();
LLUUID id;
@@ -925,3 +966,16 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open)
return NULL;
}
+
+void LLInventoryPanel::addHideFolderType(LLFolderType::EType folder_type)
+{
+ if (!getIsHiddenFolderType(folder_type))
+ {
+ mHiddenFolderTypes.push_back(folder_type);
+ }
+}
+
+BOOL LLInventoryPanel::getIsHiddenFolderType(LLFolderType::EType folder_type) const
+{
+ return (std::find(mHiddenFolderTypes.begin(), mHiddenFolderTypes.end(), folder_type) != mHiddenFolderTypes.end());
+}