diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 5c42f9145d751aba95a179edd989902518f14830..6afd76b44d80e094314d7f31755bb7b8d0deccf1 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -113,6 +113,7 @@ set(viewer_SOURCE_FILES bdfloaterposer.cpp bdfloaterposecreator.cpp bdposingmotion.cpp + fsfloatersearch.cpp fslslpreproc.cpp fslslpreprocviewer.cpp gltfscenemanager.cpp @@ -264,7 +265,6 @@ set(viewer_SOURCE_FILES llfloatercreatelandmark.cpp llfloaterdeleteprefpreset.cpp llfloaterdestinations.cpp - llfloaterdirectory.cpp llfloaterdisplayname.cpp llfloatereditenvironmentbase.cpp llfloatereditextdaycycle.cpp @@ -499,7 +499,6 @@ set(viewer_SOURCE_FILES llpaneleditwearable.cpp llpanelemojicomplete.cpp llpanelenvironment.cpp - llpaneleventinfo.cpp llpanelexperiencelisteditor.cpp llpanelexperiencelog.cpp llpanelexperiencepicker.cpp @@ -551,14 +550,6 @@ set(viewer_SOURCE_FILES llpanelprofilelegacy.cpp llpanelprofileclassifieds.cpp llpanelprofilepicks.cpp - llpanelsearchbase.cpp - llpanelsearchclassifieds.cpp - llpanelsearchevents.cpp - llpanelsearchgroups.cpp - llpanelsearchlandsales.cpp - llpanelsearchpeople.cpp - llpanelsearchplaces.cpp - llpanelsearchweb.cpp llpanelsnapshot.cpp llpanelsnapshotinventory.cpp llpanelsnapshotlocal.cpp @@ -859,6 +850,7 @@ set(viewer_HEADER_FILES bdfloaterposer.h bdfloaterposecreator.h bdposingmotion.h + fsfloatersearch.h fslslpreproc.h fslslpreprocviewer.h gltfscenemanager.h @@ -1011,7 +1003,6 @@ set(viewer_HEADER_FILES llfloatercreatelandmark.h llfloaterdeleteprefpreset.h llfloaterdestinations.h - llfloaterdirectory.h llfloaterdisplayname.h llfloatereditenvironmentbase.h llfloatereditextdaycycle.h @@ -1238,7 +1229,6 @@ set(viewer_HEADER_FILES llpaneleditwearable.h llpanelemojicomplete.h llpanelenvironment.h - llpaneleventinfo.h llpanelexperiencelisteditor.h llpanelexperiencelog.h llpanelexperiencepicker.h @@ -1291,14 +1281,6 @@ set(viewer_HEADER_FILES llpanelprofilelegacy.h llpanelprofileclassifieds.h llpanelprofilepicks.h - llpanelsearchbase.h - llpanelsearchclassifieds.h - llpanelsearchevents.h - llpanelsearchgroups.h - llpanelsearchlandsales.h - llpanelsearchpeople.h - llpanelsearchplaces.h - llpanelsearchweb.h llpanelsnapshot.h llpanelteleporthistory.h llpaneltiptoast.h diff --git a/indra/newview/app_settings/settings_alchemy.xml b/indra/newview/app_settings/settings_alchemy.xml index acf2676b9667a71ad30da0941adc7347c7f93e10..d33b1964a951925dc685c2a9bfa8d764323df227 100644 --- a/indra/newview/app_settings/settings_alchemy.xml +++ b/indra/newview/app_settings/settings_alchemy.xml @@ -2220,5 +2220,27 @@ <key>Value</key> <integer>0</integer> </map> + <key>FSLastSearchTab</key> + <map> + <key>Comment</key> + <string>Last selected tab in search window</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>FSLegacySearchActionOnTeleport</key> + <map> + <key>Comment</key> + <string>Controls what action Legacy Search should take when teleporting: 0 = No effect, 1 = Close floater, 2 Minimise floater</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>U32</string> + <key>Value</key> + <integer>1</integer> + </map> </map> </llsd> diff --git a/indra/newview/fsfloatersearch.cpp b/indra/newview/fsfloatersearch.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b881c2142ba8f10ebee90b9d0d02d12cfbb942c3 --- /dev/null +++ b/indra/newview/fsfloatersearch.cpp @@ -0,0 +1,3144 @@ +/** + * @file fsfloatersearch.cpp + * @brief Firestorm Search Floater + * + * $LicenseInfo:firstyear=2012&license=fsviewerlgpl$ + * Phoenix Firestorm Viewer Source Code + * Copyright (C) 2012, Cinder Roxley <cinder.roxley@phoenixviewer.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * The Phoenix Firestorm Project, Inc., 1831 Oakwood Drive, Fairmont, Minnesota 56031-3225 USA + * http://www.firestormviewer.org + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "fsfloatersearch.h" + +#include "lldispatcher.h" +#include "llagent.h" +#include "llavataractions.h" +#include "llavatarname.h" +#include "llavatarnamecache.h" +#include "llavatarpropertiesprocessor.h" +#include "llclassifiedflags.h" +#include "llclassifiedinfo.h" +#include "llcombobox.h" +#include "lldateutil.h" +#include "lleventflags.h" +#include "lleventnotifier.h" +#include "llfloaterreg.h" +#include "llfloaterworldmap.h" +#include "llgroupactions.h" +#include "llgroupmgr.h" +#include "llloadingindicator.h" +#include "lllogininstance.h" +#include "llnotificationsutil.h" +#include "llpanelclassified.h" +#include "llparcel.h" +#include "llproductinforequest.h" +#include "llqueryflags.h" +#include "llregionhandle.h" +#include "llremoteparcelrequest.h" +#include "lltimer.h" +#include "lltrans.h" +#include "llviewercontrol.h" +#include "llviewergenericmessage.h" +#include "llviewernetwork.h" +#include "llviewerregion.h" +#include "llworldmapmessage.h" +#include "message.h" +#include <boost/tokenizer.hpp> +#include <boost/algorithm/string.hpp> +#include <string> + +static const S32 MIN_SEARCH_STRING_SIZE = 2; +static const S32 RESULT_PAGE_SIZE = 100; + +std::string filterShortWords(std::string query_string); +void fillSearchComboBox(LLSearchComboBox* search_combo); + +//////////////////////////////////////// +// Observer Classes // +//////////////////////////////////////// + +class FSSearchRemoteParcelInfoObserver : public LLRemoteParcelInfoObserver +{ +public: + FSSearchRemoteParcelInfoObserver(FSFloaterSearch* floater, bool for_events) : LLRemoteParcelInfoObserver(), + mParent(floater), + mForEvents(for_events) + {} + + ~FSSearchRemoteParcelInfoObserver() + { + // remove any in-flight observers + std::set<LLUUID>::iterator it; + for (it = mParcelIDs.begin(); it != mParcelIDs.end(); ++it) + { + const LLUUID &id = *it; + LLRemoteParcelInfoProcessor::getInstance()->removeObserver(id, this); + } + mParcelIDs.clear(); + } + + /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data) + { + if (mParent) + { + if (mForEvents) + { + mParent->displayEventParcelImage(parcel_data); + } + else + { + mParent->displayParcelDetails(parcel_data); + } + } + mParcelIDs.erase(parcel_data.parcel_id); + LLRemoteParcelInfoProcessor::getInstance()->removeObserver(parcel_data.parcel_id, this); + } + + /*virtual*/ void setParcelID(const LLUUID& parcel_id) + { + if (!parcel_id.isNull()) + { + mParcelIDs.insert(parcel_id); + LLRemoteParcelInfoProcessor::getInstance()->addObserver(parcel_id, this); + LLRemoteParcelInfoProcessor::getInstance()->sendParcelInfoRequest(parcel_id); + } + } + + /*virtual*/ void setErrorStatus(S32 status, const std::string& reason) + { + LL_WARNS("Search") << "Can't complete remote parcel request. Http Status: " << status << ". Reason : " << reason << LL_ENDL; + } +private: + std::set<LLUUID> mParcelIDs; + FSFloaterSearch* mParent; + bool mForEvents; +}; + +///// Avatar Properties Observer ///// + +class FSSearchAvatarPropertiesObserver : public LLAvatarPropertiesObserver +{ +public: + FSSearchAvatarPropertiesObserver(FSFloaterSearch* floater) : LLAvatarPropertiesObserver(), + mParent(floater) + {} + + ~FSSearchAvatarPropertiesObserver() + { + // remove any in-flight observers + std::set<LLUUID>::iterator it; + for (it = mAvatarIDs.begin(); it != mAvatarIDs.end(); ++it) + { + const LLUUID &id = *it; + LLAvatarPropertiesProcessor::getInstance()->removeObserver(id, this); + } + mAvatarIDs.clear(); + } + + void processProperties(void* data, EAvatarProcessorType type) + { + if (APT_PROPERTIES == type) + { + LLAvatarData* avatar_data = static_cast<LLAvatarData*>(data); + if (avatar_data) + { + mParent->displayAvatarDetails(avatar_data); + LLAvatarPropertiesProcessor::getInstance()->removeObserver(avatar_data->avatar_id, this); + } + } + if (APT_CLASSIFIED_INFO == type) + { + LLAvatarClassifiedInfo* c_info = static_cast<LLAvatarClassifiedInfo*>(data); + if (c_info) + { + mParent->displayClassifiedDetails(c_info); + LLAvatarPropertiesProcessor::getInstance()->removeObserver(c_info->classified_id, this); + std::string url = gAgent.getRegionCapability("SearchStatRequest"); + if (!url.empty()) + { + LL_INFOS("Search") << "Classified stat request via capability" << LL_ENDL; + LLSD body; + body["classified_id"] = c_info->classified_id; + LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpPost(url, body, boost::bind(&LLPanelClassifiedInfo::handleSearchStatResponse, c_info->classified_id, _1)); + } + } + } + } +private: + std::set<LLUUID> mAvatarIDs; + FSFloaterSearch* mParent; +}; + +///// Group Info Observer ///// + +class FSSearchGroupInfoObserver : public LLGroupMgrObserver +{ +public: + FSSearchGroupInfoObserver(const LLUUID& group_id, FSFloaterSearch* parent) : + LLGroupMgrObserver(group_id), + mParent(parent) + { + LLGroupMgr* groupmgr = LLGroupMgr::getInstance(); + if (!group_id.isNull() && groupmgr) + { + groupmgr->addObserver(this); + mID = group_id; + groupmgr->sendGroupPropertiesRequest(group_id); + } + } + + ~FSSearchGroupInfoObserver() + { + LLGroupMgr::getInstance()->removeObserver(this); + } + + void changed(LLGroupChange gc) + { + if (gc == GC_PROPERTIES) + { + LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(mID); + mParent->displayGroupDetails(group_data); + LLGroupMgr::getInstance()->removeObserver(this); + } + } +private: + FSFloaterSearch* mParent; + LLUUID mID; +}; + +///// Silly Classified Clickthrough Class ///// +class FSDispatchClassifiedClickThrough : public LLDispatchHandler +{ +public: + virtual bool operator()( + const LLDispatcher* dispatcher, + const std::string& key, + const LLUUID& invoice, + const sparam_t& strings) + { + if (strings.size() != 4) return false; + LLUUID classified_id(strings[0]); + S32 teleport_clicks = atoi(strings[1].c_str()); + S32 map_clicks = atoi(strings[2].c_str()); + S32 profile_clicks = atoi(strings[3].c_str()); + + LLPanelClassifiedInfo::setClickThrough( + classified_id, teleport_clicks, map_clicks, profile_clicks, false); + + return true; + } +}; +static FSDispatchClassifiedClickThrough sClassifiedClickThrough; + +SearchQuery::SearchQuery() +: category("category", "") +, query("query") +{} + +//////////////////////////////////////// +// The floater itself // +//////////////////////////////////////// + +FSFloaterSearch::FSFloaterSearch(const Params& key) +: LLFloater(key) +{ + mRemoteParcelObserver = new FSSearchRemoteParcelInfoObserver(this, false); + mRemoteParcelEventLocationObserver = new FSSearchRemoteParcelInfoObserver(this, true); + mAvatarPropertiesObserver = new FSSearchAvatarPropertiesObserver(this); +} + +FSFloaterSearch::~FSFloaterSearch() +{ + delete mRemoteParcelObserver; + delete mRemoteParcelEventLocationObserver; + delete mAvatarPropertiesObserver; + gGenericDispatcher.addHandler("classifiedclickthrough", nullptr); +} + +// virtual +void FSFloaterSearch::onOpen(const LLSD& key) +{ + Params p(key); + mPanelWeb->loadURL(p.search); + if (key.has("query")) + { + mTabContainer->selectTabPanel(mPanelWeb); + } + else if (key.has("tab") && key["tab"].asString() == "groups") + { + mTabContainer->selectTabPanel(mPanelGroups); + } + + FSSearchPanelBase* current_panel = dynamic_cast<FSSearchPanelBase*>(mTabContainer->getCurrentPanel()); + if (current_panel) + { + current_panel->focusDefaultElement(); + } +} + +//virtual +void FSFloaterSearch::onClose(bool app_quitting) +{ + if (mTabContainer) + { + gSavedSettings.setS32("FSLastSearchTab", mTabContainer->getCurrentPanelIndex()); + } +} + +BOOL FSFloaterSearch::postBuild() +{ + childSetAction("people_profile_btn", boost::bind(&FSFloaterSearch::onBtnPeopleProfile, this)); + childSetAction("people_message_btn", boost::bind(&FSFloaterSearch::onBtnPeopleIM, this)); + childSetAction("people_friend_btn", boost::bind(&FSFloaterSearch::onBtnPeopleFriend, this)); + childSetAction("group_profile_btn", boost::bind(&FSFloaterSearch::onBtnGroupProfile, this)); + childSetAction("group_message_btn", boost::bind(&FSFloaterSearch::onBtnGroupChat, this)); + childSetAction("group_join_btn", boost::bind(&FSFloaterSearch::onBtnGroupJoin, this)); + childSetAction("event_reminder_btn", boost::bind(&FSFloaterSearch::onBtnEventReminder, this)); + childSetAction("teleport_btn", boost::bind(&FSFloaterSearch::onBtnTeleport, this)); + childSetAction("map_btn", boost::bind(&FSFloaterSearch::onBtnMap, this)); + resetVerbs(); + + mPanelPeople = findChild<FSPanelSearchPeople>("panel_ls_people"); + mPanelGroups = findChild<FSPanelSearchGroups>("panel_ls_groups"); + mPanelPlaces = findChild<FSPanelSearchPlaces>("panel_ls_places"); + mPanelEvents = findChild<FSPanelSearchEvents>("panel_ls_events"); + mPanelLand = findChild<FSPanelSearchLand>("panel_ls_land"); + mPanelClassifieds = findChild<FSPanelSearchClassifieds>("panel_ls_classifieds"); + mPanelWeb = findChild<FSPanelSearchWeb>("panel_ls_web"); + + mDetailsPanel = getChild<LLPanel>("panel_ls_details"); + mDetailTitle = getChild<LLTextEditor>("title"); + mDetailDesc = getChild<LLTextEditor>("desc"); + mDetailAux1 = getChild<LLTextEditor>("aux1"); + mDetailAux2 = getChild<LLTextEditor>("aux2"); + mDetailLocation = getChild<LLTextEditor>("location"); + mDetailSnapshot = getChild<LLTextureCtrl>("snapshot"); + mDetailSnapshotParcel = getChild<LLTextureCtrl>("snapshot_parcel"); + mDetailMaturity = getChild<LLIconCtrl>("maturity_icon"); + mTabContainer = getChild<LLTabContainer>("ls_tabs"); + + mTabContainer->setCommitCallback(boost::bind(&FSFloaterSearch::onTabChange, this)); + + flushDetails(); + + mDetailsPanel->setVisible(false); + + mHasSelection = false; + + if (!mTabContainer->selectTab(gSavedSettings.getS32("FSLastSearchTab"))) + { + mTabContainer->selectFirstTab(); + } + + return TRUE; +} + +void FSFloaterSearch::onTabChange() +{ + LLPanel* active_panel = mTabContainer->getCurrentPanel(); + + if (active_panel == mPanelWeb) + { + mDetailsPanel->setVisible(false); + mPanelWeb->resetFocusOnLoad(); + } + else + { + mDetailsPanel->setVisible(mHasSelection); + } + + if (active_panel == mPanelPeople || active_panel == mPanelGroups) + { + mDetailSnapshotParcel->setVisible(FALSE); + mDetailSnapshot->setVisible(TRUE); + } + else if (active_panel == mPanelPlaces || active_panel == mPanelLand || + active_panel == mPanelEvents || active_panel == mPanelClassifieds) + { + mDetailSnapshot->setVisible(FALSE); + mDetailSnapshotParcel->setVisible(TRUE); + } +} + +//static +template <class T> +T* FSFloaterSearch::getSearchPanel(const std::string& panel_name) +{ + FSFloaterSearch* search_instance = LLFloaterReg::findTypedInstance<FSFloaterSearch>("search"); + if (search_instance && search_instance->mTabContainer) + { + return dynamic_cast<T*>(search_instance->mTabContainer->getPanelByName(panel_name)); + } + else + { + return nullptr; + } +} + +void FSFloaterSearch::onSelectedItem(const LLUUID& selected_item, ESearchCategory type) +{ + if (!selected_item.isNull()) + { + mSelectedID = selected_item; + resetVerbs(); + flushDetails(); + switch (type) + { + case SC_AVATAR: + { + { + LLAvatarPropertiesProcessor::getInstance()->addObserver(selected_item, mAvatarPropertiesObserver); + LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesRequest(selected_item); + } + } + break; + case SC_GROUP: + mGroupPropertiesRequest = new FSSearchGroupInfoObserver(selected_item, this); + break; + case SC_PLACE: + mRemoteParcelObserver->setParcelID(selected_item); + break; + case SC_CLASSIFIED: + LLAvatarPropertiesProcessor::getInstance()->addObserver(selected_item, mAvatarPropertiesObserver); + LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(selected_item); + gGenericDispatcher.addHandler("classifiedclickthrough", &sClassifiedClickThrough); + break; + } + setLoadingProgress(true); + } +} + +void FSFloaterSearch::onSelectedEvent(const S32 selected_event) +{ + resetVerbs(); + flushDetails(); + + gMessageSystem->newMessageFast(_PREHASH_EventInfoRequest); + gMessageSystem->nextBlockFast(_PREHASH_AgentData); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgentID); + gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgentSessionID); + gMessageSystem->nextBlockFast(_PREHASH_EventData); + gMessageSystem->addU32Fast(_PREHASH_EventID, selected_event); + gAgent.sendReliableMessage(); +} + +void FSFloaterSearch::displayParcelDetails(const LLParcelData& parcel_data) +{ + S32 region_x; + S32 region_y; + S32 region_z; + region_x = ll_round(parcel_data.global_x) % REGION_WIDTH_UNITS; + region_y = ll_round(parcel_data.global_y) % REGION_WIDTH_UNITS; + region_z = ll_round(parcel_data.global_z); + // HACK: Flag 0x2 == adult region, + // Flag 0x1 == mature region, otherwise assume PG + if (parcel_data.flags & 0x2) + { + mDetailMaturity->setValue("Parcel_R_Dark"); + } + else if (parcel_data.flags & 0x1) + { + mDetailMaturity->setValue("Parcel_M_Dark"); + } + else + { + mDetailMaturity->setValue("Parcel_PG_Dark"); + } + + LLStringUtil::format_map_t map; + map["DWELL"] = llformat("%.0f", (F64)parcel_data.dwell); + map["AREA"] = llformat("%d m²", parcel_data.actual_area); + map["LOCATION"] = llformat("%s (%d, %d, %d)", parcel_data.sim_name.c_str(), region_x, region_y, region_z); + + mParcelGlobal = LLVector3d(parcel_data.global_x, parcel_data.global_y, parcel_data.global_z); + mDetailsPanel->setVisible(mTabContainer->getCurrentPanel()->getName() == "panel_ls_places" || mTabContainer->getCurrentPanel()->getName() == "panel_ls_land"); + mHasSelection = true; + mDetailMaturity->setVisible(true); + mDetailTitle->setValue(parcel_data.name); + mDetailDesc->setValue(parcel_data.desc); + mDetailAux1->setValue(getString("string.traffic", map)); + mDetailAux2->setValue(getString("string.area", map)); + mDetailLocation->setValue(getString("string.location", map)); + mDetailSnapshotParcel->setValue(parcel_data.snapshot_id); + childSetVisible("teleport_btn", true); + childSetVisible("map_btn", true); + setLoadingProgress(false); +} + +void FSFloaterSearch::displayAvatarDetails(LLAvatarData*& avatar_data) +{ + if (avatar_data) + { + LLStringUtil::format_map_t map; + map["AGE"] = LLDateUtil::ageFromDate(avatar_data->born_on, LLDate::now()); + if (avatar_data->partner_id.notNull()) + { + map["PARTNER"] = LLSLURL("agent", avatar_data->partner_id, "inspect").getSLURLString(); + mDetailAux2->setValue(getString("string.partner", map)); + } + + mDetailsPanel->setVisible(mTabContainer->getCurrentPanel()->getName() == "panel_ls_people"); + mHasSelection = true; + mDetailTitle->setValue(LLTrans::getString("LoadingData")); + mDetailDesc->setValue(avatar_data->about_text); + mDetailSnapshot->setValue(avatar_data->image_id); + mDetailAux1->setValue(getString("string.age", map)); + LLAvatarNameCache::get(avatar_data->avatar_id, boost::bind(&FSFloaterSearch::avatarNameUpdatedCallback,this, _1, _2)); + childSetVisible("people_profile_btn", true); + childSetVisible("people_message_btn", true); + childSetVisible("people_friend_btn", true); + getChildView("people_friend_btn")->setEnabled(!LLAvatarActions::isFriend(avatar_data->avatar_id)); + } +} + +void FSFloaterSearch::displayGroupDetails(LLGroupMgrGroupData*& group_data) +{ + if (group_data) + { + LLStringUtil::format_map_t map; + map["MEMBER_COUNT"] = llformat("%d",group_data->mMemberCount); + map["FOUNDER"] = LLSLURL("agent", group_data->mFounderID, "inspect").getSLURLString(); + + mDetailsPanel->setVisible(mTabContainer->getCurrentPanel()->getName() == "panel_ls_groups"); + mHasSelection = true; + mDetailTitle->setValue(LLTrans::getString("LoadingData")); + mDetailDesc->setValue(group_data->mCharter); + mDetailSnapshot->setValue(group_data->mInsigniaID); + mDetailAux1->setValue(getString("string.members", map)); + mDetailAux2->setValue(getString("string.founder", map)); + LLGroupData agent_gdatap; + bool is_member = gAgent.getGroupData(getSelectedID(),agent_gdatap) || gAgent.isGodlike(); + bool join_btn_enabled = !is_member && group_data->mOpenEnrollment; + childSetVisible("group_profile_btn", true); + childSetVisible("group_message_btn", true); + childSetVisible("group_join_btn", true); + getChildView("group_join_btn")->setEnabled(join_btn_enabled); + getChildView("group_message_btn")->setEnabled(is_member); + gCacheName->getGroup(getSelectedID(), boost::bind(&FSFloaterSearch::groupNameUpdatedCallback, this, _1, _2, _3)); + } +} + +void FSFloaterSearch::displayClassifiedDetails(LLAvatarClassifiedInfo*& c_info) +{ + if (c_info) + { + if (c_info->flags & CLASSIFIED_FLAG_MATURE) + { + mDetailMaturity->setValue("Parcel_M_Dark"); + } + else + { + mDetailMaturity->setValue("Parcel_PG_Dark"); + } + + LLStringUtil::format_map_t map; + map["LISTING_PRICE"] = llformat("L$%d", c_info->price_for_listing); + map["SLURL"] = LLSLURL("parcel", c_info->parcel_id, "about").getSLURLString(); + + mDetailsPanel->setVisible(mTabContainer->getCurrentPanel()->getName() == "panel_ls_classifieds"); + mHasSelection = true; + mDetailMaturity->setVisible(true); + mParcelGlobal = c_info->pos_global; + mDetailTitle->setValue(c_info->name); + mDetailDesc->setValue(c_info->description); + mDetailSnapshotParcel->setValue(c_info->snapshot_id); + mDetailAux1->setValue(getString("string.listing_price", map)); + mDetailLocation->setValue(getString("string.slurl", map)); + childSetVisible("teleport_btn", true); + childSetVisible("map_btn", true); + setLoadingProgress(false); + } +} + +void FSFloaterSearch::displayEventDetails(U32 eventId, F64 eventEpoch, const std::string& eventDateStr, const std::string &eventName, const std::string &eventDesc, const std::string &simName, U32 eventDuration, U32 eventFlags, U32 eventCover, LLVector3d eventGlobalPos) +{ + if (eventFlags == EVENT_FLAG_ADULT) + { + mDetailMaturity->setValue("Parcel_R_Dark"); + } + else if (eventFlags == EVENT_FLAG_MATURE) + { + mDetailMaturity->setValue("Parcel_M_Dark"); + } + else + { + mDetailMaturity->setValue("Parcel_PG_Dark"); + } + + S32 region_x; + S32 region_y; + S32 region_z; + region_x = (S64)ll_round(eventGlobalPos.mdV[VX]) % REGION_WIDTH_UNITS; + region_y = (S64)ll_round(eventGlobalPos.mdV[VY]) % REGION_WIDTH_UNITS; + region_z = (S32)ll_round(eventGlobalPos.mdV[VZ]); + LLStringUtil::format_map_t map; + map["DURATION"] = llformat("%d:%.2d", eventDuration / 60, eventDuration % 60); + map["LOCATION"] = llformat("%s (%d, %d, %d)", simName.c_str(), region_x, region_y, region_z); + if (eventCover > 0) + { + map["COVERCHARGE"] = llformat("L$%d", eventCover); + mDetailAux2->setValue(getString("string.covercharge", map)); + } + + mParcelGlobal = eventGlobalPos; + mEventID = eventId; + mDetailsPanel->setVisible(mTabContainer->getCurrentPanel()->getName() == "panel_ls_events"); + mHasSelection = true; + mDetailMaturity->setVisible(true); + mDetailTitle->setValue(eventName); + mDetailDesc->setValue(eventDesc); + mDetailAux1->setValue(getString("string.duration", map)); + mDetailLocation->setValue(getString("string.location", map)); + mDetailSnapshotParcel->setValue(LLUUID::null); + childSetVisible("teleport_btn", true); + childSetVisible("map_btn", true); + childSetVisible("event_reminder_btn", true); + + LLWorldMapMessage::getInstance()->sendNamedRegionRequest(simName, boost::bind(&FSFloaterSearch::regionHandleCallback, this, _1, eventGlobalPos), "", false); +} + +void FSFloaterSearch::regionHandleCallback(U64 region_handle, LLVector3d pos_global) +{ + std::string url = gAgent.getRegionCapability("RemoteParcelRequest"); + if (!url.empty()) + { + auto region_origin = from_region_handle(region_handle); + LLVector3 pos_region(LLVector3(pos_global - region_origin)); + + LLRemoteParcelInfoProcessor::getInstance()->requestRegionParcelInfo(url, + LLUUID::null, pos_region, pos_global, mRemoteParcelEventLocationObserver->getObserverHandle()); + } + else + { + setLoadingProgress(false); + } +} + +void FSFloaterSearch::displayEventParcelImage(const LLParcelData& parcel_data) +{ + mDetailSnapshotParcel->setValue(parcel_data.snapshot_id); + setLoadingProgress(false); +} + +void FSFloaterSearch::avatarNameUpdatedCallback(const LLUUID& id, const LLAvatarName& av_name) +{ + if (id == getSelectedID()) + { + mDetailTitle->setValue(av_name.getCompleteName()); + setLoadingProgress(false); + } + // Otherwise possibly a request for an older selection, ignore it. +} + +void FSFloaterSearch::groupNameUpdatedCallback(const LLUUID& id, const std::string& name, bool is_group) +{ + if (id == getSelectedID()) + { + mDetailTitle->setValue( LLSD(name) ); + setLoadingProgress(false); + } + // Otherwise possibly a request for an older selection, ignore it. +} + +void FSFloaterSearch::setLoadingProgress(bool started) +{ + LLLoadingIndicator* indicator = getChild<LLLoadingIndicator>("loading"); + + indicator->setVisible(started); + + if (started) + { + indicator->start(); + } + else + { + indicator->stop(); + } +} + +void FSFloaterSearch::resetVerbs() +{ + childSetVisible("people_profile_btn", false); + childSetVisible("people_message_btn", false); + childSetVisible("people_friend_btn", false); + childSetVisible("group_profile_btn", false); + childSetVisible("group_message_btn", false); + childSetVisible("group_join_btn", false); + childSetVisible("event_reminder_btn", false); + childSetVisible("teleport_btn", false); + childSetVisible("map_btn", false); +} + +void FSFloaterSearch::flushDetails() +{ + mDetailTitle->setValue(""); + mDetailDesc->setValue(""); + mDetailAux1->setValue(""); + mDetailAux2->setValue(""); + mDetailLocation->setValue(""); + mDetailSnapshot->setValue(LLSD()); + mDetailMaturity->setVisible(false); + mParcelGlobal.setZero(); +} + +void FSFloaterSearch::onBtnPeopleProfile() +{ + LLAvatarActions::showProfile(getSelectedID()); +} + +void FSFloaterSearch::onBtnPeopleIM() +{ + LLAvatarActions::startIM(getSelectedID()); +} + +void FSFloaterSearch::onBtnPeopleFriend() +{ + LLAvatarActions::requestFriendshipDialog(getSelectedID()); +} + +void FSFloaterSearch::onBtnGroupProfile() +{ + LLGroupActions::show(getSelectedID()); +} + +void FSFloaterSearch::onBtnGroupChat() +{ + LLGroupActions::startIM(getSelectedID()); +} + +void FSFloaterSearch::onBtnGroupJoin() +{ + LLGroupActions::join(getSelectedID()); +} + +void FSFloaterSearch::onBtnTeleport() +{ + if (!mParcelGlobal.isExactlyZero()) + { + gAgent.teleportViaLocation(mParcelGlobal); + LLFloaterWorldMap::getInstance()->trackLocation(mParcelGlobal); + /// <FS:CR> What should we do when when we teleport? The default (1) is to close the floater, + /// the user may elect to minimize the floater (2), or to do nothing (any other setting) + static LLCachedControl<U32> teleport_action(gSavedSettings, "FSLegacySearchActionOnTeleport"); + if (teleport_action == 1) + { + closeFloater(); + } + else if (teleport_action == 2) + { + setMinimized(TRUE); + } + } +} + +void FSFloaterSearch::onBtnMap() +{ + if (!mParcelGlobal.isExactlyZero()) + { + LLFloaterWorldMap::getInstance()->trackLocation(mParcelGlobal); + LLFloaterReg::showInstance("world_map", "center"); + } +} + +void FSFloaterSearch::onBtnEventReminder() +{ + gEventNotifier.add(mEventID); +} + +//////////////////////////////////////// +// People Search Panel // +//////////////////////////////////////// + +static LLPanelInjector<FSPanelSearchPeople> t_panel_fs_search_people("panel_ls_people"); + +FSPanelSearchPeople::FSPanelSearchPeople() : FSSearchPanelBase() +, mQueryID(nullptr) +, mStartSearch(0) +, mResultsReceived(0) +, mResultsContent() +, mAvatarNameCallbackConnection() +{ +} + +FSPanelSearchPeople::~FSPanelSearchPeople() +{ + if (mAvatarNameCallbackConnection.connected()) + { + mAvatarNameCallbackConnection.disconnect(); + } +} + +BOOL FSPanelSearchPeople::postBuild() +{ + mSearchComboBox = findChild<LLSearchComboBox>("people_edit"); + mSearchResults = findChild<LLScrollListCtrl>("search_results_people"); + if (mSearchComboBox) + { + mSearchComboBox->setCommitCallback(boost::bind(&FSPanelSearchPeople::onBtnFind, this)); + fillSearchComboBox(mSearchComboBox); + } + if (mSearchResults) + { + mSearchResults->setCommitCallback(boost::bind(&FSPanelSearchPeople::onSelectItem, this)); + mSearchResults->setEnabled(FALSE); + mSearchResults->setCommentText(LLTrans::getString("no_results")); + mSearchResults->setContextMenu(LLScrollListCtrl::MENU_AVATAR); + } + + childSetAction("people_next", boost::bind(&FSPanelSearchPeople::onBtnNext, this)); + childSetAction("people_back", boost::bind(&FSPanelSearchPeople::onBtnBack, this)); + getChildView("people_next")->setEnabled(FALSE); + getChildView("people_back")->setEnabled(FALSE); + + return TRUE; +} + +void FSPanelSearchPeople::focusDefaultElement() +{ + mSearchComboBox->focusTextEntry(); +} + +void FSPanelSearchPeople::find() +{ + std::string text = mSearchComboBox->getSimple(); + boost::trim(text); + if (text.size() <= MIN_SEARCH_STRING_SIZE) + { + mSearchResults->setCommentText(LLTrans::getString("search_short")); + return; + } + + if (LLUUID::validate(text)) + { + LLUUID id(text); + + mSearchResults->deleteAllItems(); + mSearchResults->setCommentText(LLTrans::getString("searching")); + mResultsReceived = 0; + mNumResultsReturned = 0; + + if (mAvatarNameCallbackConnection.connected()) + { + mAvatarNameCallbackConnection.disconnect(); + } + mAvatarNameCallbackConnection = LLAvatarNameCache::get(id, boost::bind(&FSPanelSearchPeople::onAvatarNameCallback, this, _1, _2)); + + return; + } + + LLStringUtil::replaceChar(text, '.', ' '); + + mResultsReceived = 0; + if (mQueryID.notNull()) + { + mQueryID.setNull(); + } + mQueryID.generate(); + + if (mStartSearch < 0) + { + mStartSearch = 0; + } + + gMessageSystem->newMessage("DirFindQuery"); + gMessageSystem->nextBlock("AgentData"); + gMessageSystem->addUUID("AgentID", gAgentID); + gMessageSystem->addUUID("SessionID", gAgentSessionID); + gMessageSystem->nextBlock("QueryData"); + gMessageSystem->addUUID("QueryID", getQueryID()); + gMessageSystem->addString("QueryText", text); + gMessageSystem->addU32("QueryFlags", DFQ_PEOPLE); + gMessageSystem->addS32("QueryStart", mStartSearch); + gAgent.sendReliableMessage(); + LL_DEBUGS("Search") << "Firing off search request: " << getQueryID() << LL_ENDL; + + mSearchResults->deleteAllItems(); + mSearchResults->setCommentText(LLTrans::getString("searching")); + mNumResultsReturned = 0; +} + +void FSPanelSearchPeople::onBtnFind() +{ + std::string text = mSearchComboBox->getSimple(); + if (!text.empty()) + { + LLSearchHistory::getInstance()->addEntry(text); + } + + resetSearch(); + + find(); +} + +void FSPanelSearchPeople::onBtnNext() +{ + mStartSearch += RESULT_PAGE_SIZE; + getChildView("people_back")->setEnabled(TRUE); + + find(); +} + +void FSPanelSearchPeople::onBtnBack() +{ + mStartSearch -= RESULT_PAGE_SIZE; + getChildView("people_back")->setEnabled(mStartSearch > 0); + + find(); +} + +void FSPanelSearchPeople::resetSearch() +{ + mStartSearch = 0; + getChildView("people_back")->setEnabled(FALSE); + getChildView("people_next")->setEnabled(FALSE); +} + +S32 FSPanelSearchPeople::showNextButton(S32 rows) +{ + bool show_next_button = (mResultsReceived > RESULT_PAGE_SIZE); + getChildView("people_next")->setEnabled(show_next_button); + if (show_next_button) + { + rows -= (mResultsReceived - RESULT_PAGE_SIZE); + } + return rows; +} + +void FSPanelSearchPeople::onSelectItem() +{ + if (!mSearchResults) + { + return; + } + FSFloaterSearch* search_instance = LLFloaterReg::findTypedInstance<FSFloaterSearch>("search"); + if (search_instance) + { + search_instance->FSFloaterSearch::onSelectedItem(mSearchResults->getSelectedValue(), FSFloaterSearch::SC_AVATAR); + } +} + +// static +void FSPanelSearchPeople::processSearchReply(LLMessageSystem* msg, void**) +{ + LLUUID query_id; + std::string first_name; + std::string last_name; + LLUUID agent_id; + + msg->getUUIDFast(_PREHASH_QueryData, _PREHASH_QueryID, query_id); + msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); + + // This result is not for us. + if (agent_id != gAgentID) + { + return; + } + LL_DEBUGS("Search") << "received search results - QueryID: " << query_id << " AgentID: " << agent_id << LL_ENDL; + + FSPanelSearchPeople* self = FSFloaterSearch::getSearchPanel<FSPanelSearchPeople>("panel_ls_people"); + + // floater is closed or these are not results from our last request + if (!self || query_id != self->getQueryID()) + { + return; + } + + LLScrollListCtrl* search_results = self->getChild<LLScrollListCtrl>("search_results_people"); + + if (self->mNumResultsReturned++ == 0) + { + search_results->deleteAllItems(); + } + + // Check for status messages + if (msg->getNumberOfBlocks("StatusData")) + { + U32 status; + msg->getU32("StatusData", "Status", status); + if (status & STATUS_SEARCH_PLACES_FOUNDNONE) + { + LLStringUtil::format_map_t map; + map["[TEXT]"] = self->getChild<LLUICtrl>("people_edit")->getValue().asString(); + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("not_found", map)); + return; + } + else if (status & STATUS_SEARCH_PLACES_SHORTSTRING) + { + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("search_short")); + return; + } + else if (status & STATUS_SEARCH_PLACES_BANNEDWORD) + { + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("search_banned")); + return; + } + else if (status & STATUS_SEARCH_PLACES_SEARCHDISABLED) + { + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("search_disabled")); + return; + } + } + + bool found_one = false; + S32 num_new_rows = msg->getNumberOfBlocksFast(_PREHASH_QueryReplies); + if (num_new_rows == 0 && self->mResultsReceived == 0) + { + LLStringUtil::format_map_t map; + map["[TEXT]"] = self->getChild<LLUICtrl>("people_edit")->getValue().asString(); + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("not_found", map)); + } + + self->mResultsReceived += num_new_rows; + num_new_rows = self->showNextButton(num_new_rows); + + for (S32 i = 0; i < num_new_rows; i++) + { + msg->getStringFast( _PREHASH_QueryReplies, _PREHASH_FirstName, first_name, i); + msg->getStringFast( _PREHASH_QueryReplies, _PREHASH_LastName, last_name, i); + msg->getUUIDFast( _PREHASH_QueryReplies, _PREHASH_AgentID, agent_id, i); + //msg->getU8Fast( _PREHASH_QueryReplies, _PREHASH_Online, online, i); + + if (agent_id.isNull()) + { + LL_INFOS("Search") << "Null result returned for QueryID: " << query_id << LL_ENDL; + LLStringUtil::format_map_t map; + map["[TEXT]"] = self->getChild<LLUICtrl>("people_edit")->getValue().asString(); + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("not_found", map)); + } + else + { + LL_DEBUGS("Search") << "Got: " << first_name << " " << last_name << " AgentID: " << agent_id << LL_ENDL; + search_results->setEnabled(TRUE); + found_one = true; + + std::string avatar_name; + avatar_name = LLCacheName::buildFullName(first_name, last_name); + + LLSD content; + LLSD element; + + element["id"] = agent_id; + + element["columns"][0]["column"] = "icon"; + element["columns"][0]["type"] = "icon"; + element["columns"][0]["value"] = "icon_avatar_offline.tga"; + + element["columns"][1]["column"] = "username"; + element["columns"][1]["value"] = avatar_name; + + content["name"] = avatar_name; + + search_results->addElement(element, ADD_BOTTOM); + self->mResultsContent[agent_id.asString()] = content; + } + } + if (found_one) + { + search_results->selectFirstItem(); + search_results->setFocus(TRUE); + self->onSelectItem(); + } +} + +void FSPanelSearchPeople::onAvatarNameCallback(const LLUUID& id, const LLAvatarName& av_name) +{ + if (mAvatarNameCallbackConnection.connected()) + { + mAvatarNameCallbackConnection.disconnect(); + } + + LLScrollListCtrl* search_results = getChild<LLScrollListCtrl>("search_results_people"); + + if (av_name.getAccountName() != "(?\?\?).(?\?\?)") + { + LLSD content; + LLSD data; + data["id"] = id; + + data["columns"][0]["column"] = "icon"; + data["columns"][0]["type"] = "icon"; + data["columns"][0]["value"] = "icon_avatar_offline.tga"; + + data["columns"][1]["name"] = "username"; + data["columns"][1]["value"] = av_name.getUserName(); + + content["name"] = av_name.getUserName(); + + search_results->addElement(data); + + mResultsContent[id.asString()] = content; + mResultsReceived = 1; + mNumResultsReturned = 1; + + search_results->setEnabled(TRUE); + search_results->selectFirstItem(); + search_results->setFocus(TRUE); + onSelectItem(); + } + else + { + LLStringUtil::format_map_t map; + map["[TEXT]"] = getChild<LLUICtrl>("people_edit")->getValue().asString(); + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("not_found", map)); + } +} + +//////////////////////////////////////// +// Groups Search Panel // +//////////////////////////////////////// + +static LLPanelInjector<FSPanelSearchGroups> t_panel_fs_search_groups("panel_ls_groups"); + +FSPanelSearchGroups::FSPanelSearchGroups() : FSSearchPanelBase() +, mQueryID(nullptr) +, mStartSearch(0) +, mResultsReceived(0) +, mResultsContent() +{ +} + +FSPanelSearchGroups::~FSPanelSearchGroups() +{ +} + +BOOL FSPanelSearchGroups::postBuild() +{ + mSearchComboBox = findChild<LLSearchComboBox>("groups_edit"); + mSearchResults = findChild<LLScrollListCtrl>("search_results_groups"); + if (mSearchComboBox) + { + mSearchComboBox->setCommitCallback(boost::bind(&FSPanelSearchGroups::onBtnFind, this)); + fillSearchComboBox(mSearchComboBox); + } + if (mSearchResults) + { + mSearchResults->setCommitCallback(boost::bind(&FSPanelSearchGroups::onSelectItem, this)); + mSearchResults->setEnabled(FALSE); + mSearchResults->setCommentText(LLTrans::getString("no_results")); + } + + childSetAction("groups_next", boost::bind(&FSPanelSearchGroups::onBtnNext, this)); + childSetAction("groups_back", boost::bind(&FSPanelSearchGroups::onBtnBack, this)); + getChildView("groups_next")->setEnabled(FALSE); + getChildView("groups_back")->setEnabled(FALSE); + + return TRUE; +} + +void FSPanelSearchGroups::focusDefaultElement() +{ + mSearchComboBox->focusTextEntry(); +} + +void FSPanelSearchGroups::find() +{ + std::string text = filterShortWords(mSearchComboBox->getSimple()); + if (text.size() == 0) + { + mSearchResults->setCommentText(LLTrans::getString("search_short")); + return; + } + + static LLUICachedControl<bool> inc_pg("ShowPGSims", 1); + static LLUICachedControl<bool> inc_mature("ShowMatureSims", 0); + static LLUICachedControl<bool> inc_adult("ShowAdultSims", 0); + if (!(inc_pg || inc_mature || inc_adult)) + { + LLNotificationsUtil::add("NoContentToSearch"); + return; + } + U32 scope = 0; + if (gAgent.wantsPGOnly()) + { + scope |= DFQ_PG_SIMS_ONLY; + } + bool adult_enabled = gAgent.canAccessAdult(); + bool mature_enabled = gAgent.canAccessMature(); + if (inc_pg) + { + scope |= DFQ_INC_PG; + } + if (inc_mature && mature_enabled) + { + scope |= DFQ_INC_MATURE; + } + if (inc_adult && adult_enabled) + { + scope |= DFQ_INC_ADULT; + } + scope |= DFQ_GROUPS; + + mResultsReceived = 0; + if (mQueryID.notNull()) + { + mQueryID.setNull(); + } + mQueryID.generate(); + + if (mStartSearch < 0) + { + mStartSearch = 0; + } + + gMessageSystem->newMessage("DirFindQuery"); + gMessageSystem->nextBlock("AgentData"); + gMessageSystem->addUUID("AgentID", gAgentID); + gMessageSystem->addUUID("SessionID", gAgentSessionID); + gMessageSystem->nextBlock("QueryData"); + gMessageSystem->addUUID("QueryID", getQueryID()); + gMessageSystem->addString("QueryText", text); + gMessageSystem->addU32("QueryFlags", scope); + gMessageSystem->addS32("QueryStart", mStartSearch); + gAgent.sendReliableMessage(); + LL_DEBUGS("Search") << "Firing off search request: " << getQueryID() << LL_ENDL; + + mSearchResults->deleteAllItems(); + mSearchResults->setCommentText(LLTrans::getString("searching")); + mNumResultsReturned = 0; +} + +void FSPanelSearchGroups::onBtnFind() +{ + std::string text = mSearchComboBox->getSimple(); + if (!text.empty()) + { + LLSearchHistory::getInstance()->addEntry(text); + } + + resetSearch(); + + find(); +} + +void FSPanelSearchGroups::onBtnNext() +{ + mStartSearch += RESULT_PAGE_SIZE; + getChildView("groups_back")->setEnabled(TRUE); + + find(); +} + +void FSPanelSearchGroups::onBtnBack() +{ + mStartSearch -= RESULT_PAGE_SIZE; + getChildView("groups_back")->setEnabled(mStartSearch > 0); + + find(); +} + +void FSPanelSearchGroups::resetSearch() +{ + mStartSearch = 0; + getChildView("groups_back")->setEnabled(FALSE); + getChildView("groups_next")->setEnabled(FALSE); +} + +S32 FSPanelSearchGroups::showNextButton(S32 rows) +{ + bool show_next_button = (mResultsReceived > RESULT_PAGE_SIZE); + getChildView("groups_next")->setEnabled(show_next_button); + if (show_next_button) + { + rows -= (mResultsReceived - RESULT_PAGE_SIZE); + } + return rows; +} + +void FSPanelSearchGroups::onSelectItem() +{ + if (!mSearchResults) + { + return; + } + FSFloaterSearch* search_instance = LLFloaterReg::findTypedInstance<FSFloaterSearch>("search"); + if (search_instance) + { + search_instance->FSFloaterSearch::onSelectedItem(mSearchResults->getSelectedValue(), FSFloaterSearch::SC_GROUP); + } +} + +// static +void FSPanelSearchGroups::processSearchReply(LLMessageSystem* msg, void**) +{ + LLUUID query_id; + LLUUID group_id; + LLUUID agent_id; + std::string group_name; + S32 members; + F32 search_order; + + msg->getUUIDFast( _PREHASH_QueryData, _PREHASH_QueryID, query_id); + msg->getUUIDFast( _PREHASH_AgentData, _PREHASH_AgentID, agent_id); + + // Not for us + if (agent_id != gAgentID) + { + return; + } + LL_DEBUGS("Search") << "received directory request - QueryID: " << query_id << " AgentID: " << agent_id << LL_ENDL; + + FSPanelSearchGroups* self = FSFloaterSearch::getSearchPanel<FSPanelSearchGroups>("panel_ls_groups"); + + // floater is closed or these are not results from our last request + if (!self || query_id != self->mQueryID) + { + return; + } + + LLScrollListCtrl* search_results = self->getChild<LLScrollListCtrl>("search_results_groups"); + + // Clear "Searching" label on first results + if (self->mNumResultsReturned++ == 0) + { + search_results->deleteAllItems(); + } + + // Check for status messages + if (msg->getNumberOfBlocks("StatusData")) + { + U32 status; + msg->getU32("StatusData", "Status", status); + if (status & STATUS_SEARCH_PLACES_FOUNDNONE) + { + LLStringUtil::format_map_t map; + map["[TEXT]"] = self->getChild<LLUICtrl>("groups_edit")->getValue().asString(); + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("not_found", map)); + return; + } + else if(status & STATUS_SEARCH_PLACES_SHORTSTRING) + { + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("search_short")); + return; + } + else if (status & STATUS_SEARCH_PLACES_BANNEDWORD) + { + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("search_banned")); + return; + } + else if (status & STATUS_SEARCH_PLACES_SEARCHDISABLED) + { + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("search_disabled")); + return; + } + } + + bool found_one = false; + S32 num_new_rows = msg->getNumberOfBlocksFast(_PREHASH_QueryReplies); + if (num_new_rows == 0 && self->mResultsReceived == 0) + { + LLStringUtil::format_map_t map; + map["[TEXT]"] = self->getChild<LLUICtrl>("groups_edit")->getValue().asString(); + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("not_found", map)); + } + + self->mResultsReceived += num_new_rows; + num_new_rows = self->showNextButton(num_new_rows); + + for (S32 i = 0; i < num_new_rows; i++) + { + msg->getUUIDFast( _PREHASH_QueryReplies, _PREHASH_GroupID, group_id, i); + msg->getStringFast( _PREHASH_QueryReplies, _PREHASH_GroupName, group_name, i); + msg->getS32Fast( _PREHASH_QueryReplies, _PREHASH_Members, members, i); + msg->getF32Fast( _PREHASH_QueryReplies, _PREHASH_SearchOrder, search_order,i); + if (group_id.isNull()) + { + LL_DEBUGS("Search") << "No results returned for QueryID: " << query_id << LL_ENDL; + LLStringUtil::format_map_t map; + map["[TEXT]"] = self->getChild<LLUICtrl>("groups_edit")->getValue().asString(); + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("not_found", map)); + } + else + { + LL_DEBUGS("Search") << "Got: " << group_name << " GroupID: " << group_id << LL_ENDL; + search_results->setEnabled(TRUE); + found_one = true; + + LLSD content; + LLSD element; + + element["id"] = group_id; + + element["columns"][0]["column"] = "icon"; + element["columns"][0]["type"] = "icon"; + element["columns"][0]["value"] = "Icon_Group"; + + element["columns"][1]["column"] = "group_name"; + element["columns"][1]["value"] = group_name; + + element["columns"][2]["column"] = "members"; + element["columns"][2]["value"] = members; + + element["columns"][3]["column"] = "score"; + element["columns"][3]["value"] = search_order; + + content["name"] = group_name; + + search_results->addElement(element, ADD_BOTTOM); + self->mResultsContent[group_id.asString()] = content; + } + } + if (found_one) + { + search_results->selectFirstItem(); + search_results->setFocus(TRUE); + self->onSelectItem(); + } +} + +//////////////////////////////////////// +// Places Search Panel // +//////////////////////////////////////// + +static LLPanelInjector<FSPanelSearchPlaces> t_panel_fs_search_places("panel_ls_places"); + +FSPanelSearchPlaces::FSPanelSearchPlaces() : FSSearchPanelBase() +, mQueryID(nullptr) +, mStartSearch(0) +, mResultsReceived(0) +, mResultsContent() +{ + mCommitCallbackRegistrar.add("CommitSearch", boost::bind(&FSPanelSearchPlaces::find, this)); +} + +FSPanelSearchPlaces::~FSPanelSearchPlaces() +{ +} + +BOOL FSPanelSearchPlaces::postBuild() +{ + mSearchComboBox = findChild<LLSearchComboBox>("places_edit"); + mSearchResults = findChild<LLScrollListCtrl>("search_results_places"); + mPlacesCategory = findChild<LLComboBox>("places_category"); + if (mSearchComboBox) + { + mSearchComboBox->setCommitCallback(boost::bind(&FSPanelSearchPlaces::onBtnFind, this)); + fillSearchComboBox(mSearchComboBox); + } + if (mSearchResults) + { + mSearchResults->setCommitCallback(boost::bind(&FSPanelSearchPlaces::onSelectItem, this)); + mSearchResults->setEnabled(FALSE); + mSearchResults->setCommentText(LLTrans::getString("no_results")); + } + if (mPlacesCategory) + { + mPlacesCategory->add(LLTrans::getString("all_categories"), LLSD("any")); + mPlacesCategory->addSeparator(); + for (int category = LLParcel::C_LINDEN; category < LLParcel::C_COUNT; category++) + { + LLParcel::ECategory eCategory = (LLParcel::ECategory)category; + mPlacesCategory->add(LLTrans::getString(LLParcel::getCategoryUIString(eCategory)), LLParcel::getCategoryString(eCategory)); + } + } + childSetAction("places_next", boost::bind(&FSPanelSearchPlaces::onBtnNext, this)); + childSetAction("places_back", boost::bind(&FSPanelSearchPlaces::onBtnBack, this)); + getChildView("places_next")->setEnabled(FALSE); + getChildView("places_back")->setEnabled(FALSE); + + return TRUE; +} + +void FSPanelSearchPlaces::focusDefaultElement() +{ + mSearchComboBox->focusTextEntry(); +} + +void FSPanelSearchPlaces::find() +{ + std::string text = filterShortWords(mSearchComboBox->getSimple()); + if (text.empty()) + { + mSearchResults->setCommentText(LLTrans::getString("search_short")); + return; + } + + static LLUICachedControl<bool> inc_pg("ShowPGSims", 1); + static LLUICachedControl<bool> inc_mature("ShowMatureSims", 0); + static LLUICachedControl<bool> inc_adult("ShowAdultSims", 0); + if (!(inc_pg || inc_mature || inc_adult)) + { + LLNotificationsUtil::add("NoContentToSearch"); + return; + } + S8 category; + std::string category_string = mPlacesCategory->getSelectedValue(); + if (category_string == "any") + { + category = LLParcel::C_ANY; + } + else + { + category = LLParcel::getCategoryFromString(category_string); + } + U32 scope = 0; + if (gAgent.wantsPGOnly()) + { + scope |= DFQ_PG_SIMS_ONLY; + } + bool adult_enabled = gAgent.canAccessAdult(); + bool mature_enabled = gAgent.canAccessMature(); + if (inc_pg) + { + scope |= DFQ_INC_PG; + } + if (inc_mature && mature_enabled) + { + scope |= DFQ_INC_MATURE; + } + if (inc_adult && adult_enabled) + { + scope |= DFQ_INC_ADULT; + } + scope |= DFQ_DWELL_SORT; + + mResultsReceived = 0; + if (mQueryID.notNull()) + { + mQueryID.setNull(); + } + mQueryID.generate(); + + if (mStartSearch < 0) + { + mStartSearch = 0; + } + + gMessageSystem->newMessage("DirPlacesQuery"); + gMessageSystem->nextBlock("AgentData"); + gMessageSystem->addUUID("AgentID", gAgentID); + gMessageSystem->addUUID("SessionID", gAgentSessionID); + gMessageSystem->nextBlock("QueryData"); + gMessageSystem->addUUID("QueryID", getQueryID()); + gMessageSystem->addString("QueryText", text); + gMessageSystem->addU32("QueryFlags", scope); + gMessageSystem->addS8("Category", category); + // TODO: Search filter by region name. + gMessageSystem->addString("SimName", ""); + gMessageSystem->addS32("QueryStart", mStartSearch); + gAgent.sendReliableMessage(); + LL_DEBUGS("Search") << "Firing off places search request: " << getQueryID() << LL_ENDL; + + mSearchResults->deleteAllItems(); + mSearchResults->setCommentText(LLTrans::getString("searching")); + mNumResultsReturned = 0; +} + +void FSPanelSearchPlaces::onBtnFind() +{ + std::string text = mSearchComboBox->getSimple(); + if (!text.empty()) + { + LLSearchHistory::getInstance()->addEntry(text); + } + + resetSearch(); + + find(); +} + +void FSPanelSearchPlaces::onBtnNext() +{ + mStartSearch += RESULT_PAGE_SIZE; + getChildView("places_back")->setEnabled(TRUE); + + find(); +} + +void FSPanelSearchPlaces::onBtnBack() +{ + mStartSearch -= RESULT_PAGE_SIZE; + getChildView("places_back")->setEnabled(mStartSearch > 0); + + find(); +} + +void FSPanelSearchPlaces::resetSearch() +{ + mStartSearch = 0; + getChildView("places_back")->setEnabled(FALSE); + getChildView("places_next")->setEnabled(FALSE); +} + +S32 FSPanelSearchPlaces::showNextButton(S32 rows) +{ + bool show_next_button = (mResultsReceived > RESULT_PAGE_SIZE); + getChildView("places_next")->setEnabled(show_next_button); + if (show_next_button) + { + rows -= (mResultsReceived - RESULT_PAGE_SIZE); + } + return rows; +} + +void FSPanelSearchPlaces::onSelectItem() +{ + if (!mSearchResults) + { + return; + } + FSFloaterSearch* search_instance = LLFloaterReg::findTypedInstance<FSFloaterSearch>("search"); + if (search_instance) + { + search_instance->FSFloaterSearch::onSelectedItem(mSearchResults->getSelectedValue(), FSFloaterSearch::SC_PLACE); + } +} + +// static +void FSPanelSearchPlaces::processSearchReply(LLMessageSystem* msg, void**) +{ + LLUUID agent_id; + LLUUID query_id; + LLUUID parcel_id; + std::string name; + BOOL for_sale; + BOOL auction; + F32 dwell; + + msg->getUUID("AgentData", "AgentID", agent_id); + msg->getUUID("QueryData", "QueryID", query_id); + + // Not for us + if (agent_id != gAgentID) + { + return; + } + LL_DEBUGS("Search") << "received directory request - QueryID: " << query_id << " AgentID: " << agent_id << LL_ENDL; + + FSPanelSearchPlaces* self = FSFloaterSearch::getSearchPanel<FSPanelSearchPlaces>("panel_ls_places"); + + // floater is closed or these are not results from our last request + if (!self || query_id != self->getQueryID()) + { + return; + } + + LLScrollListCtrl* search_results = self->getChild<LLScrollListCtrl>("search_results_places"); + + // Clear "Searching" label on first results + if (self->mNumResultsReturned++ == 0) + { + search_results->deleteAllItems(); + } + + // Check for status messages + if (msg->getNumberOfBlocks("StatusData")) + { + U32 status; + msg->getU32("StatusData", "Status", status); + if (status & STATUS_SEARCH_PLACES_FOUNDNONE) + { + LLStringUtil::format_map_t map; + map["[TEXT]"] = self->getChild<LLUICtrl>("places_edit")->getValue().asString(); + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("not_found", map)); + return; + } + else if(status & STATUS_SEARCH_PLACES_SHORTSTRING) + { + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("search_short")); + return; + } + else if (status & STATUS_SEARCH_PLACES_BANNEDWORD) + { + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("search_banned")); + return; + } + else if (status & STATUS_SEARCH_PLACES_SEARCHDISABLED) + { + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("search_disabled")); + return; + } + else if (status & STATUS_SEARCH_PLACES_ESTATEEMPTY) + { + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("search_disabled")); + return; + } + } + + bool found_one = false; + S32 num_new_rows = msg->getNumberOfBlocks("QueryReplies"); + if (num_new_rows == 0 && self->mResultsReceived == 0) + { + LLStringUtil::format_map_t map; + map["[TEXT]"] = self->getChild<LLUICtrl>("places_edit")->getValue().asString(); + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("not_found", map)); + } + + self->mResultsReceived += num_new_rows; + num_new_rows = self->showNextButton(num_new_rows); + + for (S32 i = 0; i < num_new_rows; i++) + { + msg->getUUID( "QueryReplies", "ParcelID", parcel_id, i); + msg->getString( "QueryReplies", "Name", name, i); + msg->getBOOL( "QueryReplies", "ForSale", for_sale,i); + msg->getBOOL( "QueryReplies", "Auction", auction, i); + msg->getF32( "QueryReplies", "Dwell", dwell, i); + if (parcel_id.isNull()) + { + LL_DEBUGS("Search") << "Null result returned for QueryID: " << query_id << LL_ENDL; + LLStringUtil::format_map_t map; + map["[TEXT]"] = self->getChild<LLUICtrl>("places_edit")->getValue().asString(); + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("not_found", map)); + } + else + { + LL_DEBUGS("Search") << "Got: " << name << " ParcelID: " << parcel_id << LL_ENDL; + search_results->setEnabled(TRUE); + found_one = true; + + LLSD content; + LLSD element; + + element["id"] = parcel_id; + + if (auction) + { + element["columns"][0]["column"] = "icon"; + element["columns"][0]["type"] = "icon"; + element["columns"][0]["value"] = "Icon_Auction"; + } + else if (for_sale) + { + element["columns"][0]["column"] = "icon"; + element["columns"][0]["type"] = "icon"; + element["columns"][0]["value"] = "Icon_For_Sale"; + } + else + { + element["columns"][0]["column"] = "icon"; + element["columns"][0]["type"] = "icon"; + element["columns"][0]["value"] = "Icon_Place"; + } + + element["columns"][1]["column"] = "place_name"; + element["columns"][1]["value"] = name; + + content["name"] = name; + + std::string buffer = llformat("%.0f", (F64)dwell); + element["columns"][2]["column"] = "dwell"; + element["columns"][2]["value"] = buffer; + + search_results->addElement(element, ADD_BOTTOM); + self->mResultsContent[parcel_id.asString()] = content; + } + } + if (found_one) + { + search_results->selectFirstItem(); + search_results->setFocus(TRUE); + self->onSelectItem(); + } +} + +//////////////////////////////////////// +// Land Search Panel // +//////////////////////////////////////// + +static LLPanelInjector<FSPanelSearchLand> t_panel_fs_search_land("panel_ls_land"); + +FSPanelSearchLand::FSPanelSearchLand() : FSSearchPanelBase() +, mQueryID(nullptr) +, mStartSearch(0) +, mResultsReceived(0) +, mResultsContent() +{ + mCommitCallbackRegistrar.add("CommitSearch", boost::bind(&FSPanelSearchLand::find, this)); +} + +FSPanelSearchLand::~FSPanelSearchLand() +{ +} + +BOOL FSPanelSearchLand::postBuild() +{ + mSearchResults = getChild<LLScrollListCtrl>("search_results_land"); + mPriceEditor = findChild<LLLineEditor>("price_edit"); + mAreaEditor = findChild<LLLineEditor>("area_edit"); + if (mSearchResults) + { + mSearchResults->setCommitCallback(boost::bind(&FSPanelSearchLand::onSelectItem, this)); + mSearchResults->setEnabled(FALSE); + mSearchResults->setCommentText(LLTrans::getString("no_results")); + } + if (mPriceEditor) + { + mPriceEditor->setCommitOnFocusLost(false); + mPriceEditor->setCommitCallback(boost::bind(&FSPanelSearchLand::onBtnFind, this)); + } + if (mAreaEditor) + { + mAreaEditor->setCommitOnFocusLost(false); + mAreaEditor->setCommitCallback(boost::bind(&FSPanelSearchLand::find, this)); + } + childSetAction("land_find", boost::bind(&FSPanelSearchLand::onBtnFind, this)); + childSetAction("land_next", boost::bind(&FSPanelSearchLand::onBtnNext, this)); + childSetAction("land_back", boost::bind(&FSPanelSearchLand::onBtnBack, this)); + + getChildView("land_next")->setEnabled(FALSE); + getChildView("land_back")->setEnabled(FALSE); + + return TRUE; +} + +void FSPanelSearchLand::find() +{ + static LLUICachedControl<bool> inc_pg("ShowPGLand", 1); + static LLUICachedControl<bool> inc_mature("ShowMatureLand", 0); + static LLUICachedControl<bool> inc_adult("ShowAdultLand", 0); + static LLUICachedControl<bool> limit_price("FindLandPrice", 1); + static LLUICachedControl<bool> limit_area("FindLandArea", 1); + if (!(inc_pg || inc_mature || inc_adult)) + { + LLNotificationsUtil::add("NoContentToSearch"); + return; + } + + U32 category = ST_ALL; + const std::string& selection = findChild<LLComboBox>("land_category")->getSelectedValue().asString(); + if (!selection.empty()) + { + if (selection == "Auction") + { + category = ST_AUCTION; + } + else if (selection == "Mainland") + { + category = ST_MAINLAND; + } + else if (selection == "Estate") + { + category = ST_ESTATE; + } + } + + U32 scope = 0; + if (gAgent.wantsPGOnly()) + { + scope |= DFQ_PG_SIMS_ONLY; + } + bool mature_enabled = gAgent.canAccessMature(); + bool adult_enabled = gAgent.canAccessAdult(); + if (inc_pg) + { + scope |= DFQ_INC_PG; + } + if (inc_mature && mature_enabled) + { + scope |= DFQ_INC_MATURE; + } + if (inc_adult && adult_enabled) + { + scope |= DFQ_INC_ADULT; + } + const std::string& sort = findChild<LLComboBox>("land_sort_combo")->getSelectedValue().asString(); + if (!sort.empty()) + { + if (sort == "Name") + { + scope |= DFQ_NAME_SORT; + } + else if (sort == "Price") + { + scope |= DFQ_PRICE_SORT; + } + else if (sort == "PPM") + { + scope |= DFQ_PER_METER_SORT; + } + else if (sort == "Area") + { + scope |= DFQ_AREA_SORT; + } + } + else + { + scope |= DFQ_PRICE_SORT; + } + if (childGetValue("ascending_check").asBoolean()) + { + scope |= DFQ_SORT_ASC; + } + if (limit_price) + { + scope |= DFQ_LIMIT_BY_PRICE; + } + if (limit_area) + { + scope |= DFQ_LIMIT_BY_AREA; + } + S32 price = childGetValue("edit_price").asInteger(); + S32 area = childGetValue("edit_area").asInteger(); + + mResultsReceived = 0; + if (mQueryID.notNull()) + { + mQueryID.setNull(); + } + mQueryID.generate(); + + if (mStartSearch < 0) + { + mStartSearch = 0; + } + + gMessageSystem->newMessage("DirLandQuery"); + gMessageSystem->nextBlock("AgentData"); + gMessageSystem->addUUID("AgentID", gAgentID); + gMessageSystem->addUUID("SessionID", gAgentSessionID); + gMessageSystem->nextBlock("QueryData"); + gMessageSystem->addUUID("QueryID", getQueryID()); + gMessageSystem->addU32("QueryFlags", scope); + gMessageSystem->addU32("SearchType", category); + gMessageSystem->addS32("Price", price); + gMessageSystem->addS32("Area", area); + gMessageSystem->addS32("QueryStart", mStartSearch); + gAgent.sendReliableMessage(); + LL_DEBUGS("Search") << "Firing off places search request: " << getQueryID() << category << LL_ENDL; + + mSearchResults->deleteAllItems(); + mSearchResults->setCommentText(LLTrans::getString("searching")); + mNumResultsReturned = 0; +} + +void FSPanelSearchLand::onBtnFind() +{ + resetSearch(); + + find(); +} + +void FSPanelSearchLand::onBtnNext() +{ + mStartSearch += RESULT_PAGE_SIZE; + getChildView("land_back")->setEnabled(TRUE); + + find(); +} + +void FSPanelSearchLand::onBtnBack() +{ + mStartSearch -= RESULT_PAGE_SIZE; + getChildView("land_back")->setEnabled(mStartSearch > 0); + + find(); +} + +void FSPanelSearchLand::resetSearch() +{ + mStartSearch = 0; + getChildView("land_back")->setEnabled(FALSE); + getChildView("land_next")->setEnabled(FALSE); +} + +S32 FSPanelSearchLand::showNextButton(S32 rows) +{ + bool show_next_button = (mResultsReceived > RESULT_PAGE_SIZE); + getChildView("land_next")->setEnabled(show_next_button); + if (show_next_button) + { + rows -= (mResultsReceived - RESULT_PAGE_SIZE); + } + return rows; +} + +void FSPanelSearchLand::onSelectItem() +{ + if (!mSearchResults) + { + return; + } + FSFloaterSearch* search_instance = LLFloaterReg::findTypedInstance<FSFloaterSearch>("search"); + if (search_instance) + { + search_instance->FSFloaterSearch::onSelectedItem(mSearchResults->getSelectedValue(), FSFloaterSearch::SC_PLACE); + } +} + +// static +void FSPanelSearchLand::processSearchReply(LLMessageSystem* msg, void**) +{ + LLUUID agent_id; + LLUUID query_id; + LLUUID parcel_id; + std::string name; + std::string land_sku; + std::string land_type; + BOOL auction; + BOOL for_sale; + S32 price; + S32 area; + + msg->getUUID("AgentData", "AgentID", agent_id); + msg->getUUID("QueryData", "QueryID", query_id); + + // Not for us + if (agent_id != gAgentID) + { + return; + } + LL_DEBUGS("Search") << "received directory request - QueryID: " << query_id << " AgentID: " << agent_id << LL_ENDL; + + FSPanelSearchLand* self = FSFloaterSearch::getSearchPanel<FSPanelSearchLand>("panel_ls_land"); + + // floater is closed or these are not results from our last request + if (!self || query_id != self->mQueryID) + { + return; + } + + LLScrollListCtrl* search_results = self->getChild<LLScrollListCtrl>("search_results_land"); + // clear "Searching" label on first results + if (self->mNumResultsReturned++ == 0) + { + search_results->deleteAllItems(); + } + + static LLUICachedControl<bool> use_price("FindLandPrice", 1); + static LLUICachedControl<bool> use_area("FindLandArea", 1); + S32 limit_price = self->childGetValue("edit_price").asInteger(); + S32 limit_area = self->childGetValue("edit_area").asInteger(); + + bool found_one = false; + S32 num_new_rows = msg->getNumberOfBlocks("QueryReplies"); + if (num_new_rows == 0 && self->mResultsReceived == 0) + { + LLStringUtil::format_map_t map; + map["[TEXT]"] = self->getChild<LLUICtrl>("events_edit")->getValue().asString(); + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("not_found", map)); + } + self->mResultsReceived += num_new_rows; + + S32 not_auction = 0; + for (S32 i = 0; i < num_new_rows; i++) + { + msg->getUUID( "QueryReplies", "ParcelID", parcel_id, i); + msg->getString( "QueryReplies", "Name", name, i); + msg->getBOOL( "QueryReplies", "Auction", auction, i); + msg->getBOOL( "QueryReplies", "ForSale", for_sale, i); + msg->getS32( "QueryReplies", "SalePrice", price, i); + msg->getS32( "QueryReplies", "ActualArea", area, i); + if (parcel_id.isNull()) + { + LL_DEBUGS("Search") << "Null result returned for QueryID: " << query_id << LL_ENDL; + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("no_results")); + } + else + { + LL_DEBUGS("Search") << "Got: " << name << " ClassifiedID: " << parcel_id << LL_ENDL; + search_results->setEnabled(TRUE); + found_one = true; + if (msg->getSizeFast(_PREHASH_QueryReplies, i, _PREHASH_ProductSKU) > 0) + { + msg->getStringFast( _PREHASH_QueryReplies, _PREHASH_ProductSKU, land_sku, i); + land_type = LLProductInfoRequestManager::instance().getDescriptionForSku(land_sku); + } + else + { + land_sku.clear(); + land_type = LLTrans::getString("land_type_unknown"); + } + if (parcel_id.isNull()) + { + continue; + } + if (use_price && (price > limit_price)) + { + continue; + } + if (use_area && (area < limit_area)) + { + continue; + } + + LLSD content; + LLSD element; + + element["id"] = parcel_id; + if (auction) + { + element["columns"][0]["column"] = "icon"; + element["columns"][0]["type"] = "icon"; + element["columns"][0]["value"] = "Icon_Auction"; + } + else if (for_sale) + { + element["columns"][0]["column"] = "icon"; + element["columns"][0]["type"] = "icon"; + element["columns"][0]["value"] = "Icon_For_Sale"; + } + else + { + element["columns"][0]["column"] = "icon"; + element["columns"][0]["type"] = "icon"; + element["columns"][0]["value"] = "Icon_Place"; + } + + element["columns"][1]["column"] = "land_name"; + element["columns"][1]["value"] = name; + + content["place_name"] = name; + + std::string buffer = "Auction"; + if (!auction) + { + buffer = llformat("%d", price); + not_auction++; + } + element["columns"][2]["column"] = "price"; + element["columns"][2]["value"] = price; + + element["columns"][3]["column"] = "area"; + element["columns"][3]["value"] = area; + if (!auction) + { + F32 ppm; + if (area > 0) + { + ppm = (F32)price / (F32)area; + } + else + { + ppm = 0.f; + } + std::string ppm_buffer = llformat("%.1f", ppm); + element["columns"][4]["column"] = "ppm"; + element["columns"][4]["value"] = ppm_buffer; + } + else + { + element["columns"][4]["column"] = "ppm"; + element["columns"][4]["value"] = "1.0"; + } + + element["columns"][5]["column"] = "land_type"; + element["columns"][5]["value"] = land_type; + + search_results->addElement(element, ADD_BOTTOM); + self->mResultsContent[parcel_id.asString()] = content; + } + // We test against non-auction properties because they don't count towards the page limit. + self->showNextButton(not_auction); + } + if (found_one) + { + search_results->selectFirstItem(); + search_results->setFocus(TRUE); + self->onSelectItem(); + } +} + +//////////////////////////////////////// +// Classifieds Search Panel // +//////////////////////////////////////// + +static LLPanelInjector<FSPanelSearchClassifieds> t_panel_fs_search_classifieds("panel_ls_classifieds"); + +FSPanelSearchClassifieds::FSPanelSearchClassifieds() : FSSearchPanelBase() +, mQueryID(nullptr) +, mStartSearch(0) +, mResultsReceived(0) +, mResultsContent() +{ + mCommitCallbackRegistrar.add("CommitSearch", boost::bind(&FSPanelSearchClassifieds::find, this)); +} + +FSPanelSearchClassifieds::~FSPanelSearchClassifieds() +{ +} + +BOOL FSPanelSearchClassifieds::postBuild() +{ + mSearchComboBox = findChild<LLSearchComboBox>("classifieds_edit"); + mSearchResults = getChild<LLScrollListCtrl>("search_results_classifieds"); + if (mSearchComboBox) + { + mSearchComboBox->setCommitCallback(boost::bind(&FSPanelSearchClassifieds::onBtnFind, this)); + fillSearchComboBox(mSearchComboBox); + } + if (mSearchResults) + { + mSearchResults->setCommitCallback(boost::bind(&FSPanelSearchClassifieds::onSelectItem, this)); + mSearchResults->setEnabled(FALSE); + mSearchResults->setCommentText(LLTrans::getString("no_results")); + } + + mClassifiedsCategory = getChild<LLComboBox>("classifieds_category"); + if (mClassifiedsCategory) + { + LLClassifiedInfo::cat_map::iterator iter; + mClassifiedsCategory->add(LLTrans::getString("all_categories"), LLSD(0)); + mClassifiedsCategory->addSeparator(); + for (iter = LLClassifiedInfo::sCategories.begin(); + iter != LLClassifiedInfo::sCategories.end(); + iter++) + { + mClassifiedsCategory->add(LLTrans::getString(iter->second), LLSD((S32)iter->first)); + } + } + childSetAction("classifieds_next", boost::bind(&FSPanelSearchClassifieds::onBtnNext, this)); + childSetAction("classifieds_back", boost::bind(&FSPanelSearchClassifieds::onBtnBack, this)); + + getChildView("classifieds_next")->setEnabled(FALSE); + getChildView("classifieds_back")->setEnabled(FALSE); + + return TRUE; +} + +void FSPanelSearchClassifieds::focusDefaultElement() +{ + mSearchComboBox->focusTextEntry(); +} + +void FSPanelSearchClassifieds::find() +{ + std::string text = filterShortWords(mSearchComboBox->getSimple()); + if (text.size() == 0) + { + mSearchResults->setCommentText(LLTrans::getString("search_short")); + return; + } + + static LLUICachedControl<bool> inc_pg("ShowPGClassifieds", 1); + static LLUICachedControl<bool> inc_mature("ShowMatureClassifieds", 0); + static LLUICachedControl<bool> inc_adult("ShowAdultClassifieds", 0); + if (!(inc_pg || inc_mature || inc_adult)) + { + LLNotificationsUtil::add("NoContentToSearch"); + return; + } + U32 category = mClassifiedsCategory->getValue().asInteger(); + BOOL auto_renew = FALSE; + U32 flags = pack_classified_flags_request(auto_renew, inc_pg, inc_mature, inc_adult); + + mResultsReceived = 0; + if (mQueryID.notNull()) + { + mQueryID.setNull(); + } + mQueryID.generate(); + + if (mStartSearch < 0) + { + mStartSearch = 0; + } + + gMessageSystem->newMessageFast(_PREHASH_DirClassifiedQuery); + gMessageSystem->nextBlockFast(_PREHASH_AgentData); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgentID); + gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgentSessionID); + gMessageSystem->nextBlockFast(_PREHASH_QueryData); + gMessageSystem->addUUIDFast(_PREHASH_QueryID, getQueryID()); + gMessageSystem->addStringFast(_PREHASH_QueryText, text); + gMessageSystem->addU32Fast(_PREHASH_QueryFlags, flags); + gMessageSystem->addU32Fast(_PREHASH_Category, category); + gMessageSystem->addS32Fast(_PREHASH_QueryStart, mStartSearch); + gAgent.sendReliableMessage(); + LL_DEBUGS("Search") << "Firing off classified ad search request: " << getQueryID() << LL_ENDL; + + mSearchResults->deleteAllItems(); + mSearchResults->setCommentText(LLTrans::getString("searching")); + mNumResultsReturned = 0; +} + +void FSPanelSearchClassifieds::onBtnFind() +{ + std::string text = mSearchComboBox->getSimple(); + if (!text.empty()) + { + LLSearchHistory::getInstance()->addEntry(text); + } + + resetSearch(); + + find(); +} + +void FSPanelSearchClassifieds::onBtnNext() +{ + mStartSearch += RESULT_PAGE_SIZE; + getChildView("classifieds_back")->setEnabled(TRUE); + + find(); +} + +void FSPanelSearchClassifieds::onBtnBack() +{ + mStartSearch -= RESULT_PAGE_SIZE; + getChildView("classifieds_back")->setEnabled(mStartSearch > 0); + + find(); +} + +void FSPanelSearchClassifieds::resetSearch() +{ + mStartSearch = 0; + getChildView("classifieds_back")->setEnabled(FALSE); + getChildView("classifieds_next")->setEnabled(FALSE); +} + +S32 FSPanelSearchClassifieds::showNextButton(S32 rows) +{ + bool show_next_button = (mResultsReceived > RESULT_PAGE_SIZE); + getChildView("classifieds_next")->setEnabled(show_next_button); + if (show_next_button) + { + rows -= (mResultsReceived - RESULT_PAGE_SIZE); + } + return rows; +} + +void FSPanelSearchClassifieds::onSelectItem() +{ + if (!mSearchResults) + { + return; + } + FSFloaterSearch* search_instance = LLFloaterReg::findTypedInstance<FSFloaterSearch>("search"); + if (search_instance) + { + search_instance->FSFloaterSearch::onSelectedItem(mSearchResults->getSelectedValue(), FSFloaterSearch::SC_CLASSIFIED); + } +} + +// static +void FSPanelSearchClassifieds::processSearchReply(LLMessageSystem* msg, void**) +{ + LLUUID agent_id; + LLUUID query_id; + LLUUID classified_id; + std::string name; + U32 creation_date; + U32 expiration_date; + S32 price_for_listing; + + msg->getUUID("AgentData", "AgentID", agent_id); + msg->getUUID("QueryData", "QueryID", query_id); + + // Not for us + if (agent_id != gAgentID) + { + return; + } + LL_DEBUGS("Search") << "received directory request - QueryID: " << query_id << " AgentID: " << agent_id << LL_ENDL; + + FSPanelSearchClassifieds* self = FSFloaterSearch::getSearchPanel<FSPanelSearchClassifieds>("panel_ls_classifieds"); + + if (msg->getNumberOfBlocks("StatusData")) + { + U32 status; + msg->getU32("StatusData", "Status", status); + if (status & STATUS_SEARCH_CLASSIFIEDS_BANNEDWORD) + { + LLNotificationsUtil::add("SearchWordBanned"); + } + } + + // floater is closed or these are not results from our last request + if (!self || query_id != self->mQueryID) + { + return; + } + + LLScrollListCtrl* search_results = self->getChild<LLScrollListCtrl>("search_results_classifieds"); + + // Clear "Searching" label on first results + if (self->mNumResultsReturned++ == 0) + { + search_results->deleteAllItems(); + } + + // Check for status messages + if (msg->getNumberOfBlocks("StatusData")) + { + U32 status; + msg->getU32("StatusData", "Status", status); + if (status & STATUS_SEARCH_PLACES_FOUNDNONE) + { + LLStringUtil::format_map_t map; + map["[TEXT]"] = self->getChild<LLUICtrl>("classifieds_edit")->getValue().asString(); + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("not_found", map)); + return; + } + else if(status & STATUS_SEARCH_PLACES_SHORTSTRING) + { + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("search_short")); + return; + } + else if (status & STATUS_SEARCH_CLASSIFIEDS_BANNEDWORD) + { + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("search_banned")); + return; + } + else if (status & STATUS_SEARCH_PLACES_SEARCHDISABLED) + { + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("search_disabled")); + return; + } + } + + bool found_one = false; + S32 num_new_rows = msg->getNumberOfBlocks("QueryReplies"); + if (num_new_rows == 0 && self->mResultsReceived == 0) + { + LLStringUtil::format_map_t map; + map["[TEXT]"] = self->getChild<LLUICtrl>("classifieds_edit")->getValue().asString(); + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("not_found", map)); + } + self->mResultsReceived += num_new_rows; + num_new_rows = self->showNextButton(num_new_rows); + + for (S32 i = 0; i < num_new_rows; i++) + { + msg->getUUID( "QueryReplies", "ClassifiedID", classified_id, i); + msg->getString( "QueryReplies", "Name", name, i); + msg->getU32( "QueryReplies", "CreationDate", creation_date, i); + msg->getU32( "QueryReplies", "ExpirationDate", expiration_date,i); + msg->getS32( "QueryReplies", "PriceForListing", price_for_listing,i); + if (classified_id.isNull()) + { + LL_DEBUGS("Search") << "Null result returned for QueryID: " << query_id << LL_ENDL; + LLStringUtil::format_map_t map; + map["[TEXT]"] = self->getChild<LLUICtrl>("classifieds_edit")->getValue().asString(); + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("not_found", map)); + } + else + { + LL_DEBUGS("Search") << "Got: " << name << " ClassifiedID: " << classified_id << LL_ENDL; + search_results->setEnabled(TRUE); + found_one = true; + + LLSD content; + LLSD element; + + element["id"] = classified_id; + + element["columns"][0]["column"] = "icon"; + element["columns"][0]["type"] = "icon"; + element["columns"][0]["value"] = "icon_top_pick.tga"; + + element["columns"][1]["column"] = "classified_name"; + element["columns"][1]["value"] = name; + + element["columns"][2]["column"] = "price"; + element["columns"][2]["value"] = price_for_listing; + + content["name"] = name; + + search_results->addElement(element, ADD_BOTTOM); + self->mResultsContent[classified_id.asString()] = content; + } + } + if (found_one) + { + search_results->selectFirstItem(); + search_results->setFocus(TRUE); + self->onSelectItem(); + } +} + +//////////////////////////////////////// +// Events Search Panel // +//////////////////////////////////////// + +static LLPanelInjector<FSPanelSearchEvents> t_panel_fs_search_events("panel_ls_events"); + +FSPanelSearchEvents::FSPanelSearchEvents() : FSSearchPanelBase() +, mQueryID(nullptr) +, mResultsReceived(0) +, mStartSearch(0) +, mDay(0) +, mResultsContent() +{ + mCommitCallbackRegistrar.add("CommitSearch", boost::bind(&FSPanelSearchEvents::find, this)); +} + +FSPanelSearchEvents::~FSPanelSearchEvents() +{ +} + +BOOL FSPanelSearchEvents::postBuild() +{ + mSearchComboBox = findChild<LLSearchComboBox>("events_edit"); + mSearchResults = getChild<LLScrollListCtrl>("search_results_events"); + mEventsMode = findChild<LLRadioGroup>("events_search_mode"); + if (mSearchComboBox) + { + mSearchComboBox->setCommitCallback(boost::bind(&FSPanelSearchEvents::onBtnFind, this)); + fillSearchComboBox(mSearchComboBox); + } + if (mSearchResults) + { + mSearchResults->setCommitCallback(boost::bind(&FSPanelSearchEvents::onSelectItem, this)); + mSearchResults->setEnabled(FALSE); + mSearchResults->setCommentText(LLTrans::getString("no_results")); + } + if (mEventsMode) + { + mEventsMode->setCommitCallback(boost::bind(&FSPanelSearchEvents::onSearchModeChanged, this)); + mEventsMode->selectFirstItem(); + } + + childSetAction("events_next", boost::bind(&FSPanelSearchEvents::onBtnNext, this)); + childSetAction("events_back", boost::bind(&FSPanelSearchEvents::onBtnBack, this)); + childSetAction("events_tomorrow", boost::bind(&FSPanelSearchEvents::onBtnTomorrow, this)); + childSetAction("events_yesterday", boost::bind(&FSPanelSearchEvents::onBtnYesterday, this)); + childSetAction("events_today", boost::bind(&FSPanelSearchEvents::onBtnToday, this)); + + getChildView("events_next")->setEnabled(FALSE); + getChildView("events_back")->setEnabled(FALSE); + getChildView("events_tomorrow")->setEnabled(FALSE); + getChildView("events_yesterday")->setEnabled(FALSE); + getChildView("events_today")->setEnabled(FALSE); + setDay(0); + + return TRUE; +} + +void FSPanelSearchEvents::focusDefaultElement() +{ + mSearchComboBox->focusTextEntry(); +} + +void FSPanelSearchEvents::find() +{ + std::string text = filterShortWords(mSearchComboBox->getSimple()); + + static LLUICachedControl<bool> inc_pg("ShowPGEvents", 1); + static LLUICachedControl<bool> inc_mature("ShowMatureEvents", 0); + static LLUICachedControl<bool> inc_adult("ShowAdultEvents", 0); + if (!(inc_pg || inc_mature || inc_adult)) + { + LLNotificationsUtil::add("NoContentToSearch"); + return; + } + + U32 category = findChild<LLComboBox>("events_category")->getSelectedValue().asInteger(); + U32 scope = DFQ_DATE_EVENTS; + if (gAgent.wantsPGOnly()) + { + scope |= DFQ_PG_SIMS_ONLY; + } + bool mature_enabled = gAgent.canAccessMature(); + bool adult_enabled = gAgent.canAccessAdult(); + if (inc_pg) + { + scope |= DFQ_INC_PG; + } + if (inc_mature && mature_enabled) + { + scope |= DFQ_INC_MATURE; + } + if (inc_adult && adult_enabled) + { + scope |= DFQ_INC_ADULT; + } + + std::ostringstream string; + + if ("current" == childGetValue("events_search_mode").asString()) + { + string << "u|"; + } + else + { + string << mDay << "|"; + } + string << category << "|"; + string << text; + + mResultsReceived = 0; + if (mQueryID.notNull()) + { + mQueryID.setNull(); + } + mQueryID.generate(); + + if (mStartSearch < 0) + { + mStartSearch = 0; + } + + gMessageSystem->newMessage("DirFindQuery"); + gMessageSystem->nextBlock("AgentData"); + gMessageSystem->addUUID("AgentID", gAgentID); + gMessageSystem->addUUID("SessionID", gAgentSessionID); + gMessageSystem->nextBlock("QueryData"); + gMessageSystem->addUUID("QueryID", getQueryID()); + gMessageSystem->addString("QueryText", string.str()); + gMessageSystem->addU32("QueryFlags", scope); + gMessageSystem->addS32("QueryStart", mStartSearch); + gAgent.sendReliableMessage(); + LL_DEBUGS("Search") << "Firing off search request: " << getQueryID() << " Search Text: " << string.str() << LL_ENDL; + + mSearchResults->deleteAllItems(); + mSearchResults->setCommentText(LLTrans::getString("searching")); + mNumResultsReturned = 0; +} + +void FSPanelSearchEvents::onBtnFind() +{ + std::string text = mSearchComboBox->getSimple(); + if (!text.empty()) + { + LLSearchHistory::getInstance()->addEntry(text); + } + + resetSearch(); + + find(); +} + +void FSPanelSearchEvents::onBtnNext() +{ + mStartSearch += RESULT_PAGE_SIZE; + getChildView("events_back")->setEnabled(TRUE); + + find(); +} + +void FSPanelSearchEvents::onBtnBack() +{ + mStartSearch -= RESULT_PAGE_SIZE; + getChildView("events_back")->setEnabled(mStartSearch > 0); + + find(); +} + +void FSPanelSearchEvents::onBtnTomorrow() +{ + resetSearch(); + setDay(mDay + 1); + + find(); +} + +void FSPanelSearchEvents::onBtnYesterday() +{ + resetSearch(); + setDay(mDay - 1); + + find(); +} + +void FSPanelSearchEvents::onBtnToday() +{ + resetSearch(); + setDay(0); + + find(); +} + +void FSPanelSearchEvents::resetSearch() +{ + mStartSearch = 0; + getChildView("events_back")->setEnabled(FALSE); + getChildView("events_next")->setEnabled(FALSE); +} + +void FSPanelSearchEvents::onSearchModeChanged() +{ + if (mEventsMode->getValue().asString() == "current") + { + getChildView("events_yesterday")->setEnabled(FALSE); + getChildView("events_tomorrow")->setEnabled(FALSE); + getChildView("events_today")->setEnabled(FALSE); + } + else + { + getChildView("events_yesterday")->setEnabled(TRUE); + getChildView("events_tomorrow")->setEnabled(TRUE); + getChildView("events_today")->setEnabled(TRUE); + } +} + +void FSPanelSearchEvents::setDay(S32 day) +{ + mDay = day; + struct tm* internal_time; + + time_t utc = time_corrected(); + utc += day * 24 * 60 * 60; + internal_time = utc_to_pacific_time(utc, is_daylight_savings()); + std::string buffer = llformat("%d/%d", 1 + internal_time->tm_mon, internal_time->tm_mday); + childSetValue("events_date", buffer); +} + +S32 FSPanelSearchEvents::showNextButton(S32 rows) +{ + bool show_next_button = (mResultsReceived > RESULT_PAGE_SIZE); + getChildView("events_next")->setEnabled(show_next_button); + if (show_next_button) + { + rows -= (mResultsReceived - RESULT_PAGE_SIZE); + } + return rows; +} + +void FSPanelSearchEvents::onSelectItem() +{ + if (!mSearchResults) + { + return; + } + S32 event_id = mSearchResults->getSelectedValue(); + FSFloaterSearch* search_instance = LLFloaterReg::findTypedInstance<FSFloaterSearch>("search"); + if (search_instance) + { + search_instance->FSFloaterSearch::onSelectedEvent(event_id); + } +} + +// static +void FSPanelSearchEvents::processSearchReply(LLMessageSystem* msg, void**) +{ + LLUUID agent_id; + LLUUID query_id; + LLUUID owner_id; + std::string name; + std::string date; + + msg->getUUID("AgentData", "AgentID", agent_id); + msg->getUUID("QueryData", "QueryID", query_id); + + // Not for us + if (agent_id != gAgentID) + { + return; + } + LL_DEBUGS("Search") << "received directory request - QueryID: " << query_id << " AgentID: " << agent_id << LL_ENDL; + + FSPanelSearchEvents* self = FSFloaterSearch::getSearchPanel<FSPanelSearchEvents>("panel_ls_events"); + + // floater is closed or these are not results from our last request + if (!self || query_id != self->mQueryID) + { + return; + } + + LLScrollListCtrl* search_results = self->getChild<LLScrollListCtrl>("search_results_events"); + + // Clear "Searching" label on first results + if (self->mNumResultsReturned++ == 0) + { + search_results->deleteAllItems(); + } + // Check for status messages + if (msg->getNumberOfBlocks("StatusData")) + { + U32 status; + msg->getU32("StatusData", "Status", status); + if (status & STATUS_SEARCH_EVENTS_FOUNDNONE) + { + LLStringUtil::format_map_t map; + map["[TEXT]"] = self->getChild<LLUICtrl>("events_edit")->getValue().asString(); + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("not_found", map)); + return; + } + else if(status & STATUS_SEARCH_EVENTS_SHORTSTRING) + { + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("search_short")); + return; + } + else if (status & STATUS_SEARCH_EVENTS_BANNEDWORD) + { + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("search_banned")); + return; + } + else if (status & STATUS_SEARCH_EVENTS_SEARCHDISABLED) + { + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("search_disabled")); + return; + } + else if (status & STATUS_SEARCH_EVENTS_NODATEOFFSET) + { + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("search_no_date_offset")); + return; + } + else if (status & STATUS_SEARCH_EVENTS_NOCATEGORY) + { + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("search_no_events_category")); + return; + } + else if (status & STATUS_SEARCH_EVENTS_NOQUERY) + { + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("search_no_query")); + return; + } + } + + S32 num_new_rows = msg->getNumberOfBlocks("QueryReplies"); + if (num_new_rows == 0 && self->mResultsReceived == 0) + { + LLStringUtil::format_map_t map; + map["[TEXT]"] = self->getChild<LLUICtrl>("events_edit")->getValue().asString(); + search_results->setEnabled(FALSE); + search_results->setCommentText(LLTrans::getString("not_found", map)); + } + + self->mResultsReceived += num_new_rows; + num_new_rows = self->showNextButton(num_new_rows); + static LLUICachedControl<bool> inc_pg("ShowPGEvents", 1); + static LLUICachedControl<bool> inc_mature("ShowMatureEvents", 0); + static LLUICachedControl<bool> inc_adult("ShowAdultEvents", 0); + bool found_one = false; + + for (S32 i = 0; i < num_new_rows; i++) + { + U32 event_id; + U32 unix_time; + U32 event_flags; + + msg->getUUID( "QueryReplies", "OwnerID", owner_id, i); + msg->getString( "QueryReplies", "Name", name, i); + msg->getU32( "QueryReplies", "EventID", event_id, i); + msg->getString( "QueryReplies", "Date", date, i); + msg->getU32( "QueryReplies", "UnixTime", unix_time, i); + msg->getU32( "QueryReplies", "EventFlags", event_flags,i); + + // Skip empty events... + if (owner_id.isNull()) + { + LL_INFOS("Search") << "Skipped " << event_id << " because of a nullptr owner result" << LL_ENDL; + continue; + } + // Skips events that don't match our scope... + if (((event_flags & (EVENT_FLAG_ADULT | EVENT_FLAG_MATURE)) == EVENT_FLAG_NONE) && !inc_pg) + { + LL_INFOS("Search") << "Skipped " << event_id << " because it was out of scope" << LL_ENDL; + continue; + } + if ((event_flags & EVENT_FLAG_MATURE) && !inc_mature) + { + LL_INFOS("Search") << "Skipped " << event_id << " because it was out of scope" << LL_ENDL; + continue; + } + if ((event_flags & EVENT_FLAG_ADULT) && !inc_adult) + { + LL_INFOS("Search") << "Skipped " << event_id << " because it was out of scope" << LL_ENDL; + continue; + } + search_results->setEnabled(TRUE); + found_one = true; + + LLSD content; + LLSD element; + + element["id"] = llformat("%u", event_id); + + if (event_flags == EVENT_FLAG_ADULT) + { + element["columns"][0]["column"] = "icon"; + element["columns"][0]["type"] = "icon"; + element["columns"][0]["value"] = "Icon_Legacy_Event_Adult"; + } + else if (event_flags == EVENT_FLAG_MATURE) + { + element["columns"][0]["column"] = "icon"; + element["columns"][0]["type"] = "icon"; + element["columns"][0]["value"] = "Icon_Legacy_Event_Mature"; + } + else + { + element["columns"][0]["column"] = "icon"; + element["columns"][0]["type"] = "icon"; + element["columns"][0]["value"] = "Icon_Legacy_Event_PG"; + } + element["columns"][1]["column"] = "name"; + element["columns"][1]["value"] = name; + + element["columns"][2]["column"] = "date"; + element["columns"][2]["value"] = date; + + element["columns"][3]["column"] = "time"; + element["columns"][3]["value"] = llformat("%u", unix_time); + + content["name"] = name; + content["event_id"] = (S32)event_id; + + search_results->addElement(element, ADD_BOTTOM); + std::string event = llformat("%u", event_id); + self->mResultsContent[event] = content; + } + if (found_one) + { + search_results->selectFirstItem(); + search_results->setFocus(TRUE); + self->onSelectItem(); + } +} + +//////////////////////////////////////// +// WebSearch Panel // +//////////////////////////////////////// + +static LLPanelInjector<FSPanelSearchWeb> t_panel_fs_search_web("panel_ls_web"); + +FSPanelSearchWeb::FSPanelSearchWeb() : FSSearchPanelBase() +, mWebBrowser(nullptr) +, mResetFocusOnLoad(false) +{ + // Second Life grids use a different URL format now + mCategoryPaths = LLSD::emptyMap(); + if (LLGridManager::getInstance()->isInSecondlife()) + { + // declare a map that transforms a category name into + // the parameter list that is used to search that category + mCategoryPaths["people"] = "collection_chosen=people"; + mCategoryPaths["places"] = "collection_chosen=places"; + mCategoryPaths["events"] = "collection_chosen=events"; + mCategoryPaths["groups"] = "collection_chosen=groups"; + mCategoryPaths["destinations"] = "collection_chosen=destinations"; + + mCategoryPaths["classifieds"] = "search_type=classified"; + mCategoryPaths["wiki"] = "search/wiki"; // not sure if this is still a thing in the new search + + mCategoryPaths["all"] = mCategoryPaths["people"].asString() + "&" + + mCategoryPaths["places"].asString() + "&" + + mCategoryPaths["events"].asString() + "&" + + mCategoryPaths["groups"].asString() + "&" + + mCategoryPaths["destinations"].asString(); + } + // OpenSim currently still uses the old URL format + else + { + // declare a map that transforms a category name into + // the URL suffix that is used to search that category + mCategoryPaths["all"] = "search"; + mCategoryPaths["people"] = "search/people"; + mCategoryPaths["places"] = "search/places"; + mCategoryPaths["events"] = "search/events"; + mCategoryPaths["groups"] = "search/groups"; + mCategoryPaths["wiki"] = "search/wiki"; + mCategoryPaths["destinations"] = "destinations"; + mCategoryPaths["classifieds"] = "classifieds"; + } +} + +BOOL FSPanelSearchWeb::postBuild() +{ + mWebBrowser = getChild<LLMediaCtrl>("search_browser"); + return TRUE; +} + +void FSPanelSearchWeb::loadURL(const SearchQuery &p) +{ + if (!mWebBrowser || !p.validateBlock()) + { + return; + } + + // CATEGORY is no longer used as part of the path on Second Life grids + LLSD subs = LLSD().with("CATEGORY", ""); + + // on OpenSim grids it probably is currently still being used, so keep the old behavior + if (!LLGridManager::getInstance()->isInSecondlife()) + { + // work out the subdir to use based on the requested category + LLSD subs = LLSD().with("CATEGORY", (mCategoryPaths.has(p.category.getValue()) ? mCategoryPaths[p.category.getValue()].asString() : mCategoryPaths["all"].asString())); + } + + // add the search query string + subs["QUERY"] = LLURI::escape(p.query); + + // add the permissions token that login.cgi gave us + // We use "search_token", and fallback to "auth_token" if not present. + LLSD search_token = LLLoginInstance::getInstance()->getResponse("search_token"); + if (search_token.asString().empty()) + { + search_token = LLLoginInstance::getInstance()->getResponse("auth_token"); + } + subs["AUTH_TOKEN"] = search_token.asString(); + + // add the user's preferred maturity (can be changed via prefs) + std::string maturity; + + // on Second Life grids, the maturity level is now a "&maturity" parameter that's not in the provided search URL + if (LLGridManager::getInstance()->isInSecondlife()) + { + if (gAgent.prefersAdult()) + { + maturity = "gma"; // PG,Mature,Adult + } + else if (gAgent.prefersMature()) + { + maturity = "gm"; // PG,Mature + } + else + { + maturity = "g"; // PG + } + + // not used on the SL search anymore, so clear out the respective parameter + subs["MATURITY"] = ""; + } + // OpenSim probably still uses the old maturity variant, so keep the old behavior here + else + { + if (gAgent.prefersAdult()) + { + maturity = "42"; // PG,Mature,Adult + } + else if (gAgent.prefersMature()) + { + maturity = "21"; // PG,Mature + } + else + { + maturity = "13"; // PG + } + subs["MATURITY"] = maturity; + } + + // add the user's god status + subs["GODLIKE"] = gAgent.isGodlike() ? "1" : "0"; + + // Get the search URL and expand all of the substitutions + // (also adds things like [LANGUAGE], [VERSION], [OS], etc.) + + // add the maturity and category variables to the new Second Life search URL + std::string url = gAgent.getRegion() != nullptr ? gAgent.getRegion()->getSearchServerURL() + : gSavedSettings.getString(LLGridManager::getInstance()->isInOpenSim() ? "OpenSimSearchURL" : "SearchURL"); + if (LLGridManager::getInstance()->isInSecondlife()) + { + url.append("&maturity=" + maturity + "&" + mCategoryPaths[p.category.getValue()].asString()); + } + + url = LLWeb::expandURLSubstitutions(url, subs); + + // Finally, load the URL in the webpanel + mWebBrowser->navigateTo(url, HTTP_CONTENT_TEXT_HTML); +} + +void FSPanelSearchWeb::focusDefaultElement() +{ + mWebBrowser->setFocus(TRUE); +} + +void FSPanelSearchWeb::draw() +{ + if (mResetFocusOnLoad) + { + focusDefaultElement(); + mResetFocusOnLoad = false; + } + + FSSearchPanelBase::draw(); +} + +//////////////////////////////////////// +// Local functions // +//////////////////////////////////////// + +std::string filterShortWords(std::string query_string) +{ + if (query_string.length() < 1) + { + return ""; + } + + std::string final_query; + bool filtered = false; + boost::char_separator<char> sep(" "); + boost::tokenizer<boost::char_separator<char> > tokens(query_string, sep); + boost::tokenizer<boost::char_separator<char> >::iterator iter = tokens.begin(); + boost::tokenizer<boost::char_separator<char> >::iterator last = tokens.end(); + boost::tokenizer<boost::char_separator<char> >::iterator temp; + for (; iter != last; ++iter) + { + if ((*iter).length() > MIN_SEARCH_STRING_SIZE) + { + final_query.append((*iter)); + temp = iter; ++temp; + if (temp != last) + { + final_query.append(" "); + } + } + else + { + filtered = true; + } + } + + if (filtered) + { + LLSD args = LLSD().with("FINALQUERY", final_query); + LLNotificationsUtil::add("SeachFilteredOnShortWords", args); + } + + return final_query; +} + +void fillSearchComboBox(LLSearchComboBox* search_combo) +{ + if (search_combo == nullptr) + { + return; + } + + LLSearchHistory::getInstance()->load(); + + LLSearchHistory::search_history_list_t search_list = + LLSearchHistory::getInstance()->getSearchHistoryList(); + LLSearchHistory::search_history_list_t::const_iterator it = search_list.begin(); + for ( ; search_list.end() != it; ++it) + { + LLSearchHistory::LLSearchHistoryItem item = *it; + search_combo->add(item.search_query); + } +} diff --git a/indra/newview/fsfloatersearch.h b/indra/newview/fsfloatersearch.h new file mode 100644 index 0000000000000000000000000000000000000000..77ad02e5ce425888422459eff8a1ebb1d91c95bc --- /dev/null +++ b/indra/newview/fsfloatersearch.h @@ -0,0 +1,416 @@ +/** + * @file fsfloatersearch.h + * @brief Firestorm search definitions + * + * $LicenseInfo:firstyear=2012&license=fsviewerlgpl$ + * Phoenix Firestorm Viewer Source Code + * Copyright (C) 2012, Cinder Roxley <cinder.roxley@phoenixviewer.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * The Phoenix Firestorm Project, Inc., 1831 Oakwood Drive, Fairmont, Minnesota 56031-3225 USA + * http://www.firestormviewer.org + * $/LicenseInfo$ + */ + +#ifndef FS_FLOATERSEARCH_H +#define FS_FLOATERSEARCH_H + +#include "llfloater.h" +#include "lliconctrl.h" +#include "lltexteditor.h" +#include "lltexturectrl.h" +#include "llremoteparcelrequest.h" +#include "llavatarpropertiesprocessor.h" +#include "llgroupmgr.h" +#include "llavatarnamecache.h" +#include "llmediactrl.h" +#include "llradiogroup.h" +#include "llsearchcombobox.h" +#include "llscrolllistctrl.h" +#include "lltabcontainer.h" + +class FSSearchRemoteParcelInfoObserver; +class LLAvatarPropertiesObserver; +class LLGroupMgrObserver; +class LLSearchEditor; +class LLSearchComboBox; +class FSFloaterSearch; +class FSScrollListCtrl; + +struct SearchQuery : public LLInitParam::Block<SearchQuery> +{ + Optional<std::string> category; + Optional<std::string> query; + + SearchQuery(); +}; + +/////////////////////////////// +// Search Panels // +/////////////////////////////// + +class FSSearchPanelBase : public LLPanel +{ +public: + FSSearchPanelBase() : LLPanel() { } + virtual ~FSSearchPanelBase() = default; + virtual void focusDefaultElement() { } +}; + +class FSPanelSearchPeople : public FSSearchPanelBase +{ + LOG_CLASS(FSFloaterSearch); +public: + FSPanelSearchPeople(); + static void processSearchReply(LLMessageSystem* msg, void**); + + /*virtual*/ void focusDefaultElement(); + +protected: + const S32& getNumResultsReturned() const { return mNumResultsReturned; }; + const S32& getNumResultsReceived() const { return mResultsReceived; }; + +private: + /*virtual*/ BOOL postBuild(); + virtual ~FSPanelSearchPeople(); + + void onBtnFind(); + void onSelectItem(); + void onBtnNext(); + void onBtnBack(); + + void find(); + void resetSearch(); + S32 showNextButton(S32); + + const LLUUID& getQueryID() const { return mQueryID; } + + void onAvatarNameCallback(const LLUUID& id, const LLAvatarName& av_name); + + typedef boost::signals2::connection avatar_name_callback_connection_t; + avatar_name_callback_connection_t mAvatarNameCallbackConnection; + + S32 mNumResultsReturned; + S32 mStartSearch; + S32 mResultsReceived; + LLSD mResultsContent; + LLUUID mQueryID; + + FSFloaterSearch* mParent; + LLSearchComboBox* mSearchComboBox; + LLScrollListCtrl* mSearchResults; +}; + +class FSPanelSearchGroups : public FSSearchPanelBase +{ + LOG_CLASS(FSFloaterSearch); +public: + FSPanelSearchGroups(); + static void processSearchReply(LLMessageSystem* msg, void**); + + /*virtual*/ void focusDefaultElement(); + +private: + /*virtual*/ BOOL postBuild(); + virtual ~FSPanelSearchGroups(); + + void onBtnFind(); + void onSelectItem(); + void onBtnNext(); + void onBtnBack(); + + void find(); + void resetSearch(); + S32 showNextButton(S32); + + const LLUUID& getQueryID() const { return mQueryID; } + + S32 mNumResultsReturned; + S32 mStartSearch; + S32 mResultsReceived; + LLSD mResultsContent; + LLUUID mQueryID; + + FSFloaterSearch* mParent; + LLSearchComboBox* mSearchComboBox; + LLScrollListCtrl* mSearchResults; +}; + +class FSPanelSearchPlaces : public FSSearchPanelBase +{ + LOG_CLASS(FSFloaterSearch); +public: + FSPanelSearchPlaces(); + static void processSearchReply(LLMessageSystem* msg, void**); + + /*virtual*/ void focusDefaultElement(); + +private: + /*virtual*/ BOOL postBuild(); + virtual ~FSPanelSearchPlaces(); + + void onBtnFind(); + void onSelectItem(); + void onBtnNext(); + void onBtnBack(); + + void find(); + void resetSearch(); + S32 showNextButton(S32); + + const LLUUID& getQueryID() const { return mQueryID; } + + S32 mNumResultsReturned; + S32 mStartSearch; + S32 mResultsReceived; + LLSD mResultsContent; + LLUUID mQueryID; + + FSFloaterSearch* mParent; + LLSearchComboBox* mSearchComboBox; + LLScrollListCtrl* mSearchResults; + LLComboBox* mPlacesCategory; +}; + +class FSPanelSearchLand : public FSSearchPanelBase +{ + LOG_CLASS(FSFloaterSearch); +public: + FSPanelSearchLand(); + static void processSearchReply(LLMessageSystem* msg, void**); + +private: + /*virtual*/ BOOL postBuild(); + virtual ~FSPanelSearchLand(); + + void onBtnFind(); + void onSelectItem(); + void onBtnNext(); + void onBtnBack(); + + void find(); + void resetSearch(); + S32 showNextButton(S32); + + const LLUUID& getQueryID() const { return mQueryID; } + + S32 mNumResultsReturned; + S32 mStartSearch; + S32 mResultsReceived; + LLSD mResultsContent; + LLUUID mQueryID; + + FSFloaterSearch* mParent; + LLLineEditor* mPriceEditor; + LLLineEditor* mAreaEditor; + LLScrollListCtrl* mSearchResults; +}; + +class FSPanelSearchClassifieds : public FSSearchPanelBase +{ + LOG_CLASS(FSFloaterSearch); +public: + FSPanelSearchClassifieds(); + static void processSearchReply(LLMessageSystem* msg, void**); + + /*virtual*/ void focusDefaultElement(); + +private: + /*virtual*/ BOOL postBuild(); + virtual ~FSPanelSearchClassifieds(); + + void onBtnFind(); + void onSelectItem(); + void onBtnNext(); + void onBtnBack(); + + void find(); + void resetSearch(); + S32 showNextButton(S32); + + const LLUUID& getQueryID() const { return mQueryID; } + + S32 mNumResultsReturned; + S32 mStartSearch; + S32 mResultsReceived; + LLSD mResultsContent; + LLUUID mQueryID; + + FSFloaterSearch* mParent; + LLSearchComboBox* mSearchComboBox; + LLScrollListCtrl* mSearchResults; + LLComboBox* mClassifiedsCategory; +}; + +class FSPanelSearchEvents : public FSSearchPanelBase +{ + LOG_CLASS(FSFloaterSearch); +public: + FSPanelSearchEvents(); + static void processSearchReply(LLMessageSystem* msg, void**); + + /*virtual*/ void focusDefaultElement(); + +private: + /*virtual*/ BOOL postBuild(); + virtual ~FSPanelSearchEvents(); + + void onBtnFind(); + void onSelectItem(); + void onBtnNext(); + void onBtnBack(); + void onBtnTomorrow(); + void onBtnYesterday(); + void onBtnToday(); + + void find(); + void setDay(S32 day); + void onSearchModeChanged(); + void resetSearch(); + S32 showNextButton(S32); + + const LLUUID& getQueryID() const { return mQueryID; } + + S32 mNumResultsReturned; + S32 mResultsReceived; + S32 mStartSearch; + S32 mDay; + LLSD mResultsContent; + LLUUID mQueryID; + + FSFloaterSearch* mParent; + LLSearchComboBox* mSearchComboBox; + LLScrollListCtrl* mSearchResults; + LLRadioGroup* mEventsMode; +}; + +class FSPanelSearchWeb : public FSSearchPanelBase +{ + LOG_CLASS(FSFloaterSearch); +public: + FSPanelSearchWeb(); + /*virtual*/ BOOL postBuild(); + void loadURL(const SearchQuery &query); + /*virtual*/ void focusDefaultElement(); + /*virtual*/ void draw(); + void resetFocusOnLoad() { mResetFocusOnLoad = true; } + +private: + virtual ~FSPanelSearchWeb() {}; + + LLMediaCtrl* mWebBrowser; + LLSD mCategoryPaths; + + bool mResetFocusOnLoad; +}; + +class FSFloaterSearch : public LLFloater +{ + LOG_CLASS(FSFloaterSearch); +public: + typedef enum e_search_category + { + SC_AVATAR, + SC_GROUP, + SC_PLACE, + SC_CLASSIFIED + } ESearchCategory; + + struct _Params : public LLInitParam::Block<_Params, LLFloater::Params> + { + Optional<SearchQuery> search; + }; + + typedef LLSDParamAdapter<_Params> Params; + + FSFloaterSearch(const Params& key); + ~FSFloaterSearch(); + void onOpen(const LLSD& key); + BOOL postBuild(); + + void avatarNameUpdatedCallback(const LLUUID& id, const LLAvatarName& av_name); + void groupNameUpdatedCallback(const LLUUID& id, const std::string& name, bool is_group); + void onSelectedItem(const LLUUID& selected_item, ESearchCategory type); + void onSelectedEvent(const S32 selected_event); + void displayParcelDetails(const LLParcelData& parcel_data); + void displayClassifiedDetails(LLAvatarClassifiedInfo*& c_info); + void displayAvatarDetails(LLAvatarData*& avatar_data); + void displayGroupDetails(LLGroupMgrGroupData*& group_data); + void displayEventDetails(U32 eventId, + F64 eventEpoch, + const std::string& eventDateStr, + const std::string &eventName, + const std::string &eventDesc, + const std::string &simName, + U32 eventDuration, + U32 eventFlags, + U32 eventCover, + LLVector3d eventGlobalPos); + void displayEventParcelImage(const LLParcelData& parcel_data); + void setLoadingProgress(bool started); + + template <class T> + static T* getSearchPanel(const std::string& panel_name); + +private: + virtual void onClose(bool app_quitting); + const LLUUID& getSelectedID() { return mSelectedID; } + LLVector3d mParcelGlobal; + LLUUID mSelectedID; + U32 mEventID; + bool mHasSelection; + + void resetVerbs(); + void flushDetails(); + void onTabChange(); + void onBtnPeopleProfile(); + void onBtnPeopleIM(); + void onBtnPeopleFriend(); + void onBtnGroupProfile(); + void onBtnGroupChat(); + void onBtnGroupJoin(); + void onBtnEventReminder(); + void onBtnTeleport(); + void onBtnMap(); + + void regionHandleCallback(U64 region_handle, LLVector3d pos_global); + + FSSearchRemoteParcelInfoObserver* mRemoteParcelObserver; + FSSearchRemoteParcelInfoObserver* mRemoteParcelEventLocationObserver; + LLAvatarPropertiesObserver* mAvatarPropertiesObserver; + LLGroupMgrObserver* mGroupPropertiesRequest; + + FSPanelSearchPeople* mPanelPeople; + FSPanelSearchGroups* mPanelGroups; + FSPanelSearchPlaces* mPanelPlaces; + FSPanelSearchEvents* mPanelEvents; + FSPanelSearchLand* mPanelLand; + FSPanelSearchClassifieds* mPanelClassifieds; + FSPanelSearchWeb* mPanelWeb; + + LLPanel* mDetailsPanel; + LLTextEditor* mDetailTitle; + LLTextEditor* mDetailDesc; + LLTextEditor* mDetailAux1; + LLTextEditor* mDetailAux2; + LLTextEditor* mDetailLocation; + LLTextureCtrl* mDetailSnapshot; + LLTextureCtrl* mDetailSnapshotParcel; + LLIconCtrl* mDetailMaturity; + LLTabContainer* mTabContainer; +}; + +#endif // FS_FLOATERSEARCH_H diff --git a/indra/newview/lleventnotifier.cpp b/indra/newview/lleventnotifier.cpp index 4bc481b21ec2415fee09a4e9cbfd283b70b81759..04aad5aa0f41176cabe0a61dd6e98c4157a636ad 100644 --- a/indra/newview/lleventnotifier.cpp +++ b/indra/newview/lleventnotifier.cpp @@ -168,8 +168,7 @@ bool LLEventNotifier::handleResponse(U32 eventId, const LLSD& notification, cons bool LLEventNotifier::add(const LLEventStruct& event) { - if (mNewEventSignal(event)) { return false; } - + if (mNewEventSignal(event)) return false; LLEventNotification *new_enp = new LLEventNotification(event.eventId, event.eventEpoch, event.eventDateStr, event.eventName); LL_INFOS() << "Add event " << event.eventName << " id " << event.eventId << " date " << event.eventDateStr << LL_ENDL; @@ -208,21 +207,21 @@ void LLEventNotifier::processEventInfoReply(LLMessageSystem *msg, void **) U32 event_time_utc; msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); - msg->getU32Fast(_PREHASH_EventData, _PREHASH_EventID, event_id); - msg->getStringFast(_PREHASH_EventData, _PREHASH_Name, event_name); - msg->getStringFast(_PREHASH_EventData, _PREHASH_Date, eventd_date); - msg->getU32Fast(_PREHASH_EventData, _PREHASH_DateUTC, event_time_utc); + msg->getU32("EventData", "EventID", event_id); + msg->getString("EventData", "Name", event_name); + msg->getString("EventData", "Date", eventd_date); + msg->getU32("EventData", "DateUTC", event_time_utc); LLEventStruct event(event_id, (F64)event_time_utc, eventd_date, event_name); - msg->getString(_PREHASH_EventData, _PREHASH_Creator, event.creator); - msg->getString(_PREHASH_EventData, _PREHASH_Category, event.category); - msg->getString(_PREHASH_EventData, _PREHASH_Desc, event.desc); - msg->getU32(_PREHASH_EventData, _PREHASH_Duration, event.duration); - msg->getU32(_PREHASH_EventData, _PREHASH_Cover, event.cover); - msg->getU32(_PREHASH_EventData, _PREHASH_Amount, event.amount); - msg->getString(_PREHASH_EventData, _PREHASH_SimName, event.simName); - msg->getVector3d(_PREHASH_EventData, _PREHASH_GlobalPos, event.globalPos); - msg->getU32(_PREHASH_EventData, _PREHASH_EventFlags, event.flags); + msg->getString("EventData", "Creator", event.creator); + msg->getString("EventData", "Category", event.category); + msg->getString("EventData", "Desc", event.desc); + msg->getU32("EventData", "Duration", event.duration); + msg->getU32("EventData", "Cover", event.cover); + msg->getU32("EventData", "Amount", event.amount); + msg->getString("EventData", "SimName", event.simName); + msg->getVector3d("EventData", "GlobalPos", event.globalPos); + msg->getU32("EventData", "EventFlags", event.flags); gEventNotifier.add(event); } @@ -247,22 +246,29 @@ void LLEventNotifier::load(const LLSD& event_options) is_iso8601_date = true; } - std::string dateStr = response["event_date"].asString(); - if (is_iso8601_date) { - std::string iso8601date = - "[" + LLTrans::getString("LTimeYear") + "]-[" + LLTrans::getString("LTimeMthNum") + "]-[" - + LLTrans::getString("LTimeDay") + "] [" + LLTrans::getString("LTimeHour") + "]:[" - + LLTrans::getString("LTimeMin") + "]:[" + LLTrans::getString("LTimeSec") + "]"; + std::string dateStr; + + dateStr = "[" + LLTrans::getString("LTimeYear") + "]-[" + + LLTrans::getString("LTimeMthNum") + "]-[" + + LLTrans::getString("LTimeDay") + "] [" + + LLTrans::getString("LTimeHour") + "]:[" + + LLTrans::getString("LTimeMin") + "]:[" + + LLTrans::getString("LTimeSec") + "]"; LLSD substitution; substitution["datetime"] = date; - LLStringUtil::format(iso8601date, substitution); - dateStr = iso8601date; - } + LLStringUtil::format(dateStr, substitution); - add(LLEventStruct(response["event_id"].asInteger(), response["event_date_ut"], dateStr, response["event_name"].asString())); + LLEventStruct event(response["event_id"].asInteger(), response["event_date_ut"], dateStr, response["event_name"].asString()); + add(event); + } + else + { + LLEventStruct event(response["event_id"].asInteger(), response["event_date_ut"], response["event_date"].asString(), response["event_name"].asString()); + add(event); + } } } @@ -305,11 +311,11 @@ void LLEventNotifier::serverPushRequest(U32 event_id, bool add) } -LLEventNotification::LLEventNotification(U32 eventId, F64 eventEpoch, const std::string& eventDateStr, const std::string &eventName) : +LLEventNotification::LLEventNotification(U32 eventId, F64 eventEpoch, std::string eventDateStr, std::string eventName) : mEventID(eventId), - mEventName(eventName), + mEventName(std::move(eventName)), mEventDateEpoch(eventEpoch), - mEventDateStr(eventDateStr) + mEventDateStr(std::move(eventDateStr)) { } diff --git a/indra/newview/lleventnotifier.h b/indra/newview/lleventnotifier.h index 14ced4908d8fe417ac18d6cf1f760fe2dedc6e6d..f30039f51b0fc5fcd16ade19d0980d99b58be5c9 100644 --- a/indra/newview/lleventnotifier.h +++ b/indra/newview/lleventnotifier.h @@ -27,6 +27,7 @@ #ifndef LL_LLEVENTNOTIFIER_H #define LL_LLEVENTNOTIFIER_H +#include <utility> #include "llframetimer.h" #include "v3dmath.h" @@ -47,9 +48,9 @@ typedef struct event_st{ std::string simName; LLVector3d globalPos; U32 flags = 0; - event_st(U32 id, F64 epoch, const std::string& date_str, const std::string& name) - : eventId(id), eventEpoch(epoch), eventDateStr(date_str), eventName(name){} - event_st(){} + event_st(U32 id, F64 epoch, std::string date_str, std::string name) + : eventId(id), eventEpoch(epoch), eventDateStr(std::move(date_str)), eventName(std::move(name)){} + event_st() = default; } LLEventStruct; class LLEventNotifier @@ -90,12 +91,12 @@ class LLEventNotifier class LLEventNotification { public: - LLEventNotification(U32 eventId, F64 eventEpoch, const std::string& eventDateStr, const std::string &eventName); + LLEventNotification(U32 eventId, F64 eventEpoch, std::string eventDateStr, std::string eventName); U32 getEventID() const { return mEventID; } const std::string &getEventName() const { return mEventName; } - bool isValid() const { return mEventID > 0 && mEventDateEpoch != 0 && mEventName.size() > 0; } + bool isValid() const { return mEventID > 0 && mEventDateEpoch != 0 && !mEventName.empty(); } const F64 &getEventDateEpoch() const { return mEventDateEpoch; } const std::string &getEventDateStr() const { return mEventDateStr; } diff --git a/indra/newview/llfloaterdirectory.cpp b/indra/newview/llfloaterdirectory.cpp deleted file mode 100644 index 1df46a66fdbeb6d7ce81e9a480eaccf6f2aff56c..0000000000000000000000000000000000000000 --- a/indra/newview/llfloaterdirectory.cpp +++ /dev/null @@ -1,1219 +0,0 @@ -/* - * @file llfloaterdirectory.cpp - * @brief Legacy search facility - * - * Copyright (c) 2014-2022, Cinder Roxley <cinder@sdf.org> - * - * Permission is hereby granted, free of charge, to any person or organization - * obtaining a copy of the software and accompanying documentation covered by - * this license (the "Software") to use, reproduce, display, distribute, - * execute, and transmit the Software, and to prepare derivative works of the - * Software, and to permit third-parties to whom the Software is furnished to - * do so, all subject to the following: - * - * The copyright notices in the Software and this entire statement, including - * the above license grant, this restriction and the following disclaimer, - * must be included in all copies of the Software, in whole or in part, and - * all derivative works of the Software, unless such copies or derivative - * works are solely in the form of machine-executable object code generated by - * a source language processor. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT - * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE - * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - */ - -#include "llviewerprecompiledheaders.h" -#include "llfloaterdirectory.h" - -// llmessage -#include "lleventflags.h" -#include "llqueryflags.h" -#include "message.h" - -// llui -#include "llfloaterreg.h" -#include "lllayoutstack.h" -#include "llpanel.h" -#include "llresmgr.h" -#include "llscrolllistctrl.h" -#include "lltabcontainer.h" -#include "lltextbase.h" -#include "lltrans.h" - -// newview -#include "llagent.h" -#include "llpanelsearchbase.h" -#include "llpanelsearchweb.h" -#include "llproductinforequest.h" -#include "llviewercontrol.h" - -SearchQuery::SearchQuery() -: category("category", ""), - collection("collection", ""), - query("query") -{} - -static const std::array<std::string, 6> sSearchPanels{ {"panel_search_people", "panel_search_groups", "panel_search_places", "panel_search_classifieds", "panel_search_events", "panel_search_landsales"} }; -static const std::array<std::string, 5> sDetailPanels{ {"detail_avatar", "detail_group", "detail_place", "detail_classified", "detail_event"} }; - -LLFloaterDirectory::LLFloaterDirectory(const Params& key) - : LLFloater(key) - , mCurrentResultType(SE_UNDEFINED) - , mCurrentQuery() - , mResultStart(0) - , mNumResultsReceived(0) - , mQueryID() - , mTabContainer(nullptr) - , mPanelWeb(nullptr) - , mResultList(nullptr) - , mResultsStatus(nullptr) -{ -} - -LLFloaterDirectory::~LLFloaterDirectory() -{ -} - -BOOL LLFloaterDirectory::postBuild() -{ - mResultList = findChild<LLScrollListCtrl>("results"); - mResultList->setCommitCallback(boost::bind(&LLFloaterDirectory::onCommitSelection, this)); - for (std::string panel_name: sSearchPanels) - { - LLPanelSearch* panel = static_cast<LLPanelSearch*>(findChild<LLUICtrl>(panel_name)); - if (panel) - panel->setSearchFloater(this); - } - mPanelWeb = findChild<LLPanelSearchWeb>("panel_search_web"); - mTabContainer = findChild<LLTabContainer>("search_tabs"); - mTabContainer->setCommitCallback(boost::bind(&LLFloaterDirectory::onTabChanged, this)); - setProgress(false); - mResultsStatus = findChild<LLTextBase>("results_status"); - getChild<LLButton>("PageUp")->setCommitCallback(boost::bind(&LLFloaterDirectory::choosePage, this, _1)); - getChild<LLButton>("PageDn")->setCommitCallback(boost::bind(&LLFloaterDirectory::choosePage, this, _1)); - showDetailPanel(LLStringUtil::null); // hide all the panels - paginate(); - - if (!mTabContainer->selectTab(gSavedSettings.getS32("AlchemyLastDirectoryTab"))) - { - mTabContainer->selectFirstTab(); - } - - return LLFloater::postBuild(); -} - -void LLFloaterDirectory::onOpen(const LLSD& key) -{ - Params p(key); - mPanelWeb->loadUrl(p.search); - if (key.has("query")) - { - mTabContainer->selectTabPanel(mPanelWeb); - } - onTabChanged(); -} - -void LLFloaterDirectory::onClose(bool app_quitting) -{ - if (mTabContainer) - { - gSavedSettings.setS32("AlchemyLastDirectoryTab", mTabContainer->getCurrentPanelIndex()); - } -} - -void LLFloaterDirectory::setProgress(bool working) -{ - getChild<LLUICtrl>("loading")->setVisible(working); -} - -void LLFloaterDirectory::setResultsComment(const std::string& message) -{ - mResultList->setCommentText(message); -} - -void LLFloaterDirectory::onTabChanged() -{ - LLPanel* active_panel = mTabContainer->getCurrentPanel(); - bool show_detail = active_panel != mPanelWeb; - findChild<LLLayoutStack>("results_stack")->setVisible(show_detail); - findChild<LLButton>("PageUp")->setVisible(show_detail); - findChild<LLButton>("PageDn")->setVisible(show_detail); - mResultsStatus->setVisible(show_detail); -} - -void LLFloaterDirectory::onCommitSelection() -{ - switch (mCurrentResultType) - { - case SE_PEOPLE: - { - LLSD params; - params["avatar_id"] = mResultList->getSelectedValue().asUUID(); - getChild<LLPanel>("detail_avatar")->onOpen(params); - showDetailPanel("detail_avatar"); - break; - } - case SE_GROUPS: - { - LLSD params; - params["group_id"] = mResultList->getSelectedValue().asUUID(); - getChild<LLPanel>("detail_group")->onOpen(params); - showDetailPanel("detail_group"); - break; - } - case SE_LANDSALES: - case SE_PLACES: - { - LLSD params; - params["type"] = "remote_place"; - params["id"] = mResultList->getSelectedValue().asUUID(); - getChild<LLPanel>("detail_place")->onOpen(params); - showDetailPanel("detail_place"); - break; - } - case SE_CLASSIFIEDS: - { - LLSD params; - params["classified_id"] = mResultList->getSelectedValue().asUUID(); - getChild<LLPanel>("detail_classified")->onOpen(params); - showDetailPanel("detail_classified"); - break; - } - case SE_EVENTS: - { - getChild<LLPanel>("detail_event")->onOpen(mResultList->getSelectedValue().asInteger()); - showDetailPanel("detail_event"); - break; - } - case SE_UNDEFINED: - default: - LL_WARNS("Search") << "Unhandled search mode: " << mCurrentResultType << LL_ENDL; - break; - } -} - -void LLFloaterDirectory::paginate() -{ - if (mNumResultsReceived) - { - LLStringUtil::format_map_t args; - std::string total_str; - LLResMgr::getInstance()->getIntegerString(total_str, mResultStart + mNumResultsReceived - 1); - args["TOTAL"] = total_str; - args["VISIBLE_END"] = total_str; - total_str = LLStringUtil::null; - LLResMgr::getInstance()->getIntegerString(total_str, mResultStart + 1); - args["VISIBLE_BEGIN"] = total_str; - mResultsStatus->setText(getString((mNumResultsReceived > mCurrentQuery.results_per_page) - ? "result_spillover" : "result_count", - args)); - } - else - mResultsStatus->setText(getString("no_results")); - childSetEnabled("PageUp", mNumResultsReceived > mCurrentQuery.results_per_page); - childSetEnabled("PageDn", mResultStart > 0); -} - -void LLFloaterDirectory::choosePage(LLUICtrl* ctrl) -{ - if (ctrl->getName() == "PageUp") - mResultStart += mCurrentQuery.results_per_page; - else if (ctrl->getName() == "PageDn") - mResultStart -= mCurrentQuery.results_per_page; - else - { - LL_WARNS("Search") << "Unknown control: " << ctrl->getName() << LL_ENDL; - return; // Fuck you, you lose. - } - queryDirectory(mCurrentQuery, false); -} - -void LLFloaterDirectory::showDetailPanel(const std::string& panel_name) -{ - for (const std::string& panel_itr: sDetailPanels) - { - getChild<LLPanel>(panel_itr)->setVisible(panel_itr == panel_name); - } -} - -void LLFloaterDirectory::rebuildResultList() -{ - mResultList->clearColumns(); - switch (mCurrentResultType) - { - case SE_PEOPLE: - { - LLScrollListColumn::Params icon; - icon.name = "icon"; - icon.width.pixel_width = 20; - mResultList->addColumn(icon); - - LLScrollListColumn::Params name; - name.name = "name"; - name.header.label = "Name"; - name.width.relative_width = 1.f; - mResultList->addColumn(name); - break; - } - case SE_GROUPS: - { - LLScrollListColumn::Params icon; - icon.name = "icon"; - icon.width.pixel_width = 20; - mResultList->addColumn(icon); - - LLScrollListColumn::Params name; - name.name = "name"; - name.header.label = "Name"; - name.width.relative_width = 0.72f; - mResultList->addColumn(name); - - LLScrollListColumn::Params members; - members.name = "members"; - members.header.label = "Members"; - members.width.relative_width = 0.25f; - mResultList->addColumn(members); - - LLScrollListColumn::Params score; - score.name = "score"; - score.header.label = "Score"; - score.width.relative_width = 0.03f; - mResultList->addColumn(score); - break; - } - case SE_PLACES: - { - LLScrollListColumn::Params icon; - icon.name = "icon"; - icon.width.pixel_width = 20; - mResultList->addColumn(icon); - - LLScrollListColumn::Params name; - name.name = "name"; - name.header.label = "Name"; - name.width.relative_width = 0.81f; - mResultList->addColumn(name); - - LLScrollListColumn::Params dwell; - dwell.name = "dwell"; - dwell.header.label = "Traffic"; - dwell.width.relative_width = 0.19f; - mResultList->addColumn(dwell); - break; - } - case SE_LANDSALES: - { - LLScrollListColumn::Params icon; - icon.name = "icon"; - icon.width.pixel_width = 20; - mResultList->addColumn(icon); - - LLScrollListColumn::Params name; - name.name = "name"; - name.header.label = "Name"; - name.width.relative_width = 0.45f; - mResultList->addColumn(name); - - LLScrollListColumn::Params price; - price.name="price"; - price.header.label="Price"; - price.width.relative_width = 0.1f; - mResultList->addColumn(price); - - LLScrollListColumn::Params area; - area.name="area"; - area.header.label="Area"; - area.width.relative_width = 0.1f; - mResultList->addColumn(area); - - LLScrollListColumn::Params ppm; - ppm.name="ppm"; - ppm.header.label="L$/m"; - ppm.width.relative_width = 0.1f; - mResultList->addColumn(ppm); - - LLScrollListColumn::Params type; - type.name="type"; - type.header.label="Type"; - type.width.relative_width = 0.2f; - mResultList->addColumn(type); - break; - } - case SE_CLASSIFIEDS: - { - LLScrollListColumn::Params icon; - icon.name = "icon"; - icon.width.pixel_width = 20; - mResultList->addColumn(icon); - - LLScrollListColumn::Params name; - name.name = "name"; - name.header.label = "Name"; - name.width.relative_width = 0.7f; - mResultList->addColumn(name); - - LLScrollListColumn::Params price; - price.name="price"; - price.header.label="Price"; - price.width.relative_width = 0.3f; - mResultList->addColumn(price); - break; - } - case SE_EVENTS: - { - LLScrollListColumn::Params icon; - icon.name = "icon"; - icon.width.pixel_width = 20; - mResultList->addColumn(icon); - - LLScrollListColumn::Params name; - name.name = "name"; - name.header.label = "Name"; - name.width.relative_width = 0.65f; - mResultList->addColumn(name); - - //LLScrollListColumn::Params time; - //time.name="time"; - //time.header.label="Time"; - //time.width.relative_width = 0.2f; - //mResultList->addColumn(time); - - LLScrollListColumn::Params date; - date.name="date"; - date.header.label="Date"; - date.width.relative_width = 0.3f; - mResultList->addColumn(date); - break; - } - case SE_UNDEFINED: - default: - LL_WARNS("Search") << "Unhandled search mode: " << mCurrentResultType << LL_ENDL; - break; - - } -} - -void LLFloaterDirectory::queryDirectory(const LLDirQuery& query, bool new_search) -{ - if (mCurrentResultType != query.type) - { - mCurrentResultType = query.type; - rebuildResultList(); - } - mResultList->clearRows(); - - if (new_search) - { - mResultStart = 0; - } - - mCurrentQuery = query; - mNumResultsReceived = 0; - mQueryID.generate(); - - switch (mCurrentResultType) - { - case SE_PEOPLE: - { - gMessageSystem->newMessageFast(_PREHASH_DirFindQuery); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - gMessageSystem->nextBlockFast(_PREHASH_QueryData); - gMessageSystem->addUUIDFast(_PREHASH_QueryID, mQueryID); - gMessageSystem->addStringFast(_PREHASH_QueryText, query.text); - gMessageSystem->addU32Fast(_PREHASH_QueryFlags, DFQ_PEOPLE); - gMessageSystem->addS32Fast(_PREHASH_QueryStart, mResultStart); - gAgent.sendReliableMessage(); - LL_DEBUGS("Search") << "Firing off search request: " << mQueryID << LL_ENDL; - break; - } - case SE_GROUPS: - { - gMessageSystem->newMessageFast(_PREHASH_DirFindQuery); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - gMessageSystem->nextBlockFast(_PREHASH_QueryData); - gMessageSystem->addUUIDFast(_PREHASH_QueryID, mQueryID); - gMessageSystem->addStringFast(_PREHASH_QueryText, query.text); - gMessageSystem->addU32Fast(_PREHASH_QueryFlags, query.scope); - gMessageSystem->addS32Fast(_PREHASH_QueryStart, mResultStart); - gAgent.sendReliableMessage(); - LL_DEBUGS("Search") << "Firing off search request: " << mQueryID << LL_ENDL; - break; - } - case SE_EVENTS: - { - gMessageSystem->newMessageFast(_PREHASH_DirFindQuery); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - gMessageSystem->nextBlockFast(_PREHASH_QueryData); - gMessageSystem->addUUIDFast(_PREHASH_QueryID, mQueryID); - gMessageSystem->addStringFast(_PREHASH_QueryText, query.text); - gMessageSystem->addU32Fast(_PREHASH_QueryFlags, query.scope); - gMessageSystem->addS32Fast(_PREHASH_QueryStart, mResultStart); - gAgent.sendReliableMessage(); - LL_DEBUGS("Search") << "Firing off search request: " << mQueryID << " Search Text: " << query.text << LL_ENDL; - break; - } - case SE_PLACES: - { - gMessageSystem->newMessageFast(_PREHASH_DirPlacesQuery); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - gMessageSystem->nextBlockFast(_PREHASH_QueryData); - gMessageSystem->addUUIDFast(_PREHASH_QueryID, mQueryID); - gMessageSystem->addStringFast(_PREHASH_QueryText, query.text); - gMessageSystem->addU32Fast(_PREHASH_QueryFlags, query.scope); - gMessageSystem->addS8Fast(_PREHASH_Category, query.category_char); - // TODO: Search filter by region name. - gMessageSystem->addStringFast(_PREHASH_SimName, ""); - gMessageSystem->addS32Fast(_PREHASH_QueryStart, mResultStart); - gAgent.sendReliableMessage(); - LL_DEBUGS("Search") << "Firing off search request: " << mQueryID << LL_ENDL; - break; - } - case SE_LANDSALES: - { - gMessageSystem->newMessageFast(_PREHASH_DirLandQuery); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - gMessageSystem->nextBlockFast(_PREHASH_QueryData); - gMessageSystem->addUUIDFast(_PREHASH_QueryID, mQueryID); - gMessageSystem->addU32Fast(_PREHASH_QueryFlags, query.scope); - gMessageSystem->addU32Fast(_PREHASH_SearchType, query.category_int); - gMessageSystem->addS32Fast(_PREHASH_Price, query.price); - gMessageSystem->addS32Fast(_PREHASH_Area, query.area); - gMessageSystem->addS32Fast(_PREHASH_QueryStart, mResultStart); - gAgent.sendReliableMessage(); - LL_DEBUGS("Search") << "Firing off search request: " << mQueryID << query.category_int << LL_ENDL; - break; - } - case SE_CLASSIFIEDS: - { - gMessageSystem->newMessageFast(_PREHASH_DirClassifiedQuery); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - gMessageSystem->nextBlockFast(_PREHASH_QueryData); - gMessageSystem->addUUIDFast(_PREHASH_QueryID, mQueryID); - gMessageSystem->addStringFast(_PREHASH_QueryText, query.text); - gMessageSystem->addU32Fast(_PREHASH_QueryFlags, query.scope); - gMessageSystem->addU32Fast(_PREHASH_Category, query.category_int); - gMessageSystem->addS32Fast(_PREHASH_QueryStart, mResultStart); - gAgent.sendReliableMessage(); - LL_DEBUGS("Search") << "Firing off search request: " << mQueryID << LL_ENDL; - break; - } - case SE_UNDEFINED: - default: - break; - } - mResultList->setCommentText(getString("searching")); - setProgress(true); -} - -//static -void LLFloaterDirectory::processSearchPeopleReply(LLMessageSystem* msg, void**) -{ - LLUUID query_id; - std::string first_name; - std::string last_name; - LLUUID agent_id; - U8 online; - //S32 reputation; - - msg->getUUIDFast(_PREHASH_QueryData, _PREHASH_QueryID, query_id); - msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); - - if (agent_id != gAgent.getID()) return; // not for us - LL_DEBUGS("Search") << "Received results for query id: " << query_id << LL_ENDL; - - // *TODO: Get rid of this so we can have multiple search windows - LLFloaterDirectory* self = LLFloaterReg::findTypedInstance<LLFloaterDirectory>("search"); - if (self == nullptr || query_id != self->mQueryID) return; // not the result we're waiting for - self->setProgress(false); - - LLScrollListCtrl* pResults = self->mResultList; - - S32 num_new_rows = msg->getNumberOfBlocksFast(_PREHASH_QueryReplies); - if (num_new_rows == 0) - { - LLStringUtil::format_map_t map; - map["[TEXT]"] = self->mCurrentQuery.text; - pResults->setCommentText(self->getString("not_found", map)); - } - - self->mNumResultsReceived += num_new_rows; - - for (S32 i = 0; i < num_new_rows; ++i) - { - msg->getStringFast( _PREHASH_QueryReplies, _PREHASH_FirstName, first_name, i); - msg->getStringFast( _PREHASH_QueryReplies, _PREHASH_LastName, last_name, i); - msg->getUUIDFast( _PREHASH_QueryReplies, _PREHASH_AgentID, agent_id, i); - //msg->getS32Fast( _PREHASH_QueryReplies, _PREHASH_Reputation, reputation, i); - msg->getU8Fast( _PREHASH_QueryReplies, _PREHASH_Online, online, i); - - if (agent_id.isNull()) - { - LL_INFOS("Search") << "Null result returned for QueryID: " << query_id << LL_ENDL; - LLStringUtil::format_map_t map; - map["[TEXT]"] = self->mCurrentQuery.text; - pResults->setCommentText(self->getString("not_found", map)); - } - else - { - LL_DEBUGS("Search") << "Got: " << first_name << " " << last_name << " AgentID: " << agent_id << LL_ENDL; - pResults->setEnabled(TRUE); - - std::string avatar_name = LLCacheName::buildFullName(first_name, last_name); - - LLSD element; - element["id"] = agent_id; - - element["columns"][0]["column"] = "icon"; - element["columns"][0]["type"] = "icon"; - element["columns"][0]["value"] = online ? "icon_avatar_online.tga" : "icon_avatar_offline.tga"; - - element["columns"][1]["column"] = "name"; - element["columns"][1]["value"] = avatar_name; - - pResults->addElement(element, ADD_BOTTOM); - } - } - self->paginate(); -} - -//static -void LLFloaterDirectory::processSearchGroupsReply(LLMessageSystem* msg, void**) -{ - LLUUID query_id; - LLUUID group_id; - LLUUID agent_id; - std::string group_name; - S32 members; - F32 search_order; - - msg->getUUIDFast(_PREHASH_QueryData, _PREHASH_QueryID, query_id); - msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); - - if (agent_id != gAgent.getID()) return; // not for us - LL_DEBUGS("Search") << "Received results for query id: " << query_id << LL_ENDL; - - LLFloaterDirectory* self = LLFloaterReg::findTypedInstance<LLFloaterDirectory>("search"); - if (self == nullptr || query_id != self->mQueryID) return; // not the result we're waiting for - - self->setProgress(false); - LLScrollListCtrl* pResults = self->mResultList; - - // Check for status messages - if (msg->getNumberOfBlocks("StatusData")) - { - U32 status; - msg->getU32("StatusData", "Status", status); - if (status & STATUS_SEARCH_PLACES_FOUNDNONE) - { - LLStringUtil::format_map_t map; - map["[TEXT]"] = self->getChild<LLUICtrl>("groups_edit")->getValue().asString(); - pResults->setCommentText(self->getString("not_found", map)); - return; - } - else if(status & STATUS_SEARCH_PLACES_SHORTSTRING) - { - pResults->setCommentText(self->getString("search_short")); - return; - } - else if (status & STATUS_SEARCH_PLACES_BANNEDWORD) - { - pResults->setCommentText(self->getString("search_banned")); - return; - } - else if (status & STATUS_SEARCH_PLACES_SEARCHDISABLED) - { - pResults->setCommentText(self->getString("search_disabled")); - return; - } - } - - S32 num_new_rows = msg->getNumberOfBlocksFast(_PREHASH_QueryReplies); - if (num_new_rows == 0) - { - LLStringUtil::format_map_t map; - map["[TEXT]"] = self->mCurrentQuery.text; - pResults->setCommentText(self->getString("not_found", map)); - } - - self->mNumResultsReceived += num_new_rows; - for (S32 i = 0; i < num_new_rows; ++i) - { - msg->getUUIDFast( _PREHASH_QueryReplies, _PREHASH_GroupID, group_id, i); - msg->getStringFast( _PREHASH_QueryReplies, _PREHASH_GroupName, group_name, i); - msg->getS32Fast( _PREHASH_QueryReplies, _PREHASH_Members, members, i); - msg->getF32Fast( _PREHASH_QueryReplies, _PREHASH_SearchOrder, search_order,i); - if (group_id.isNull()) - { - LL_DEBUGS("Search") << "No results returned for QueryID: " << query_id << LL_ENDL; - LLStringUtil::format_map_t map; - map["[TEXT]"] = self->mCurrentQuery.text; - pResults->setCommentText(self->getString("not_found", map)); - } - else - { - LL_DEBUGS("Search") << "Got: " << group_name << " GroupID: " << group_id << LL_ENDL; - pResults->setEnabled(TRUE); - - LLSD element; - - element["id"] = group_id; - - element["columns"][0]["column"] = "icon"; - element["columns"][0]["type"] = "icon"; - element["columns"][0]["value"] = "Icon_Group"; - - element["columns"][1]["column"] = "name"; - element["columns"][1]["value"] = group_name; - - element["columns"][2]["column"] = "members"; - element["columns"][2]["value"] = members; - - element["columns"][3]["column"] = "score"; - element["columns"][3]["value"] = search_order; - - pResults->addElement(element, ADD_BOTTOM); - } - } - self->paginate(); -} - -//static -void LLFloaterDirectory::processSearchPlacesReply(LLMessageSystem* msg, void**) -{ - LLUUID agent_id; - LLUUID query_id; - LLUUID parcel_id; - std::string name; - BOOL for_sale; - BOOL auction; - F32 dwell; - - msg->getUUIDFast(_PREHASH_QueryData, _PREHASH_QueryID, query_id); - msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); - - if (agent_id != gAgent.getID()) return; // not for us - LL_DEBUGS("Search") << "Received results for query id: " << query_id << LL_ENDL; - - LLFloaterDirectory* self = LLFloaterReg::findTypedInstance<LLFloaterDirectory>("search"); - if (self == nullptr || query_id != self->mQueryID) return; // not the result we're waiting for - - self->setProgress(false); - LLScrollListCtrl* pResults = self->mResultList; - - // Check for status messages - if (msg->getNumberOfBlocks("StatusData")) - { - U32 status; - msg->getU32("StatusData", "Status", status); - if (status & STATUS_SEARCH_PLACES_FOUNDNONE) - { - LLStringUtil::format_map_t map; - map["[TEXT]"] = self->mCurrentQuery.text; - pResults->setCommentText(self->getString("not_found", map)); - return; - } - else if(status & STATUS_SEARCH_PLACES_SHORTSTRING) - { - pResults->setCommentText(self->getString("search_short")); - return; - } - else if (status & STATUS_SEARCH_PLACES_BANNEDWORD) - { - pResults->setCommentText(self->getString("search_banned")); - return; - } - else if (status & STATUS_SEARCH_PLACES_SEARCHDISABLED) - { - pResults->setCommentText(self->getString("search_disabled")); - return; - } - } - - S32 num_new_rows = msg->getNumberOfBlocksFast(_PREHASH_QueryReplies); - if (num_new_rows == 0) - { - LLStringUtil::format_map_t map; - map["[TEXT]"] = self->mCurrentQuery.text; - pResults->setCommentText(self->getString("not_found", map)); - } - - self->mNumResultsReceived += num_new_rows; - for (S32 i = 0; i < num_new_rows; ++i) - { - msg->getUUID( "QueryReplies", "ParcelID", parcel_id, i); - msg->getString( "QueryReplies", "Name", name, i); - msg->getBOOL( "QueryReplies", "ForSale", for_sale, i); - msg->getBOOL( "QueryReplies", "Auction", auction, i); - msg->getF32( "QueryReplies", "Dwell", dwell, i); - if (parcel_id.isNull()) - { - LL_DEBUGS("Search") << "Null result returned for QueryID: " << query_id << LL_ENDL; - LLStringUtil::format_map_t map; - map["[TEXT]"] = self->mCurrentQuery.text; - pResults->setCommentText(self->getString("not_found", map)); - } - else - { - LL_DEBUGS("Search") << "Got: " << name << " ParcelID: " << parcel_id << LL_ENDL; - pResults->setEnabled(TRUE); - - LLSD element; - - element["id"] = parcel_id; - - if (auction) - { - element["columns"][0]["column"] = "icon"; - element["columns"][0]["type"] = "icon"; - element["columns"][0]["value"] = "Icon_Auction"; - } - else if (for_sale) - { - element["columns"][0]["column"] = "icon"; - element["columns"][0]["type"] = "icon"; - element["columns"][0]["value"] = "Icon_For_Sale"; - } - else - { - element["columns"][0]["column"] = "icon"; - element["columns"][0]["type"] = "icon"; - element["columns"][0]["value"] = "Icon_Place"; - } - - element["columns"][1]["column"] = "name"; - element["columns"][1]["value"] = name; - - std::string buffer = llformat("%.0f", dwell); - element["columns"][2]["column"] = "dwell"; - element["columns"][2]["value"] = buffer; - - pResults->addElement(element, ADD_BOTTOM); - } - } - self->paginate(); -} - -//static -void LLFloaterDirectory::processSearchClassifiedsReply(LLMessageSystem* msg, void**) -{ - LLUUID agent_id; - LLUUID query_id; - LLUUID classified_id; - std::string name; - U32 creation_date; - U32 expiration_date; - S32 price_for_listing; - - msg->getUUIDFast(_PREHASH_QueryData, _PREHASH_QueryID, query_id); - msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); - - if (agent_id != gAgent.getID()) return; // not for us - LL_DEBUGS("Search") << "Received results for query id: " << query_id << LL_ENDL; - - LLFloaterDirectory* self = LLFloaterReg::findTypedInstance<LLFloaterDirectory>("search"); - if (self == nullptr || query_id != self->mQueryID) return; // not the result we're waiting for - - self->setProgress(false); - LLScrollListCtrl* pResults = self->mResultList; - - // Check for status messages - if (msg->getNumberOfBlocks("StatusData")) - { - U32 status; - msg->getU32("StatusData", "Status", status); - if (status & STATUS_SEARCH_PLACES_FOUNDNONE) - { - LLStringUtil::format_map_t map; - map["[TEXT]"] = self->mCurrentQuery.text; - pResults->setCommentText(self->getString("not_found", map)); - return; - } - else if(status & STATUS_SEARCH_PLACES_SHORTSTRING) - { - pResults->setCommentText(self->getString("search_short")); - return; - } - else if (status & STATUS_SEARCH_PLACES_BANNEDWORD) - { - pResults->setCommentText(self->getString("search_banned")); - return; - } - else if (status & STATUS_SEARCH_PLACES_SEARCHDISABLED) - { - pResults->setCommentText(self->getString("search_disabled")); - return; - } - } - - S32 num_new_rows = msg->getNumberOfBlocksFast(_PREHASH_QueryReplies); - if (num_new_rows == 0) - { - LLStringUtil::format_map_t map; - map["[TEXT]"] = self->mCurrentQuery.text; - pResults->setCommentText(self->getString("not_found", map)); - } - - self->mNumResultsReceived += num_new_rows; - for (S32 i = 0; i < num_new_rows; ++i) - { - msg->getUUID( "QueryReplies", "ClassifiedID", classified_id, i); - msg->getString( "QueryReplies", "Name", name, i); - msg->getU32( "QueryReplies", "CreationDate", creation_date, i); - msg->getU32( "QueryReplies", "ExpirationDate", expiration_date,i); - msg->getS32( "QueryReplies", "PriceForListing", price_for_listing,i); - if (classified_id.isNull()) - { - LL_DEBUGS("Search") << "No results returned for QueryID: " << query_id << LL_ENDL; - LLStringUtil::format_map_t map; - map["[TEXT]"] = self->mCurrentQuery.text; - pResults->setCommentText(self->getString("not_found", map)); - } - else - { - LL_DEBUGS("Search") << "Got: " << name << " ClassifiedID: " << classified_id << LL_ENDL; - pResults->setEnabled(TRUE); - - LLSD element; - - element["id"] = classified_id; - - element["columns"][0]["column"] = "icon"; - element["columns"][0]["type"] = "icon"; - element["columns"][0]["value"] = "icon_top_pick.tga"; - - element["columns"][1]["column"] = "name"; - element["columns"][1]["value"] = name; - - element["columns"][2]["column"] = "price"; - element["columns"][2]["value"] = price_for_listing; - - pResults->addElement(element, ADD_BOTTOM); - } - } - self->paginate(); -} - -// static -void LLFloaterDirectory::processSearchLandReply(LLMessageSystem* msg, void**) -{ - LLUUID agent_id; - LLUUID query_id; - LLUUID parcel_id; - std::string name; - std::string land_sku; - std::string land_type; - BOOL auction; - BOOL for_sale; - S32 price; - S32 area; - - msg->getUUIDFast(_PREHASH_QueryData, _PREHASH_QueryID, query_id); - msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); - - if (agent_id != gAgent.getID()) return; // not for us - LL_DEBUGS("Search") << "Received results for query id: " << query_id << LL_ENDL; - - LLFloaterDirectory* self = LLFloaterReg::findTypedInstance<LLFloaterDirectory>("search"); - if (self == nullptr || query_id != self->mQueryID) return; // not the result we're waiting for - - self->setProgress(false); - LLScrollListCtrl* pResults = self->mResultList; - - // Check for status messages - if (msg->getNumberOfBlocks("StatusData")) - { - U32 status; - msg->getU32("StatusData", "Status", status); - if (status & STATUS_SEARCH_PLACES_FOUNDNONE) - { - LLStringUtil::format_map_t map; - map["[TEXT]"] = self->mCurrentQuery.text; - pResults->setCommentText(self->getString("not_found", map)); - return; - } - else if(status & STATUS_SEARCH_PLACES_SHORTSTRING) - { - pResults->setCommentText(self->getString("search_short")); - return; - } - else if (status & STATUS_SEARCH_PLACES_BANNEDWORD) - { - pResults->setCommentText(self->getString("search_banned")); - return; - } - else if (status & STATUS_SEARCH_PLACES_SEARCHDISABLED) - { - pResults->setCommentText(self->getString("search_disabled")); - return; - } - } - - S32 num_new_rows = msg->getNumberOfBlocksFast(_PREHASH_QueryReplies); - if (num_new_rows == 0) - { - LLStringUtil::format_map_t map; - map["[TEXT]"] = self->mCurrentQuery.text; - pResults->setCommentText(self->getString("not_found", map)); - } - - self->mNumResultsReceived += num_new_rows; - for (S32 i = 0; i < num_new_rows; ++i) - { - msg->getUUID( "QueryReplies", "ParcelID", parcel_id, i); - msg->getString( "QueryReplies", "Name", name, i); - msg->getBOOL( "QueryReplies", "Auction", auction, i); - msg->getBOOL( "QueryReplies", "ForSale", for_sale, i); - msg->getS32( "QueryReplies", "SalePrice", price, i); - msg->getS32( "QueryReplies", "ActualArea", area, i); - if (parcel_id.isNull()) - { - LL_DEBUGS("Search") << "Null result returned for QueryID: " << query_id << LL_ENDL; - pResults->setCommentText(self->getString("no_results")); - } - else - { - LL_DEBUGS("Search") << "Got: " << name << " ClassifiedID: " << parcel_id << LL_ENDL; - pResults->setEnabled(TRUE); - if ( msg->getSizeFast(_PREHASH_QueryReplies, i, _PREHASH_ProductSKU) > 0 ) - { - msg->getStringFast( _PREHASH_QueryReplies, _PREHASH_ProductSKU, land_sku, i); - land_type = LLProductInfoRequestManager::instance().getDescriptionForSku(land_sku); - } - else - { - land_sku.clear(); - land_type = LLTrans::getString("land_type_unknown"); - } - if (parcel_id.isNull()) - continue; - - LLSD element; - - element["id"] = parcel_id; - if (auction) - { - element["columns"][0]["column"] = "icon"; - element["columns"][0]["type"] = "icon"; - element["columns"][0]["value"] = "Icon_Auction"; - } - else if (for_sale) - { - element["columns"][0]["column"] = "icon"; - element["columns"][0]["type"] = "icon"; - element["columns"][0]["value"] = "Icon_For_Sale"; - } - else - { - element["columns"][0]["column"] = "icon"; - element["columns"][0]["type"] = "icon"; - element["columns"][0]["value"] = "Icon_Place"; - } - - element["columns"][1]["column"] = "name"; - element["columns"][1]["value"] = name; - - std::string buffer = "Auction"; - if (!auction) - { - buffer = llformat("%d", price); - } - element["columns"][2]["column"] = "price"; - element["columns"][2]["value"] = price; - - element["columns"][3]["column"] = "area"; - element["columns"][3]["value"] = area; - if (!auction) - { - F32 ppm; - if (area > 0) - ppm = (F32)price / (F32)area; - else - ppm = 0.f; - std::string buffer = llformat("%.1f", ppm); - element["columns"][4]["column"] = "ppm"; - element["columns"][4]["value"] = buffer; - } - else - { - element["columns"][4]["column"] = "ppm"; - element["columns"][4]["value"] = "1.0"; - } - - element["columns"][5]["column"] = "type"; - element["columns"][5]["value"] = land_type; - - pResults->addElement(element, ADD_BOTTOM); - } - } - self->paginate(); -} - -// static -void LLFloaterDirectory::processSearchEventsReply(LLMessageSystem* msg, void**) -{ - LLUUID agent_id; - LLUUID query_id; - LLUUID owner_id; - std::string name; - std::string date; - - msg->getUUIDFast(_PREHASH_QueryData, _PREHASH_QueryID, query_id); - msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); - - if (agent_id != gAgent.getID()) return; // not for us - LL_DEBUGS("Search") << "Received results for query id: " << query_id << LL_ENDL; - - LLFloaterDirectory* self = LLFloaterReg::findTypedInstance<LLFloaterDirectory>("search"); - if (self == nullptr || query_id != self->mQueryID) return; // not the result we're waiting for - - self->setProgress(false); - LLScrollListCtrl* pResults = self->mResultList; - - // Check for status messages - if (msg->getNumberOfBlocks("StatusData")) - { - U32 status; - msg->getU32("StatusData", "Status", status); - if (status & STATUS_SEARCH_EVENTS_FOUNDNONE) - { - LLStringUtil::format_map_t map; - map["[TEXT]"] = self->mCurrentQuery.text; - pResults->setCommentText(self->getString("not_found", map)); - return; - } - else if(status & STATUS_SEARCH_EVENTS_SHORTSTRING) - { - pResults->setCommentText(self->getString("search_short")); - return; - } - else if (status & STATUS_SEARCH_EVENTS_BANNEDWORD) - { - pResults->setCommentText(self->getString("search_banned")); - return; - } - else if (status & STATUS_SEARCH_EVENTS_SEARCHDISABLED) - { - pResults->setCommentText(self->getString("search_disabled")); - return; - } - else if (status & STATUS_SEARCH_EVENTS_NODATEOFFSET) - { - pResults->setCommentText(self->getString("search_no_date_offset")); - return; - } - else if (status & STATUS_SEARCH_EVENTS_NOCATEGORY) - { - pResults->setCommentText(self->getString("search_no_events_category")); - return; - } - else if (status & STATUS_SEARCH_EVENTS_NOQUERY) - { - pResults->setCommentText(self->getString("search_no_query")); - return; - } - } - - S32 num_new_rows = msg->getNumberOfBlocksFast(_PREHASH_QueryReplies); - if (num_new_rows == 0) - { - LLStringUtil::format_map_t map; - map["[TEXT]"] = self->mCurrentQuery.text; - pResults->setCommentText(self->getString("not_found", map)); - } - - self->mNumResultsReceived += num_new_rows; - for (S32 i = 0; i < num_new_rows; ++i) - { - U32 event_id; - //U32 unix_time; - U32 event_flags; - - msg->getUUID( "QueryReplies", "OwnerID", owner_id, i); - msg->getString( "QueryReplies", "Name", name, i); - msg->getU32( "QueryReplies", "EventID", event_id, i); - msg->getString( "QueryReplies", "Date", date, i); - //msg->getU32( "QueryReplies", "UnixTime", unix_time, i); - msg->getU32( "QueryReplies", "EventFlags", event_flags,i); - - static LLUICachedControl<bool> inc_pg("ShowPGEvents", true); - static LLUICachedControl<bool> inc_mature("ShowMatureEvents", false); - static LLUICachedControl<bool> inc_adult("ShowAdultEvents", false); - - // Skip empty events... - if (owner_id.isNull()) - { - LL_INFOS("Search") << "Skipped " << event_id << " because of a NULL owner result" << LL_ENDL; - continue; - } - // Skips events that don't match our scope... - if (((event_flags & (EVENT_FLAG_ADULT | EVENT_FLAG_MATURE)) == EVENT_FLAG_NONE) && !inc_pg) - { - LL_INFOS("Search") << "Skipped " << event_id << " because it was out of scope" << LL_ENDL; - continue; - } - if ((event_flags & EVENT_FLAG_MATURE) && !inc_mature) - { - LL_INFOS("Search") << "Skipped " << event_id << " because it was out of scope" << LL_ENDL; - continue; - } - if ((event_flags & EVENT_FLAG_ADULT) && !inc_adult) - { - LL_INFOS("Search") << "Skipped " << event_id << " because it was out of scope" << LL_ENDL; - continue; - } - pResults->setEnabled(TRUE); - - LLSD element; - - element["id"] = llformat("%u", event_id); - - if (event_flags == EVENT_FLAG_ADULT) - { - element["columns"][0]["column"] = "icon"; - element["columns"][0]["type"] = "icon"; - element["columns"][0]["value"] = "Parcel_R_Dark"; - } - else if (event_flags == EVENT_FLAG_MATURE) - { - element["columns"][0]["column"] = "icon"; - element["columns"][0]["type"] = "icon"; - element["columns"][0]["value"] = "Parcel_M_Dark"; - } - else - { - element["columns"][0]["column"] = "icon"; - element["columns"][0]["type"] = "icon"; - element["columns"][0]["value"] = "Parcel_PG_Dark"; - } - - element["columns"][1]["column"] = "name"; - element["columns"][1]["value"] = name; - - element["columns"][2]["column"] = "date"; - element["columns"][2]["value"] = date; - - //element["columns"][3]["column"] = "time"; - //element["columns"][3]["value"] = llformat("%u", unix_time); - - pResults->addElement(element, ADD_BOTTOM); - } - self->paginate(); -} diff --git a/indra/newview/llfloaterdirectory.h b/indra/newview/llfloaterdirectory.h deleted file mode 100644 index 0817f223ab432cc88409a3bda40df146d6d8075f..0000000000000000000000000000000000000000 --- a/indra/newview/llfloaterdirectory.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - * @file llfloaterdirectory.h - * @brief Legacy search facility definitions - * - * Copyright (c) 2014-2022, Cinder Roxley <cinder@sdf.org> - * - * Permission is hereby granted, free of charge, to any person or organization - * obtaining a copy of the software and accompanying documentation covered by - * this license (the "Software") to use, reproduce, display, distribute, - * execute, and transmit the Software, and to prepare derivative works of the - * Software, and to permit third-parties to whom the Software is furnished to - * do so, all subject to the following: - * - * The copyright notices in the Software and this entire statement, including - * the above license grant, this restriction and the following disclaimer, - * must be included in all copies of the Software, in whole or in part, and - * all derivative works of the Software, unless such copies or derivative - * works are solely in the form of machine-executable object code generated by - * a source language processor. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT - * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE - * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - */ - -#ifndef LL_FLOATERDIRECTORY_H -#define LL_FLOATERDIRECTORY_H - -#include "llfloater.h" -#include "llsdparam.h" - -class LLUICtrl; -class LLPanel; -class LLPanelSearchWeb; -class LLScrollListCtrl; -class LLTabContainer; -class LLTextBase; - -static const size_t MIN_SEARCH_STRING_SIZE = 3; - -typedef enum { - SE_UNDEFINED = 0, - SE_PEOPLE, - SE_GROUPS, - SE_PLACES, - SE_LANDSALES, - SE_EVENTS, - SE_CLASSIFIEDS -} ESearch; - -struct SearchQuery : public LLInitParam::Block<SearchQuery> -{ - Optional<std::string> category; - Optional<std::string> collection; - Optional<std::string> query; - - SearchQuery(); -}; - -typedef struct dir_query -{ - dir_query() - : type(SE_UNDEFINED), text(LLStringUtil::null), scope(0), - category_int(0), category_char(0x0), price(0), area(0), results_per_page(100) {} - ESearch type; - std::string text; - U32 scope; - U32 category_int; - S8 category_char; - S32 price; - S32 area; - U32 results_per_page; -} LLDirQuery; - -class LLFloaterDirectory : public LLFloater -{ - friend class LLPanelSearchClassifieds; - friend class LLPanelSearchEvents; - friend class LLPanelSearchGroups; - friend class LLPanelSearchLandSales; - friend class LLPanelSearchPeople; - friend class LLPanelSearchPlaces; - -public: - struct _Params : LLInitParam::Block<_Params, LLFloater::Params> - { - Optional<SearchQuery> search; - }; - typedef LLSDParamAdapter<_Params> Params; - - LLFloaterDirectory(const Params& key); - BOOL postBuild() override; - void onOpen(const LLSD& key) override; - void onClose(bool app_quitting) override; - - static void processSearchPeopleReply(LLMessageSystem* msg, void**); - static void processSearchGroupsReply(LLMessageSystem* msg, void**); - static void processSearchPlacesReply(LLMessageSystem* msg, void**); - static void processSearchClassifiedsReply(LLMessageSystem* msg, void**); - static void processSearchLandReply(LLMessageSystem* msg, void**); - static void processSearchEventsReply(LLMessageSystem* msg, void**); - -protected: - void setProgress(bool working); - void queryDirectory(const LLDirQuery& query, bool new_search = false); - void setResultsComment(const std::string& message); - -private: - ~LLFloaterDirectory(); - void onCommitSelection(); - void choosePage(LLUICtrl* ctrl); - void onTabChanged(); - void paginate(); - void showDetailPanel(const std::string& panel_name); - void rebuildResultList(); - - ESearch mCurrentResultType; - LLDirQuery mCurrentQuery; - S32 mResultStart; - S32 mNumResultsReceived; - LLUUID mQueryID; - - LLTabContainer* mTabContainer; - LLPanelSearchWeb* mPanelWeb; - LLScrollListCtrl* mResultList; - LLTextBase* mResultsStatus; -}; - -#endif // LL_FLOATERDIRECTORY_H diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index b8b95fc711a8e3692df07413770a14e96d4958e0..53f3e818fb37c9d9b519edcef512f36718ae411e 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -59,7 +59,7 @@ //static LLPanelClassifiedInfo::panel_list_t LLPanelClassifiedInfo::sAllPanels; -static LLPanelInjector<LLPanelClassifiedInfo> t_panel_classified_info("panel_classified_info"); +static LLPanelInjector<LLPanelClassifiedInfo> t_panel_panel_classified_info("panel_classified_info"); // "classifiedclickthrough" // strings[0] = classified_id @@ -93,8 +93,6 @@ static LLDispatchClassifiedClickThrough sClassifiedClickThrough; ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// -static LLPanelInjector<LLPanelClassifiedInfo> t_classified_info("panel_classified_info"); - LLPanelClassifiedInfo::LLPanelClassifiedInfo() : LLPanel() , mInfoLoaded(false) diff --git a/indra/newview/llpanelclassified.h b/indra/newview/llpanelclassified.h index e742328df25ebabe47957dd76cb5e5f1b5c104bf..c201bf11b7dcb537469fc6b4f5b125556a423ba9 100644 --- a/indra/newview/llpanelclassified.h +++ b/indra/newview/llpanelclassified.h @@ -173,8 +173,10 @@ class LLPanelClassifiedInfo : public LLPanel, public LLAvatarPropertiesObserver S32 mMapClicksNew; S32 mProfileClicksNew; +public: static void handleSearchStatResponse(LLUUID classifiedId, LLSD result); +private: typedef std::list<LLPanelClassifiedInfo*> panel_list_t; static panel_list_t sAllPanels; diff --git a/indra/newview/llpaneleventinfo.cpp b/indra/newview/llpaneleventinfo.cpp deleted file mode 100644 index d9ffc02e42d418449d411fa0f762fc939f710d74..0000000000000000000000000000000000000000 --- a/indra/newview/llpaneleventinfo.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/* - * @file llpaneleventinfo.cpp - * @brief Event info panel - * - * Copyright (c) 2014, Cinder Roxley <cinder@sdf.org> - * - * Permission is hereby granted, free of charge, to any person or organization - * obtaining a copy of the software and accompanying documentation covered by - * this license (the "Software") to use, reproduce, display, distribute, - * execute, and transmit the Software, and to prepare derivative works of the - * Software, and to permit third-parties to whom the Software is furnished to - * do so, all subject to the following: - * - * The copyright notices in the Software and this entire statement, including - * the above license grant, this restriction and the following disclaimer, - * must be included in all copies of the Software, in whole or in part, and - * all derivative works of the Software, unless such copies or derivative - * works are solely in the form of machine-executable object code generated by - * a source language processor. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT - * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE - * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - */ - -#include "llviewerprecompiledheaders.h" -#include "llpaneleventinfo.h" - -#include "llbutton.h" -#include "lleventflags.h" -#include "lliconctrl.h" -#include "llfloaterreg.h" -#include "llresmgr.h" -#include "llslurl.h" -#include "lltrans.h" - -#include "llagent.h" -#include "llfloaterworldmap.h" -#include "llviewercontrol.h" - -static LLPanelInjector<LLPanelEventInfo> t_event_info("panel_event_info"); - -LLPanelEventInfo::LLPanelEventInfo() -: LLPanel() -, mEvent() -, mEventID(0) -{ - mEventNotifierConnection = gEventNotifier.setNewEventCallback(boost::bind(&LLPanelEventInfo::processEventReply, this, _1)); -} - -LLPanelEventInfo::~LLPanelEventInfo() -{ - if (mEventNotifierConnection.connected()) - { - mEventNotifierConnection.disconnect(); - } -} - -BOOL LLPanelEventInfo::postBuild() -{ - childSetAction("teleport_btn", boost::bind(&LLPanelEventInfo::onBtnTeleport, this)); - childSetAction("show_on_map_btn", boost::bind(&LLPanelEventInfo::onBtnMap, this)); - childSetAction("remind_btn", boost::bind(&LLPanelEventInfo::onBtnRemind, this)); - return TRUE; -} - -void LLPanelEventInfo::onOpen(const LLSD& key) -{ - U32 id(key.asInteger()); - setEventID(id); - - gEventNotifier.add(getEventID()); -} - -// *TODO: localize this bitch. -std::string LLPanelEventInfo::formatFromMinutes(U32 time) -{ - U32 hours = time / 60; - U32 minutes = time % 60; - - std::ostringstream output; - if (hours) - output << hours << " " << getString("hours") << " "; - if (minutes) - output << minutes << " " << getString("minutes"); - return output.str(); -} - -bool LLPanelEventInfo::processEventReply(const LLEventStruct& event) -{ - if (event.eventId != getEventID()) return false; // no - mEvent = event; - getChild<LLUICtrl>("name")->setValue(mEvent.eventName); - getChild<LLUICtrl>("desc")->setValue(mEvent.desc); - getChild<LLUICtrl>("duration")->setValue(formatFromMinutes(mEvent.duration)); - getChild<LLUICtrl>("host")->setValue(LLSLURL("agent", LLUUID(mEvent.creator), "inspect").getSLURLString()); - getChild<LLUICtrl>("time")->setValue(mEvent.eventDateStr); - // *TODO: Prettier - //std::string time; - //LLStringUtil::formatDatetime(time, "%a %d %b %Y %H:%M", "slt", mEvent.eventEpoch); - //getChild<LLUICtrl>("time")->setValue(time); - - // *TODO: Add translation strings - //getChild<LLUICtrl>("category")->setValue(LLTrans::getString(mEvent.category)); - getChild<LLUICtrl>("category")->setValue(mEvent.category); - getChild<LLUICtrl>("cover")->setValue(mEvent.cover - ? LLResMgr::getInstance()->getMonetaryString(mEvent.amount) - : getString("free")); - bool mature = (mEvent.flags & EVENT_FLAG_MATURE); - getChild<LLUICtrl>("content_type")->setValue(getString(mature ? "type_mature" : "type_pg")); - getChild<LLIconCtrl>("content_type_moderate")->setVisible(mature); - getChild<LLIconCtrl>("content_type_general")->setVisible(!mature); - getChild<LLUICtrl>("location")->setValue(LLSLURL(mEvent.simName, mEvent.globalPos).getSLURLString()); - getChild<LLButton>("remind_btn")->setLabel(getString(gEventNotifier.hasNotification(mEvent.eventId) - ? "no_reminder" - : "reminder")); - return true; -} - -void LLPanelEventInfo::onBtnTeleport() -{ - if (!mEvent.globalPos.isExactlyZero()) - { - gAgent.teleportViaLocation(mEvent.globalPos); - LLFloaterWorldMap* worldmap = LLFloaterWorldMap::getInstance(); - if (worldmap) - worldmap->trackLocation(mEvent.globalPos); - } -} - -void LLPanelEventInfo::onBtnMap() -{ - LLFloaterWorldMap* worldmap = LLFloaterWorldMap::getInstance(); - if (!mEvent.globalPos.isExactlyZero() && worldmap) - { - worldmap->trackLocation(mEvent.globalPos); - LLFloaterReg::showInstance("world_map", "center"); - } -} - -void LLPanelEventInfo::onBtnRemind() -{ - if (gEventNotifier.hasNotification(mEvent.eventId)) - { - gEventNotifier.remove(mEvent.eventId); - getChild<LLButton>("remind_btn")->setLabel(getString("reminder")); - } - else - { - gEventNotifier.add(mEvent.eventId); - getChild<LLButton>("remind_btn")->setLabel(getString("no_reminder")); - } -} diff --git a/indra/newview/llpaneleventinfo.h b/indra/newview/llpaneleventinfo.h deleted file mode 100644 index 3852dba91ed9248bead9ce789839f1bca11d9860..0000000000000000000000000000000000000000 --- a/indra/newview/llpaneleventinfo.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * @file llpaneleventinfo.cpp - * @brief Event info panel - * - * Copyright (c) 2014, Cinder Roxley <cinder@sdf.org> - * - * Permission is hereby granted, free of charge, to any person or organization - * obtaining a copy of the software and accompanying documentation covered by - * this license (the "Software") to use, reproduce, display, distribute, - * execute, and transmit the Software, and to prepare derivative works of the - * Software, and to permit third-parties to whom the Software is furnished to - * do so, all subject to the following: - * - * The copyright notices in the Software and this entire statement, including - * the above license grant, this restriction and the following disclaimer, - * must be included in all copies of the Software, in whole or in part, and - * all derivative works of the Software, unless such copies or derivative - * works are solely in the form of machine-executable object code generated by - * a source language processor. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT - * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE - * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - */ - -#ifndef LL_PANELEVENTINFO_H -#define LL_PANELEVENTINFO_H - -#include "llpanel.h" -#include "lleventnotifier.h" - -class LLPanelEventInfo : public LLPanel -{ -public: - LLPanelEventInfo(); - /*virtual*/ BOOL postBuild() override; - /*virtual*/ void onOpen(const LLSD& key) override; - -private: - ~LLPanelEventInfo(); - bool processEventReply(const LLEventStruct& event); - std::string formatFromMinutes(U32 time); - void setEventID(U32 id) { mEventID = id; } - U32 getEventID() const { return mEventID; } - void onBtnTeleport(); - void onBtnMap(); - void onBtnRemind(); - - LLEventStruct mEvent; - U32 mEventID; - boost::signals2::connection mEventNotifierConnection; -}; - -#endif // LL_PANELEVENTINFO_H diff --git a/indra/newview/llpanelsearchbase.cpp b/indra/newview/llpanelsearchbase.cpp deleted file mode 100644 index ba11c8a009633eb35b3934992f10d3b599ff794c..0000000000000000000000000000000000000000 --- a/indra/newview/llpanelsearchbase.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * @file llpanelsearchbase.cpp - * @brief Search panel base class - * - * Copyright (c) 2014, Cinder Roxley <cinder@sdf.org> - * - * Permission is hereby granted, free of charge, to any person or organization - * obtaining a copy of the software and accompanying documentation covered by - * this license (the "Software") to use, reproduce, display, distribute, - * execute, and transmit the Software, and to prepare derivative works of the - * Software, and to permit third-parties to whom the Software is furnished to - * do so, all subject to the following: - * - * The copyright notices in the Software and this entire statement, including - * the above license grant, this restriction and the following disclaimer, - * must be included in all copies of the Software, in whole or in part, and - * all derivative works of the Software, unless such copies or derivative - * works are solely in the form of machine-executable object code generated by - * a source language processor. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT - * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE - * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - */ - -#include "llviewerprecompiledheaders.h" -#include "llpanelsearchbase.h" -#include "llfloaterdirectory.h" - -LLPanelSearch::LLPanelSearch() -: LLPanel() -, mFloater(nullptr) -{ -} - -void LLPanelSearch::setSearchFloater(LLFloaterDirectory* floater) -{ - mFloater = floater; -} diff --git a/indra/newview/llpanelsearchbase.h b/indra/newview/llpanelsearchbase.h deleted file mode 100644 index 3e54edce0eecb15c3211c92fe04658a8b60e51e5..0000000000000000000000000000000000000000 --- a/indra/newview/llpanelsearchbase.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * @file llpanelsearchbase.h - * @brief Search panel base class - * - * Copyright (c) 2014, Cinder Roxley <cinder@sdf.org> - * - * Permission is hereby granted, free of charge, to any person or organization - * obtaining a copy of the software and accompanying documentation covered by - * this license (the "Software") to use, reproduce, display, distribute, - * execute, and transmit the Software, and to prepare derivative works of the - * Software, and to permit third-parties to whom the Software is furnished to - * do so, all subject to the following: - * - * The copyright notices in the Software and this entire statement, including - * the above license grant, this restriction and the following disclaimer, - * must be included in all copies of the Software, in whole or in part, and - * all derivative works of the Software, unless such copies or derivative - * works are solely in the form of machine-executable object code generated by - * a source language processor. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT - * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE - * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - */ - -#ifndef LL_PANELSEARCHBASE_H -#define LL_PANELSEARCHBASE_H - -#include "llpanel.h" - -class LLUICtrl; -class LLFloaterDirectory; - -class LLPanelSearch : public LLPanel -{ -public: - LLPanelSearch(); - BOOL postBuild() override { return FALSE; } - void setSearchFloater(LLFloaterDirectory* floater); - -protected: - virtual ~LLPanelSearch() = default;; - LLFloaterDirectory* mFloater; - -private: - virtual void onCommitSearch(LLUICtrl* ctrl) {} - virtual void search() {} -}; - -#endif // LL_PANELSEARCHBASE_H diff --git a/indra/newview/llpanelsearchclassifieds.cpp b/indra/newview/llpanelsearchclassifieds.cpp deleted file mode 100644 index 4834c63adf11334ab8123ab1cdfeaea90fafb8b5..0000000000000000000000000000000000000000 --- a/indra/newview/llpanelsearchclassifieds.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/* - * @file llpanelsearchclassifieds.cpp - * @brief Groups search panel - * - * Copyright (c) 2014, Cinder Roxley <cinder@sdf.org> - * - * Permission is hereby granted, free of charge, to any person or organization - * obtaining a copy of the software and accompanying documentation covered by - * this license (the "Software") to use, reproduce, display, distribute, - * execute, and transmit the Software, and to prepare derivative works of the - * Software, and to permit third-parties to whom the Software is furnished to - * do so, all subject to the following: - * - * The copyright notices in the Software and this entire statement, including - * the above license grant, this restriction and the following disclaimer, - * must be included in all copies of the Software, in whole or in part, and - * all derivative works of the Software, unless such copies or derivative - * works are solely in the form of machine-executable object code generated by - * a source language processor. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT - * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE - * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - */ - -#include "llviewerprecompiledheaders.h" -#include "llpanelsearchclassifieds.h" -#include "llfloaterdirectory.h" - -#include "llfloaterreg.h" -#include "llqueryflags.h" -#include "lltrans.h" - -#include "llagent.h" -#include "llclassifiedflags.h" -#include "llclassifiedinfo.h" -#include "llcombobox.h" -#include "llnotificationsutil.h" -#include "llparcel.h" -#include "llsearcheditor.h" -#include "llsearchhistory.h" - -static LLPanelInjector<LLPanelSearchClassifieds> t_panel_search_classifieds("panel_search_classifieds"); - -LLPanelSearchClassifieds::LLPanelSearchClassifieds() - : LLPanelSearch() - , mSearchEditor(nullptr) - , mClassifiedsCategory(nullptr) -{ - mCommitCallbackRegistrar.add("Search.query", boost::bind(&LLPanelSearchClassifieds::onCommitSearch, this, _1)); -} - -BOOL LLPanelSearchClassifieds::postBuild() -{ - mClassifiedsCategory = getChild<LLComboBox>("classifieds_category"); - mClassifiedsCategory->add("All categories", LLSD("any")); - mClassifiedsCategory->addSeparator(); - for (auto iter = LLClassifiedInfo::sCategories.cbegin(); - iter != LLClassifiedInfo::sCategories.cend(); - ++iter) - { - mClassifiedsCategory->add(LLTrans::getString(iter->second)); - } - - mSearchEditor = getChild<LLSearchEditor>("search_bar"); - //mSearchEditor->setKeystrokeCallback(boost::bind(&LLPanelSearchClassifieds::onCommitSearch, this, _1)); - - return TRUE; -} - -void LLPanelSearchClassifieds::onCommitSearch(LLUICtrl* ctrl) -{ - LLSearchEditor* pSearchEditor = dynamic_cast<LLSearchEditor*>(ctrl); - if (pSearchEditor) - { - std::string text = pSearchEditor->getText(); - LLStringUtil::trim(text); - if (text.length() <= MIN_SEARCH_STRING_SIZE) - LLSearchHistory::getInstance()->addEntry(text); - } - search(); -} - -void LLPanelSearchClassifieds::search() -{ - LLDirQuery query; - query.type = SE_CLASSIFIEDS; - query.results_per_page = 100; - query.text = mSearchEditor->getText(); - LLStringUtil::trim(query.text); - - query.category_int = mClassifiedsCategory->getValue().asInteger(); - - static LLUICachedControl<bool> inc_pg("ShowPGClassifieds", true); - static LLUICachedControl<bool> inc_mature("ShowMatureClassifieds", false); - static LLUICachedControl<bool> inc_adult("ShowAdultClassifieds", false); - if (!(inc_pg || inc_mature || inc_adult)) - { - LLNotificationsUtil::add("NoContentToSearch"); - return; - } - query.scope = pack_classified_flags_request(/*auto_renew*/ FALSE, inc_pg, inc_mature, inc_adult); - - mFloater->queryDirectory(query, true); -} diff --git a/indra/newview/llpanelsearchclassifieds.h b/indra/newview/llpanelsearchclassifieds.h deleted file mode 100644 index 64992be6bb9b2c2592fb914aec7a174c1189bbed..0000000000000000000000000000000000000000 --- a/indra/newview/llpanelsearchclassifieds.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * @file llpanelsearchclassifieds.h - * @brief Groups search panel - * - * Copyright (c) 2014, Cinder Roxley <cinder@sdf.org> - * - * Permission is hereby granted, free of charge, to any person or organization - * obtaining a copy of the software and accompanying documentation covered by - * this license (the "Software") to use, reproduce, display, distribute, - * execute, and transmit the Software, and to prepare derivative works of the - * Software, and to permit third-parties to whom the Software is furnished to - * do so, all subject to the following: - * - * The copyright notices in the Software and this entire statement, including - * the above license grant, this restriction and the following disclaimer, - * must be included in all copies of the Software, in whole or in part, and - * all derivative works of the Software, unless such copies or derivative - * works are solely in the form of machine-executable object code generated by - * a source language processor. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT - * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE - * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - */ - -#ifndef LL_PANELSEARCHCLASSIFIEDS_H -#define LL_PANELSEARCHCLASSIFIEDS_H - -#include "llpanelsearchbase.h" - -class LLComboBox; -class LLSearchEditor; - -class LLPanelSearchClassifieds : public LLPanelSearch -{ -public: - LLPanelSearchClassifieds(); - /*virtual*/ BOOL postBuild() override; - -private: - /*virtual*/ void onCommitSearch(LLUICtrl* ctrl) override; - /*virtual*/ void search() override; - - LLSearchEditor* mSearchEditor; - LLComboBox* mClassifiedsCategory; -}; - -#endif // LL_PANELSEARCHCLASSIFIEDS_H diff --git a/indra/newview/llpanelsearchevents.cpp b/indra/newview/llpanelsearchevents.cpp deleted file mode 100644 index 425d5a157bc15fb22657c6bf65b448adf77be190..0000000000000000000000000000000000000000 --- a/indra/newview/llpanelsearchevents.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/* - * @file llpanelsearchevents.cpp - * @brief Events search panel - * - * Copyright (c) 2014, Cinder Roxley <cinder@sdf.org> - * - * Permission is hereby granted, free of charge, to any person or organization - * obtaining a copy of the software and accompanying documentation covered by - * this license (the "Software") to use, reproduce, display, distribute, - * execute, and transmit the Software, and to prepare derivative works of the - * Software, and to permit third-parties to whom the Software is furnished to - * do so, all subject to the following: - * - * The copyright notices in the Software and this entire statement, including - * the above license grant, this restriction and the following disclaimer, - * must be included in all copies of the Software, in whole or in part, and - * all derivative works of the Software, unless such copies or derivative - * works are solely in the form of machine-executable object code generated by - * a source language processor. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT - * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE - * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - */ - -#include "llviewerprecompiledheaders.h" -#include "llpanelsearchevents.h" -#include "llfloaterdirectory.h" - -#include "llfloaterreg.h" -#include "llqueryflags.h" - -#include "llagent.h" -#include "llcombobox.h" -#include "llnotificationsutil.h" -#include "llparcel.h" -#include "llsearcheditor.h" -#include "llsearchhistory.h" - -static LLPanelInjector<LLPanelSearchEvents> t_panel_search_events("panel_search_events"); - -LLPanelSearchEvents::LLPanelSearchEvents() -: LLPanelSearch() -, mDate(0) -{ - mCommitCallbackRegistrar.add("Search.query", boost::bind(&LLPanelSearchEvents::onCommitSearch, this, _1)); - mCommitCallbackRegistrar.add("Search.AddDay", boost::bind(&LLPanelSearchEvents::addDay, this)); - mCommitCallbackRegistrar.add("Search.MinusDay", boost::bind(&LLPanelSearchEvents::minusDay, this)); -} - -BOOL LLPanelSearchEvents::postBuild() -{ - mSearchEditor = getChild<LLSearchEditor>("search_bar"); - //mSearchEditor->setKeystrokeCallback(boost::bind(&LLPanelSearchEvents::onCommitSearch, this, _1)); - setDate(0); - - return TRUE; -} - -void LLPanelSearchEvents::onCommitSearch(LLUICtrl* ctrl) -{ - LLSearchEditor* pSearchEditor = dynamic_cast<LLSearchEditor*>(ctrl); - if (pSearchEditor) - { - std::string text = pSearchEditor->getText(); - LLStringUtil::trim(text); - if (text.length() <= MIN_SEARCH_STRING_SIZE) - LLSearchHistory::getInstance()->addEntry(text); - } - search(); -} - -void LLPanelSearchEvents::search() -{ - LLDirQuery query; - query.type = SE_EVENTS; - query.results_per_page = 200; - std::string text = mSearchEditor->getText(); - LLStringUtil::trim(text); - - static LLUICachedControl<bool> inc_pg("ShowPGEvents", true); - static LLUICachedControl<bool> inc_mature("ShowMatureEvents", false); - static LLUICachedControl<bool> inc_adult("ShowAdultEvents", false); - if (!(inc_pg || inc_mature || inc_adult)) - { - LLNotificationsUtil::add("NoContentToSearch"); - return; - } - - query.scope = DFQ_DATE_EVENTS; - if (inc_pg) - query.scope |= DFQ_INC_PG; - if (inc_mature && gAgent.canAccessMature()) - query.scope |= DFQ_INC_MATURE; - if (inc_adult && gAgent.canAccessAdult()) - query.scope |= DFQ_INC_ADULT; - - std::ostringstream string; - string << (childGetValue("events_search_mode").asString() == "current" ? "u" : llformat("%d",mDate)) << "|" - << getChild<LLComboBox>("events_category")->getSelectedValue().asInteger() << "|" - << text; - query.text = string.str(); - - mFloater->queryDirectory(query, true); -} - -void LLPanelSearchEvents::setDate(S32 day) -{ - mDate = day; - - time_t utc = time_corrected(); - utc += day * 24 * 60 * 60; - struct tm * internal_time = utc_to_pacific_time(utc, is_daylight_savings()); - const std::string date = llformat("%d/%d", 1 + internal_time->tm_mon, internal_time->tm_mday); - childSetValue("events_date", date); -} - -void LLPanelSearchEvents::addDay() -{ - setDate(++mDate); - if (childGetValue("events_search_mode").asString() == "date") - search(); -} - -void LLPanelSearchEvents::minusDay() -{ - setDate(--mDate); - if (childGetValue("events_search_mode").asString() == "date") - search(); -} diff --git a/indra/newview/llpanelsearchevents.h b/indra/newview/llpanelsearchevents.h deleted file mode 100644 index 1f2af30622f89a218e48f4f8dade34e7d512cac8..0000000000000000000000000000000000000000 --- a/indra/newview/llpanelsearchevents.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * @file llpanelsearchevents.h - * @brief Events search panel - * - * Copyright (c) 2014, Cinder Roxley <cinder@sdf.org> - * - * Permission is hereby granted, free of charge, to any person or organization - * obtaining a copy of the software and accompanying documentation covered by - * this license (the "Software") to use, reproduce, display, distribute, - * execute, and transmit the Software, and to prepare derivative works of the - * Software, and to permit third-parties to whom the Software is furnished to - * do so, all subject to the following: - * - * The copyright notices in the Software and this entire statement, including - * the above license grant, this restriction and the following disclaimer, - * must be included in all copies of the Software, in whole or in part, and - * all derivative works of the Software, unless such copies or derivative - * works are solely in the form of machine-executable object code generated by - * a source language processor. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT - * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE - * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - */ - -#ifndef LL_PANELSEARCHEVENTS_H -#define LL_PANELSEARCHEVENTS_H - -#include "llpanelsearchbase.h" - -class LLComboBox; -class LLSearchEditor; - -class LLPanelSearchEvents : public LLPanelSearch -{ -public: - LLPanelSearchEvents(); - /*virtual*/ BOOL postBuild() override; - -private: - /*virtual*/ void onCommitSearch(LLUICtrl* ctrl) override; - /*virtual*/ void search() override; - void setDate(S32 day); - void addDay(); - void minusDay(); - - S32 mDate; - LLSearchEditor* mSearchEditor; -}; - -#endif // LL_PANELSEARCHEVENTS_H diff --git a/indra/newview/llpanelsearchgroups.cpp b/indra/newview/llpanelsearchgroups.cpp deleted file mode 100644 index b4fbea45d86941e09238b746430d9f298a4f814b..0000000000000000000000000000000000000000 --- a/indra/newview/llpanelsearchgroups.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/* - * @file llpanelsearchgroups.cpp - * @brief Groups search panel - * - * Copyright (c) 2014, Cinder Roxley <cinder@sdf.org> - * - * Permission is hereby granted, free of charge, to any person or organization - * obtaining a copy of the software and accompanying documentation covered by - * this license (the "Software") to use, reproduce, display, distribute, - * execute, and transmit the Software, and to prepare derivative works of the - * Software, and to permit third-parties to whom the Software is furnished to - * do so, all subject to the following: - * - * The copyright notices in the Software and this entire statement, including - * the above license grant, this restriction and the following disclaimer, - * must be included in all copies of the Software, in whole or in part, and - * all derivative works of the Software, unless such copies or derivative - * works are solely in the form of machine-executable object code generated by - * a source language processor. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT - * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE - * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - */ - -#include "llviewerprecompiledheaders.h" -#include "llpanelsearchgroups.h" -#include "llfloaterdirectory.h" - -#include "llfloaterreg.h" -#include "llqueryflags.h" - -#include "llagent.h" -#include "llnotificationsutil.h" -#include "llsearcheditor.h" -#include "llsearchhistory.h" - -static LLPanelInjector<LLPanelSearchGroups> t_panel_search_groups("panel_search_groups"); - -LLPanelSearchGroups::LLPanelSearchGroups() - : LLPanelSearch() - , mSearchEditor(nullptr) -{ - mCommitCallbackRegistrar.add("Search.query", boost::bind(&LLPanelSearchGroups::onCommitSearch, this, _1)); -} - -BOOL LLPanelSearchGroups::postBuild() -{ - mSearchEditor = getChild<LLSearchEditor>("search_bar"); - //mSearchEditor->setKeystrokeCallback(boost::bind(&LLPanelSearchGroups::onCommitSearch, this, _1)); - - return TRUE; -} - -void LLPanelSearchGroups::onCommitSearch(LLUICtrl* ctrl) -{ - LLSearchEditor* pSearchEditor = dynamic_cast<LLSearchEditor*>(ctrl); - if (pSearchEditor) - { - std::string text = pSearchEditor->getText(); - LLStringUtil::trim(text); - if (text.length() <= MIN_SEARCH_STRING_SIZE) - LLSearchHistory::getInstance()->addEntry(text); - } - search(); -} - -void LLPanelSearchGroups::search() -{ - LLDirQuery query; - query.type = SE_GROUPS; - query.results_per_page = 100; - query.text = mSearchEditor->getText(); - LLStringUtil::trim(query.text); - - static LLUICachedControl<bool> inc_pg("ShowPGGroups", true); - static LLUICachedControl<bool> inc_mature("ShowMatureGroups", false); - static LLUICachedControl<bool> inc_adult("ShowAdultGroups", false); - if (!(inc_pg || inc_mature || inc_adult)) - { - LLNotificationsUtil::add("NoContentToSearch"); - return; - } - - if (inc_pg) - query.scope |= DFQ_INC_PG; - if (inc_mature && gAgent.canAccessMature()) - query.scope |= DFQ_INC_MATURE; - if (inc_adult && gAgent.canAccessAdult()) - query.scope |= DFQ_INC_ADULT; - query.scope |= DFQ_GROUPS; - - mFloater->queryDirectory(query, true); -} diff --git a/indra/newview/llpanelsearchgroups.h b/indra/newview/llpanelsearchgroups.h deleted file mode 100644 index f3e80c6b17199e4100d3027c3eaf51fea6d76211..0000000000000000000000000000000000000000 --- a/indra/newview/llpanelsearchgroups.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * @file llpanelsearchgroups.h - * @brief Groups search panel - * - * Copyright (c) 2014, Cinder Roxley <cinder@sdf.org> - * - * Permission is hereby granted, free of charge, to any person or organization - * obtaining a copy of the software and accompanying documentation covered by - * this license (the "Software") to use, reproduce, display, distribute, - * execute, and transmit the Software, and to prepare derivative works of the - * Software, and to permit third-parties to whom the Software is furnished to - * do so, all subject to the following: - * - * The copyright notices in the Software and this entire statement, including - * the above license grant, this restriction and the following disclaimer, - * must be included in all copies of the Software, in whole or in part, and - * all derivative works of the Software, unless such copies or derivative - * works are solely in the form of machine-executable object code generated by - * a source language processor. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT - * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE - * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - */ - -#ifndef LL_PANELSEARCHGROUPS_H -#define LL_PANELSEARCHGROUPS_H - -#include "llpanelsearchbase.h" - -class LLSearchEditor; - -class LLPanelSearchGroups : public LLPanelSearch -{ -public: - LLPanelSearchGroups(); - /*virtual*/ BOOL postBuild() override; - -private: - /*virtual*/ void onCommitSearch(LLUICtrl* ctrl) override; - /*virtual*/ void search() override; - - LLSearchEditor* mSearchEditor; -}; - -#endif // LL_PANELSEARCHGROUPS_H diff --git a/indra/newview/llpanelsearchlandsales.cpp b/indra/newview/llpanelsearchlandsales.cpp deleted file mode 100644 index a2def0f36a6c16948d3eded04e9183eec5fb2fd7..0000000000000000000000000000000000000000 --- a/indra/newview/llpanelsearchlandsales.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* - * @file llpanelsearchlandsales.cpp - * @brief Groups search panel - * - * Copyright (c) 2014, Cinder Roxley <cinder@sdf.org> - * - * Permission is hereby granted, free of charge, to any person or organization - * obtaining a copy of the software and accompanying documentation covered by - * this license (the "Software") to use, reproduce, display, distribute, - * execute, and transmit the Software, and to prepare derivative works of the - * Software, and to permit third-parties to whom the Software is furnished to - * do so, all subject to the following: - * - * The copyright notices in the Software and this entire statement, including - * the above license grant, this restriction and the following disclaimer, - * must be included in all copies of the Software, in whole or in part, and - * all derivative works of the Software, unless such copies or derivative - * works are solely in the form of machine-executable object code generated by - * a source language processor. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT - * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE - * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - */ - -#include "llviewerprecompiledheaders.h" -#include "llpanelsearchlandsales.h" -#include "llfloaterdirectory.h" - -#include "llfloaterreg.h" -#include "llqueryflags.h" - -#include "llagent.h" -#include "llnotificationsutil.h" -#include "llsearcheditor.h" -#include "llsearchhistory.h" -#include "llviewercontrol.h" - -static LLPanelInjector<LLPanelSearchLandSales> t_panel_search_land_sales("panel_search_landsales"); - -LLPanelSearchLandSales::LLPanelSearchLandSales() -: LLPanelSearch() -{ - mCommitCallbackRegistrar.add("Search.query", boost::bind(&LLPanelSearchLandSales::onCommitSearch, this, _1)); -} - -BOOL LLPanelSearchLandSales::postBuild() -{ - return TRUE; -} - -void LLPanelSearchLandSales::onCommitSearch(LLUICtrl* ctrl) -{ - search(); -} - -void LLPanelSearchLandSales::search() -{ - LLDirQuery query; - query.type = SE_LANDSALES; - query.results_per_page = 100; - - static LLUICachedControl<bool> inc_pg("ShowPGLand", true); - static LLUICachedControl<bool> inc_mature("ShowMatureLand", false); - static LLUICachedControl<bool> inc_adult("ShowAdultLand", false); - static LLUICachedControl<bool> limit_price("FindLandPrice", true); - static LLUICachedControl<bool> limit_area("FindLandArea", true); - if (!(inc_pg || inc_mature || inc_adult)) - { - LLNotificationsUtil::add("NoContentToSearch"); - return; - } - - const std::string& type = gSavedSettings.getString("FindLandType"); - if (type == "All") - query.category_int = ST_ALL; - else if (type == "Auction") - query.category_int = ST_AUCTION; - else if (type == "Mainland") - query.category_int = ST_MAINLAND; - else if (type == "Estate") - query.category_int = ST_ESTATE; - - if (gAgent.wantsPGOnly()) - query.scope |= DFQ_PG_SIMS_ONLY; - if (inc_pg) - query.scope |= DFQ_INC_PG; - if (inc_mature && gAgent.canAccessMature()) - query.scope |= DFQ_INC_MATURE; - if (inc_adult && gAgent.canAccessAdult()) - query.scope |= DFQ_INC_ADULT; - - const std::string& sort = gSavedSettings.getString("FindLandSort"); - if (sort == "Name") - query.scope |= DFQ_NAME_SORT; - else if (sort == "Price") - query.scope |= DFQ_PRICE_SORT; - else if (sort == "PPM") - query.scope |= DFQ_PER_METER_SORT; - else if (sort == "Area") - query.scope |= DFQ_AREA_SORT; - - if (gSavedSettings.getBOOL("FindLandSortAscending")) - query.scope |= DFQ_SORT_ASC; - if (limit_price) - query.scope |= DFQ_LIMIT_BY_PRICE; - if (limit_area) - query.scope |= DFQ_LIMIT_BY_AREA; - query.price = childGetValue("edit_price").asInteger(); - query.area = childGetValue("edit_area").asInteger(); - - mFloater->queryDirectory(query, true); -} diff --git a/indra/newview/llpanelsearchlandsales.h b/indra/newview/llpanelsearchlandsales.h deleted file mode 100644 index f0f27407719333b67bef0b86b3aa344a2a81eb78..0000000000000000000000000000000000000000 --- a/indra/newview/llpanelsearchlandsales.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * @file llpanelsearchlandsales.h - * @brief Land sale search panel - * - * Copyright (c) 2014, Cinder Roxley <cinder@sdf.org> - * - * Permission is hereby granted, free of charge, to any person or organization - * obtaining a copy of the software and accompanying documentation covered by - * this license (the "Software") to use, reproduce, display, distribute, - * execute, and transmit the Software, and to prepare derivative works of the - * Software, and to permit third-parties to whom the Software is furnished to - * do so, all subject to the following: - * - * The copyright notices in the Software and this entire statement, including - * the above license grant, this restriction and the following disclaimer, - * must be included in all copies of the Software, in whole or in part, and - * all derivative works of the Software, unless such copies or derivative - * works are solely in the form of machine-executable object code generated by - * a source language processor. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT - * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE - * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - */ - -#ifndef LL_PANELSEARCHLANDSALES_H -#define LL_PANELSEARCHLANDSALES_H - -#include "llpanelsearchbase.h" - -class LLPanelSearchLandSales : public LLPanelSearch -{ -public: - LLPanelSearchLandSales(); - /*virtual*/ BOOL postBuild() override; - -private: - /*virtual*/ void search() override; - /*virtual*/ void onCommitSearch(LLUICtrl* ctrl) override; -}; - -#endif // LL_PANELSEARCHLANDSALES_H diff --git a/indra/newview/llpanelsearchpeople.cpp b/indra/newview/llpanelsearchpeople.cpp deleted file mode 100644 index 69b2c3fc5c4adee9059322d7f1918538187cef5b..0000000000000000000000000000000000000000 --- a/indra/newview/llpanelsearchpeople.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/* - * @file llpanelsearchpeople.cpp - * @brief People search panel - * - * Copyright (c) 2014, Cinder Roxley <cinder@sdf.org> - * - * Permission is hereby granted, free of charge, to any person or organization - * obtaining a copy of the software and accompanying documentation covered by - * this license (the "Software") to use, reproduce, display, distribute, - * execute, and transmit the Software, and to prepare derivative works of the - * Software, and to permit third-parties to whom the Software is furnished to - * do so, all subject to the following: - * - * The copyright notices in the Software and this entire statement, including - * the above license grant, this restriction and the following disclaimer, - * must be included in all copies of the Software, in whole or in part, and - * all derivative works of the Software, unless such copies or derivative - * works are solely in the form of machine-executable object code generated by - * a source language processor. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT - * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE - * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - */ - -#include "llviewerprecompiledheaders.h" -#include "llpanelsearchpeople.h" -#include "llfloaterdirectory.h" - -#include "llfloaterreg.h" - -#include "llagent.h" -#include "llsearcheditor.h" -#include "llsearchhistory.h" - -static LLPanelInjector<LLPanelSearchPeople> t_panel_search_people("panel_search_people"); - -LLPanelSearchPeople::LLPanelSearchPeople() -: LLPanelSearch() -{ - mCommitCallbackRegistrar.add("Search.query", boost::bind(&LLPanelSearchPeople::onCommitSearch, this, _1)); -} - -BOOL LLPanelSearchPeople::postBuild() -{ - mSearchEditor = getChild<LLSearchEditor>("search_bar"); - //mSearchEditor->setKeystrokeCallback(boost::bind(&LLPanelSearchPeople::onCommitSearch, this, _1)); - - return TRUE; -} - -void LLPanelSearchPeople::onCommitSearch(LLUICtrl* ctrl) -{ - LLSearchEditor* pSearchEditor = dynamic_cast<LLSearchEditor*>(ctrl); - if (pSearchEditor) - { - std::string text = pSearchEditor->getText(); - LLStringUtil::trim(text); - if (text.length() <= MIN_SEARCH_STRING_SIZE) - LLSearchHistory::getInstance()->addEntry(text); - } - search(); -} - -bool isNotAlphaNum(char c) -{ - return !std::isalnum(c); -} - -void LLPanelSearchPeople::search() -{ - LLDirQuery query; - query.type = SE_PEOPLE; - query.results_per_page = 100; - query.text = mSearchEditor->getText(); - std::replace_if(query.text.begin(), query.text.end(), isNotAlphaNum, ' '); - LLStringUtil::trim(query.text); - - mFloater->queryDirectory(query, true); - if (query.text.length() < MIN_SEARCH_STRING_SIZE) - mFloater->setResultsComment(getString("SeachFilteredOnShortWordsEmpty")); -} diff --git a/indra/newview/llpanelsearchpeople.h b/indra/newview/llpanelsearchpeople.h deleted file mode 100644 index e55645f7f626ae438f99d23aeecc6a6231ba3ba2..0000000000000000000000000000000000000000 --- a/indra/newview/llpanelsearchpeople.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * @file llpanelsearchpeople.h - * @brief People search panel - * - * Copyright (c) 2014, Cinder Roxley <cinder@sdf.org> - * - * Permission is hereby granted, free of charge, to any person or organization - * obtaining a copy of the software and accompanying documentation covered by - * this license (the "Software") to use, reproduce, display, distribute, - * execute, and transmit the Software, and to prepare derivative works of the - * Software, and to permit third-parties to whom the Software is furnished to - * do so, all subject to the following: - * - * The copyright notices in the Software and this entire statement, including - * the above license grant, this restriction and the following disclaimer, - * must be included in all copies of the Software, in whole or in part, and - * all derivative works of the Software, unless such copies or derivative - * works are solely in the form of machine-executable object code generated by - * a source language processor. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT - * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE - * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - */ - -#ifndef LL_PANELSEARCHPEOPLE_H -#define LL_PANELSEARCHPEOPLE_H - -#include "llpanelsearchbase.h" - -class LLSearchEditor; - -class LLPanelSearchPeople : public LLPanelSearch -{ -public: - LLPanelSearchPeople(); - /*virtual*/ BOOL postBuild() override; - -private: - /*virtual*/ void onCommitSearch(LLUICtrl* ctrl) override; - /*virtual*/ void search() override; - - LLSearchEditor* mSearchEditor; -}; - -#endif // LL_PANELSEARCHPEOPLE_H diff --git a/indra/newview/llpanelsearchplaces.cpp b/indra/newview/llpanelsearchplaces.cpp deleted file mode 100644 index 97b758dea427417cf47cc10236ba509af28f1630..0000000000000000000000000000000000000000 --- a/indra/newview/llpanelsearchplaces.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/* - * @file llpanelsearchplaces.cpp - * @brief Groups search panel - * - * Copyright (c) 2014, Cinder Roxley <cinder@sdf.org> - * - * Permission is hereby granted, free of charge, to any person or organization - * obtaining a copy of the software and accompanying documentation covered by - * this license (the "Software") to use, reproduce, display, distribute, - * execute, and transmit the Software, and to prepare derivative works of the - * Software, and to permit third-parties to whom the Software is furnished to - * do so, all subject to the following: - * - * The copyright notices in the Software and this entire statement, including - * the above license grant, this restriction and the following disclaimer, - * must be included in all copies of the Software, in whole or in part, and - * all derivative works of the Software, unless such copies or derivative - * works are solely in the form of machine-executable object code generated by - * a source language processor. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT - * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE - * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - */ - -#include "llviewerprecompiledheaders.h" -#include "llpanelsearchplaces.h" -#include "llfloaterdirectory.h" - -#include "llfloaterreg.h" -#include "llqueryflags.h" - -#include "llagent.h" -#include "llcombobox.h" -#include "llnotificationsutil.h" -#include "llparcel.h" -#include "llsearcheditor.h" -#include "llsearchhistory.h" - -static LLPanelInjector<LLPanelSearchPlaces> t_panel_search_places("panel_search_places"); - -LLPanelSearchPlaces::LLPanelSearchPlaces() -: LLPanelSearch() -{ - mCommitCallbackRegistrar.add("Search.query", boost::bind(&LLPanelSearchPlaces::onCommitSearch, this, _1)); -} - -BOOL LLPanelSearchPlaces::postBuild() -{ - mPlacesCategory = getChild<LLComboBox>("places_category"); - mPlacesCategory->add("All categories", LLSD("any")); - mPlacesCategory->addSeparator(); - for (size_t category = LLParcel::C_LINDEN; category < LLParcel::C_COUNT; ++category) - { - LLParcel::ECategory eCategory = static_cast<LLParcel::ECategory>(category); - mPlacesCategory->add(LLParcel::getCategoryUIString(eCategory), LLParcel::getCategoryString(eCategory)); - } - - mSearchEditor = getChild<LLSearchEditor>("search_bar"); - //mSearchEditor->setKeystrokeCallback(boost::bind(&LLPanelSearchPlaces::onCommitSearch, this, _1)); - - return TRUE; -} - -void LLPanelSearchPlaces::onCommitSearch(LLUICtrl* ctrl) -{ - LLSearchEditor* pSearchEditor = dynamic_cast<LLSearchEditor*>(ctrl); - if (pSearchEditor) - { - std::string text = pSearchEditor->getText(); - LLStringUtil::trim(text); - if (text.length() <= MIN_SEARCH_STRING_SIZE) - LLSearchHistory::getInstance()->addEntry(text); - } - search(); -} - -void LLPanelSearchPlaces::search() -{ - LLDirQuery query; - query.type = SE_PLACES; - query.results_per_page = 100; - query.text = mSearchEditor->getText(); - LLStringUtil::trim(query.text); - - const std::string& category_string = mPlacesCategory->getSelectedValue(); - query.category_char = category_string == "any" ? LLParcel::C_ANY : LLParcel::getCategoryFromString(category_string); - - static LLUICachedControl<bool> inc_pg("ShowPGSims", true); - static LLUICachedControl<bool> inc_mature("ShowMatureSims", false); - static LLUICachedControl<bool> inc_adult("ShowAdultSims", false); - if (!(inc_pg || inc_mature || inc_adult)) - { - LLNotificationsUtil::add("NoContentToSearch"); - return; - } - if (gAgent.wantsPGOnly()) - query.scope |= DFQ_PG_SIMS_ONLY; - if (inc_pg) - query.scope |= DFQ_INC_PG; - if (inc_mature && gAgent.canAccessMature()) - query.scope |= DFQ_INC_MATURE; - if (inc_adult && gAgent.canAccessAdult()) - query.scope |= DFQ_INC_ADULT; - query.scope |= DFQ_DWELL_SORT; - - mFloater->queryDirectory(query, true); -} diff --git a/indra/newview/llpanelsearchplaces.h b/indra/newview/llpanelsearchplaces.h deleted file mode 100644 index 42e69dd117da94b2a3a9c876d4073563d2dca396..0000000000000000000000000000000000000000 --- a/indra/newview/llpanelsearchplaces.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * @file llpanelsearchplaces.h - * @brief Groups search panel - * - * Copyright (c) 2014, Cinder Roxley <cinder@sdf.org> - * - * Permission is hereby granted, free of charge, to any person or organization - * obtaining a copy of the software and accompanying documentation covered by - * this license (the "Software") to use, reproduce, display, distribute, - * execute, and transmit the Software, and to prepare derivative works of the - * Software, and to permit third-parties to whom the Software is furnished to - * do so, all subject to the following: - * - * The copyright notices in the Software and this entire statement, including - * the above license grant, this restriction and the following disclaimer, - * must be included in all copies of the Software, in whole or in part, and - * all derivative works of the Software, unless such copies or derivative - * works are solely in the form of machine-executable object code generated by - * a source language processor. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT - * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE - * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - */ - -#ifndef LL_PANELSEARCHPLACES_H -#define LL_PANELSEARCHPLACES_H - -#include "llpanelsearchbase.h" - -class LLComboBox; -class LLSearchEditor; - -class LLPanelSearchPlaces : public LLPanelSearch -{ -public: - LLPanelSearchPlaces(); - /*virtual*/ BOOL postBuild() override; - -private: - /*virtual*/ void onCommitSearch(LLUICtrl* ctrl) override; - /*virtual*/ void search() override; - - LLSearchEditor* mSearchEditor; - LLComboBox* mPlacesCategory; -}; - -#endif // LL_PANELSEARCHPLACES_H diff --git a/indra/newview/llpanelsearchweb.cpp b/indra/newview/llpanelsearchweb.cpp deleted file mode 100644 index dfd9fedc3efe90eb78d412ddfe9e9463383df564..0000000000000000000000000000000000000000 --- a/indra/newview/llpanelsearchweb.cpp +++ /dev/null @@ -1,281 +0,0 @@ -/* - * @file llpanelsearchweb.cpp - * @brief Web search panel - * - * Copyright (c) 2014, Cinder Roxley <cinder@sdf.org> - * - * Permission is hereby granted, free of charge, to any person or organization - * obtaining a copy of the software and accompanying documentation covered by - * this license (the "Software") to use, reproduce, display, distribute, - * execute, and transmit the Software, and to prepare derivative works of the - * Software, and to permit third-parties to whom the Software is furnished to - * do so, all subject to the following: - * - * The copyright notices in the Software and this entire statement, including - * the above license grant, this restriction and the following disclaimer, - * must be included in all copies of the Software, in whole or in part, and - * all derivative works of the Software, unless such copies or derivative - * works are solely in the form of machine-executable object code generated by - * a source language processor. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT - * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE - * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - */ - -#include "llviewerprecompiledheaders.h" -#include "llpanelsearchweb.h" - -#include "llagent.h" -#include "llfloaterdirectory.h" -#include "lllogininstance.h" -#include "llmediactrl.h" -#include "llprogressbar.h" -#include "lltextbox.h" -#include "llviewercontrol.h" -#include "llviewernetwork.h" -#include "llviewerregion.h" -#include "llweb.h" - -static LLPanelInjector<LLPanelSearchWeb> t_panel_search_web("panel_search_web"); - -LLPanelSearchWeb::LLPanelSearchWeb() -: LLPanel() -, mStatusBarText(nullptr) -, mStatusBarProgress(nullptr) -, mBtnBack(nullptr) -, mBtnForward(nullptr) -, mBtnReload(nullptr) -, mBtnStop(nullptr) -, mWebBrowser(nullptr) -{ - mSearchType.insert("standard"); - mSearchType.insert("land"); - mSearchType.insert("classified"); - - mCollectionType.insert("events"); - mCollectionType.insert("destinations"); - mCollectionType.insert("places"); - mCollectionType.insert("groups"); - mCollectionType.insert("people"); - - mCategoryPaths = LLSD::emptyMap(); - mCategoryPaths["all"] = "search"; - mCategoryPaths["people"] = "search/people"; - mCategoryPaths["places"] = "search/places"; - mCategoryPaths["events"] = "search/events"; - mCategoryPaths["groups"] = "search/groups"; - mCategoryPaths["wiki"] = "search/wiki"; - mCategoryPaths["destinations"] = "destinations"; - - mCommitCallbackRegistrar.add("WebContent.Back", boost::bind(&LLPanelSearchWeb::onClickBack, this)); - mCommitCallbackRegistrar.add("WebContent.Forward", boost::bind(&LLPanelSearchWeb::onClickForward, this)); - mCommitCallbackRegistrar.add("WebContent.Reload", boost::bind(&LLPanelSearchWeb::onClickReload, this)); - mCommitCallbackRegistrar.add("WebContent.Stop", boost::bind(&LLPanelSearchWeb::onClickStop, this)); -} - -BOOL LLPanelSearchWeb::postBuild() -{ - mWebBrowser = getChild<LLMediaCtrl>("webbrowser"); - if (mWebBrowser) mWebBrowser->addObserver(this); - - mWebBrowser = getChild<LLMediaCtrl>("webbrowser"); - mStatusBarProgress = getChild<LLProgressBar>("statusbarprogress"); - mStatusBarText = getChild<LLTextBox>("statusbartext"); - - mBtnBack = getChild<LLButton>("back"); - mBtnForward = getChild<LLButton>("forward"); - mBtnReload = getChild<LLButton>("reload"); - mBtnStop = getChild<LLButton>("stop"); - - return TRUE; -} - -void LLPanelSearchWeb::loadUrl(const SearchQuery& p) -{ - if (!mWebBrowser || !p.validateBlock()) return; - - mWebBrowser->setTrustedContent(true); - - // work out the subdir to use based on the requested category - LLSD subs; - if (LLGridManager::instance().isInSecondlife()) - { - if (mSearchType.find(p.category.getValue()) != mSearchType.end()) - { - subs["TYPE"] = p.category.getValue(); - } - else - { - subs["TYPE"] = "standard"; - } - - subs["COLLECTION"] = ""; - if (subs["TYPE"] == "standard") - { - if (mCollectionType.find(p.collection) != mCollectionType.end()) - { - subs["COLLECTION"] = "&collection_chosen=" + std::string(p.collection); - } - else - { - std::string collection_args(""); - for (std::set<std::string>::iterator it = mCollectionType.begin(); it != mCollectionType.end(); ++it) - { - collection_args += "&collection_chosen=" + std::string(*it); - } - subs["COLLECTION"] = collection_args; - } - } - } - else - { - subs["CATEGORY"] = (mCategoryPaths.has(p.category.getValue()) - ? mCategoryPaths[p.category.getValue()].asString() - : mCategoryPaths["all"].asString()); - } - - // add the search query string - subs["QUERY"] = LLURI::escape(p.query()); - - // add the user's preferred maturity (can be changed via prefs) - std::string maturity; - if (LLGridManager::instance().isInSecondlife()) - { - if (gAgent.prefersAdult()) - { - maturity = "gma"; // PG,Mature,Adult - } - else if (gAgent.prefersMature()) - { - maturity = "gm"; // PG,Mature - } - else - { - maturity = "g"; // PG - } - } - else - { - if (gAgent.prefersAdult()) - { - maturity = "42"; // PG,Mature,Adult - } - else if (gAgent.prefersMature()) - { - maturity = "21"; // PG,Mature - } - else - { - maturity = "13"; // PG - } - } - subs["MATURITY"] = maturity; - - // add the user's god status - subs["GODLIKE"] = gAgent.isGodlike() ? "1" : "0"; - - // Get the search URL and expand all of the substitutions - // (also adds things like [LANGUAGE], [VERSION], [OS], etc.) - LLViewerRegion* regionp = gAgent.getRegion(); - std::string url = regionp != nullptr ? regionp->getSearchServerURL() - : gSavedSettings.getString(LLGridManager::getInstance()->isInOpenSim() ? "OpenSimSearchURL" : "SearchURL"); - url = LLWeb::expandURLSubstitutions(url, subs); - // Finally, load the URL in the webpanel - mWebBrowser->navigateTo(url, "text/html"); -} - -// virtual -void LLPanelSearchWeb::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) -{ - if(event == MEDIA_EVENT_LOCATION_CHANGED) - { - const std::string url = self->getLocation(); - - if ( url.length() ) - mStatusBarText->setText( url ); - } - else if(event == MEDIA_EVENT_NAVIGATE_BEGIN) - { - // flags are sent with this event - mBtnBack->setEnabled( self->getHistoryBackAvailable() ); - mBtnForward->setEnabled( self->getHistoryForwardAvailable() ); - - // toggle visibility of these buttons based on browser state - mBtnReload->setVisible( false ); - mBtnStop->setVisible( true ); - - // turn "on" progress bar now we're about to start loading - mStatusBarProgress->setVisible( true ); - } - else if(event == MEDIA_EVENT_NAVIGATE_COMPLETE) - { - // flags are sent with this event - mBtnBack->setEnabled( self->getHistoryBackAvailable() ); - mBtnForward->setEnabled( self->getHistoryForwardAvailable() ); - - // toggle visibility of these buttons based on browser state - mBtnReload->setVisible( true ); - mBtnStop->setVisible( false ); - - // turn "off" progress bar now we're loaded - mStatusBarProgress->setVisible( false ); - - // we populate the status bar with URLs as they change so clear it now we're done - const LLStringExplicit end_str(""); - mStatusBarText->setText( end_str ); - } - else if(event == MEDIA_EVENT_STATUS_TEXT_CHANGED ) - { - const std::string text = self->getStatusText(); - if ( text.length() ) - mStatusBarText->setText( text ); - } - else if(event == MEDIA_EVENT_PROGRESS_UPDATED ) - { - int percent = (int)self->getProgressPercent(); - mStatusBarProgress->setValue( percent ); - } - else if(event == MEDIA_EVENT_LINK_HOVERED ) - { - const std::string link = self->getHoverLink(); - mStatusBarText->setText( link ); - } -} - -void LLPanelSearchWeb::onClickForward() const -{ - mWebBrowser->navigateForward(); -} - -void LLPanelSearchWeb::onClickBack() const -{ - mWebBrowser->navigateBack(); -} - -void LLPanelSearchWeb::onClickReload() const -{ - - if( mWebBrowser->getMediaPlugin() ) - { - bool ignore_cache = true; - mWebBrowser->getMediaPlugin()->browse_reload( ignore_cache ); - } -} - -void LLPanelSearchWeb::onClickStop() -{ - if( mWebBrowser->getMediaPlugin() ) - mWebBrowser->getMediaPlugin()->browse_stop(); - - // still should happen when we catch the navigate complete event - // but sometimes (don't know why) that event isn't sent from Qt - // and we ghetto a point where the stop button stays active. - mBtnReload->setVisible( true ); - mBtnStop->setVisible( false ); -} diff --git a/indra/newview/llpanelsearchweb.h b/indra/newview/llpanelsearchweb.h deleted file mode 100644 index 4877db8bf962381301582b9606d8740674e26647..0000000000000000000000000000000000000000 --- a/indra/newview/llpanelsearchweb.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * @file llpanelsearchweb.h - * @brief Web search panel - * - * Copyright (c) 2014, Cinder Roxley <cinder@sdf.org> - * - * Permission is hereby granted, free of charge, to any person or organization - * obtaining a copy of the software and accompanying documentation covered by - * this license (the "Software") to use, reproduce, display, distribute, - * execute, and transmit the Software, and to prepare derivative works of the - * Software, and to permit third-parties to whom the Software is furnished to - * do so, all subject to the following: - * - * The copyright notices in the Software and this entire statement, including - * the above license grant, this restriction and the following disclaimer, - * must be included in all copies of the Software, in whole or in part, and - * all derivative works of the Software, unless such copies or derivative - * works are solely in the form of machine-executable object code generated by - * a source language processor. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT - * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE - * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - */ - -#ifndef LL_PANELSEARCHWEB_H -#define LL_PANELSEARCHWEB_H - -#include "llpanel.h" -#include "llviewermediaobserver.h" - -class LLMediaCtrl; -class LLProgressBar; -class LLTextBox; -struct SearchQuery; - -class LLPanelSearchWeb : public LLPanel, public LLViewerMediaObserver -{ -public: - LLPanelSearchWeb(); - BOOL postBuild() override; - void loadUrl(const SearchQuery& query); - -private: - void onClickBack() const; - void onClickForward() const; - void onClickReload() const; - void onClickStop(); - /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) override; - - LLTextBox* mStatusBarText; - LLProgressBar* mStatusBarProgress; - LLButton* mBtnBack; - LLButton* mBtnForward; - LLButton* mBtnReload; - LLButton* mBtnStop; - - std::set<std::string> mSearchType; - std::set<std::string> mCollectionType; - LLSD mCategoryPaths; - //U8 mSearchGodLevel; - LLMediaCtrl* mWebBrowser; -}; - -#endif // LL_PANELSEARCHWEB_H diff --git a/indra/newview/llsearchcombobox.h b/indra/newview/llsearchcombobox.h index ff9c74a6a84736edd863b78a9a26ec18ee80a74d..891237e92eae314003f39c58d728f32d2b12887f 100644 --- a/indra/newview/llsearchcombobox.h +++ b/indra/newview/llsearchcombobox.h @@ -61,6 +61,11 @@ class LLSearchComboBox : public LLComboBox ~LLSearchComboBox(); + /** + * Sets focus to text box + */ + void focusTextEntry(); + protected: LLSearchComboBox(const Params&p); @@ -93,11 +98,6 @@ class LLSearchComboBox : public LLComboBox */ void onSelectionCommit(); - /** - * Sets focus to text box - */ - void focusTextEntry(); - LLButton* mSearchButton; }; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 5650732f72f5d44bedfbcadfdb109ef10b548db4..f4fe10b4b128f43abcdc04942ee2d4e120c9aa74 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -183,7 +183,6 @@ #include "pipeline.h" #include "llappviewer.h" #include "llfasttimerview.h" -#include "llfloaterdirectory.h" #include "llfloatermap.h" #include "llweb.h" #include "llvoiceclient.h" @@ -221,6 +220,7 @@ #if LL_WINDOWS #include "lldxhardware.h" #endif +#include "fsfloatersearch.h" // // exported globals @@ -2914,13 +2914,12 @@ void register_viewer_callbacks(LLMessageSystem* msg) msg->setHandlerFuncFast(_PREHASH_GroupNoticesListReply, LLPanelGroupNotices::processGroupNoticesListReply); // directory search - msg->setHandlerFunc("DirPeopleReply", LLFloaterDirectory::processSearchPeopleReply); - msg->setHandlerFunc("DirGroupsReply", LLFloaterDirectory::processSearchGroupsReply); - msg->setHandlerFunc("DirPlacesReply", LLFloaterDirectory::processSearchPlacesReply); - msg->setHandlerFunc("DirEventsReply", LLFloaterDirectory::processSearchEventsReply); - msg->setHandlerFunc("DirLandReply", LLFloaterDirectory::processSearchLandReply); - msg->setHandlerFunc("DirClassifiedReply", LLFloaterDirectory::processSearchClassifiedsReply); - + msg->setHandlerFuncFast(_PREHASH_DirPeopleReply, FSPanelSearchPeople::processSearchReply); + msg->setHandlerFuncFast(_PREHASH_DirPlacesReply, FSPanelSearchPlaces::processSearchReply); + msg->setHandlerFuncFast(_PREHASH_DirGroupsReply, FSPanelSearchGroups::processSearchReply); + msg->setHandlerFuncFast(_PREHASH_DirEventsReply, FSPanelSearchEvents::processSearchReply); + msg->setHandlerFuncFast(_PREHASH_DirLandReply, FSPanelSearchLand::processSearchReply); + msg->setHandlerFuncFast(_PREHASH_DirClassifiedReply, FSPanelSearchClassifieds::processSearchReply); msg->setHandlerFuncFast(_PREHASH_AvatarPickerReply, LLFloaterAvatarPicker::processAvatarPickerReply); diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 9dace140f3a3992a09cb980acbd0687ec96e91c2..d808228a3cfea4e8989d92a270c7fb61376bf827 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -83,7 +83,6 @@ #include "llfloatercreatelandmark.h" #include "llfloaterdeleteprefpreset.h" #include "llfloaterdestinations.h" -#include "llfloaterdirectory.h" #include "llfloaterdisplayname.h" #include "llfloatereditextdaycycle.h" #include "llfloateremojipicker.h" @@ -203,6 +202,7 @@ #include "llpreviewtexture.h" #include "llscriptfloater.h" #include "llsyswellwindow.h" +#include "fsfloatersearch.h" #include "bdfloaterposer.h" #include "bdfloaterposecreator.h" @@ -543,6 +543,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("stop_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterNotRunQueue>); LLFloaterReg::add("snapshot", "floater_snapshot.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSnapshot>); LLFloaterReg::add("simple_snapshot", "floater_simple_snapshot.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSimpleSnapshot>); + LLFloaterReg::add("search", "floater_fs_search.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<FSFloaterSearch>); //LLFloaterReg::add("search", "floater_search.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSearch>); // [SL:KB] - Patch: UI-FloaterSearchReplace | Checked: 2010-10-26 (Catznip-2.3) LLFloaterReg::add("search_replace", "floater_search_replace.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSearchReplace>); @@ -588,7 +589,6 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("progress_view", "floater_progress_view.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterProgressView>); LLFloaterReg::add("quick_settings", "floater_quick_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloater>); LLFloaterReg::add("region_tracker", "floater_region_tracker.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<ALFloaterRegionTracker>); - LLFloaterReg::add("search", "floater_directory.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterDirectory>); LLFloaterReg::add("settings_color", "floater_settings_color.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<ALFloaterSettingsColor>); LLFloaterReg::add("sound_explorer", "floater_explore_sounds.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<ALFloaterExploreSounds>); LLFloaterReg::add("webprofile", "floater_web_profile.xml", (LLFloaterBuildFunc)&LLFloaterWebProfile::create); diff --git a/indra/newview/llviewerinput.cpp b/indra/newview/llviewerinput.cpp index 9639fb38ed4598cd48052f743ff499743e739427..74e8c10132132aa4c721b5270955f0ac26996735 100644 --- a/indra/newview/llviewerinput.cpp +++ b/indra/newview/llviewerinput.cpp @@ -49,6 +49,7 @@ #include "llfloatercamera.h" #include "llinitparam.h" #include "llselectmgr.h" +#include "fsfloatersearch.h" #include "llfloaterwebcontent.h" // [RLVa:KB] - Checked: 2021-07-29 (RLVa-1.4.4a) #include "rlvactions.h" @@ -708,7 +709,7 @@ bool start_chat( EKeystate s ) bool start_gesture( EKeystate s ) { LLFloater* focused_floater = gFloaterView->getFocusedFloater(); - if (focused_floater && dynamic_cast<LLFloaterWebContent*>(focused_floater)) + if (focused_floater && (dynamic_cast<LLFloaterWebContent*>(focused_floater) || dynamic_cast<FSFloaterSearch*>(focused_floater))) { return true; } diff --git a/indra/newview/skins/default/textures/icon_group.png b/indra/newview/skins/default/textures/icon_group.png new file mode 100644 index 0000000000000000000000000000000000000000..4c206fd883470dabb2235e6e44fb26dd4cd87fce Binary files /dev/null and b/indra/newview/skins/default/textures/icon_group.png differ diff --git a/indra/newview/skins/default/textures/icon_group.tga b/indra/newview/skins/default/textures/icon_group.tga deleted file mode 100644 index 79cd71689d0b982cc016cfe685e605098dfc8f67..0000000000000000000000000000000000000000 Binary files a/indra/newview/skins/default/textures/icon_group.tga and /dev/null differ diff --git a/indra/newview/skins/default/textures/icon_legacy_event.tga b/indra/newview/skins/default/textures/icon_legacy_event.tga new file mode 100644 index 0000000000000000000000000000000000000000..7805dbce60eb7c58bb99826157ed222813c27419 Binary files /dev/null and b/indra/newview/skins/default/textures/icon_legacy_event.tga differ diff --git a/indra/newview/skins/default/textures/icon_legacy_event_adult.tga b/indra/newview/skins/default/textures/icon_legacy_event_adult.tga new file mode 100644 index 0000000000000000000000000000000000000000..c344fb1e78887afe2b20ac4830ffb057772416cd Binary files /dev/null and b/indra/newview/skins/default/textures/icon_legacy_event_adult.tga differ diff --git a/indra/newview/skins/default/textures/icon_legacy_event_mature.tga b/indra/newview/skins/default/textures/icon_legacy_event_mature.tga new file mode 100644 index 0000000000000000000000000000000000000000..61c879bc923c7d1ee625a3995012a3ddecca363d Binary files /dev/null and b/indra/newview/skins/default/textures/icon_legacy_event_mature.tga differ diff --git a/indra/newview/skins/default/textures/icons/ProgressLarge_1.png b/indra/newview/skins/default/textures/icons/ProgressLarge_1.png new file mode 100644 index 0000000000000000000000000000000000000000..ff277fc431d6d5f8b13baeb47b478f321e00ab79 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/ProgressLarge_1.png differ diff --git a/indra/newview/skins/default/textures/icons/ProgressLarge_10.png b/indra/newview/skins/default/textures/icons/ProgressLarge_10.png new file mode 100644 index 0000000000000000000000000000000000000000..1c94e21d89261478fdde301cf1309dcc3bbe3065 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/ProgressLarge_10.png differ diff --git a/indra/newview/skins/default/textures/icons/ProgressLarge_11.png b/indra/newview/skins/default/textures/icons/ProgressLarge_11.png new file mode 100644 index 0000000000000000000000000000000000000000..89bea9b474bbbdb36be8e1024c00d226a22070f9 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/ProgressLarge_11.png differ diff --git a/indra/newview/skins/default/textures/icons/ProgressLarge_12.png b/indra/newview/skins/default/textures/icons/ProgressLarge_12.png new file mode 100644 index 0000000000000000000000000000000000000000..da38475ba4dc61dfe4bff14a3175837f07d13fa3 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/ProgressLarge_12.png differ diff --git a/indra/newview/skins/default/textures/icons/ProgressLarge_2.png b/indra/newview/skins/default/textures/icons/ProgressLarge_2.png new file mode 100644 index 0000000000000000000000000000000000000000..c024275ebef799760ab3ae4f1ef9377df066632e Binary files /dev/null and b/indra/newview/skins/default/textures/icons/ProgressLarge_2.png differ diff --git a/indra/newview/skins/default/textures/icons/ProgressLarge_3.png b/indra/newview/skins/default/textures/icons/ProgressLarge_3.png new file mode 100644 index 0000000000000000000000000000000000000000..87b931e72e753c263fc0f07bddd2448ce123d8be Binary files /dev/null and b/indra/newview/skins/default/textures/icons/ProgressLarge_3.png differ diff --git a/indra/newview/skins/default/textures/icons/ProgressLarge_4.png b/indra/newview/skins/default/textures/icons/ProgressLarge_4.png new file mode 100644 index 0000000000000000000000000000000000000000..6dbef74361edb829542a2809fb2a976f03008cac Binary files /dev/null and b/indra/newview/skins/default/textures/icons/ProgressLarge_4.png differ diff --git a/indra/newview/skins/default/textures/icons/ProgressLarge_5.png b/indra/newview/skins/default/textures/icons/ProgressLarge_5.png new file mode 100644 index 0000000000000000000000000000000000000000..daccf9b375ffc677a02aa434bd0fc2514c1d614b Binary files /dev/null and b/indra/newview/skins/default/textures/icons/ProgressLarge_5.png differ diff --git a/indra/newview/skins/default/textures/icons/ProgressLarge_6.png b/indra/newview/skins/default/textures/icons/ProgressLarge_6.png new file mode 100644 index 0000000000000000000000000000000000000000..cafddcb88dc21d60592ca403c46fd7fc0289adb9 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/ProgressLarge_6.png differ diff --git a/indra/newview/skins/default/textures/icons/ProgressLarge_7.png b/indra/newview/skins/default/textures/icons/ProgressLarge_7.png new file mode 100644 index 0000000000000000000000000000000000000000..8acf6472d4d70d6fb758fa7321584c8bf7c6e621 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/ProgressLarge_7.png differ diff --git a/indra/newview/skins/default/textures/icons/ProgressLarge_8.png b/indra/newview/skins/default/textures/icons/ProgressLarge_8.png new file mode 100644 index 0000000000000000000000000000000000000000..df0e825cef1f053d42c4fffca7efdd0e9f4969cf Binary files /dev/null and b/indra/newview/skins/default/textures/icons/ProgressLarge_8.png differ diff --git a/indra/newview/skins/default/textures/icons/ProgressLarge_9.png b/indra/newview/skins/default/textures/icons/ProgressLarge_9.png new file mode 100644 index 0000000000000000000000000000000000000000..293a7b8f5c6c7983e2e46c56cb661a1994ad3249 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/ProgressLarge_9.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index ec2de431bae5834b7499e475bc302fe50cc515b4..c80f637a649b24200d318154bcd5306ddb58f0f2 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -990,4 +990,21 @@ with the same filename but different name <texture name="Right_Trigger" file_name="xbox/right_trigger.png" preload="false" /> <texture name="Triggers" file_name="xbox/triggers.png" preload="false" /> <texture name="None" file_name="xbox/none.png" preload="false" /> + + <texture name="Icon_Legacy_Event_PG" file_name="icon_legacy_event.tga" preload="false" /> + <texture name="Icon_Legacy_Event_Mature" file_name="icon_legacy_event_mature.tga" preload="false" /> + <texture name="Icon_Legacy_Event_Adult" file_name="icon_legacy_event_adult.tga" preload="false" /> + + <texture name="ProgressLarge_1" file_name="icons/ProgressLarge_1.png" preload="true" /> + <texture name="ProgressLarge_2" file_name="icons/ProgressLarge_2.png" preload="true" /> + <texture name="ProgressLarge_3" file_name="icons/ProgressLarge_3.png" preload="true" /> + <texture name="ProgressLarge_4" file_name="icons/ProgressLarge_4.png" preload="true" /> + <texture name="ProgressLarge_5" file_name="icons/ProgressLarge_5.png" preload="true" /> + <texture name="ProgressLarge_6" file_name="icons/ProgressLarge_6.png" preload="true" /> + <texture name="ProgressLarge_7" file_name="icons/ProgressLarge_7.png" preload="true" /> + <texture name="ProgressLarge_8" file_name="icons/ProgressLarge_8.png" preload="true" /> + <texture name="ProgressLarge_9" file_name="icons/ProgressLarge_9.png" preload="true" /> + <texture name="ProgressLarge_10" file_name="icons/ProgressLarge_10.png" preload="true" /> + <texture name="ProgressLarge_11" file_name="icons/ProgressLarge_11.png" preload="true" /> + <texture name="ProgressLarge_12" file_name="icons/ProgressLarge_12.png" preload="true" /> </textures> diff --git a/indra/newview/skins/default/xui/en/floater_directory.xml b/indra/newview/skins/default/xui/en/floater_directory.xml deleted file mode 100644 index 3c6d0cb7fee1f17c5a061f15982c43aef2957e74..0000000000000000000000000000000000000000 --- a/indra/newview/skins/default/xui/en/floater_directory.xml +++ /dev/null @@ -1,291 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<floater - legacy_header_height="18" - single_instance="true" - can_resize="true" - height="590" - min_height="135" - min_width="430" - layout="topleft" - name="search" - save_rect="true" - title="SEARCH" - width="602"> - <floater.string - name="not_found"> -'[TEXT]' not found - </floater.string> - <floater.string - name="no_results"> -No results - </floater.string> - <floater.string - name="result_spillover"> -Over [TOTAL] results Showing [VISIBLE_BEGIN]/[VISIBLE_END] - </floater.string> - <floater.string - name="result_count"> -[TOTAL] results. - </floater.string> - <floater.string - name="searching"> -Searching... - </floater.string> - <floater.string - name="all_categories"> -All Categories - </floater.string> - <floater.string - name="search_banned"> -Some terms in your search query were excluded due to content restrictions as clarified in the Community Standards. - </floater.string> - <floater.string - name="search_short"> -Your search terms were too short so no search was performed. - </floater.string> - <floater.string - name="search_disabled"> -Directory search is disabled in this region. - </floater.string> - <floater.string - name="search_no_date_offset"> -Your search terms were missing the date offset. - </floater.string> - <floater.string - name="search_no_catgory"> -Your search terms were missing a category. - </floater.string> - <floater.string - name="search_no_query"> -Your search terms were missing a query string. - </floater.string> - <tab_container - border="true" - follows="all" - top="16" - left="0" - height="573" - width="602" - name="search_tabs" - tab_min_width="70" - tab_position="top"> - <panel - border="false" - label="People" - filename="panel_search_people.xml" - class="panel_search_people" - name="panel_search_people" - follows="left|top|right" - layout="topleft" - left="0" - top="0" - bottom="-16" /> - <panel - border="false" - label="Groups" - filename="panel_search_groups.xml" - class="panel_search_groups" - name="panel_search_groups" - follows="left|top|right" - layout="topleft" - left="0" - top="0" - bottom="-1" /> - <panel - border="false" - label="Places" - filename="panel_search_places.xml" - class="panel_search_places" - name="panel_search_places" - follows="left|top|right" - layout="topleft" - left="0" - top="0" - bottom="-1" /> - <panel - border="false" - label="Land" - filename="panel_search_landsales.xml" - class="panel_search_landsales" - name="panel_search_landsales" - follows="left|top|right" - layout="topleft" - left="0" - top="0" - bottom="-1" /> - <panel - border="false" - label="Events" - filename="panel_search_events.xml" - class="panel_search_events" - name="panel_search_events" - follows="left|top|right" - layout="topleft" - left="0" - top="0" - bottom="-1" /> - <panel - border="false" - label="Classifieds" - filename="panel_search_classifieds.xml" - class="panel_search_classifieds" - name="panel_search_classifieds" - follows="left|top|right" - layout="topleft" - left="0" - top="0" - bottom="-1" /> - <panel - border="false" - label="AltaVista" - filename="panel_search_web.xml" - class="panel_search_web" - name="panel_search_web" - follows="all" - layout="topleft" - left="0" - top="0" - bottom="-1" /> - </tab_container> - <layout_stack - follows="all" - animate="false" - top="86" - height="480" - left="0" - right="-1" - drag_handle_gap="2" - drag_handle_first_indent="1" - drag_handle_second_indent="1" - layout="topleft" - name="results_stack" - orientation="horizontal" - show_drag_handle="true"> - <layout_panel - border="true" - auto_resize="true" - user_resize="true" - layout="topleft" - top="0" - left="0" - width="300" - bottom="-1" - min_height="10" - name="results_lp"> - <scroll_list - layout="topleft" - top="1" - left="2" - width="300" - bottom="-1" - column_padding="0" - draw_heading="true" - follows="left|right|top|bottom" - multi_select="true" - name="results" - search_column="0" /> - </layout_panel> - <layout_panel - border="true" - auto_resize="true" - user_resize="true" - layout="topleft" - top="0" - bottom="-1" - left="405" - width="313" - min_height="10" - name="detail_lp"> - <panel - follows="all" - name="detail_avatar" - top="0" - bottom="-1" - left="0" - width="313" - class="panel_profile_legacy_sidetray" - filename="panel_profile_legacy_sidetray.xml" /> - <panel - follows="all" - name="detail_group" - top="0" - bottom="-1" - left="0" - width="313" - class="panel_group_info_sidetray" - filename="panel_group_info_sidetray.xml" /> - <panel - follows="all" - name="detail_place" - top="0" - bottom="-1" - left="0" - width="313" - class="panel_places" - filename="panel_places.xml" /> - <panel - follows="all" - name="detail_event" - top="0" - bottom="-1" - left="0" - width="313" - class="panel_event_info" - filename="panel_event_info.xml" /> - <panel - follows="all" - name="detail_classified" - top="0" - bottom="-1" - left="0" - width="313" - class="panel_classified_info" - filename="panel_classified_info.xml" /> - </layout_panel> - </layout_stack> - <text - follows="bottom|left" - height="16" - layout="topleft" - left="4" - name="results_status" - top_pad="3" - value="[TOTAL] results" - width="205" /> - <button - follows="bottom|left" - height="16" - width="16" - image_unselected="Arrow_Left" - image_disabled="Arrow_Left_Off" - image_disabled_selected="Arrow_Left_Off" - image_selected="Arrow_Left" - image_pressed="Arrow_Left" - image_top_pad="0" - layout="topleft" - left_pad="5" - name="PageDn" - top_delta="0" /> - <button - follows="bottom|left" - height="16" - width="16" - image_unselected="Arrow_Right" - image_disabled="Arrow_Right_Off" - image_disabled_selected="Arrow_Right_Off" - image_selected="Arrow_Right" - image_pressed="Arrow_Right" - image_top_pad="0" - layout="topleft" - left_pad="5" - name="PageUp" - top_delta="0" /> - <loading_indicator - follows="bottom|right" - height="16" - layout="topleft" - right="-4" - name="loading" - top_delta="0" - width="16" /> -</floater> diff --git a/indra/newview/skins/default/xui/en/floater_fs_search.xml b/indra/newview/skins/default/xui/en/floater_fs_search.xml new file mode 100644 index 0000000000000000000000000000000000000000..71f0b7a4444cb34877d115934d5ee4d84370ad5d --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_fs_search.xml @@ -0,0 +1,337 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + default_tab_group="1" + height="590" + help_topic="search" + layout="topleft" + legacy_header_height="0" + min_height="590" + min_width="660" + name="floater_search" + positioning="centered" + save_rect="true" + single_instance="true" + title="SEARCH" + width="780"> + <!-- Strings --> + <floater.string name="string.location"> + Location: [LOCATION] + </floater.string> + <floater.string name="string.traffic"> + Traffic: [DWELL] + </floater.string> + <floater.string name="string.area"> + Area: [AREA] + </floater.string> + <floater.string name="string.members"> + Members: [MEMBER_COUNT] + </floater.string> + <floater.string name="string.founder"> + Founder: [FOUNDER] + </floater.string> + <floater.string name="string.age"> + Age: [AGE] + </floater.string> + <floater.string name="string.partner"> + Partner: [PARTNER] + </floater.string> + <floater.string name="string.listing_price"> + Listing Price: [LISTING_PRICE] + </floater.string> + <floater.string name="string.slurl"> + [SLURL] + </floater.string> + <floater.string name="string.duration"> + Duration: [DURATION] + </floater.string> + <floater.string name="string.covercharge"> + Cover: [COVERCHARGE] + </floater.string> + <!-- Tab time --> + <tab_container + layout="topleft" + follows="all" + top="1" + left="0" + name="ls_tabs" + tab_min_width="90" + tab_position="top" + width="780" + height="585"> + <panel + class="panel_ls_web" + filename="panel_fs_search_legacy_web.xml" + label="Websearch" + layout="topleft" + name="panel_ls_web" /> + <panel + class="panel_ls_people" + filename="panel_fs_search_legacy_people.xml" + label="People" + layout="topleft" + name="panel_ls_people" /> + <panel + class="panel_ls_groups" + filename="panel_fs_search_legacy_groups.xml" + label="Groups" + layout="topleft" + name="panel_ls_groups" /> + <panel + class="panel_ls_places" + filename="panel_fs_search_legacy_places.xml" + label="Places" + layout="topleft" + name="panel_ls_places" /> + <panel + class="panel_ls_land" + filename="panel_fs_search_legacy_land.xml" + label="Land Sales" + layout="topleft" + name="panel_ls_land" /> + <panel + class="panel_ls_events" + filename="panel_fs_search_legacy_events.xml" + label="Events" + layout="topleft" + name="panel_ls_events" /> + <panel + class="panel_ls_classifieds" + filename="panel_fs_search_legacy_classifieds.xml" + label="Classifieds" + layout="topleft" + name="panel_ls_classifieds" /> + </tab_container> + <!-- Details/Action Panes --> + <panel + border="true" + follows="top|right|bottom" + height="508" + layout="topleft" + left="412" + top="80" + width="366" + name="panel_ls_details"> + <text_editor + left="12" + top="5" + height="24" + width="340" + layout="topleft" + follows="left|top|right" + name="title" + bg_visible="false" + border_visible="false" + allow_scroll="false" + h_pad="0" + v_pad="0" + halign="center" + enabled="false" + use_ellipses="true" + font="SansSerifHugeBold" + value="Undefined name" /> + <texture_picker + enabled="false" + fallback_image="Generic_Person_Large" + follows="left|top|right" + height="210" + layout="topleft" + left="43" + name="snapshot" + top_pad="4" + width="280"/> + <texture_picker + enabled="false" + fallback_image="default_land_picture.j2c" + follows="left|top|right" + height="210" + layout="topleft" + left_delta="0" + name="snapshot_parcel" + top_delta="0" + visible="false" + width="280"/> + <text_editor + left="20" + top_pad="2" + height="16" + width="180" + layout="topleft" + follows="left|top|right" + name="aux1" + bg_visible="false" + border_visible="false" + h_pad="0" + v_pad="0" + word_wrap="true" + enabled="false" + max_length="117" + allow_scroll="false" + parse_urls="true" + value="Auxilary info field 1"/> + <text_editor + left_pad="4" + top_delta="0" + height="16" + width="140" + layout="topleft" + follows="left|top|right" + name="aux2" + bg_visible="false" + border_visible="false" + h_pad="0" + v_pad="0" + word_wrap="true" + enabled="false" + max_length="117" + allow_scroll="false" + parse_urls="true" + value="Auxilary info field 2"/> + <icon + follows="top|right" + height="16" + image_name="Unknown_Icon" + layout="topleft" + left="20" + top_pad="2" + name="maturity_icon" + width="18" /> + <text_editor + left_pad="4" + top_delta="0" + height="28" + width="302" + layout="topleft" + follows="left|top|right" + name="location" + bg_visible="false" + border_visible="false" + h_pad="0" + v_pad="0" + word_wrap="true" + enabled="false" + max_length="117" + allow_scroll="false" + parse_urls="true" + value="Location info field"/> + <text_editor + left="20" + top_pad="12" + height="154" + width="324" + layout="topleft" + follows="left|top|right" + name="desc" + bg_visible="false" + border_visible="false" + h_pad="0" + v_pad="0" + word_wrap="true" + parse_urls="true" + enabled="false" + max_length="1000" + trusted_content="false" + value="You unlock this door with the key of imagination. Beyond it is another dimension: a dimension of sound, a dimension of sight, a dimension of mind. You're moving into a land of both shadow and substance, of things and ideas; you've just crossed over into the Twilight Zone. What you are about to see is real; the litigants on the screen are not actors. They are genuine citizens who, having filed their claims in a real small claims court, have been persuaded to drop their suits there and have them settled here, in this forum... the People's Court."/> + <button + layout="topleft" + follows="left|bottom" + height="23" + label="Open Profile" + name="people_profile_btn" + top="484" + left="3" + width="120" /> + <button + layout="topleft" + follows="left|bottom" + height="23" + label="Send Message" + name="people_message_btn" + width="120" + left_pad="1" /> + <button + layout="topleft" + follows="left|bottom" + height="23" + label="Add Friend" + name="people_friend_btn" + width="120" + left_pad="1" /> + <button + layout="topleft" + follows="left|bottom" + height="23" + label="Open Profile" + name="group_profile_btn" + top="484" + left="3" + width="120" /> + <button + layout="topleft" + follows="left|bottom" + height="23" + label="Join Chat" + name="group_message_btn" + width="120" + left_pad="1" /> + <button + layout="topleft" + follows="left|bottom" + height="23" + label="Join Group" + name="group_join_btn" + width="120" + left_pad="1" /> + <button + layout="topleft" + follows="left|bottom" + height="23" + label="Teleport" + name="teleport_btn" + top="484" + left="3" + width="120" /> + <button + layout="topleft" + follows="left|bottom" + height="23" + label="Show on Map" + name="map_btn" + width="120" + left_pad="1" /> + <button + layout="topleft" + follows="left|bottom" + height="23" + label="Remind me" + name="event_reminder_btn" + width="120" + left_pad="1" /> + <loading_indicator + left="134" + top="320" + follows="left|top|right" + mouse_opaque="false" + name="loading" + images_per_sec="1.0" + tab_stop="false" + height="100" + width="100" + visible="false" > + <images> + <image name="ProgressLarge_1"/> + <image name="ProgressLarge_2"/> + <image name="ProgressLarge_3"/> + <image name="ProgressLarge_4"/> + <image name="ProgressLarge_5"/> + <image name="ProgressLarge_6"/> + <image name="ProgressLarge_7"/> + <image name="ProgressLarge_8"/> + <image name="ProgressLarge_9"/> + <image name="ProgressLarge_10"/> + <image name="ProgressLarge_11"/> + <image name="ProgressLarge_12"/> + </images> + </loading_indicator> + </panel> +</floater> diff --git a/indra/newview/skins/default/xui/en/panel_event_info.xml b/indra/newview/skins/default/xui/en/panel_event_info.xml deleted file mode 100644 index b065f493c12e4bc0935a2152adcb63aaa4e6e284..0000000000000000000000000000000000000000 --- a/indra/newview/skins/default/xui/en/panel_event_info.xml +++ /dev/null @@ -1,456 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - background_visible="true" - follows="all" - height="570" - layout="topleft" - left="0" - min_height="350" - name="event_info" - class="event_info" - top="20" - width="333"> - <panel.string name="free"> - FREE - </panel.string> - <panel.string name="hours"> - hours - </panel.string> - <panel.string name="minutes"> - minutes - </panel.string> - <panel.string name="type_mature"> - Moderate - </panel.string> - <panel.string name="type_pg"> - General Content - </panel.string> - <panel.string name="reminder"> - Remind - </panel.string> - <panel.string name="no_reminder"> - Don't remind - </panel.string> - <button - follows="top|left" - height="24" - image_hover_unselected="BackButton_Over" - image_pressed="BackButton_Press" - image_unselected="BackButton_Off" - layout="topleft" - name="back_btn" - left="10" - tab_stop="false" - top="2" - width="30" - use_draw_context_alpha="false" /> - <text - follows="top|left|right" - font="SansSerifHugeBold" - height="26" - layout="topleft" - left_pad="4" - name="title" - text_color="LtGray" - top="0" - value="Event Info" - use_ellipses="true" - width="275" /> - <scroll_container - color="PanelDefaultBackgroundColor" - opaque="true" - follows="all" - height="502" - layout="topleft" - left="10" - top_pad="10" - name="profile_scroll" - reserve_scroll_corner="false" - width="312"> - <panel - name="scroll_content_panel" - follows="left|top" - min_height="300" - layout="topleft" - top="0" - background_visible="false" - height="610" - left="0" - width="285"> - <panel - name="snapshot_panel" - layout="topleft" - follows="left|top|right" - height="197" - left="10" - top="10" - width="275"> - <texture_picker - fallback_image="default_land_picture.j2c" - enabled="false" - follows="left|top|right" - height="197" - layout="topleft" - left="0" - name="snapshot" - top="0" - width="275" /> - </panel> - <text_editor - allow_scroll="false" - bg_visible="false" - follows="left|top|right" - h_pad="0" - height="35" - width="290" - layout="topleft" - font="SansSerifBig" - font.style="BOLD" - left="10" - top_pad="10" - name="name" - read_only="true" - text_color="white" - v_pad="0" - value="[name]" - use_ellipses="true" /> - <text - follows="left|top" - font.style="BOLD" - height="10" - layout="topleft" - left="10" - name="event_location_label" - text_color="white" - top_pad="5" - value="Location:" - width="250" /> - <text_editor - parse_urls="true" - allow_scroll="false" - bg_visible="false" - follows="left|top" - h_pad="0" - height="30" - layout="topleft" - left="10" - name="location" - read_only="true" - top_pad="5" - width="290" - word_wrap="true" - v_pad="0" - value="[loading...]" /> - <text - follows="left|top" - font.style="BOLD" - height="10" - layout="topleft" - left="10" - name="content_type_label" - text_color="white" - top_pad="10" - value="Content Type:" - width="140" /> - <icon - follows="top|left" - height="16" - image_name="Parcel_M_Light" - layout="topleft" - left_pad="0" - name="content_type_moderate" - top_pad="-11" - width="18" /> - <icon - follows="top|left" - height="16" - image_name="Parcel_PG_Light" - layout="topleft" - left_delta="0" - name="content_type_general" - top_delta="0" - width="18" /> - <text_editor - allow_scroll="false" - bg_visible="false" - follows="left|top|right" - h_pad="0" - height="18" - layout="topleft" - left_pad="2" - name="content_type" - read_only="true" - width="130" - top_delta="1" - v_pad="0" - value="[content type]" /> - <text - follows="left|top" - font.style="BOLD" - height="10" - layout="topleft" - left="10" - name="time_label" - text_color="white" - top_pad="0" - value="Time:" - width="140" /> - <text_editor - allow_scroll="false" - bg_visible="false" - follows="left|top|right" - h_pad="0" - height="18" - layout="topleft" - left_pad="0" - name="time" - read_only="true" - width="150" - top_pad="-10" - v_pad="0" - value="[time]" /> - <text - follows="left|top" - font.style="BOLD" - height="10" - layout="topleft" - left="10" - name="duration_label" - text_color="white" - top_pad="0" - value="Duration:" - width="140" /> - <text_editor - allow_scroll="false" - bg_visible="false" - follows="left|top" - h_pad="0" - halign="left" - height="16" - layout="topleft" - left_pad="0" - name="duration" - read_only="true" - top_pad="-10" - v_pad="0" - value="[duration] hours" - width="150" /> - <layout_stack - animate="false" - name="descr_stack" - layout="topleft" - follows="all" - orientation="vertical" - left="10" - top_pad="5" - width="290" - height="215"> - <layout_panel - auto_resize="false" - name="host_layout_panel" - layout="topleft" - follows="all" - left="0" - top="0" - width="290" - height="16"> - <text - follows="left|top" - font.style="BOLD" - height="10" - layout="topleft" - left="0" - name="host_label" - text_color="white" - top_pad="0" - value="Host:" - width="140" /> - <text_editor - allow_scroll="false" - bg_visible="false" - follows="left|top" - h_pad="0" - halign="left" - height="16" - layout="topleft" - left_pad="0" - parse_urls="true" - name="host" - read_only="true" - top_pad="-10" - v_pad="0" - value="secondlife:///app/agent/00000000-0000-0000-0000-000000000000/inspect" - width="150" /> - </layout_panel> - <layout_panel - auto_resize="false" - name="category_panel" - layout="topleft" - follows="all" - left="0" - top="0" - width="290" - height="16"> - <text - follows="left|top" - font.style="BOLD" - height="10" - layout="topleft" - left="0" - name="category_label" - text_color="white" - top="0" - value="Category:" - width="140" /> - <text - height="16" - layout="topleft" - follows="top|left" - left_pad="0" - name="category" - top_pad="-10" - value="[category]" - width="150" /> - </layout_panel> - <layout_panel - auto_resize="false" - name="cover_panel" - layout="topleft" - follows="all" - left="0" - top="0" - width="290" - height="16"> - <text - follows="left|top" - font.style="BOLD" - height="10" - layout="topleft" - left="0" - name="cover_label" - text_color="white" - top="0" - value="Cover:" - width="140" /> - <text - height="16" - layout="topleft" - follows="top|left" - left_pad="0" - name="cover" - top_pad="-10" - value="L$[cover]" - width="150" /> - </layout_panel> - <layout_panel - name="descr_layout_panel" - layout="topleft" - follows="all" - left="0" - top="0" - width="290" - height="215"> - <text - auto_resize="false" - follows="left|top" - font.style="BOLD" - height="10" - layout="topleft" - left="0" - name="desc_label" - text_color="white" - top="0" - value="Description:" - width="250" /> - <text_editor - parse_urls="true" - allow_scroll="true" - bg_visible="false" - follows="all" - h_pad="0" - height="200" - layout="topleft" - left="0" - max_length="1023" - name="desc" - read_only="true" - top_pad="7" - width="280" - v_pad="0" - value="[description]" - word_wrap="true" /> - </layout_panel> - </layout_stack> - </panel> -</scroll_container> -<panel - follows="left|right|bottom" - height="35" - layout="topleft" - top_pad="5" - left="9" - name="buttons"> - <layout_stack - follows="bottom|left|right" - height="23" - layout="topleft" - name="layout_stack1" - left="0" - orientation="horizontal" - top_pad="0" - width="309"> - <layout_panel - follows="bottom|left|right" - height="23" - layout="bottomleft" - left="0" - name="layout_panel1" - auto_resize="true" - width="101"> - <button - follows="bottom|left|right" - height="23" - label="Teleport" - layout="topleft" - left="0" - name="teleport_btn" - top="0" - width="101" /> - </layout_panel> - <layout_panel - follows="bottom|left|right" - height="23" - layout="bottomleft" - left_pad="3" - name="show_on_map_btn_lp" - auto_resize="true" - width="100"> - <button - follows="bottom|left|right" - height="23" - label="Map" - layout="topleft" - name="show_on_map_btn" - top="0" - width="100" /> - </layout_panel> - <layout_panel - follows="bottom|left|right" - height="23" - layout="bottomleft" - left_pad="3" - name="remind_btn_lp" - auto_resize="true" - width="101"> - <button - follows="bottom|left|right" - height="23" - label="Remind" - layout="topleft" - name="remind_btn" - top="0" - width="101" /> - </layout_panel> - </layout_stack> - </panel> -</panel> diff --git a/indra/newview/skins/default/xui/en/panel_fs_search_legacy_classifieds.xml b/indra/newview/skins/default/xui/en/panel_fs_search_legacy_classifieds.xml new file mode 100644 index 0000000000000000000000000000000000000000..66c35558b10d93e30f6027ecaa2ac34ce6264715 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_fs_search_legacy_classifieds.xml @@ -0,0 +1,169 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + border="false" + follows="all" + height="566" + layout="topleft" + left="1" + width="780" + label="Classifieds" + name="panel_ls_classifieds"> + <panel + border="false" + follows="top|left|right" + height="53" + layout="topleft" + left="0" + width="780" + name="panel_ls_input"> + <text + type="string" + length="1" + follows="left|top" + top_pad="5" + layout="topleft" + left="6" + name="search_text" + top="12" + height="16" + width="156"> + Enter search terms: + </text> + <search_combo_box + layout="topleft" + follows="left|top|right" + height="23" + left_delta="0" + name="classifieds_edit" + top="29" + width="651" /> + <combo_box + follows="right|top" + layout="topleft" + height="23" + allow_text_entry="false" + top_delta="0" + left_pad="2" + name="classifieds_category" + width="122"> + <combo_box.commit_callback + function="CommitSearch" /> + </combo_box> + <check_box + control_name="ShowPGClassifieds" + follows="right|top" + height="16" + label="" + layout="topleft" + left="660" + name="pg_all" + top="12" + width="15"> + <check_box.commit_callback + function="CommitSearch" /> + </check_box> + <icon + follows="right|top" + height="16" + image_name="Parcel_PG_Dark" + layout="topleft" + left_pad="2" + name="rating_icon_general" + top_delta="-1" + width="18"/> + <check_box + control_name="ShowMatureClassifieds" + follows="right|top" + height="16" + label="" + layout="topleft" + left_pad="2" + name="mature_all" + top_delta="1" + width="15"> + <check_box.commit_callback + function="CommitSearch" /> + </check_box> + <icon + follows="right|top" + height="16" + image_name="Parcel_M_Dark" + layout="topleft" + left_pad="2" + name="rating_icon_moderate" + top_delta="-1" + width="18"/> + <check_box + control_name="ShowAdultClassifieds" + follows="right|top" + height="16" + label="" + layout="topleft" + left_pad="2" + name="adult_all" + top_delta="1" + width="15"> + <check_box.commit_callback + function="CommitSearch" /> + </check_box> + <icon + follows="right|top" + height="16" + image_name="Parcel_R_Dark" + layout="topleft" + left_pad="2" + name="rating_icon_adult" + top_delta="-1" + width="18"/> + </panel> + <!-- Search Pane --> + <panel + border="true" + follows="all" + height="510" + layout="topleft" + left="1" + width="410" + top_pad="1" + name="panel_ls_scrolllist"> + <scroll_list + draw_heading="true" + follows="all" + height="485" + layout="topleft" + left="0" + name="search_results_classifieds" + top="0" + width="410"> + <columns + label="" + name="icon" + width="20" /> + <columns + label="Name" + name="classified_name" + relwidth="0.70" /> + <columns + label="Listing Price" + name="price" + relwidth="0.3"/> + </scroll_list> + <button + layout="topleft" + follows="left|bottom" + height="23" + label="Back" + name="classifieds_back" + top_pad="2" + left="3" + width="100" /> + <button + layout="topleft" + follows="left|bottom" + height="23" + label="Next" + name="classifieds_next" + width="100" + left_pad="1" /> + </panel> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_fs_search_legacy_events.xml b/indra/newview/skins/default/xui/en/panel_fs_search_legacy_events.xml new file mode 100644 index 0000000000000000000000000000000000000000..3f7e3290a78b879bf0ad4ea5634c092f5d108beb --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_fs_search_legacy_events.xml @@ -0,0 +1,257 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + border="false" + follows="all" + height="566" + layout="topleft" + left="1" + width="780" + label="Events" + name="panel_ls_events"> + <panel + border="false" + follows="top|left|right" + height="53" + layout="topleft" + left="0" + width="780" + name="panel_ls_input"> + <text + type="string" + length="1" + follows="left|top" + top_pad="5" + layout="topleft" + left="6" + name="search_text" + top="12" + height="16" + width="156"> + Enter search terms: + </text> + <radio_group + left_pad="20" + height="16" + width="300" + layout="topleft" + name="events_search_mode"> + <radio_item + height="16" + label="Ongoing and Upcoming" + layout="topleft" + name="current" + value="current" + top_pad="0" + width="120" /> + <radio_item + height="16" + label="By Date" + layout="topleft" + name="date" + value="date" + left_pad="70" + width="120" /> + <radio_group.commit_callback + function="CommitSearch" /> + </radio_group> + <text + type="string" + length="1" + follows="left|top" + top_delta="0" + layout="topleft" + left_pad="5" + name="events_date" + font.style="BOLD" + height="16" + width="80"> + 4/20 + </text> + <search_combo_box + layout="topleft" + follows="left|top|right" + height="23" + left="6" + name="events_edit" + top="29" + width="651" /> + <combo_box + follows="right|top" + layout="topleft" + height="23" + top_delta="0" + left_pad="2" + name="events_category" + width="122"> + <combo_box.item label="Any Category" name="any" value="0" /> + <combo_box.item label="" value="filter_separator" enabled="false" /> + <combo_box.item label="Discussion" name="discussion" value="18" /> + <combo_box.item label="Sports" name="sports" value="19" /> + <combo_box.item label="Live Music" name="music" value="20" /> + <!-- <combo_box.item label="???" name="mystery_category" value="21" /> --> + <combo_box.item label="Commercial" name="commercial" value="22" /> + <combo_box.item label="Nightlife/Entertainment" name="nightlife" value="23" /> + <combo_box.item label="Games/Contests" name="games" value="24" /> + <combo_box.item label="Pageants" name="pageants" value="25" /> + <combo_box.item label="Education" name="education" value="26" /> + <combo_box.item label="Arts and Culture" name="arts" value="27" /> + <combo_box.item label="Charity/Support Groups" name="charity" value="28" /> + <combo_box.item label="Miscellaneous" name="misc" value="29" /> + <combo_box.commit_callback + function="CommitSearch" /> + </combo_box> + <check_box + control_name="ShowPGEvents" + follows="right|top" + height="16" + label="" + layout="topleft" + left="660" + name="pg_all" + top="12" + width="15" > + <check_box.commit_callback + function="CommitSearch" /> + </check_box> + <icon + follows="right|top" + height="16" + image_name="Parcel_PG_Dark" + layout="topleft" + left_pad="2" + name="rating_icon_general" + top_delta="-1" + width="18"/> + <check_box + control_name="ShowMatureEvents" + follows="right|top" + height="16" + label="" + layout="topleft" + left_pad="2" + name="mature_all" + top_delta="1" + width="15"> + <check_box.commit_callback + function="CommitSearch" /> + </check_box> + <icon + follows="right|top" + height="16" + image_name="Parcel_M_Dark" + layout="topleft" + left_pad="2" + name="rating_icon_moderate" + top_delta="-1" + width="18"/> + <check_box + control_name="ShowAdultEvents" + follows="right|top" + height="16" + label="" + layout="topleft" + left_pad="2" + name="adult_all" + top_delta="1" + width="15"> + <check_box.commit_callback + function="CommitSearch" /> + </check_box> + <icon + follows="right|top" + height="16" + image_name="Parcel_R_Dark" + layout="topleft" + left_pad="2" + name="rating_icon_adult" + top_delta="-1" + width="18"/> + </panel> + <!-- Search Pane --> + <panel + border="true" + follows="all" + height="510" + layout="topleft" + left="1" + width="410" + top_pad="1" + name="panel_ls_scrolllist"> + <scroll_list + draw_heading="true" + follows="all" + height="485" + layout="topleft" + left="0" + name="search_results_events" + sort_ascending="true" + sort_column="3" + top="0" + width="410"> + <columns + label="" + name="icon" + width="20" /> + <columns + label="Event Name" + name="name" + relwidth="0.72" /> + <columns + label="Date/Time" + name="date" + sort_column="time" + relwidth="0.28" /> + <columns + label="Time" + name="time" + width="0"/> + </scroll_list> + <button + layout="topleft" + follows="left|bottom" + height="23" + label="Yesterday" + name="events_yesterday" + top_pad="2" + left="3" + width="100" /> + <button + layout="topleft" + follows="left|bottom" + height="23" + label="Today" + name="events_today" + width="100" + left_pad="1" /> + <button + layout="topleft" + follows="left|bottom" + height="23" + label="Tomorrow" + name="events_tomorrow" + width="100" + left_pad="1" /> + <button + layout="topleft" + follows="left|bottom" + height="23" + image_bottom_pad="2" + image_overlay="Arrow_Left_Off" + image_overlay_alignment="left" + label="Back" + name="events_back" + width="25" + left_pad="1" /> + <button + layout="topleft" + follows="left|bottom" + height="23" + image_bottom_pad="2" + image_overlay="Arrow_Right_Off" + image_overlay_alignment="left" + label="Next" + name="events_next" + width="25" + left_pad="1" /> + </panel> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_fs_search_legacy_groups.xml b/indra/newview/skins/default/xui/en/panel_fs_search_legacy_groups.xml new file mode 100644 index 0000000000000000000000000000000000000000..90001952f7c38528926e77ddb32302e2e0b23bbc --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_fs_search_legacy_groups.xml @@ -0,0 +1,159 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + border="false" + follows="all" + height="566" + layout="topleft" + left="1" + width="780" + label="Groups" + name="panel_ls_groups"> + <panel + border="false" + follows="top|left|right" + height="53" + layout="topleft" + left="0" + width="780" + name="panel_ls_input"> + <text + type="string" + length="1" + follows="left|top" + top_pad="5" + layout="topleft" + left="6" + name="search_text" + top="12" + height="16" + width="156"> + Enter search terms: + </text> + <search_combo_box + layout="topleft" + follows="left|top|right" + height="23" + left_delta="0" + name="groups_edit" + top="29" + width="770"> + </search_combo_box> + <check_box + control_name="ShowPGGroups" + follows="right|top" + height="16" + label="" + layout="topleft" + left="660" + name="pg_all" + top="12" + width="15" + visible="false"/> + <icon + follows="right|top" + height="16" + image_name="Parcel_PG_Dark" + layout="topleft" + left_pad="2" + name="rating_icon_general" + top_delta="-1" + width="18" + visible="false"/> + <check_box + control_name="ShowMatureGroups" + follows="right|top" + height="16" + label="" + layout="topleft" + left_pad="2" + name="mature_all" + top_delta="1" + width="15" + visible="false"/> + <icon + follows="right|top" + height="16" + image_name="Parcel_M_Dark" + layout="topleft" + left_pad="2" + name="rating_icon_moderate" + top_delta="-1" + width="18" + visible="false"/> + <check_box + control_name="ShowAdultGroups" + follows="right|top" + height="16" + label="" + layout="topleft" + left_pad="2" + name="adult_all" + top_delta="1" + width="15" + visible="false"/> + <icon + follows="right|top" + height="16" + image_name="Parcel_R_Dark" + layout="topleft" + left_pad="2" + name="rating_icon_adult" + top_delta="-1" + width="18" + visible="false"/> + </panel> + <!-- Search Pane --> + <panel + border="true" + follows="all" + height="510" + layout="topleft" + left="1" + width="410" + top_pad="1" + name="panel_ls_scrolllist"> + <scroll_list + draw_heading="true" + follows="all" + height="485" + layout="topleft" + left="0" + name="search_results_groups" + top="0" + width="410"> + <columns + label="" + name="icon" + width="20" /> + <columns + label="Group Name" + name="group_name" + relwidth="0.72" /> + <columns + label="Members" + name="members" + relwidth="0.25" /> + <columns + label="Score" + name="score" + width="0" /> + </scroll_list> + <button + layout="topleft" + follows="left|bottom" + height="23" + label="Back" + name="groups_back" + top_pad="2" + left="3" + width="100" /> + <button + layout="topleft" + follows="left|bottom" + height="23" + label="Next" + name="groups_next" + width="100" + left_pad="1" /> + </panel> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_fs_search_legacy_land.xml b/indra/newview/skins/default/xui/en/panel_fs_search_legacy_land.xml new file mode 100644 index 0000000000000000000000000000000000000000..bb03a1e9995b765a5386002da4a82bba89cb7c77 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_fs_search_legacy_land.xml @@ -0,0 +1,281 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + border="false" + follows="all" + height="566" + layout="topleft" + left="1" + width="780" + label="Land Sales" + name="panel_ls_land"> + <panel + border="false" + follows="top|left|right" + height="53" + layout="topleft" + left="0" + width="780" + name="panel_ls_input"> + <check_box + control_name="ShowPGLand" + follows="right|top" + height="16" + label="" + layout="topleft" + left="660" + name="pg_all" + top="12" + width="15"> + <check_box.commit_callback + function="CommitSearch" /> + </check_box> + <icon + follows="right|top" + height="16" + image_name="Parcel_PG_Dark" + layout="topleft" + left_pad="2" + name="rating_icon_general" + top_delta="-1" + width="18"/> + <check_box + control_name="ShowMatureLand" + follows="right|top" + height="16" + label="" + layout="topleft" + left_pad="2" + name="mature_all" + top_delta="1" + width="15"> + <check_box.commit_callback + function="CommitSearch" /> + </check_box> + <icon + follows="right|top" + height="16" + image_name="Parcel_M_Dark" + layout="topleft" + left_pad="2" + name="rating_icon_moderate" + top_delta="-1" + width="18"/> + <check_box + control_name="ShowAdultLand" + follows="right|top" + height="16" + label="" + layout="topleft" + left_pad="2" + name="adult_all" + top_delta="1" + width="15"> + <check_box.commit_callback + function="CommitSearch" /> + </check_box> + <icon + follows="right|top" + height="16" + image_name="Parcel_R_Dark" + layout="topleft" + left_pad="2" + name="rating_icon_adult" + top_delta="-1" + width="18"/> + <text + type="string" + length="1" + follows="left|top" + layout="topleft" + left="6" + name="search_text" + top="12" + height="16" + width="256"> + Enter search terms: + </text> + <combo_box + control_name="FindLandType" + follows="left|top" + layout="topleft" + height="23" + allow_text_entry="false" + top_pad="2" + left="6" + name="land_category" + width="122"> + <combo_box.item label="All Categories" name="All" value="All"/> + <combo_box.item label="Auction" name="Auction" value="Auction"/> + <combo_box.item label="Mainland Sales" name="Mainland" value="Mainland"/> + <combo_box.item label="Estate Sales" name="Estate" value="Estate"/> + <combo_box.commit_callback + function="CommitSearch" /> + </combo_box> + <check_box + control_name="FindLandPrice" + follows="left|top" + height="16" + label="Price <" + layout="topleft" + left_pad="3" + name="price_check" + top_delta="3" + width="40" > + <check_box.commit_callback + function="CommitSearch" /> + </check_box> + <line_editor + enabled_control="FindLandPrice" + bevel_style="none" + border_style="line" + border.border_thickness="0" + commit_on_focus_lost="false" + follows="left|top" + height="18" + left_pad="20" + name="edit_price" + top_delta="-1" + width="40" > + <line_editor.commit_callback + function="CommitSearch" /> + </line_editor> + <check_box + control_name="FindLandArea" + follows="left|top" + height="16" + label="Area >" + layout="topleft" + left_pad="3" + name="area_check" + top_delta="1" + width="40" > + <check_box.commit_callback + function="CommitSearch" /> + </check_box> + <line_editor + enabled_control="FindLandArea" + bevel_style="none" + border_style="line" + border.border_thickness="0" + commit_on_focus_lost="false" + follows="left|top" + height="18" + left_pad="20" + name="edit_area" + top_delta="-1" + width="40" > + <line_editor.commit_callback + function="CommitSearch" /> + </line_editor> + <text + type="string" + length="1" + follows="left|top" + layout="topleft" + left="365" + name="sort_text" + top="12" + height="16" + width="98"> + Sort results by: + </text> + <check_box + follows="left|top" + height="16" + label="Ascending" + layout="topleft" + left_pad="3" + name="ascending_check" + width="100" > + <check_box.commit_callback + function="CommitSearch" /> + </check_box> + <combo_box + follows="left|top" + layout="topleft" + height="23" + allow_text_entry="false" + left_delta="-102" + top_pad="1" + name="land_sort_combo" + width="118"> + <combo_box.item label="Name" name="Name_item" value="Name"/> + <combo_box.item label="Price" name="Price_item" value="Price"/> + <combo_box.item label="Price per meter" name="PPM_item" value="PPM"/> + <combo_box.item label="Area" name="Area_item" value="Area"/> + <combo_box.commit_callback + function="CommitSearch" /> + </combo_box> + <button + follows="top|right" + height="23" + label="Search" + layout="topleft" + left="678" + top_delta="0" + name="land_find" + width="100" /> + </panel> + <!-- Search Pane --> + <panel + border="true" + follows="all" + height="510" + layout="topleft" + left="1" + width="410" + top_pad="1" + name="panel_ls_scrolllist"> + <scroll_list + draw_heading="true" + follows="all" + height="485" + layout="topleft" + left="0" + name="search_results_land" + top="0" + width="410"> + <columns + label="" + name="icon" + width="20" /> + <columns + label="Name" + name="land_name" + relwidth="0.45" /> + <columns + label="Price" + name="price" + relwidth="0.1" /> + <columns + label="Area" + name="area" + relwidth="0.1" /> + <columns + label="L$/m" + name="ppm" + relwidth="0.1" /> + <columns + label="Type" + name="land_type" + relwidth="0.2" /> + </scroll_list> + <button + layout="topleft" + follows="left|bottom" + height="23" + label="Back" + name="land_back" + top_pad="2" + left="3" + width="100" /> + <button + layout="topleft" + follows="left|bottom" + height="23" + label="Next" + name="land_next" + width="100" + left_pad="1" /> + </panel> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_fs_search_legacy_people.xml b/indra/newview/skins/default/xui/en/panel_fs_search_legacy_people.xml new file mode 100644 index 0000000000000000000000000000000000000000..28df02a7e3ced559795525a87414e0945231b539 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_fs_search_legacy_people.xml @@ -0,0 +1,89 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + border="false" + follows="all" + height="566" + layout="topleft" + left="1" + width="780" + label="People" + name="panel_ls_people"> + <panel + border="false" + follows="top|left|right" + height="53" + layout="topleft" + left="0" + width="780" + name="panel_ls_input"> + <text + type="string" + length="1" + follows="left|top" + top_pad="5" + layout="topleft" + left="6" + name="search_text" + top="12" + height="16" + width="156"> + Enter search terms: + </text> + <search_combo_box + layout="topleft" + follows="left|top|right" + height="23" + left_delta="0" + name="people_edit" + top="29" + width="770"> + </search_combo_box> + </panel> + <!-- Search Pane --> + <panel + border="true" + follows="all" + height="510" + layout="topleft" + left="1" + width="410" + top_pad="1" + name="panel_ls_scrolllist"> + <scroll_list + content_type="Agents" + draw_heading="true" + follows="all" + height="485" + layout="topleft" + left="0" + name="search_results_people" + top="0" + width="410"> + <columns + label="" + name="icon" + width="20" /> + <columns + label="Name" + name="username" + relwidth="1" /> + </scroll_list> + <button + layout="topleft" + follows="left|bottom" + height="23" + label="Back" + name="people_back" + top_pad="2" + left="3" + width="100" /> + <button + layout="topleft" + follows="left|bottom" + height="23" + label="Next" + name="people_next" + width="100" + left_pad="1" /> + </panel> +</panel> \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/panel_fs_search_legacy_places.xml b/indra/newview/skins/default/xui/en/panel_fs_search_legacy_places.xml new file mode 100644 index 0000000000000000000000000000000000000000..09c142b8fc18688df44226384e6e7ae8a28a72ca --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_fs_search_legacy_places.xml @@ -0,0 +1,169 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + border="false" + follows="all" + height="566" + layout="topleft" + left="1" + width="780" + label="Places" + name="panel_ls_places"> + <panel + border="false" + follows="top|left|right" + height="53" + layout="topleft" + left="0" + width="780" + name="panel_ls_input"> + <text + type="string" + length="1" + follows="left|top" + top_pad="5" + layout="topleft" + left="6" + name="search_text" + top="12" + height="16" + width="156"> + Enter search terms: + </text> + <search_combo_box + layout="topleft" + follows="left|top|right" + height="23" + left_delta="0" + name="places_edit" + top="29" + width="651" /> + <combo_box + follows="right|top" + layout="topleft" + height="23" + allow_text_entry="false" + top_delta="0" + left_pad="2" + name="places_category" + width="122"> + <combo_box.commit_callback + function="CommitSearch" /> + </combo_box> + <check_box + control_name="ShowPGSims" + follows="right|top" + height="16" + label="" + layout="topleft" + left="660" + name="pg_all" + top="12" + width="15"> + <check_box.commit_callback + function="CommitSearch" /> + </check_box> + <icon + follows="right|top" + height="16" + image_name="Parcel_PG_Dark" + layout="topleft" + left_pad="2" + name="rating_icon_general" + top_delta="-1" + width="18"/> + <check_box + control_name="ShowMatureSims" + follows="right|top" + height="16" + label="" + layout="topleft" + left_pad="2" + name="mature_all" + top_delta="1" + width="15"> + <check_box.commit_callback + function="CommitSearch" /> + </check_box> + <icon + follows="right|top" + height="16" + image_name="Parcel_M_Dark" + layout="topleft" + left_pad="2" + name="rating_icon_moderate" + top_delta="-1" + width="18"/> + <check_box + control_name="ShowAdultSims" + follows="right|top" + height="16" + label="" + layout="topleft" + left_pad="2" + name="adult_all" + top_delta="1" + width="15"> + <check_box.commit_callback + function="CommitSearch" /> + </check_box> + <icon + follows="right|top" + height="16" + image_name="Parcel_R_Dark" + layout="topleft" + left_pad="2" + name="rating_icon_adult" + top_delta="-1" + width="18"/> + </panel> + <!-- Search Pane --> + <panel + border="true" + follows="all" + height="510" + layout="topleft" + left="1" + width="410" + top_pad="1" + name="panel_ls_scrolllist"> + <scroll_list + draw_heading="true" + follows="all" + height="485" + layout="topleft" + left="0" + name="search_results_places" + top="0" + width="410"> + <columns + label="" + name="icon" + width="20" /> + <columns + label="Name" + name="place_name" + relwidth="0.81" /> + <columns + label="Traffic" + name="dwell" + relwidth="0.16" /> + </scroll_list> + <button + layout="topleft" + follows="left|bottom" + height="23" + label="Back" + name="places_back" + top_pad="2" + left="3" + width="100" /> + <button + layout="topleft" + follows="left|bottom" + height="23" + label="Next" + name="places_next" + width="100" + left_pad="1" /> + </panel> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_fs_search_legacy_web.xml b/indra/newview/skins/default/xui/en/panel_fs_search_legacy_web.xml new file mode 100644 index 0000000000000000000000000000000000000000..382a5e8945eafd325fbbb81c5225acdb8c52edc9 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_fs_search_legacy_web.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel +border="false" +follows="all" +height="566" +layout="topleft" +left="1" +width="780" +label="Websearch" +name="panel_ls_web"> + <web_browser + top="5" + bottom="-1" + left="5" + right="-5" + layout="topleft" + follows="all" + name="search_browser" + trusted_content="true" + start_url="about:blank" /> +</panel> \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/panel_search_classifieds.xml b/indra/newview/skins/default/xui/en/panel_search_classifieds.xml deleted file mode 100644 index a865121b618f1e72219ca92d89f24058d41cd9cd..0000000000000000000000000000000000000000 --- a/indra/newview/skins/default/xui/en/panel_search_classifieds.xml +++ /dev/null @@ -1,113 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - height="70" - layout="topleft" - name="panel_search_classifieds" - width="602" - default_tab_group="2"> - <text - follows="left|top|right" - height="16" - layout="topleft" - left="4" - name="search_title" - top="4" - value="Enter search terms:" - width="255" /> - <check_box - control_name="ShowPGClassifieds" - follows="right|top" - height="16" - label="" - layout="topleft" - left="489" - name="pg_all" - top="4" - width="15"> - <check_box.commit_callback - function="Search.query" /> - </check_box> - <icon - follows="right|top" - height="16" - image_name="Parcel_PG_Dark" - layout="topleft" - left_pad="2" - name="rating_icon_general" - top_delta="-1" - width="18"/> - <check_box - control_name="ShowMatureClassifieds" - follows="right|top" - height="16" - label="" - layout="topleft" - left_pad="2" - name="mature_all" - top_delta="1" - width="15"> - <check_box.commit_callback - function="Search.query" /> - </check_box> - <icon - follows="right|top" - height="16" - image_name="Parcel_M_Dark" - layout="topleft" - left_pad="2" - name="rating_icon_moderate" - top_delta="-1" - width="18"/> - <check_box - control_name="ShowAdultClassifieds" - follows="right|top" - height="16" - label="" - layout="topleft" - left_pad="2" - name="adult_all" - top_delta="1" - width="15"> - <check_box.commit_callback - function="Search.query" /> - </check_box> - <icon - follows="right|top" - height="16" - image_name="Parcel_R_Dark" - layout="topleft" - left_pad="2" - name="rating_icon_adult" - top_delta="-1" - width="18"/> - <search_editor - tab_group="2" - follows="top|left|right" - search_button_visible="true" - height="22" - text_readonly_color="DkGray" - label="Search" - layout="topleft" - top_pad="1" - left="4" - right="-128" - name="search_bar" - select_on_focus="true" - commit_on_focus_lost="false" - tool_tip="Enter search terms"> - <search_editor.commit_callback - function="Search.query" /> - </search_editor> - <combo_box - follows="right|top" - layout="topleft" - height="23" - allow_text_entry="false" - top_delta="0" - left_pad="2" - name="classifieds_category" - width="122"> - <combo_box.commit_callback - function="Search.query" /> - </combo_box> -</panel> diff --git a/indra/newview/skins/default/xui/en/panel_search_events.xml b/indra/newview/skins/default/xui/en/panel_search_events.xml deleted file mode 100644 index 407eaf6486a0fc4d24a03b249002f89c7274f1fe..0000000000000000000000000000000000000000 --- a/indra/newview/skins/default/xui/en/panel_search_events.xml +++ /dev/null @@ -1,198 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - height="70" - layout="topleft" - name="panel_search_events" - width="602" - default_tab_group="2"> - <text - follows="left|top" - height="16" - layout="topleft" - left="4" - name="search_title" - top="4" - value="Enter search terms:" - width="128" /> - <radio_group - top_delta="0" - left="130" - height="16" - width="230" - layout="topleft" - initial_value="current" - name="events_search_mode"> - <radio_item - height="16" - label="Ongoing and Upcoming" - layout="topleft" - name="current" - value="current" - top_pad="0" - width="120" /> - <radio_item - height="16" - label="By Date" - layout="topleft" - name="date" - value="date" - left_pad="40" - width="120" /> - <radio_group.commit_callback - function="Search.query" /> - </radio_group> - <button - follows="top|left" - height="16" - width="16" - image_unselected="MinusItem_Off" - image_disabled="MinusItem_Disabled" - image_selected="MinusItem_Press" - image_pressed="MinusItem_Press" - image_top_pad="0" - layout="topleft" - left_pad="14" - name="minus_day" - top_delta="0"> - <button.commit_callback - function="Search.MinusDay" /> - </button> - <text - type="string" - length="1" - follows="left|top" - top_delta="0" - layout="topleft" - left_pad="5" - name="events_date" - font.style="BOLD" - height="16" - width="40" - value="4/20" /> - <button - follows="top|left" - height="16" - width="16" - image_unselected="AddItem_Off" - image_disabled="AddItem_Disabled" - image_selected="AddItem_Press" - image_pressed="AddItem_Press" - image_top_pad="0" - layout="topleft" - left_pad="5" - name="plus_day" - top_delta="0"> - <button.commit_callback - function="Search.AddDay" /> - </button> - <check_box - control_name="ShowPGEvents" - follows="right|top" - height="16" - label="" - layout="topleft" - left="489" - name="pg_all" - top="4" - width="15"> - <check_box.commit_callback - function="Search.query" /> - </check_box> - <icon - follows="right|top" - height="16" - image_name="Parcel_PG_Dark" - layout="topleft" - left_pad="2" - name="rating_icon_general" - top_delta="-1" - width="18"/> - <check_box - control_name="ShowMatureEvents" - follows="right|top" - height="16" - label="" - layout="topleft" - left_pad="2" - name="mature_all" - top_delta="1" - width="15"> - <check_box.commit_callback - function="Search.query" /> - </check_box> - <icon - follows="right|top" - height="16" - image_name="Parcel_M_Dark" - layout="topleft" - left_pad="2" - name="rating_icon_moderate" - top_delta="-1" - width="18"/> - <check_box - control_name="ShowAdultEvents" - follows="right|top" - height="16" - label="" - layout="topleft" - left_pad="2" - name="adult_all" - top_delta="1" - width="15"> - <check_box.commit_callback - function="Search.query" /> - </check_box> - <icon - follows="right|top" - height="16" - image_name="Parcel_R_Dark" - layout="topleft" - left_pad="2" - name="rating_icon_adult" - top_delta="-1" - width="18"/> - <search_editor - tab_group="2" - follows="top|left|right" - search_button_visible="true" - height="22" - text_readonly_color="DkGray" - label="Search" - layout="topleft" - top_pad="1" - left="4" - right="-128" - name="search_bar" - select_on_focus="true" - commit_on_focus_lost="false" - tool_tip="Enter search terms"> - <search_editor.commit_callback - function="Search.query" /> - </search_editor> - <combo_box - follows="right|top" - layout="topleft" - height="23" - allow_text_entry="false" - top_delta="0" - left_pad="2" - name="events_category" - width="122"> - <combo_box.item label="Any Category" name="any" value="0" /> - <combo_box.item label="" value="filter_separator" enabled="false" /> - <combo_box.item label="Discussion" name="discussion" value="18" /> - <combo_box.item label="Sports" name="sports" value="19" /> - <combo_box.item label="Live Music" name="music" value="20" /> - <!-- <combo_box.item label="???" name="mystery_category" value="21" /> --> - <combo_box.item label="Commercial" name="commercial" value="22" /> - <combo_box.item label="Nightlife/Entertainment" name="nightlife" value="23" /> - <combo_box.item label="Games/Contests" name="games" value="24" /> - <combo_box.item label="Pageants" name="pageants" value="25" /> - <combo_box.item label="Education" name="education" value="26" /> - <combo_box.item label="Arts and Culture" name="arts" value="27" /> - <combo_box.item label="Charity/Support Groups" name="charity" value="28" /> - <combo_box.item label="Miscellaneous" name="misc" value="29" /> - <combo_box.commit_callback - function="Search.query" /> - </combo_box> -</panel> diff --git a/indra/newview/skins/default/xui/en/panel_search_groups.xml b/indra/newview/skins/default/xui/en/panel_search_groups.xml deleted file mode 100644 index 78e531ca2fc354161acaa5df8039b58f59b9fb58..0000000000000000000000000000000000000000 --- a/indra/newview/skins/default/xui/en/panel_search_groups.xml +++ /dev/null @@ -1,101 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - height="70" - layout="topleft" - name="panel_search_groups" - width="602" - default_tab_group="2"> - <text - follows="left|top|right" - height="16" - layout="topleft" - left="4" - name="search_title" - top="4" - value="Enter search terms:" - width="255" /> - <check_box - control_name="ShowPGGroups" - follows="right|top" - height="16" - label="" - layout="topleft" - left="489" - name="pg_all" - top="4" - width="15"> - <check_box.commit_callback - function="Search.query" /> - </check_box> - <icon - follows="right|top" - height="16" - image_name="Parcel_PG_Dark" - layout="topleft" - left_pad="2" - name="rating_icon_general" - top_delta="-1" - width="18"/> - <check_box - control_name="ShowMatureGroups" - follows="right|top" - height="16" - label="" - layout="topleft" - left_pad="2" - name="mature_all" - top_delta="1" - width="15"> - <check_box.commit_callback - function="Search.query" /> - </check_box> - <icon - follows="right|top" - height="16" - image_name="Parcel_M_Dark" - layout="topleft" - left_pad="2" - name="rating_icon_moderate" - top_delta="-1" - width="18"/> - <check_box - control_name="ShowAdultGroups" - follows="right|top" - height="16" - label="" - layout="topleft" - left_pad="2" - name="adult_all" - top_delta="1" - width="15"> - <check_box.commit_callback - function="Search.query" /> - </check_box> - <icon - follows="right|top" - height="16" - image_name="Parcel_R_Dark" - layout="topleft" - left_pad="2" - name="rating_icon_adult" - top_delta="-1" - width="18"/> - <search_editor - tab_group="2" - follows="top|left|right" - search_button_visible="true" - height="22" - text_readonly_color="DkGray" - label="Search" - layout="topleft" - top_pad="1" - left="4" - right="-4" - name="search_bar" - select_on_focus="true" - commit_on_focus_lost="false" - tool_tip="Enter search terms"> - <search_editor.commit_callback - function="Search.query" /> - </search_editor> -</panel> diff --git a/indra/newview/skins/default/xui/en/panel_search_landsales.xml b/indra/newview/skins/default/xui/en/panel_search_landsales.xml deleted file mode 100644 index 982fcdefc9db9a7f7b13f0dcce8582965dc748ab..0000000000000000000000000000000000000000 --- a/indra/newview/skins/default/xui/en/panel_search_landsales.xml +++ /dev/null @@ -1,181 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - height="70" - layout="topleft" - name="panel_search_landsales" - width="602"> - <text - follows="left|top|right" - height="16" - layout="topleft" - left="4" - name="search_title" - top="4" - value="Enter search terms:" - width="255" /> - <check_box - control_name="ShowPGLand" - follows="right|top" - height="16" - label="" - layout="topleft" - left="489" - name="pg_all" - top="4" - width="15"> - <check_box.commit_callback - function="Search.query" /> - </check_box> - <icon - follows="right|top" - height="16" - image_name="Parcel_PG_Dark" - layout="topleft" - left_pad="2" - name="rating_icon_general" - top_delta="-1" - width="18"/> - <check_box - control_name="ShowMatureLand" - follows="right|top" - height="16" - label="" - layout="topleft" - left_pad="2" - name="mature_all" - top_delta="1" - width="15"> - <check_box.commit_callback - function="Search.query" /> - </check_box> - <icon - follows="right|top" - height="16" - image_name="Parcel_M_Dark" - layout="topleft" - left_pad="2" - name="rating_icon_moderate" - top_delta="-1" - width="18"/> - <check_box - control_name="ShowAdultLand" - follows="right|top" - height="16" - label="" - layout="topleft" - left_pad="2" - name="adult_all" - top_delta="1" - width="15"> - <check_box.commit_callback - function="Search.query" /> - </check_box> - <icon - follows="right|top" - height="16" - image_name="Parcel_R_Dark" - layout="topleft" - left_pad="2" - name="rating_icon_adult" - top_delta="-1" - width="18"/> - <check_box - control_name="FindLandPrice" - follows="left|top" - height="16" - label="Price <" - layout="topleft" - left="4" - name="price_check" - top_pad="6" - width="40" > - <check_box.commit_callback - function="Search.query" /> - </check_box> - <line_editor - enabled_control="FindLandPrice" - commit_on_focus_lost="false" - follows="left|top" - height="16" - left_pad="20" - name="edit_price" - layout="topleft" - top_delta="-1" - width="40" > - <line_editor.commit_callback - function="Search.query" /> - </line_editor> - <check_box - control_name="FindLandArea" - follows="left|top" - height="16" - label="Area >" - layout="topleft" - left_pad="3" - name="area_check" - top_delta="1" - width="40" > - <check_box.commit_callback - function="Search.query" /> - </check_box> - <line_editor - enabled_control="FindLandArea" - commit_on_focus_lost="false" - follows="left|top" - layout="topleft" - height="16" - left_pad="18" - name="edit_area" - top_delta="-1" - width="40" > - <line_editor.commit_callback - function="Search.query" /> - </line_editor> - <combo_box - control_name="FindLandType" - follows="right|top" - layout="topleft" - height="22" - allow_text_entry="false" - left_pad="90" - top_delta="-1" - name="land_type" - width="110"> - <combo_box.item label="All Categories" name="All" value="All"/> - <combo_box.item label="Auction" name="Auction" value="Auction"/> - <combo_box.item label="Mainland Sales" name="Mainland" value="Mainland"/> - <combo_box.item label="Estate Sales" name="Estate" value="Estate"/> - <combo_box.commit_callback - function="Search.query" /> - </combo_box> - <combo_box - control_name="FindLandSort" - follows="right|top" - layout="topleft" - height="22" - allow_text_entry="false" - left_pad="2" - top_delta="0" - name="land_sort" - width="110"> - <combo_box.item label="Sort by Name" name="Name_item" value="Name"/> - <combo_box.item label="Sort by Price" name="Price_item" value="Price"/> - <combo_box.item label="Sort by Price per meter" name="PPM_item" value="PPM"/> - <combo_box.item label="Sort by Area" name="Area_item" value="Area"/> - <combo_box.commit_callback - function="Search.query" /> - </combo_box> - <check_box - control_name="FindLandSortAscending" - follows="right|top" - height="16" - label="Ascending" - layout="topleft" - left_pad="3" - name="ascending" - top_delta="5" - width="40" > - <check_box.commit_callback - function="Search.query" /> - </check_box> -</panel> diff --git a/indra/newview/skins/default/xui/en/panel_search_people.xml b/indra/newview/skins/default/xui/en/panel_search_people.xml deleted file mode 100644 index 98387dbd9a2f18aada111dbf62fa904008499c05..0000000000000000000000000000000000000000 --- a/indra/newview/skins/default/xui/en/panel_search_people.xml +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - height="70" - class="panel_search_people" - name="panel_search_people" - width="602" - default_tab_group="2"> - <panel.string name="SeachFilteredOnShortWordsEmpty"> - Your search terms were too short so no search was performed. - </panel.string> - <text - follows="left|top|right" - height="16" - layout="topleft" - left="4" - name="search_title" - top="4" - value="Enter search terms:" - width="255" /> - <search_editor - tab_group="2" - follows="top|left|right" - search_button_visible="true" - height="22" - text_readonly_color="DkGray" - label="Search" - layout="topleft" - top_pad="1" - left="4" - right="-4" - name="search_bar" - select_on_focus="true" - commit_on_focus_lost="false" - tool_tip="Enter search terms"> - <search_editor.commit_callback - function="Search.query" /> - </search_editor> -</panel> diff --git a/indra/newview/skins/default/xui/en/panel_search_places.xml b/indra/newview/skins/default/xui/en/panel_search_places.xml deleted file mode 100644 index 94ae80a1576933b64eeae4bd6547b57632c96921..0000000000000000000000000000000000000000 --- a/indra/newview/skins/default/xui/en/panel_search_places.xml +++ /dev/null @@ -1,113 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - height="70" - layout="topleft" - name="panel_search_places" - width="602" - default_tab_group="2"> - <text - follows="left|top|right" - height="16" - layout="topleft" - left="4" - name="search_title" - top="4" - value="Enter search terms:" - width="255" /> - <check_box - control_name="ShowPGSims" - follows="right|top" - height="16" - label="" - layout="topleft" - left="489" - name="pg_all" - top="4" - width="15"> - <check_box.commit_callback - function="Search.query" /> - </check_box> - <icon - follows="right|top" - height="16" - image_name="Parcel_PG_Dark" - layout="topleft" - left_pad="2" - name="rating_icon_general" - top_delta="-1" - width="18"/> - <check_box - control_name="ShowMatureSims" - follows="right|top" - height="16" - label="" - layout="topleft" - left_pad="2" - name="mature_all" - top_delta="1" - width="15"> - <check_box.commit_callback - function="Search.query" /> - </check_box> - <icon - follows="right|top" - height="16" - image_name="Parcel_M_Dark" - layout="topleft" - left_pad="2" - name="rating_icon_moderate" - top_delta="-1" - width="18"/> - <check_box - control_name="ShowAdultSims" - follows="right|top" - height="16" - label="" - layout="topleft" - left_pad="2" - name="adult_all" - top_delta="1" - width="15"> - <check_box.commit_callback - function="Search.query" /> - </check_box> - <icon - follows="right|top" - height="16" - image_name="Parcel_R_Dark" - layout="topleft" - left_pad="2" - name="rating_icon_adult" - top_delta="-1" - width="18"/> - <search_editor - tab_group="2" - follows="top|left|right" - search_button_visible="true" - height="22" - text_readonly_color="DkGray" - label="Search" - layout="topleft" - top_pad="1" - left="4" - right="-128" - name="search_bar" - select_on_focus="true" - commit_on_focus_lost="false" - tool_tip="Enter search terms"> - <search_editor.commit_callback - function="Search.query" /> - </search_editor> - <combo_box - follows="right|top" - layout="topleft" - height="23" - allow_text_entry="false" - top_delta="0" - left_pad="2" - name="places_category" - width="122"> - <combo_box.commit_callback - function="Search.query" /> - </combo_box> -</panel> diff --git a/indra/newview/skins/default/xui/en/panel_search_web.xml b/indra/newview/skins/default/xui/en/panel_search_web.xml deleted file mode 100644 index 81cb9067db204685ce625dbfae92b9b87c36d1b9..0000000000000000000000000000000000000000 --- a/indra/newview/skins/default/xui/en/panel_search_web.xml +++ /dev/null @@ -1,138 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - height="775" - layout="topleft" - follows="all" - name="panel_search_web" - width="780" - default_tab_group="2"> - <layout_stack - bottom="775" - follows="all" - layout="topleft" - left="5" - animate="false" - name="stack1" - orientation="vertical" - top="4" - width="770"> - <layout_panel - height="40" - follows="all" - layout="topleft" - left_delta="0" - name="external_controls" - top_delta="0" - auto_resize="true" - width="585"> - <web_browser - tab_group="2" - bottom="-2" - follows="all" - layout="topleft" - left="0" - name="webbrowser" - top="0"/> - </layout_panel> - <layout_panel - name="status_bar" - height="23" - auto_resize="false"> - <button - image_overlay="Arrow_Left_Off" - image_disabled="PushButton_Disabled" - image_disabled_selected="PushButton_Disabled" - image_selected="PushButton_Selected" - image_unselected="PushButton_Off" - chrome="true" - hover_glow_amount="0.15" - tool_tip="Navigate back" - follows="left|top" - height="22" - layout="topleft" - left="1" - name="back" - top="0" - width="22"> - <button.commit_callback - function="WebContent.Back" /> - </button> - <button - image_overlay="Arrow_Right_Off" - image_disabled="PushButton_Disabled" - image_disabled_selected="PushButton_Disabled" - image_selected="PushButton_Selected" - image_unselected="PushButton_Off" - chrome="true" - tool_tip="Navigate forward" - follows="left|top" - height="22" - layout="topleft" - left="27" - name="forward" - top_delta="0" - width="22"> - <button.commit_callback - function="WebContent.Forward" /> - </button> - <button - image_overlay="Stop_Off" - image_disabled="PushButton_Disabled" - image_disabled_selected="PushButton_Disabled" - image_selected="PushButton_Selected" - image_unselected="PushButton_Off" - chrome="true" - tool_tip="Stop navigation" - enabled="true" - follows="left|top" - height="22" - layout="topleft" - left="51" - name="stop" - top_delta="0" - width="22"> - <button.commit_callback - function="WebContent.Stop" /> - </button> - <button - image_overlay="Refresh_Off" - image_disabled="PushButton_Disabled" - image_disabled_selected="PushButton_Disabled" - image_selected="PushButton_Selected" - image_unselected="PushButton_Off" - chrome="true" - tool_tip="Reload page" - follows="left|top" - height="22" - layout="topleft" - left="51" - name="reload" - top_delta="0" - width="22"> - <button.commit_callback - function="WebContent.Reload" /> - </button> - <text - type="string" - length="200" - follows="bottom|left" - height="20" - layout="topleft" - left_pad="3" - name="statusbartext" - parse_urls="false" - text_color="0.4 0.4 0.4 1" - top_delta="1" - width="441"/> - <progress_bar - color_bar="0.3 1.0 0.3 1" - follows="bottom|right" - height="16" - top_delta="1" - left_pad="3" - layout="topleft" - name="statusbarprogress" - width="64"/> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index cef6aa18083a84c133a3bfd16323911c0ad3a528..78d3e4d4a8d6ef32b567bf56dc3de8bd687d8a3f 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2991,13 +2991,13 @@ Expected .wav, .tga, .bmp, .jpg, .jpeg, or .anim <string name="None">None</string> <string name="Linden Location">Linden Location</string> <string name="Adult">Adult</string> - <string name="Arts&Culture">Arts & Culture</string> + <string name="Arts and Culture">Arts & Culture</string> <string name="Business">Business</string> <string name="Educational">Educational</string> <string name="Gaming">Gaming</string> <string name="Hangout">Hangout</string> <string name="Newcomer Friendly">Newcomer Friendly</string> - <string name="Parks&Nature">Parks & Nature</string> + <string name="Parks and Nature">Parks & Nature</string> <string name="Residential">Residential</string> <!--<string name="Shopping">Shopping</string> --> <string name="Stage">Stage</string> @@ -4464,6 +4464,13 @@ and report the problem. <string name="outfit_photo_load_codec_error">Invalid image format. Please use another image</string> <!-- Alchemy Strings --> + <string name="not_found">'[TEXT]' not found</string> + <string name="no_results">No results</string> + <string name="searching">Searching...</string> + <string name="all_categories">All Categories</string> + <string name="search_banned">Some terms in your search query were excluded due to content restrictions as clarified in the Community Standards.</string> + <string name="search_short">Your search terms were too short so no search was performed.</string> + <string name="search_disabled">Legacy Search has been disabled in this region.</string> <string name="NotifyIncomingMessage">Incoming message from [NAME]...</string> <string name="NearbyChatTitleChannel">Nearby chat (on channel [CHANNEL])</string> <string name="AvatarTyping">Typing</string>