BOOL LLParticipantList::postBuild()
{
	mAvatarList = getChild<LLScrollListCtrl>("speakers_list");

	mAvatarList->sortByColumn(gSavedSettings.getString("FloaterActiveSpeakersSortColumn"), gSavedSettings.getBOOL("FloaterActiveSpeakersSortAscending"));
	mAvatarList->setDoubleClickCallback(boost::bind(&LLParticipantList::onAvatarListDoubleClicked, this));
	mAvatarList->setCommitOnSelectionChange(true);
	mAvatarList->setCommitCallback(boost::bind(&LLParticipantList::handleSpeakerSelect, this));
	mAvatarList->setSortChangedCallback(boost::bind(&LLParticipantList::onSortChanged, this));

	if (LLUICtrl* ctrl = findChild<LLUICtrl>("mute_text_btn"))
		ctrl->setCommitCallback(boost::bind(&LLParticipantList::toggleMuteText, this));
	if (LLUICtrl* ctrl = findChild<LLUICtrl>("mute_btn"))
		ctrl->setCommitCallback(boost::bind(&LLParticipantList::toggleMuteVoice, this));
	if (LLUICtrl* ctrl = findChild<LLUICtrl>("speaker_volume"))
		ctrl->setCommitCallback(boost::bind(&LLParticipantList::onVolumeChange, this, _2));
	if (LLUICtrl* ctrl = findChild<LLUICtrl>("profile_btn"))
		ctrl->setCommitCallback(boost::bind(&LLParticipantList::onClickProfile, this));
	if (LLUICtrl* ctrl = findChild<LLUICtrl>("moderator_allow_voice"))
		ctrl->setCommitCallback(boost::bind(&LLParticipantList::moderateVoiceParticipant, this, _2));
	if (LLUICtrl* ctrl = findChild<LLUICtrl>("moderator_allow_text"))
		ctrl->setCommitCallback(boost::bind(&LLParticipantList::toggleAllowTextChat, this, _2));
	if (LLUICtrl* ctrl = findChild<LLUICtrl>("moderator_mode"))
		ctrl->setCommitCallback(boost::bind(&LLParticipantList::moderateVoiceAllParticipants, this, _2));

	// update speaker UI
	handleSpeakerSelect();

	return true;
}
Exemplo n.º 2
0
BOOL LLPanelActiveSpeakers::postBuild()
{
	mSpeakerList = LLUICtrlFactory::getScrollListByName(this, "speakers_list");
	mSpeakerList->setDoubleClickCallback(onDoubleClickSpeaker);
	mSpeakerList->setCommitOnSelectionChange(TRUE);
	mSpeakerList->setCommitCallback(onSelectSpeaker);
	mSpeakerList->setCallbackUserData(this);

	mMuteTextCtrl = (LLUICtrl*)getCtrlByNameAndType("mute_text_btn", WIDGET_TYPE_DONTCARE);
	childSetCommitCallback("mute_text_btn", onClickMuteTextCommit, this);

	mMuteVoiceCtrl = (LLUICtrl*)getCtrlByNameAndType("mute_btn", WIDGET_TYPE_DONTCARE);
	childSetCommitCallback("mute_btn", onClickMuteVoiceCommit, this);
	childSetAction("mute_btn", onClickMuteVoice, this);

	childSetCommitCallback("speaker_volume", onVolumeChange, this);

	mNameText = LLUICtrlFactory::getTextBoxByName(this, "resident_name");
	
	mProfileBtn = LLUICtrlFactory::getButtonByName(this, "profile_btn");
	childSetAction("profile_btn", onClickProfile, this);

	childSetCommitCallback("moderator_allow_voice", onModeratorMuteVoice, this);
	childSetCommitCallback("moderator_allow_text", onModeratorMuteText, this);
	childSetCommitCallback("moderation_mode", onChangeModerationMode, this);

	// update speaker UI
	handleSpeakerSelect();

	return TRUE;
}
BOOL LLPanelActiveSpeakers::postBuild()
{
	std::string sort_column = gSavedSettings.getString(std::string("FloaterActiveSpeakersSortColumn"));
	BOOL sort_ascending     = gSavedSettings.getBOOL(  std::string("FloaterActiveSpeakersSortAscending"));

	mSpeakerList = getChild<LLScrollListCtrl>("speakers_list");
	mSpeakerList->sortByColumn(sort_column, sort_ascending);
	mSpeakerList->setDoubleClickCallback(onDoubleClickSpeaker);
	mSpeakerList->setCommitOnSelectionChange(TRUE);
	mSpeakerList->setCommitCallback(onSelectSpeaker);
	mSpeakerList->setSortChangedCallback(onSortChanged);
	mSpeakerList->setCallbackUserData(this);

	mMuteTextCtrl = getChild<LLUICtrl>("mute_text_btn");
	childSetCommitCallback("mute_text_btn", onClickMuteTextCommit, this);

	mMuteVoiceCtrl = getChild<LLUICtrl>("mute_btn");
	childSetCommitCallback("mute_btn", onClickMuteVoiceCommit, this);
	childSetAction("mute_btn", onClickMuteVoice, this);

	childSetCommitCallback("speaker_volume", onVolumeChange, this);

	mNameText = getChild<LLTextBox>("resident_name");
	
	mProfileBtn = getChild<LLButton>("profile_btn");
	childSetAction("profile_btn", onClickProfile, this);

	childSetCommitCallback("moderator_allow_voice", onModeratorMuteVoice, this);
	childSetCommitCallback("moderator_allow_text", onModeratorMuteText, this);
	childSetCommitCallback("moderation_mode", onChangeModerationMode, this);

	// update speaker UI
	handleSpeakerSelect();

	return TRUE;
}