SL-19686 Fix selection callback

master
Andrey Kleshchev 2023-06-07 21:56:32 +03:00
parent 662370ddea
commit c5979e11b6
2 changed files with 8 additions and 12 deletions

View File

@ -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();

View File

@ -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;