void LLFloaterVFSExplorer::setEditID(LLUUID edit_id)
{
	LLScrollListCtrl* list = getChild<LLScrollListCtrl>("file_list");
	bool found_in_list = (list->getItemIndex(edit_id) != -1);
	bool found_in_files = false;
	LLVFSFileSpecifier file;
	std::map<LLVFSFileSpecifier, LLVFSFileBlock*>::iterator end = sVFSFileMap.end();
	for(std::map<LLVFSFileSpecifier, LLVFSFileBlock*>::iterator iter = sVFSFileMap.begin(); iter != end; ++iter)
	{
		if((*iter).first.mFileID == edit_id)
		{
			found_in_files = true;
			file = (*iter).first;
			break;
		}
	}
	if(found_in_files && found_in_list)
	{
		mEditID = edit_id;
		list->selectByID(edit_id);
		setEditEnabled(true);
		childSetText("name_edit", file.mFileID.asString());
		childSetText("id_edit", file.mFileID.asString());
		childSetValue("type_combo", std::string(LLAssetType::lookup(file.mFileType)));
	}
	else
	{
		mEditID = LLUUID::null;
		list->deselectAllItems(TRUE);
		setEditEnabled(false);
		childSetText("name_edit", std::string(""));
		childSetText("id_edit", std::string(""));
		childSetValue("type_combo", std::string("animatn"));
	}
}
//static
void LLFloaterTeleportHistory::loadFile(const std::string &file_name)
{
    LLFloaterTeleportHistory *pFloaterHistory = LLFloaterTeleportHistory::findInstance();
    if(!pFloaterHistory)
        return;

    LLScrollListCtrl* pScrollList = pFloaterHistory->mPlacesList;
    if(!pScrollList)
        return;

    std::string temp_str(gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter() + file_name);

    llifstream file(temp_str);

    if (file.is_open())
    {
        LL_INFOS() << "Loading "<< file_name << " file at " << temp_str << LL_ENDL;
        LLSD data;
        LLSDSerialize::fromXML(data, file);
        if (data.isUndefined())
        {
            LL_INFOS() << "file missing, ill-formed, "
                       "or simply undefined; not reading the"
                       " file" << LL_ENDL;
        }
        else
        {
            const S32 max_entries = gSavedSettings.getS32("TeleportHistoryMaxEntries");
            const S32 num_entries = llmin(max_entries,(const S32)data.size());
            pScrollList->clear();
            for(S32 i = 0; i < num_entries; i++) //Lower entry = newer
            {
                pScrollList->addElement(data[i], ADD_BOTTOM);
            }
            pScrollList->deselectAllItems(TRUE);
            pFloaterHistory->mID = pScrollList->getItemCount();
            pFloaterHistory->setButtonsEnabled(FALSE);
        }
    }
}
BOOL LLFloaterAvatarPicker::handleDragAndDrop(S32 x, S32 y, MASK mask,
											  BOOL drop, EDragAndDropType cargo_type,
											  void *cargo_data, EAcceptance *accept,
											  std::string& tooltip_msg)
{
	LLScrollListCtrl* list = getActiveList();
	if(list)
	{
		LLRect rc_list;
		LLRect rc_point(x,y,x,y);
		if (localRectToOtherView(rc_point, &rc_list, list))
		{
			// Keep selected only one item
			list->deselectAllItems(TRUE);
			list->selectItemAt(rc_list.mLeft, rc_list.mBottom, mask);
			LLScrollListItem* selection = list->getFirstSelected();
			if (selection)
			{
				LLUUID session_id = LLUUID::null;
				LLUUID dest_agent_id = selection->getUUID();
				std::string avatar_name = selection->getColumn(0)->getValue().asString();
				if (dest_agent_id.notNull() && dest_agent_id != gAgentID)
				{
//					if (drop)
// [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0h) | Added: RLVa-1.3.0h
					if ( (drop) && ( (!rlv_handler_t::isEnabled()) || (gRlvHandler.canStartIM(dest_agent_id)) ) )
// [/RLVa:KB]
					{
						// Start up IM before give the item
						session_id = gIMMgr->addSession(avatar_name, IM_NOTHING_SPECIAL, dest_agent_id);
					}
					return LLToolDragAndDrop::handleGiveDragAndDrop(dest_agent_id, session_id, drop,
																	cargo_type, cargo_data, accept, getName());
				}
			}
		}
	}
	*accept = ACCEPT_NO;
	return TRUE;
}