From bd3ef14552886b30b3cfafa7e7a89553492af8c3 Mon Sep 17 00:00:00 2001 From: Cho Date: Tue, 29 Apr 2014 00:08:06 +0100 Subject: Got experience picker working again for ACME-1420 --- indra/newview/llfloaterexperiencepicker.cpp | 20 +++++++++----------- indra/newview/llfloaterexperiencepicker.h | 11 +---------- indra/newview/llpanelexperiencelisteditor.cpp | 4 +--- 3 files changed, 11 insertions(+), 24 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterexperiencepicker.cpp b/indra/newview/llfloaterexperiencepicker.cpp index 4a484463e8..60a9bdfd98 100644 --- a/indra/newview/llfloaterexperiencepicker.cpp +++ b/indra/newview/llfloaterexperiencepicker.cpp @@ -1,4 +1,4 @@ -/** +/** * @file llfloaterexperiencepicker.cpp * @brief Implementation of llfloaterexperiencepicker * @author dolphin@lindenlab.com @@ -44,7 +44,7 @@ #include "lldraghandle.h" #include "llpanelexperiencepicker.h" -LLFloaterExperiencePicker* LLFloaterExperiencePicker::show( select_callback_t callback, const LLUUID& key, BOOL allow_multiple, BOOL closeOnSelect, LLView * frustumOrigin ) +LLFloaterExperiencePicker* LLFloaterExperiencePicker::show( select_callback_t callback, const LLUUID& key, BOOL allow_multiple, BOOL close_on_select, filter_list filters, LLView * frustumOrigin ) { LLFloaterExperiencePicker* floater = LLFloaterReg::showTypedInstance("experience_search", key); @@ -54,9 +54,13 @@ LLFloaterExperiencePicker* LLFloaterExperiencePicker::show( select_callback_t ca return NULL; } - floater->mSelectionCallback = callback; - floater->mCloseOnSelect = closeOnSelect; - floater->mAllowMultiple = allow_multiple; + if (floater->mSearchPanel) + { + floater->mSearchPanel->mSelectionCallback = callback; + floater->mSearchPanel->mCloseOnSelect = close_on_select; + floater->mSearchPanel->setAllowMultiple(allow_multiple); + floater->mSearchPanel->addFilters(filters.begin(), filters.end()); + } if(frustumOrigin) { @@ -150,11 +154,5 @@ LLFloaterExperiencePicker::~LLFloaterExperiencePicker() BOOL LLFloaterExperiencePicker::postBuild() { mSearchPanel = static_cast(getChild("panel_experience_search")); - - mSearchPanel->mSelectionCallback = mSelectionCallback; - mSearchPanel->mCloseOnSelect = mCloseOnSelect; - mSearchPanel->setAllowMultiple(mAllowMultiple); - mSearchPanel->addFilters(mFilters.begin(), mFilters.end()); - return LLFloater::postBuild(); } diff --git a/indra/newview/llfloaterexperiencepicker.h b/indra/newview/llfloaterexperiencepicker.h index 22bfb64ba7..29054a57db 100644 --- a/indra/newview/llfloaterexperiencepicker.h +++ b/indra/newview/llfloaterexperiencepicker.h @@ -37,33 +37,24 @@ class LLPanelExperiencePicker; class LLFloaterExperiencePicker : public LLFloater { public: - friend class LLExperiencePickerResponder; typedef boost::function select_callback_t; // filter function for experiences, return true if the experience should be hidden. typedef boost::function filter_function; typedef std::vector filter_list; - static LLFloaterExperiencePicker* show( select_callback_t callback, const LLUUID& key, BOOL allow_multiple, BOOL closeOnSelect, LLView * frustumOrigin); + static LLFloaterExperiencePicker* show( select_callback_t callback, const LLUUID& key, BOOL allow_multiple, BOOL close_on_select, filter_list filters, LLView * frustumOrigin); LLFloaterExperiencePicker(const LLSD& key); virtual ~LLFloaterExperiencePicker(); BOOL postBuild(); - template - void addFilters(IT begin, IT end){mFilters.insert(mFilters.end(), begin, end);} - virtual void draw(); private: LLPanelExperiencePicker* mSearchPanel; - select_callback_t mSelectionCallback; - filter_list mFilters; - bool mAllowMultiple; - bool mCloseOnSelect; - void drawFrustum(); LLHandle mFrustumOrigin; F32 mContextConeOpacity; diff --git a/indra/newview/llpanelexperiencelisteditor.cpp b/indra/newview/llpanelexperiencelisteditor.cpp index a4ceb3830c..7a7be32b96 100644 --- a/indra/newview/llpanelexperiencelisteditor.cpp +++ b/indra/newview/llpanelexperiencelisteditor.cpp @@ -107,9 +107,7 @@ void LLPanelExperienceListEditor::onAdd() { mKey.generateNewID(); - LLFloaterExperiencePicker* picker=LLFloaterExperiencePicker::show(boost::bind(&LLPanelExperienceListEditor::addExperienceIds, this, _1), mKey, FALSE, TRUE, mAdd); - picker->addFilters(mFilters.begin(), mFilters.end()); - + LLFloaterExperiencePicker* picker=LLFloaterExperiencePicker::show(boost::bind(&LLPanelExperienceListEditor::addExperienceIds, this, _1), mKey, FALSE, TRUE, mFilters, mAdd); mPicker = picker->getDerivedHandle(); } } -- cgit v1.2.3