void LLPanelRequestTools::refresh() { std::string buffer = getChild<LLUICtrl>("destination")->getValue(); LLCtrlListInterface *list = childGetListInterface("destination"); if (!list) return; S32 last_item = list->getItemCount(); if (last_item >=3) { list->selectItemRange(2,last_item); list->operateOnSelection(LLCtrlListInterface::OP_DELETE); } for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* regionp = *iter; std::string name = regionp->getName(); if (!name.empty()) { list->addSimpleElement(name); } } if(!buffer.empty()) { list->selectByValue(buffer); } else { list->operateOnSelection(LLCtrlListInterface::OP_DESELECT); } }
//--------------------------------------------------------------------------- // LLFloaterClothing //--------------------------------------------------------------------------- LLFloaterClothing::LLFloaterClothing() : LLFloater("floater_clothing", "FloaterClothingRect", ""), mSelectedID(), mAllowSelection(FALSE) { gUICtrlFactory->buildFloater(this, "floater_clothing.xml"); sInstance = this; sObserver = new LLFloaterClothingObserver; gInventory.addObserver(sObserver); childSetAction("take_off_btn", onClickTakeOff, this); childSetAction("wear_btn", onClickWear, this); childSetDoubleClickCallback("clothing_list", onClickWear); childSetCommitCallback("clothing_list", onCommitList, this); LLCtrlListInterface* list = childGetListInterface("clothing_list"); if (list) { list->addSimpleElement(LOADING_STRING); } setDefaultBtn("wear_btn"); gInventory.startBackgroundFetch(); }
void LLPanelRequestTools::refresh() { std::string buffer = childGetValue("destination"); LLCtrlListInterface *list = childGetListInterface("destination"); if (!list) return; list->operateOnAll(LLCtrlListInterface::OP_DELETE); list->addSimpleElement(SELECTION); list->addSimpleElement(AGENT_REGION); for (LLWorld::region_list_t::iterator iter = gWorldp->mActiveRegionList.begin(); iter != gWorldp->mActiveRegionList.end(); ++iter) { LLViewerRegion* regionp = *iter; LLString name = regionp->getName(); //MK if (RRenabled && gAgent.mRRInterface.mContainsShowloc) { name = "(Hidden)"; } //mk if (!name.empty()) { list->addSimpleElement(name); } } if(!buffer.empty()) { list->selectByValue(buffer); } else { list->selectByValue(SELECTION); } }
BOOL LLFloaterWorldMap::postBuild() { mPanel = getChild<LLPanel>("objects_mapview"); LLComboBox *avatar_combo = getChild<LLComboBox>("friend combo"); avatar_combo->selectFirstItem(); avatar_combo->setPrearrangeCallback( boost::bind(&LLFloaterWorldMap::onAvatarComboPrearrange, this) ); avatar_combo->setTextEntryCallback( boost::bind(&LLFloaterWorldMap::onComboTextEntry, this) ); mListFriendCombo = dynamic_cast<LLCtrlListInterface *>(avatar_combo); LLSearchEditor *location_editor = getChild<LLSearchEditor>("location"); location_editor->setFocusChangedCallback(boost::bind(&LLFloaterWorldMap::onLocationFocusChanged, this, _1)); location_editor->setKeystrokeCallback( boost::bind(&LLFloaterWorldMap::onSearchTextEntry, this)); getChild<LLScrollListCtrl>("search_results")->setDoubleClickCallback( boost::bind(&LLFloaterWorldMap::onClickTeleportBtn, this)); mListSearchResults = childGetListInterface("search_results"); LLComboBox *landmark_combo = getChild<LLComboBox>( "landmark combo"); landmark_combo->selectFirstItem(); landmark_combo->setPrearrangeCallback( boost::bind(&LLFloaterWorldMap::onLandmarkComboPrearrange, this) ); landmark_combo->setTextEntryCallback( boost::bind(&LLFloaterWorldMap::onComboTextEntry, this) ); mListLandmarkCombo = dynamic_cast<LLCtrlListInterface *>(landmark_combo); mCurZoomVal = log(LLWorldMapView::sMapScale)/log(2.f); getChild<LLUICtrl>("zoom slider")->setValue(LLWorldMapView::sMapScale); setDefaultBtn(NULL); mZoomTimer.stop(); onChangeMaturity(); return TRUE; }
BOOL LLFloaterLandHoldings::postBuild() { childSetAction("Teleport", onClickTeleport, this); childSetAction("Show on Map", onClickMap, this); // Grant list childSetDoubleClickCallback("grant list", onGrantList); childSetUserData("grant list", this); LLCtrlListInterface *list = childGetListInterface("grant list"); if (!list) return TRUE; S32 count = gAgent.mGroups.count(); for(S32 i = 0; i < count; ++i) { LLUUID id(gAgent.mGroups.get(i).mID); LLSD element; element["id"] = id; element["columns"][0]["column"] = "group"; element["columns"][0]["value"] = gAgent.mGroups.get(i).mName; element["columns"][0]["font"] = "SANSSERIF"; LLUIString areastr = getString("area_string"); areastr.setArg("[AREA]", llformat("%d", gAgent.mGroups.get(i).mContribution)); element["columns"][1]["column"] = "area"; element["columns"][1]["value"] = areastr; element["columns"][1]["font"] = "SANSSERIF"; list->addElement(element, ADD_SORTED); } return TRUE; }
// virtual void LLPanelDirBrowser::draw() { // HACK: If the results panel has data, we want to select the first // item. Unfortunately, we don't know when the find is actually done, // so only do this if it's been some time since the last packet of // results was received. if (mLastResultTimer.getElapsedTimeF32() > 0.5) { if (!mDidAutoSelect && hasChild("results") && !childHasFocus("results")) { LLCtrlListInterface *list = childGetListInterface("results"); if (list) { if (list->getCanSelect()) { list->selectFirstItem(); // select first item by default childSetFocus("results", TRUE); } // Request specific data from the server onCommitList(); } } mDidAutoSelect = TRUE; } LLPanel::draw(); }
// No longer really builds a list. Instead, just updates mAvatarCombo. void LLFloaterWorldMap::buildAvatarIDList() { LLCtrlListInterface *list = childGetListInterface("friend combo"); if (!list) return; // Delete all but the "None" entry S32 list_size = list->getItemCount(); while (list_size > 1) { list->selectNthItem(1); list->operateOnSelection(LLCtrlListInterface::OP_DELETE); --list_size; } LLSD default_column; default_column["name"] = "friend name"; default_column["label"] = "Friend Name"; default_column["width"] = 500; list->addColumn(default_column); // Get all of the calling cards for avatar that are currently online LLCollectMappableBuddies collector; LLAvatarTracker::instance().applyFunctor(collector); LLCollectMappableBuddies::buddy_map_t::iterator it; LLCollectMappableBuddies::buddy_map_t::iterator end; it = collector.mMappable.begin(); end = collector.mMappable.end(); for( ; it != end; ++it) { list->addSimpleElement((*it).first, ADD_BOTTOM, (*it).second); } list->setCurrentByID( LLAvatarTracker::instance().getAvatarID() ); list->selectFirstItem(); }
void LLPanelDirBrowser::newClassified() { LLCtrlListInterface *list = childGetListInterface("results"); if (!list) return; if (mFloaterDirectory->mPanelClassifiedp) { // Clear the panel on the right mFloaterDirectory->mPanelClassifiedp->reset(); // Set up the classified with the info we've created // and a sane default position. mFloaterDirectory->mPanelClassifiedp->initNewClassified(); // We need the ID to select in the list. LLUUID classified_id = mFloaterDirectory->mPanelClassifiedp->getClassifiedID(); // Put it in the list on the left addClassified(list, classified_id, mFloaterDirectory->mPanelClassifiedp->getClassifiedName(),0,0); // Select it. list->setCurrentByID(classified_id); // Make the right panel visible (should already be) mFloaterDirectory->mPanelClassifiedp->setVisible(TRUE); } }
void LLPanelRequestTools::refresh() { std::string buffer = childGetValue("destination"); LLCtrlListInterface *list = childGetListInterface("destination"); if (!list) return; list->operateOnAll(LLCtrlListInterface::OP_DELETE); list->addSimpleElement(SELECTION); list->addSimpleElement(AGENT_REGION); for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->mActiveRegionList.begin(); iter != LLWorld::getInstance()->mActiveRegionList.end(); ++iter) { LLViewerRegion* regionp = *iter; std::string name = regionp->getName(); if (!name.empty()) { list->addSimpleElement(name); } } if(!buffer.empty()) { list->selectByValue(buffer); } else { list->selectByValue(SELECTION); } }
void LLFloaterMediaBrowser::buildURLHistory() { LLCtrlListInterface* url_list = childGetListInterface("address"); if (url_list) { url_list->operateOnAll(LLCtrlListInterface::OP_DELETE); } // Get all of the entries in the "browser" collection LLSD browser_history = LLURLHistory::getURLHistory("browser"); LLSD::array_iterator iter_history = browser_history.beginArray(); LLSD::array_iterator end_history = browser_history.endArray(); for(; iter_history != end_history; ++iter_history) { std::string url = (*iter_history).asString(); if(! url.empty()) url_list->addSimpleElement(url); } // initialize URL history in the plugin if(mBrowser && mBrowser->getMediaPlugin()) { mBrowser->getMediaPlugin()->initializeUrlHistory(browser_history); } }
void LLPanelGroups::startIM() { //llinfos << "LLPanelFriends::onClickIM()" << llendl; LLCtrlListInterface *group_list = childGetListInterface("group list"); LLUUID group_id; if (group_list && (group_id = group_list->getCurrentID()).notNull()) { LLGroupData group_data; if (gAgent.getGroupData(group_id, group_data)) { gIMMgr->setFloaterOpen(TRUE); gIMMgr->addSession( group_data.mName, IM_SESSION_GROUP_START, group_id); make_ui_sound("UISndStartIM"); } else { // this should never happen, as starting a group IM session // relies on you belonging to the group and hence having the group data make_ui_sound("UISndInvalidOp"); } } }
void LLFloaterTopObjects::doToObjects(int action, bool all) { LLMessageSystem *msg = gMessageSystem; LLViewerRegion* region = gAgent.getRegion(); if (!region) return; LLCtrlListInterface *list = childGetListInterface("objects_list"); if (!list || list->getItemCount() == 0) return; std::vector<LLUUID>::iterator id_itor; bool start_message = true; for (id_itor = mObjectListIDs.begin(); id_itor != mObjectListIDs.end(); ++id_itor) { LLUUID task_id = *id_itor; if (!all && !list->isSelected(task_id)) { // Selected only continue; } if (start_message) { if (action == ACTION_RETURN) { msg->newMessageFast(_PREHASH_ParcelReturnObjects); } else { msg->newMessageFast(_PREHASH_ParcelDisableObjects); } msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID,gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_ParcelData); msg->addS32Fast(_PREHASH_LocalID, -1); // Whole region msg->addS32Fast(_PREHASH_ReturnType, RT_NONE); start_message = false; } msg->nextBlockFast(_PREHASH_TaskIDs); msg->addUUIDFast(_PREHASH_TaskID, task_id); if (msg->isSendFullFast(_PREHASH_TaskIDs)) { msg->sendReliable(region->getHost()); start_message = true; } } if (!start_message) { msg->sendReliable(region->getHost()); } }
void LLPanelScriptLimitsRegionMemory::returnObjectsFromParcel(S32 local_id) { LLMessageSystem *msg = gMessageSystem; LLViewerRegion* region = gAgent.getRegion(); if (!region) return; LLCtrlListInterface *list = childGetListInterface("scripts_list"); if (!list || list->getItemCount() == 0) return; std::vector<LLSD>::iterator id_itor; bool start_message = true; for (id_itor = mObjectListItems.begin(); id_itor != mObjectListItems.end(); ++id_itor) { LLSD element = *id_itor; if (!list->isSelected(element["id"].asUUID())) { // Selected only continue; } if(element["local_id"].asInteger() != local_id) { // Not the parcel we are looking for continue; } if (start_message) { msg->newMessageFast(_PREHASH_ParcelReturnObjects); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID,gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_ParcelData); msg->addS32Fast(_PREHASH_LocalID, element["local_id"].asInteger()); msg->addU32Fast(_PREHASH_ReturnType, RT_LIST); start_message = false; } msg->nextBlockFast(_PREHASH_TaskIDs); msg->addUUIDFast(_PREHASH_TaskID, element["id"].asUUID()); if (msg->isSendFullFast(_PREHASH_TaskIDs)) { msg->sendReliable(region->getHost()); start_message = true; } } if (!start_message) { msg->sendReliable(region->getHost()); } }
void LLPanelGroups::info() { llinfos << "LLPanelGroups::info" << llendl; LLCtrlListInterface *group_list = childGetListInterface("group list"); LLUUID group_id; if (group_list && (group_id = group_list->getCurrentID()).notNull()) { LLFloaterGroupInfo::showFromUUID(group_id); } }
void LLFloaterWorldMap::clearLocationSelection(BOOL clear_ui) { LLCtrlListInterface *list = childGetListInterface("search_results"); if (list) { list->operateOnAll(LLCtrlListInterface::OP_DELETE); } LLWorldMap::getInstance()->cancelTracking(); mCompletingRegionName = ""; }
void LLFloaterWorldMap::clearLandmarkSelection(BOOL clear_ui) { if (clear_ui || !childHasKeyboardFocus("landmark combo")) { LLCtrlListInterface *list = childGetListInterface("landmark combo"); if (list) { list->selectByValue( "None" ); } } }
// Checked: 2010-04-18 (RLVa-1.1.3b) | Modified: RLVa-1.2.0e void RlvFloaterBehaviour::refreshAll() { LLCtrlListInterface* pBhvrList = childGetListInterface("behaviour_list"); if (!pBhvrList) return; pBhvrList->operateOnAll(LLCtrlListInterface::OP_DELETE); if (!gAgentAvatarp) return; // // Set-up a row we can just reuse // LLSD sdRow; LLSD& sdColumns = sdRow["columns"]; sdColumns[0]["column"] = "behaviour"; sdColumns[0]["type"] = "text"; sdColumns[1]["column"] = "name"; sdColumns[1]["type"] = "text"; // // List behaviours // const RlvHandler::rlv_object_map_t* pRlvObjects = gRlvHandler.getObjectMap(); for (RlvHandler::rlv_object_map_t::const_iterator itObj = pRlvObjects->begin(), endObj = pRlvObjects->end(); itObj != endObj; ++itObj) { sdColumns[1]["value"] = rlvGetItemNameFromObjID(itObj->first); const rlv_command_list_t* pCommands = itObj->second.getCommandList(); for (rlv_command_list_t::const_iterator itCmd = pCommands->begin(), endCmd = pCommands->end(); itCmd != endCmd; ++itCmd) { std::string strBhvr = itCmd->asString(); LLUUID idOption(itCmd->getOption()); if (idOption.notNull()) { std::string strLookup; if ( (gCacheName->getFullName(idOption, strLookup)) || (gCacheName->getGroupName(idOption, strLookup)) ) { if (strLookup.find("???") == std::string::npos) strBhvr.assign(itCmd->getBehaviour()).append(":").append(strLookup); } else if (m_PendingLookup.end() == m_PendingLookup.find(idOption)) { m_PendingLookup[idOption] = gCacheName->get(idOption, false, boost::bind(&RlvFloaterBehaviour::onAvatarNameLookup,this,_1)); } } sdColumns[0]["value"] = strBhvr; pBhvrList->addElement(sdRow, ADD_BOTTOM); } } }
void LLPanelScriptLimitsAttachment::clearList() { LLCtrlListInterface *list = childGetListInterface("scripts_list"); if (list) { list->operateOnAll(LLCtrlListInterface::OP_DELETE); } std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestWaiting"); childSetValue("loading_text", LLSD(msg_waiting)); }
void LLFloaterWorldMap::clearAvatarSelection(BOOL clear_ui) { if (clear_ui || !childHasKeyboardFocus("friend combo")) { mTrackedStatus = LLTracker::TRACKING_NOTHING; LLCtrlListInterface *list = childGetListInterface("friend combo"); if (list) { list->selectByValue( "None" ); } } }
void LLPanelDirBrowser::getSelectedInfo(LLUUID* id, S32 *type) { LLCtrlListInterface *list = childGetListInterface("results"); if (!list) return; LLSD id_sd = childGetValue("results"); *id = id_sd.asUUID(); std::string id_str = id_sd.asString(); *type = mResultsContents[id_str]["type"]; }
void LLFloaterTopObjects::clearList() { LLCtrlListInterface *list = childGetListInterface("objects_list"); if (list) { list->operateOnAll(LLCtrlListInterface::OP_DELETE); } mObjectListData.clear(); mObjectListIDs.clear(); mtotalScore = 0.f; }
// clear the group list, and get a fresh set of info. void LLPanelGroups::reset() { LLCtrlListInterface *group_list = childGetListInterface("group list"); if (group_list) { group_list->operateOnAll(LLCtrlListInterface::OP_DELETE); } childSetTextArg("groupcount", "[COUNT]", llformat("%d",gAgent.mGroups.count())); childSetTextArg("groupcount", "[MAX]", llformat("%d",MAX_AGENT_GROUPS)); init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID()); enableButtons(); }
void LLFloaterWorldMap::buildLandmarkIDLists() { LLCtrlListInterface *list = childGetListInterface("landmark combo"); if (!list) { return; } // Delete all but the "None" entry S32 list_size = list->getItemCount(); if (list_size > 1) { list->selectItemRange(1, -1); list->operateOnSelection(LLCtrlListInterface::OP_DELETE); } mLandmarkItemIDList.reset(); mLandmarkAssetIDList.reset(); // Get all of the current landmarks mLandmarkAssetIDList.put( LLUUID::null ); mLandmarkItemIDList.put( LLUUID::null ); mLandmarkAssetIDList.put( sHomeID ); mLandmarkItemIDList.put( sHomeID ); LLInventoryModel::cat_array_t cats; LLInventoryModel::item_array_t items; LLIsType is_landmark(LLAssetType::AT_LANDMARK); gInventory.collectDescendentsIf(gAgent.getInventoryRootID(), cats, items, LLInventoryModel::EXCLUDE_TRASH, is_landmark); std::sort(items.begin(), items.end(), LLViewerInventoryItem::comparePointers()); S32 count = items.count(); for(S32 i = 0; i < count; ++i) { LLInventoryItem* item = items.get(i); list->addSimpleElement(item->getName(), ADD_BOTTOM, item->getUUID()); mLandmarkAssetIDList.put( item->getAssetUUID() ); mLandmarkItemIDList.put( item->getUUID() ); } list->sortByColumn(std::string("landmark name"), TRUE); list->selectFirstItem(); }
// clear the group list, and get a fresh set of info. void LLPanelGroups::reset() { LLCtrlListInterface *group_list = childGetListInterface("group list"); if (group_list) { group_list->operateOnAll(LLCtrlListInterface::OP_DELETE); } childSetTextArg("groupcount", "[COUNT]", llformat("%d",gAgent.mGroups.count())); childSetTextArg("groupcount", "[MAX]", llformat("%d", gHippoLimits->getMaxAgentGroups())); const std::string none_text = getString("none"); init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID(), none_text); enableButtons(); }
void LLPanelGroups::invite() { LLCtrlListInterface *group_list = childGetListInterface("group list"); LLUUID group_id; //if (group_list && (group_id = group_list->getCurrentID()).notNull()) if (group_list) { group_id = group_list->getCurrentID(); } LLFloaterGroupInvite::showForGroup(group_id); }
void lggPanelIRC::removeirc() { llinfos << "lggPanelIRC::removeirc" << llendl; LLCtrlListInterface *irc_list = childGetListInterface("PhoenixIRC_list"); LLUUID irc_id; if (irc_list && (irc_id = irc_list->getCurrentID()).notNull()) { llinfos << "lggPanelIRC::removeirc" << irc_list->getSelectedValue() << " and " << irc_list->getCurrentID() << llendl; glggIrcGroupHandler.deleteIrcGroupByID(irc_list->getCurrentID()); } newList(); }
void lggPanelIRC::editirc() { llinfos << "lggPanelIRC::editirc" << llendl; LLCtrlListInterface *irc_list = childGetListInterface("PhoenixIRC_list"); LLUUID irc_id; if (irc_list && (irc_id = irc_list->getCurrentID()).notNull()) { LggIrcFloaterStarter::show(glggIrcGroupHandler.getIrcGroupInfoByID(irc_list->getCurrentID()),this); //TODO CLeanup shit } }
void LLFloaterGroupPicker::ok() { LLCtrlListInterface *group_list = childGetListInterface("group list"); LLUUID group_id; if (group_list) { group_id = group_list->getCurrentID(); } if(mSelectCallback) { mSelectCallback(group_id, mCallbackUserdata); } close(); }
void LLPanelGroups::enableButtons() { LLCtrlListInterface *group_list = childGetListInterface("group list"); LLUUID group_id; if (group_list) { group_id = group_list->getCurrentID(); } if(group_id != gAgent.getGroupID()) { childEnable("Activate"); } else { childDisable("Activate"); } if (group_id.notNull()) { childEnable("Info"); childEnable("IM"); childEnable("Leave"); } else { childDisable("Info"); childDisable("IM"); childDisable("Leave"); } if(gAgent.mGroups.count() < MAX_AGENT_GROUPS) { childEnable("Create"); } else { childDisable("Create"); } if (group_id.notNull() && gAgent.hasPowerInGroup(group_id, GP_MEMBER_INVITE)) { LLPanelGroups::childEnable("Invite..."); } else { LLPanelGroups::childDisable("Invite..."); } }
void LLPanelFriends::updateFriends(U32 changed_mask) { LLUUID selected_id; LLCtrlListInterface *friends_list = childGetListInterface("friend_list"); if (!friends_list) return; LLCtrlScrollInterface *friends_scroll = childGetScrollInterface("friend_list"); if (!friends_scroll) return; // We kill the selection warning, otherwise we'll spam with warning popups // if the maximum amount of friends are selected mShowMaxSelectWarning = false; LLDynamicArray<LLUUID> selected_friends = getSelectedIDs(); if(changed_mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE)) { refreshNames(changed_mask); } else if(changed_mask & LLFriendObserver::POWERS) { --mNumRightsChanged; if(mNumRightsChanged > 0) { mPeriod = RIGHTS_CHANGE_TIMEOUT; mEventTimer.start(); mAllowRightsChange = FALSE; } else { tick(); } } if(selected_friends.size() > 0) { // only non-null if friends was already found. This may fail, // but we don't really care here, because refreshUI() will // clean up the interface. friends_list->setCurrentByID(selected_id); for(LLDynamicArray<LLUUID>::iterator itr = selected_friends.begin(); itr != selected_friends.end(); ++itr) { friends_list->setSelectedByValue(*itr, true); } } refreshUI(); mShowMaxSelectWarning = true; }