BOOL LLPanelDirLand::postBuild() { LLPanelDirBrowser::postBuild(); childSetValue("type", gSavedSettings.getString("FindLandType")); bool adult_enabled = gAgent.canAccessAdult(); bool mature_enabled = gAgent.canAccessMature(); childSetVisible("incpg", true); if (!mature_enabled) { childSetValue("incmature", FALSE); childDisable("incmature"); } if (!adult_enabled) { childSetValue("incadult", FALSE); childDisable("incadult"); } childSetCommitCallback("pricecheck", onCommitPrice, this); childSetCommitCallback("areacheck", onCommitArea, this); childSetValue("priceedit", gStatusBar->getBalance()); childSetEnabled("priceedit", gSavedSettings.getBOOL("FindLandPrice")); childSetPrevalidate("priceedit", LLLineEditor::prevalidateNonNegativeS32); childSetEnabled("areaedit", gSavedSettings.getBOOL("FindLandArea")); childSetPrevalidate("areaedit", LLLineEditor::prevalidateNonNegativeS32); childSetAction("Search", onClickSearchCore, this); setDefaultBtn("Search"); childSetTextArg("land", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); childSetTextArg("pricecheck_symbol", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); childSetLabelArg("pricecheck", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); mCurrentSortColumn = "per_meter"; LLScrollListCtrl* results = getChild<LLScrollListCtrl>("results"); if (results) { results->setSortChangedCallback(boost::bind(&LLPanelDirLand::onClickSort,this)); results->sortByColumn(mCurrentSortColumn,mCurrentSortAscending); LLStringUtil::format_map_t args; args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); int n = results->getNumColumns(); for (int i=0; i<n; i++) { LLScrollListColumn *col = results->getColumn(i); std::string label = col->mLabel; LLStringUtil::format(label, args); results->setColumnLabel(col->mName, label); } } childSetVisible("filter_gaming", (gAgent.getRegion()->getGamingFlags() & REGION_GAMING_PRESENT) && !(gAgent.getRegion()->getGamingFlags() & REGION_GAMING_HIDE_FIND_LAND)); return TRUE; }
//static bool FloaterMediaLists::handleAddDomainCallback(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) { const std::string domain = LLViewerParcelMedia::extractDomain(response["url"].asString()); if (domain.empty()) { LL_INFOS("MediaFilter") << "No domain specified" << LL_ENDL; return false; } bool whitelist = notification["payload"]["whitelist"].asBoolean(); LLSD newmedia; newmedia["domain"] = domain; newmedia["action"] = (whitelist ? "allow" : "deny"); LLViewerParcelMedia::sMediaFilterList.append(newmedia); LLViewerParcelMedia::saveDomainFilterList(); LLFloater* floater = LLFloaterReg::getInstance("media_lists"); if (floater) { LLScrollListCtrl* list = floater->getChild<LLScrollListCtrl>(whitelist ? "whitelist" : "blacklist"); LLSD element; element["columns"][0]["column"] = "list"; element["columns"][0]["value"] = domain; list->addElement(element); list->sortByColumn("list", TRUE); } } return false; }
BOOL LLFloaterExploreSounds::postBuild(void) { childSetDoubleClickCallback("sound_list", handle_play_locally, this); childSetAction("play_locally_btn", handle_play_locally, this); childSetAction("play_in_world_btn", handle_play_in_world, this); childSetAction("look_at_btn", handle_look_at, this); childSetAction("copy_uuid_btn", handle_copy_uuid, this); childSetAction("stop_btn", handle_stop, this); LLScrollListCtrl* list = getChild<LLScrollListCtrl>("sound_list"); list->sortByColumn("playing", TRUE); return TRUE; }
BOOL LLFloaterExploreSounds::postBuild(void) { LLScrollListCtrl* soundlist = getChild<LLScrollListCtrl>("sound_list"); soundlist->setDoubleClickCallback(boost::bind(&LLFloaterExploreSounds::handle_play_locally,this)); soundlist->sortByColumn("playing", TRUE); childSetAction("play_locally_btn", handle_play_locally, this); childSetAction("look_at_btn", handle_look_at, this); childSetAction("stop_btn", handle_stop, this); childSetAction("bl_btn", blacklistSound, this); return TRUE; }
BOOL LLPanelDirLand::postBuild() { LLPanelDirBrowser::postBuild(); childSetValue("type", gSavedSettings.getString("FindLandType")); bool adult_enabled = gAgent.canAccessAdult(); bool mature_enabled = gAgent.canAccessMature(); childSetVisible("incpg", true); if (!mature_enabled) { childSetValue("incmature", FALSE); childDisable("incmature"); } if (!adult_enabled) { childSetValue("incadult", FALSE); childDisable("incadult"); } childSetCommitCallback("pricecheck", onCommitPrice, this); childSetCommitCallback("areacheck", onCommitArea, this); childSetValue("priceedit", gStatusBar->getBalance()); childSetEnabled("priceedit", gSavedSettings.getBOOL("FindLandPrice")); childSetPrevalidate("priceedit", LLLineEditor::prevalidateNonNegativeS32); childSetEnabled("areaedit", gSavedSettings.getBOOL("FindLandArea")); childSetPrevalidate("areaedit", LLLineEditor::prevalidateNonNegativeS32); childSetAction("Search", onClickSearchCore, this); setDefaultBtn("Search"); mCurrentSortColumn = "per_meter"; LLScrollListCtrl* results = getChild<LLScrollListCtrl>("results"); if (results) { results->setSortChangedCallback(onClickSort); results->sortByColumn(mCurrentSortColumn,mCurrentSortAscending); } return TRUE; }
BOOL LLPanelDirLand::postBuild() { LLPanelDirBrowser::postBuild(); childSetValue("type", gSavedSettings.getString("FindLandType")); if (gAgent.mAccess <= SIM_ACCESS_PG) { childSetValue("rating", PG_ONLY); childDisable("rating"); } childSetCommitCallback("pricecheck", onCommitPrice, this); childSetCommitCallback("areacheck", onCommitArea, this); childSetValue("priceedit", gStatusBar->getBalance()); childSetEnabled("priceedit", gSavedSettings.getBOOL("FindLandPrice")); childSetPrevalidate("priceedit", LLLineEditor::prevalidateNonNegativeS32); childSetEnabled("areaedit", gSavedSettings.getBOOL("FindLandArea")); childSetPrevalidate("areaedit", LLLineEditor::prevalidateNonNegativeS32); childSetAction("Search", onClickSearchCore, this); setDefaultBtn("Search"); mCurrentSortColumn = "per_meter"; LLScrollListCtrl* results = (LLScrollListCtrl*)getChildByName("results"); if (results) { results->setSortChangedCallback(onClickSort); results->sortByColumn(mCurrentSortColumn,mCurrentSortAscending); } return TRUE; }
// static void LLPanelDirBrowser::processDirGroupsReply(LLMessageSystem* msg, void**) { S32 i; LLUUID query_id; LLUUID group_id; std::string group_name; S32 members; F32 search_order; msg->getUUIDFast(_PREHASH_QueryData,_PREHASH_QueryID, query_id ); LLPanelDirBrowser* self; self = gDirBrowserInstances.getIfThere(query_id); if (!self) { return; } self->mHaveSearchResults = TRUE; LLScrollListCtrl* list = self->findChild<LLScrollListCtrl>("results"); if (!list) return; if (!list->getCanSelect()) { list->operateOnAll(LLCtrlListInterface::OP_DELETE); self->mResultsContents = LLSD(); } S32 rows = msg->getNumberOfBlocksFast(_PREHASH_QueryReplies); self->mResultsReceived += rows; rows = self->showNextButton(rows); for (i = 0; i < 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()) { continue; } LLSD content; content["type"] = GROUP_CODE; content["name"] = group_name; LLSD row; row["id"] = group_id; LLUUID image_id; row["columns"][0]["column"] = "icon"; row["columns"][0]["type"] = "icon"; row["columns"][0]["value"] = "icon_group.tga"; row["columns"][1]["column"] = "name"; row["columns"][1]["value"] = group_name; row["columns"][1]["font"] = "SANSSERIF"; row["columns"][2]["column"] = "members"; row["columns"][2]["value"] = members; row["columns"][2]["font"] = "SANSSERIF_SMALL"; row["columns"][3]["column"] = "score"; row["columns"][3]["value"] = search_order; list->addElement(row); self->mResultsContents[group_id.asString()] = content; } list->sortByColumn(self->mCurrentSortColumn, self->mCurrentSortAscending); self->updateResultCount(); // Poke the result received timer self->mLastResultTimer.reset(); self->mDidAutoSelect = FALSE; }
void LLPanelDirBrowser::processDirEventsReply(LLMessageSystem* msg, void**) { LLUUID agent_id; LLUUID query_id; LLUUID owner_id; std::string name; std::string date; BOOL show_pg = gSavedSettings.getBOOL("ShowPGEvents"); BOOL show_mature = gSavedSettings.getBOOL("ShowMatureEvents"); BOOL show_adult = gSavedSettings.getBOOL("ShowAdultEvents"); msg->getUUID("AgentData", "AgentID", agent_id); msg->getUUID("QueryData", "QueryID", query_id ); LLPanelDirBrowser* self; self = gDirBrowserInstances.getIfThere(query_id); if (!self) { return; } if (msg->getNumberOfBlocks("StatusData")) { U32 status; msg->getU32("StatusData", "Status", status); if (status & STATUS_SEARCH_EVENTS_BANNEDWORD) { LLNotificationsUtil::add("SearchWordBanned"); } } self->mHaveSearchResults = TRUE; LLScrollListCtrl* list = self->findChild<LLScrollListCtrl>("results"); if (!list) return; if (!list->getCanSelect()) { list->operateOnAll(LLCtrlListInterface::OP_DELETE); self->mResultsContents = LLSD(); } S32 rows = msg->getNumberOfBlocks("QueryReplies"); self->mResultsReceived += rows; rows = self->showNextButton(rows); for (S32 i = 0; i < 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()) { //RN: should this check event_id instead? llwarns << "skipped event due to owner_id null, event_id " << event_id << llendl; continue; } // skip events that don't match the flags // there's no PG flag, so we make sure neither adult nor mature is set if (((event_flags & (EVENT_FLAG_ADULT | EVENT_FLAG_MATURE)) == EVENT_FLAG_NONE) && !show_pg) { //llwarns << "Skipped pg event because we're not showing pg, event_id " << event_id << llendl; continue; } if ((event_flags & EVENT_FLAG_MATURE) && !show_mature) { //llwarns << "Skipped mature event because we're not showing mature, event_id " << event_id << llendl; continue; } if ((event_flags & EVENT_FLAG_ADULT) && !show_adult) { //llwarns << "Skipped adult event because we're not showing adult, event_id " << event_id << llendl; continue; } LLSD content; content["type"] = EVENT_CODE; content["name"] = name; content["event_id"] = (S32)event_id; LLSD row; row["id"] = llformat("%u", event_id); // Column 0 - event icon LLUUID image_id; if (event_flags == EVENT_FLAG_ADULT) { row["columns"][0]["column"] = "icon"; row["columns"][0]["type"] = "icon"; row["columns"][0]["value"] = "icon_event_adult.tga"; } else if (event_flags == EVENT_FLAG_MATURE) { row["columns"][0]["column"] = "icon"; row["columns"][0]["type"] = "icon"; row["columns"][0]["value"] = "icon_event_mature.tga"; } else { row["columns"][0]["column"] = "icon"; row["columns"][0]["type"] = "icon"; row["columns"][0]["value"] = "icon_event.tga"; } row["columns"][1]["column"] = "name"; row["columns"][1]["value"] = name; row["columns"][1]["font"] = "SANSSERIF"; struct tm* t = utc_to_pacific_time(unix_time, gPacificDaylightTime); std::string format = "%m-%d "; format += gSavedSettings.getString("ShortTimeFormat"); timeStructToFormattedString(t, format, date); row["columns"][2]["column"] = "date"; row["columns"][2]["value"] = date; row["columns"][2]["font"] = "SANSSERIF_SMALL"; row["columns"][3]["column"] = "time"; row["columns"][3]["value"] = llformat("%u", unix_time); row["columns"][3]["font"] = "SANSSERIF_SMALL"; list->addElement(row, ADD_SORTED); std::string id_str = llformat("%u", event_id); self->mResultsContents[id_str] = content; } list->sortByColumn(self->mCurrentSortColumn, self->mCurrentSortAscending); self->updateResultCount(); // Poke the result received timer self->mLastResultTimer.reset(); self->mDidAutoSelect = FALSE; }
void LLPanelDirBrowser::processDirPlacesReply(LLMessageSystem* msg, void**) { LLUUID agent_id; LLUUID query_id; LLUUID parcel_id; std::string name; BOOL is_for_sale; BOOL is_auction; F32 dwell; msg->getUUID("AgentData", "AgentID", agent_id); msg->getUUID("QueryData", "QueryID", query_id ); if (msg->getNumberOfBlocks("StatusData")) { U32 status; msg->getU32("StatusData", "Status", status); if (status & STATUS_SEARCH_PLACES_BANNEDWORD) { LLNotificationsUtil::add("SearchWordBanned"); } } LLPanelDirBrowser* self; self = gDirBrowserInstances.getIfThere(query_id); if (!self) { // data from an old query return; } self->mHaveSearchResults = TRUE; LLScrollListCtrl* list = self->findChild<LLScrollListCtrl>("results"); if (!list) return; if (!list->getCanSelect()) { list->operateOnAll(LLCtrlListInterface::OP_DELETE); self->mResultsContents = LLSD(); } S32 count = msg->getNumberOfBlocks("QueryReplies"); self->mResultsReceived += count; count = self->showNextButton(count); for (S32 i = 0; i < count ; i++) { msg->getUUID("QueryReplies", "ParcelID", parcel_id, i); msg->getString("QueryReplies", "Name", name, i); msg->getBOOL("QueryReplies", "ForSale", is_for_sale, i); msg->getBOOL("QueryReplies", "Auction", is_auction, i); msg->getF32("QueryReplies", "Dwell", dwell, i); if (parcel_id.isNull()) { continue; } LLSD content; S32 type; LLSD row = self->createLandSale(parcel_id, is_auction, is_for_sale, name, &type); content["type"] = type; content["name"] = name; std::string buffer = llformat("%.0f", (F64)dwell); row["columns"][3]["column"] = "dwell"; row["columns"][3]["value"] = buffer; row["columns"][3]["font"] = "SANSSERIF_SMALL"; list->addElement(row); self->mResultsContents[parcel_id.asString()] = content; } list->sortByColumn(self->mCurrentSortColumn, self->mCurrentSortAscending); self->updateResultCount(); // Poke the result received timer self->mLastResultTimer.reset(); self->mDidAutoSelect = FALSE; }
void LLPanelDirBrowser::processDirPeopleReply(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); LLPanelDirBrowser* self; self = gDirBrowserInstances.getIfThere(query_id); if (!self) { // data from an old query return; } self->mHaveSearchResults = TRUE; LLScrollListCtrl* list = self->findChild<LLScrollListCtrl>("results"); if (!list) return; if (!list->getCanSelect()) { list->operateOnAll(LLCtrlListInterface::OP_DELETE); self->mResultsContents = LLSD(); } S32 rows = msg->getNumberOfBlocksFast(_PREHASH_QueryReplies); self->mResultsReceived += rows; rows = self->showNextButton(rows); for (S32 i = 0; i < 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); // unused // msg->getStringFast(_PREHASH_QueryReplies,_PREHASH_Group, group, i); // msg->getS32Fast( _PREHASH_QueryReplies,_PREHASH_Reputation, reputation, i); if (agent_id.isNull()) { continue; } LLSD content; LLSD row; row["id"] = agent_id; // We don't show online status in the finder anymore, // so just use the 'offline' icon as the generic 'person' icon row["columns"][0]["column"] = "icon"; row["columns"][0]["type"] = "icon"; row["columns"][0]["value"] = "icon_avatar_offline.tga"; content["type"] = AVATAR_CODE; std::string fullname = first_name + " " + last_name; row["columns"][1]["column"] = "name"; row["columns"][1]["value"] = fullname; row["columns"][1]["font"] = "SANSSERIF"; content["name"] = fullname; list->addElement(row); self->mResultsContents[agent_id.asString()] = content; } list->sortByColumn(self->mCurrentSortColumn, self->mCurrentSortAscending); self->updateResultCount(); // Poke the result received timer self->mLastResultTimer.reset(); self->mDidAutoSelect = FALSE; }
void LLFloaterWorldMap::updateSims(bool found_null_sim) { if (mCompletingRegionName == "") { return; } LLScrollListCtrl *list = getChild<LLScrollListCtrl>("search_results"); list->operateOnAll(LLCtrlListInterface::OP_DELETE); S32 name_length = mCompletingRegionName.length(); LLSD match; S32 num_results = 0; std::vector<std::pair <U64, LLSimInfo*> > sim_info_vec(LLWorldMap::getInstance()->getRegionMap().begin(), LLWorldMap::getInstance()->getRegionMap().end()); std::sort(sim_info_vec.begin(), sim_info_vec.end(), SortRegionNames()); for (std::vector<std::pair <U64, LLSimInfo*> >::const_iterator it = sim_info_vec.begin(); it != sim_info_vec.end(); ++it) { LLSimInfo* info = it->second; std::string sim_name_lower = info->getName(); LLStringUtil::toLower(sim_name_lower); if (sim_name_lower.substr(0, name_length) == mCompletingRegionName) { if (sim_name_lower == mCompletingRegionName) { match = info->getName(); } LLSD value; value["id"] = info->getName(); value["columns"][0]["column"] = "sim_name"; value["columns"][0]["value"] = info->getName(); list->addElement(value); num_results++; } } if (found_null_sim) { mCompletingRegionName = ""; } if (num_results > 0) { // Ansariel: Let's sort the list to make it more user-friendly list->sortByColumn("sim_name", TRUE); // if match found, highlight it and go if (!match.isUndefined()) { list->selectByValue(match); } // else select first found item else { list->selectFirstItem(); } getChild<LLUICtrl>("search_results")->setFocus(TRUE); onCommitSearchResult(); } else { // if we found nothing, say "none" list->setCommentText(LLTrans::getString("worldmap_results_none_found")); list->operateOnAll(LLCtrlListInterface::OP_DESELECT); } }
void LLFloaterWorldMap::updateSims(bool found_null_sim) { if (mCompletingRegionName == "") { return; } LLScrollListCtrl *list = getChild<LLScrollListCtrl>("search_results"); list->operateOnAll(LLCtrlListInterface::OP_DELETE); LLSD selected_value = list->getSelectedValue(); S32 name_length = mCompletingRegionName.length(); BOOL match_found = FALSE; S32 num_results = 0; std::map<U64, LLSimInfo*>::const_iterator it; for (it = LLWorldMap::getInstance()->getRegionMap().begin(); it != LLWorldMap::getInstance()->getRegionMap().end(); ++it) { LLSimInfo* info = it->second; std::string sim_name_lower = info->getName(); LLStringUtil::toLower(sim_name_lower); if (sim_name_lower.substr(0, name_length) == mCompletingRegionName) { if (LLWorldMap::getInstance()->isTrackingCommit()) { if (info->isName(mCompletingRegionName)) { selected_value = info->getName(); match_found = TRUE; } } LLSD value; value["id"] = info->getName(); value["columns"][0]["column"] = "sim_name"; value["columns"][0]["value"] = info->getName(); list->addElement(value); num_results++; } } list->selectByValue(selected_value); if (found_null_sim) { mCompletingRegionName = ""; } if (match_found) { mExactMatch = TRUE; list->sortByColumn("sim_name", TRUE); childSetFocus("search_results"); onCommitSearchResult(NULL, this); } else if (!mExactMatch && num_results > 0) { list->sortByColumn("sim_name", TRUE); list->selectFirstItem(); // select first item by default childSetFocus("search_results"); onCommitSearchResult(NULL, this); } else { list->addCommentText(std::string("None found.")); list->operateOnAll(LLCtrlListInterface::OP_DESELECT); } }