summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelexperiencepicker.cpp
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2015-10-19 12:03:08 -0700
committerRider Linden <rider@lindenlab.com>2015-10-19 12:03:08 -0700
commit53b947e0397d6b88fdc6c0a10144e5a6d02a67d3 (patch)
tree38c94f216386ba6653e8152d9db0198807f4f2cc /indra/newview/llpanelexperiencepicker.cpp
parented7963bad14abd628fa60d0d5baf357f1858c48c (diff)
parent4312629e7c5749b86add9d42e6e550602f34dbf5 (diff)
Merge from viewer release.
Diffstat (limited to 'indra/newview/llpanelexperiencepicker.cpp')
-rw-r--r--indra/newview/llpanelexperiencepicker.cpp42
1 files changed, 41 insertions, 1 deletions
diff --git a/indra/newview/llpanelexperiencepicker.cpp b/indra/newview/llpanelexperiencepicker.cpp
index dcc5f4f234..a7f2dbafa2 100644
--- a/indra/newview/llpanelexperiencepicker.cpp
+++ b/indra/newview/llpanelexperiencepicker.cpp
@@ -42,6 +42,7 @@
#include "llviewercontrol.h"
#include "llfloater.h"
#include "lltrans.h"
+#include <boost/regex.hpp>
#define BTN_FIND "find"
#define BTN_OK "ok_btn"
@@ -112,6 +113,46 @@ void LLPanelExperiencePicker::editKeystroke( class LLLineEditor* caller, void* u
void LLPanelExperiencePicker::onBtnFind()
{
mCurrentPage=1;
+ boost::cmatch what;
+ std::string text = getChild<LLUICtrl>(TEXT_EDIT)->getValue().asString();
+ const boost::regex expression("secondlife:///app/experience/[\\da-f-]+/profile");
+ if (boost::regex_match(text.c_str(), what, expression))
+ {
+ LLURI uri(text);
+ LLSD path_array = uri.pathArray();
+ if (path_array.size() == 4)
+ {
+ std::string exp_id = path_array.get(2).asString();
+ LLUUID experience_id(exp_id);
+ if (!experience_id.isNull())
+ {
+ const LLSD& experience_details = LLExperienceCache::instance().get(experience_id);
+ if(!experience_details.isUndefined())
+ {
+ std::string experience_name_string = experience_details[LLExperienceCache::NAME].asString();
+ if(!experience_name_string.empty())
+ {
+ getChild<LLUICtrl>(TEXT_EDIT)->setValue(experience_name_string);
+ }
+ }
+ else
+ {
+ getChild<LLScrollListCtrl>(LIST_RESULTS)->deleteAllItems();
+ getChild<LLScrollListCtrl>(LIST_RESULTS)->setCommentText(getString("searching"));
+
+ getChildView(BTN_OK)->setEnabled(FALSE);
+ getChildView(BTN_PROFILE)->setEnabled(FALSE);
+
+ getChildView(BTN_RIGHT)->setEnabled(FALSE);
+ getChildView(BTN_LEFT)->setEnabled(FALSE);
+ LLExperienceCache::instance().get(experience_id, boost::bind(&LLPanelExperiencePicker::onBtnFind, this));
+ return;
+ }
+ }
+ }
+ }
+
+
find();
}
@@ -155,7 +196,6 @@ void LLPanelExperiencePicker::findResults(LLHandle<LLPanelExperiencePicker> hpar
}
}
-
bool LLPanelExperiencePicker::isSelectButtonEnabled()
{
LLScrollListCtrl* list=getChild<LLScrollListCtrl>(LIST_RESULTS);