Esempio n. 1
0
void LLPanelFriends::updateColumns(void* user_data)
{
	LLPanelFriends* panelp = (LLPanelFriends*)user_data;
	if (panelp)
	{
		LLButton* expand_button = panelp->getChild<LLButton>("expand_collapse_btn");
		LLScrollListCtrl* list = panelp->getChild<LLScrollListCtrl>("friend_list");
		//llinfos << "Refreshing UI" << llendl;
		S32 width = 22;
		std::string button = ">";
		if (gSavedSettings.getBOOL("ContactListCollapsed"))
		{
			width = 0;
			button = "<";
		}
		expand_button->setLabel(button);
		LLScrollListColumn* column = list->getColumn(5);
		list->updateStaticColumnWidth(column, width);
		column->setWidth(width);
		column = list->getColumn(6);
		list->updateStaticColumnWidth(column, width);
		column->setWidth(width);
		column = list->getColumn(7);
		list->updateStaticColumnWidth(column, width);
		column->setWidth(width);
		list->updateLayout();
		if (!gSavedSettings.getBOOL("ContactListCollapsed"))
		{
			panelp->updateFriends(LLFriendObserver::ADD);
		}
	}
}
BOOL LLFloaterAvatarList::postBuild()
{
	// Default values
	mTracking = FALSE;
	mUpdate = TRUE;

	// Set callbacks
	childSetAction("profile_btn", onClickProfile, this);
	childSetAction("im_btn", onClickIM, this);
	childSetAction("offer_btn", onClickTeleportOffer, this);
	childSetAction("track_btn", onClickTrack, this);
	childSetAction("mark_btn", onClickMark, this);
	childSetAction("focus_btn", onClickFocus, this);
	childSetAction("prev_in_list_btn", onClickPrevInList, this);
	childSetAction("next_in_list_btn", onClickNextInList, this);
	childSetAction("prev_marked_btn", onClickPrevMarked, this);
	childSetAction("next_marked_btn", onClickNextMarked, this);

	childSetAction("get_key_btn", onClickGetKey, this);

	childSetAction("freeze_btn", onClickFreeze, this);
	childSetAction("eject_btn", onClickEject, this);
	childSetAction("mute_btn", onClickMute, this);
	childSetAction("ar_btn", onClickAR, this);
	childSetAction("teleport_btn", onClickTeleport, this);
	childSetAction("estate_eject_btn", onClickEjectFromEstate, this);
	childSetAction("estate_ban_btn", onClickBanFromEstate, this);

	childSetAction("send_keys_btn", onClickSendKeys, this);

	getChild<LLRadioGroup>("update_rate")->setSelectedIndex(gSavedSettings.getU32("RadarUpdateRate"));
	childSetCommitCallback("update_rate", onCommitUpdateRate, this);

	// Get a pointer to the scroll list from the interface
	mAvatarList = getChild<LLScrollListCtrl>("avatar_list");
	mAvatarList->sortByColumn("distance", TRUE);
	mAvatarList->setCommitOnSelectionChange(TRUE);
	mAvatarList->setCallbackUserData(this);
	mAvatarList->setCommitCallback(onSelectName);
	mAvatarList->setDoubleClickCallback(onClickFocus);
	refreshAvatarList();

	gIdleCallbacks.addFunction(LLFloaterAvatarList::callbackIdle);

	if(gHippoGridManager->getConnectedGrid()->isSecondLife()){
		LLScrollListCtrl* list = getChild<LLScrollListCtrl>("avatar_list");
		list->getColumn(LIST_AVATAR_NAME)->setWidth(0);
		list->getColumn(LIST_CLIENT)->setWidth(0);
		list->getColumn(LIST_CLIENT)->mDynamicWidth = FALSE;
		list->getColumn(LIST_CLIENT)->mRelWidth = 0;
		list->getColumn(LIST_AVATAR_NAME)->mDynamicWidth = TRUE;
		list->getColumn(LIST_AVATAR_NAME)->mRelWidth = -1;
		list->updateLayout();
	}

	return TRUE;
}