diff options
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 15 | ||||
-rw-r--r-- | indra/newview/llinventorypanel.h | 5 |
2 files changed, 8 insertions, 12 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index c29638ee78..3b8aa3f296 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -305,6 +305,11 @@ void LLInventoryPanel::initFolderRoot() mFolderRoot.get()->setFollowsAll(); mFolderRoot.get()->addChild(mFolderRoot.get()->mStatusTextBox); + if (mSelectionCallback) + { + mFolderRoot.get()->setSelectCallback(mSelectionCallback); + } + // Set up the callbacks from the inventory we're viewing, and then build everything. mInventoryObserver = new LLInventoryPanelObserver(this); mInventory->addObserver(mInventoryObserver); @@ -1433,6 +1438,7 @@ void LLInventoryPanel::setSelectCallback(const boost::function<void (const std:: { mFolderRoot.get()->setSelectCallback(cb); } + mSelectionCallback = cb; } void LLInventoryPanel::clearSelection() @@ -2135,15 +2141,6 @@ LLInventorySingleFolderPanel::~LLInventorySingleFolderPanel() { } -void LLInventorySingleFolderPanel::setSelectCallback(const boost::function<void(const std::deque<LLFolderViewItem*>& items, BOOL user_action)>& cb) -{ - if (mFolderRoot.get()) - { - mFolderRoot.get()->setSelectCallback(cb); - mSelectionCallback = cb; - } -} - void LLInventorySingleFolderPanel::initFromParams(const Params& p) { mFolderID = gInventory.getRootFolderID(); diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index f4f6940743..8d05fcb8b9 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -368,6 +368,8 @@ protected: virtual LLFolderView * createFolderRoot(LLUUID root_id ); virtual LLFolderViewFolder* createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop); virtual LLFolderViewItem* createFolderViewItem(LLInvFVBridge * bridge); + + boost::function<void(const std::deque<LLFolderViewItem*>& items, BOOL user_action)> mSelectionCallback; private: // buildViewsTree does not include some checks and is meant // for recursive use, use buildNewViews() for first call @@ -425,8 +427,6 @@ public: std::list<LLUUID> getNavBackwardList() { return mBackwardFolders; } std::list<LLUUID> getNavForwardList() { return mForwardFolders; } - void setSelectCallback(const boost::function<void (const std::deque<LLFolderViewItem*>& items, BOOL user_action)>& cb); - typedef boost::function<void()> root_changed_callback_t; boost::signals2::connection setRootChangedCallback(root_changed_callback_t cb); @@ -435,7 +435,6 @@ protected: ~LLInventorySingleFolderPanel(); void updateSingleFolderRoot(); - boost::function<void(const std::deque<LLFolderViewItem*>& items, BOOL user_action)> mSelectionCallback; friend class LLUICtrlFactory; LLUUID mFolderID; |