BOOL LLFloaterRegionDebugConsole::postBuild()
{
	LLLineEditor* input = getChild<LLLineEditor>("region_debug_console_input");
	input->setEnableLineHistory(true);
	input->setCommitCallback(boost::bind(&LLFloaterRegionDebugConsole::onInput, this, _1, _2));
	input->setFocus(true);
	input->setCommitOnFocusLost(false);

	mOutput = getChild<LLTextEditor>("region_debug_console_output");

	std::string url = gAgent.getRegion()->getCapability("SimConsoleAsync");
	if (url.empty())
	{
		// Fall back to see if the old API is supported.
		url = gAgent.getRegion()->getCapability("SimConsole");
		if (url.empty())
		{
			mOutput->appendText(
				CONSOLE_NOT_SUPPORTED + PROMPT,
				false, false);
			return TRUE;
		}
	}

	mOutput->appendText("> ", false, false);
	return TRUE;
}
Beispiel #2
0
BOOL LLPreviewGesture::postBuild()
{
	LLLineEditor* edit;
	LLComboBox* combo;
	LLButton* btn;
	LLScrollListCtrl* list;
	LLTextBox* text;
	LLCheckBoxCtrl* check;

	edit = LLViewerUICtrlFactory::getLineEditorByName(this, "trigger_editor");
	edit->setKeystrokeCallback(onKeystrokeCommit);
	edit->setCommitCallback(onCommitSetDirty);
	edit->setCommitOnFocusLost(TRUE);
	edit->setCallbackUserData(this);
	edit->setIgnoreTab(TRUE);
	mTriggerEditor = edit;

	text = LLViewerUICtrlFactory::getTextBoxByName(this, "replace_text");
	text->setEnabled(FALSE);
	mReplaceText = text;

	edit = LLViewerUICtrlFactory::getLineEditorByName(this, "replace_editor");
	edit->setEnabled(FALSE);
	edit->setKeystrokeCallback(onKeystrokeCommit);
	edit->setCommitCallback(onCommitSetDirty);
	edit->setCommitOnFocusLost(TRUE);
	edit->setCallbackUserData(this);
	edit->setIgnoreTab(TRUE);
	mReplaceEditor = edit;

	combo = LLViewerUICtrlFactory::getComboBoxByName(this, "modifier_combo");
	combo->setCommitCallback(onCommitSetDirty);
	combo->setCallbackUserData(this);
	mModifierCombo = combo;

	combo = LLViewerUICtrlFactory::getComboBoxByName(this, "key_combo");
	combo->setCommitCallback(onCommitSetDirty);
	combo->setCallbackUserData(this);
	mKeyCombo = combo;

	list = LLViewerUICtrlFactory::getScrollListByName(this, "library_list");
	list->setCommitCallback(onCommitLibrary);
	list->setDoubleClickCallback(onClickAdd);
	list->setCallbackUserData(this);
	mLibraryList = list;

	btn = LLViewerUICtrlFactory::getButtonByName(this, "add_btn");
	btn->setClickedCallback(onClickAdd);
	btn->setCallbackUserData(this);
	btn->setEnabled(FALSE);
	mAddBtn = btn;

	btn = LLViewerUICtrlFactory::getButtonByName(this, "up_btn");
	btn->setClickedCallback(onClickUp);
	btn->setCallbackUserData(this);
	btn->setEnabled(FALSE);
	mUpBtn = btn;

	btn = LLViewerUICtrlFactory::getButtonByName(this, "down_btn");
	btn->setClickedCallback(onClickDown);
	btn->setCallbackUserData(this);
	btn->setEnabled(FALSE);
	mDownBtn = btn;

	btn = LLViewerUICtrlFactory::getButtonByName(this, "delete_btn");
	btn->setClickedCallback(onClickDelete);
	btn->setCallbackUserData(this);
	btn->setEnabled(FALSE);
	mDeleteBtn = btn;

	list = LLViewerUICtrlFactory::getScrollListByName(this, "step_list");
	list->setCommitCallback(onCommitStep);
	list->setCallbackUserData(this);
	mStepList = list;

	// Options
	text = LLViewerUICtrlFactory::getTextBoxByName(this, "options_text");
	text->setBorderVisible(TRUE);
	mOptionsText = text;

	combo = LLViewerUICtrlFactory::getComboBoxByName(this, "animation_list");
	combo->setVisible(FALSE);
	combo->setCommitCallback(onCommitAnimation);
	combo->setCallbackUserData(this);
	mAnimationCombo = combo;

	LLRadioGroup* group;
	group = LLViewerUICtrlFactory::getRadioGroupByName(this, "animation_trigger_type");
	group->setVisible(FALSE);
	group->setCommitCallback(onCommitAnimationTrigger);
	group->setCallbackUserData(this);
	mAnimationRadio = group;

	combo = LLViewerUICtrlFactory::getComboBoxByName(this, "sound_list");
	combo->setVisible(FALSE);
	combo->setCommitCallback(onCommitSound);
	combo->setCallbackUserData(this);
	mSoundCombo = combo;

	edit = LLViewerUICtrlFactory::getLineEditorByName(this, "chat_editor");
	edit->setVisible(FALSE);
	edit->setCommitCallback(onCommitChat);
	//edit->setKeystrokeCallback(onKeystrokeCommit);
	edit->setCommitOnFocusLost(TRUE);
	edit->setCallbackUserData(this);
	edit->setIgnoreTab(TRUE);
	mChatEditor = edit;

	check = LLViewerUICtrlFactory::getCheckBoxByName(this, "wait_anim_check");
	check->setVisible(FALSE);
	check->setCommitCallback(onCommitWait);
	check->setCallbackUserData(this);
	mWaitAnimCheck = check;

	check = LLViewerUICtrlFactory::getCheckBoxByName(this, "wait_time_check");
	check->setVisible(FALSE);
	check->setCommitCallback(onCommitWait);
	check->setCallbackUserData(this);
	mWaitTimeCheck = check;

	edit = LLViewerUICtrlFactory::getLineEditorByName(this, "wait_time_editor");
	edit->setEnabled(FALSE);
	edit->setVisible(FALSE);
	edit->setPrevalidate(LLLineEditor::prevalidateFloat);
//	edit->setKeystrokeCallback(onKeystrokeCommit);
	edit->setCommitOnFocusLost(TRUE);
	edit->setCommitCallback(onCommitWaitTime);
	edit->setCallbackUserData(this);
	edit->setIgnoreTab(TRUE);
	mWaitTimeEditor = edit;

	// Buttons at the bottom
	check = LLViewerUICtrlFactory::getCheckBoxByName(this, "active_check");
	check->setCommitCallback(onCommitActive);
	check->setCallbackUserData(this);
	mActiveCheck = check;

	btn = LLViewerUICtrlFactory::getButtonByName(this, "save_btn");
	btn->setClickedCallback(onClickSave);
	btn->setCallbackUserData(this);
	mSaveBtn = btn;

	btn = LLViewerUICtrlFactory::getButtonByName(this, "preview_btn");
	btn->setClickedCallback(onClickPreview);
	btn->setCallbackUserData(this);
	mPreviewBtn = btn;


	// Populate the comboboxes
	addModifiers();
	addKeys();
	addAnimations();
	addSounds();


	const LLInventoryItem* item = getItem();

	if (item) 
	{
		childSetCommitCallback("desc", LLPreview::onText, this);
		childSetText("desc", item->getDescription());
		childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe);
	}

	return TRUE;
}
BOOL LLPanelGroupLandMoney::postBuild()
{
	/* This power was removed to make group roles simpler
	bool has_parcel_view     = gAgent.hasPowerInGroup(mGroupID,
													  GP_LAND_VIEW_OWNED);
	bool has_accounting_view = gAgent.hasPowerInGroup(mGroupID,
													  GP_ACCOUNTING_VIEW);
	*/
	
	bool can_view = gAgent.isInGroup(mGroupID);

	mImplementationp->mGroupOverLimitIconp = 
		getChild<LLIconCtrl>("group_over_limit_icon");
	mImplementationp->mGroupOverLimitTextp = 
		getChild<LLTextBox>("group_over_limit_text");

	mImplementationp->mYourContributionEditorp 
		= getChild<LLLineEditor>("your_contribution_line_editor");
	if ( mImplementationp->mYourContributionEditorp )
	{
		LLLineEditor* editor = mImplementationp->mYourContributionEditorp;

	    editor->setCommitCallback(mImplementationp->contributionCommitCallback, this);
		editor->setKeystrokeCallback(mImplementationp->contributionKeystrokeCallback, this);
	}

	mImplementationp->mMapButtonp = getChild<LLButton>("map_button");

	mImplementationp->mGroupParcelsp = 
		getChild<LLScrollListCtrl>("group_parcel_list");

	if ( mImplementationp->mGroupParcelsp )
	{
		mImplementationp->mGroupParcelsp->setCommitCallback(boost::bind(&LLPanelGroupLandMoney::onLandSelectionChanged, this));
		mImplementationp->mGroupParcelsp->setCommitOnSelectionChange(true);
	}

	mImplementationp->mCantViewParcelsText = getString("cant_view_group_land_text");
	mImplementationp->mCantViewAccountsText = getString("cant_view_group_accounting_text");
	mImplementationp->mEmptyParcelsText = getString("epmty_view_group_land_text");
	
	if ( mImplementationp->mMapButtonp )
	{
		mImplementationp->mMapButtonp->setClickedCallback(LLPanelGroupLandMoney::impl::mapCallback, mImplementationp);
	}

	if ( mImplementationp->mGroupOverLimitTextp )
	{
		mImplementationp->mGroupOverLimitTextp->setVisible(FALSE);
	}

	if ( mImplementationp->mGroupOverLimitIconp )
	{
		mImplementationp->mGroupOverLimitIconp->setVisible(FALSE);
	}

	if ( !can_view )
	{
		if ( mImplementationp->mGroupParcelsp )
		{
			mImplementationp->mGroupParcelsp->setCommentText(
							mImplementationp->mCantViewParcelsText);
			mImplementationp->mGroupParcelsp->setEnabled(FALSE);
		}
	}



	LLButton* earlierp, *laterp;
	LLTextEditor* textp;
	LLPanel* panelp;

	LLTabContainer* tabcp = getChild<LLTabContainer>("group_money_tab_container");

	if ( !can_view )
	{
		if ( tabcp )
		{
			S32 i;
			S32 tab_count = tabcp->getTabCount();

			for (i = tab_count - 1; i >=0; --i)
			{
				tabcp->enableTabButton(i, false);
			}
		}
	}

	std::string loading_text = getString("loading_txt");
	
	//pull out the widgets for the L$ details tab
	earlierp = getChild<LLButton>("earlier_details_button", true);
	laterp = getChild<LLButton>("later_details_button", true);
	textp = getChild<LLTextEditor>("group_money_details_text", true);
	panelp = getChild<LLPanel>("group_money_details_tab", true);

	if ( !can_view )
	{
		textp->setText(mImplementationp->mCantViewAccountsText);
	}
	else
	{
		mImplementationp->mMoneyDetailsTabEHp = 
			new LLGroupMoneyDetailsTabEventHandler(earlierp,
												   laterp,
												   textp,
												   tabcp,
												   panelp,
												   loading_text);
	}

	textp = getChild<LLTextEditor>("group_money_planning_text", true);
	panelp = getChild<LLPanel>("group_money_planning_tab", true);

	if ( !can_view )
	{
		textp->setText(mImplementationp->mCantViewAccountsText);
	}
	else
	{
		//Temporally disabled for DEV-11287.
		mImplementationp->mMoneyPlanningTabEHp = 
			new LLGroupMoneyPlanningTabEventHandler(textp,
													tabcp,
													panelp,
													loading_text);
	}

	//pull out the widgets for the L$ sales tab
	earlierp = getChild<LLButton>("earlier_sales_button", true);
	laterp = getChild<LLButton>("later_sales_button", true);
	textp = getChild<LLTextEditor>("group_money_sales_text", true);
	panelp = getChild<LLPanel>("group_money_sales_tab", true);

	if ( !can_view )
	{
		textp->setText(mImplementationp->mCantViewAccountsText);
	}
	else
	{
		mImplementationp->mMoneySalesTabEHp = 
			new LLGroupMoneySalesTabEventHandler(earlierp,
												 laterp,
												 textp,
												 tabcp,
												 panelp,
												 loading_text);
	}

	return LLPanelGroupTab::postBuild();
}
void LLPanelGroupLandMoney::setGroupID(const LLUUID& id)
{
	LLPanelGroupLandMoney::sGroupIDs.removeData(mGroupID);
	LLPanelGroupTab::setGroupID(id);
	LLPanelGroupLandMoney::sGroupIDs.addData(mGroupID, this);


	bool can_view = gAgent.isInGroup(mGroupID);

	mImplementationp->mGroupOverLimitIconp = 
		getChild<LLIconCtrl>("group_over_limit_icon");
	mImplementationp->mGroupOverLimitTextp = 
		getChild<LLTextBox>("group_over_limit_text");

	mImplementationp->mYourContributionEditorp 
		= getChild<LLLineEditor>("your_contribution_line_editor");
	if ( mImplementationp->mYourContributionEditorp )
	{
		LLLineEditor* editor = mImplementationp->mYourContributionEditorp;

	    editor->setCommitCallback(mImplementationp->contributionCommitCallback, this);
		editor->setKeystrokeCallback(mImplementationp->contributionKeystrokeCallback, this);
	}

	mImplementationp->mMapButtonp = getChild<LLButton>("map_button");

	mImplementationp->mGroupParcelsp = 
		getChild<LLScrollListCtrl>("group_parcel_list");

	if ( mImplementationp->mGroupParcelsp )
	{
		mImplementationp->mGroupParcelsp->setCommitCallback(boost::bind(&LLPanelGroupLandMoney::onLandSelectionChanged, this));
		mImplementationp->mGroupParcelsp->setCommitOnSelectionChange(true);
	}

	mImplementationp->mCantViewParcelsText = getString("cant_view_group_land_text");
	mImplementationp->mCantViewAccountsText = getString("cant_view_group_accounting_text");
	
	if ( mImplementationp->mMapButtonp )
	{
		mImplementationp->mMapButtonp->setClickedCallback(LLPanelGroupLandMoney::impl::mapCallback, mImplementationp);
	}

	if ( mImplementationp->mGroupOverLimitTextp )
	{
		mImplementationp->mGroupOverLimitTextp->setVisible(FALSE);
	}

	if ( mImplementationp->mGroupOverLimitIconp )
	{
		mImplementationp->mGroupOverLimitIconp->setVisible(FALSE);
	}

	if ( mImplementationp->mGroupParcelsp )
	{
		mImplementationp->mGroupParcelsp->setEnabled(can_view);
	}

	if ( !can_view && mImplementationp->mGroupParcelsp )
	{
		mImplementationp->mGroupParcelsp->setEnabled(FALSE);
	}


	LLButton* earlierp, *laterp;
	LLTextEditor* textp;
	LLPanel* panelp;

	LLTabContainer* tabcp = getChild<LLTabContainer>("group_money_tab_container");

	if ( tabcp )
	{
		S32 i;
		S32 tab_count = tabcp->getTabCount();

		for (i = tab_count - 1; i >=0; --i)
		{
			tabcp->enableTabButton(i, can_view );
		}
	}

	std::string loading_text = getString("loading_txt");
	
	//pull out the widgets for the L$ details tab
	earlierp = getChild<LLButton>("earlier_details_button", true);
	laterp = getChild<LLButton>("later_details_button", true);
	textp = getChild<LLTextEditor>("group_money_details_text", true);
	panelp = getChild<LLPanel>("group_money_details_tab", true);

	if ( !can_view )
	{
		textp->setText(mImplementationp->mCantViewAccountsText);
	}
	else
	{
		if(mImplementationp->mMoneyDetailsTabEHp == 0)
			mImplementationp->mMoneyDetailsTabEHp = new LLGroupMoneyDetailsTabEventHandler(earlierp,laterp,textp,tabcp,panelp,loading_text);
		mImplementationp->mMoneyDetailsTabEHp->setGroupID(mGroupID);
	}

	textp = getChild<LLTextEditor>("group_money_planning_text", true);
	

	if ( !can_view )
	{
		textp->setText(mImplementationp->mCantViewAccountsText);
	}
	else
	{
		panelp = getChild<LLPanel>("group_money_planning_tab", true);
		if(mImplementationp->mMoneyPlanningTabEHp == 0)
			mImplementationp->mMoneyPlanningTabEHp = new LLGroupMoneyPlanningTabEventHandler(textp,tabcp,panelp,loading_text);
		mImplementationp->mMoneyPlanningTabEHp->setGroupID(mGroupID);
	}

	//pull out the widgets for the L$ sales tab
	textp = getChild<LLTextEditor>("group_money_sales_text", true);


	if ( !can_view )
	{
		textp->setText(mImplementationp->mCantViewAccountsText);
	}
	else
	{
		earlierp = getChild<LLButton>("earlier_sales_button", true);
		laterp = getChild<LLButton>("later_sales_button", true);
		panelp = getChild<LLPanel>("group_money_sales_tab", true);
		if(mImplementationp->mMoneySalesTabEHp == NULL) 
			mImplementationp->mMoneySalesTabEHp = new LLGroupMoneySalesTabEventHandler(earlierp,laterp,textp,tabcp,panelp,loading_text);
		mImplementationp->mMoneySalesTabEHp->setGroupID(mGroupID);
	}

	mImplementationp->mBeenActivated = false;

	activate();
}