summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorCho <cho@lindenlab.com>2014-04-29 00:08:06 +0100
committerCho <cho@lindenlab.com>2014-04-29 00:08:06 +0100
commitbd3ef14552886b30b3cfafa7e7a89553492af8c3 (patch)
tree57d384f1d5c1606a957c0e3c65b3587593c8fd2d /indra
parent6cc318fda28a878186d35c79bf5474d4d1ac66d3 (diff)
Got experience picker working again for ACME-1420
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfloaterexperiencepicker.cpp20
-rw-r--r--indra/newview/llfloaterexperiencepicker.h11
-rw-r--r--indra/newview/llpanelexperiencelisteditor.cpp4
3 files changed, 11 insertions, 24 deletions
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<LLFloaterExperiencePicker>("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<LLPanelExperiencePicker*>(getChild<LLUICtrl>("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<void (const uuid_vec_t&)> select_callback_t;
// filter function for experiences, return true if the experience should be hidden.
typedef boost::function<bool (const LLSD&)> filter_function;
typedef std::vector<filter_function> 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 <class IT>
- 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 <LLView> 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<LLFloaterExperiencePicker>();
}
}