Example #1
0
void LLPrefsIMImpl::setPersonalInfo(
	const std::string& visibility,
	bool im_via_email,
	const std::string& email)
{
	mGotPersonalInfo = true;
	mOriginalIMViaEmail = im_via_email;
	mDirectoryVisibility = visibility;
	if(visibility == VISIBILITY_DEFAULT)
	{
		mOriginalHideOnlineStatus = false;
		childEnable("online_visibility"); 	 
	}
	else if(visibility == VISIBILITY_HIDDEN)
	{
		mOriginalHideOnlineStatus = true;
		childEnable("online_visibility"); 	 
	}
	else
	{
		mOriginalHideOnlineStatus = true;
	}
	childSetValue("online_visibility", mOriginalHideOnlineStatus); 	 
	childSetLabelArg("online_visibility", "[DIR_VIS]", mDirectoryVisibility);
	childEnable("send_im_to_email");
	childSetValue("send_im_to_email", im_via_email);
	childEnable("log_instant_messages");
	childEnable("log_chat");
	childEnable("busy_response");
//MK
	if (RRenabled && gAgent.mRRInterface.contains ("sendim"))
	{
		childDisable("busy_response");
	}
//mk
	childEnable("log_instant_messages_timestamp");
	childEnable("log_chat_timestamp");
	childEnable("log_chat_IM");
	childEnable("log_date_timestamp");
	
	//RN: get wide string so replace char can work (requires fixed-width encoding)
	LLWString busy_response = utf8str_to_wstring( gSavedPerAccountSettings.getString("BusyModeResponse") );
	LLWString::replaceChar(busy_response, '^', '\n');
	LLWString::replaceChar(busy_response, '%', ' ');
	childSetText("busy_response", wstring_to_utf8str(busy_response));

	enableHistory();

	// Truncate the e-mail address if it's too long (to prevent going off
	// the edge of the dialog).
	std::string display_email(email);
	if(display_email.size() > 30)
	{
		display_email.resize(30);
		display_email += "...";
	}

	childSetLabelArg("send_im_to_email", "[EMAIL]", display_email);
}
BOOL LLPanelAudioPrefs::postBuild()
{
	refreshValues(); // initialize member data from saved settings
	childSetLabelArg("currency_change_threshold", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());

	return TRUE;
}
BOOL LLPanelDirLand::postBuild()
{
	LLPanelDirBrowser::postBuild();

	childSetValue("type", gSavedSettings.getString("FindLandType"));

	bool adult_enabled = gAgent.canAccessAdult();
	bool mature_enabled = gAgent.canAccessMature();
	childSetVisible("incpg", true);
	if (!mature_enabled)
	{
		childSetValue("incmature", FALSE);
		childDisable("incmature");
	}
	if (!adult_enabled)
	{
		childSetValue("incadult", FALSE);
		childDisable("incadult");
	}

	childSetCommitCallback("pricecheck", onCommitPrice, this);
	childSetCommitCallback("areacheck", onCommitArea, this);

	childSetValue("priceedit", gStatusBar->getBalance());
	childSetEnabled("priceedit", gSavedSettings.getBOOL("FindLandPrice"));
	childSetPrevalidate("priceedit", LLLineEditor::prevalidateNonNegativeS32);
	
	childSetEnabled("areaedit", gSavedSettings.getBOOL("FindLandArea"));
	childSetPrevalidate("areaedit", LLLineEditor::prevalidateNonNegativeS32);

	childSetAction("Search", onClickSearchCore, this);
	setDefaultBtn("Search");

	childSetTextArg("land", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());
	childSetTextArg("pricecheck_symbol", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());
	childSetLabelArg("pricecheck", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());

	mCurrentSortColumn = "per_meter";

	LLScrollListCtrl* results = getChild<LLScrollListCtrl>("results");
	if (results)
	{
		results->setSortChangedCallback(boost::bind(&LLPanelDirLand::onClickSort,this));
		results->sortByColumn(mCurrentSortColumn,mCurrentSortAscending);
		
		LLStringUtil::format_map_t args;
		args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol();
		int n = results->getNumColumns();
		for (int i=0; i<n; i++) {
			LLScrollListColumn *col = results->getColumn(i);
			std::string label = col->mLabel;
			LLStringUtil::format(label, args);
			results->setColumnLabel(col->mName, label);
		}
	}

	childSetVisible("filter_gaming", (gAgent.getRegion()->getGamingFlags() & REGION_GAMING_PRESENT) && !(gAgent.getRegion()->getGamingFlags() & REGION_GAMING_HIDE_FIND_LAND));

	return TRUE;
}
BOOL LLPanelAudioPrefs::postBuild()
{
	refreshValues(); // initialize member data from saved settings
	childSetLabelArg("L$ Change Threshold", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());
	childSetValue("mute_wind_check", !gSavedSettings.getBOOL("MuteWind"));

	return TRUE;
}
//-----------------------------------------------------------------------------
// postBuild()
//-----------------------------------------------------------------------------
BOOL LLFloaterNameDesc::postBuild()
{
	LLRect r;

	std::string asset_name = mFilename;
	LLStringUtil::replaceNonstandardASCII( asset_name, '?' );
	LLStringUtil::replaceChar(asset_name, '|', '?');
	LLStringUtil::stripNonprintable(asset_name);
	LLStringUtil::trim(asset_name);

	asset_name = gDirUtilp->getBaseFileName(asset_name, true); // no extsntion

	setTitle(mFilename);

	centerWithin(gViewerWindow->getRootView()->getRect());

	S32 line_width = getRect().getWidth() - 2 * PREVIEW_HPAD;
	S32 y = getRect().getHeight() - PREVIEW_LINE_HEIGHT;

	r.setLeftTopAndSize( PREVIEW_HPAD, y, line_width, PREVIEW_LINE_HEIGHT );
	y -= PREVIEW_LINE_HEIGHT;

	r.setLeftTopAndSize( PREVIEW_HPAD, y, line_width, PREVIEW_LINE_HEIGHT );    

	getChild<LLUICtrl>("name_form")->setCommitCallback(boost::bind(&LLFloaterNameDesc::doCommit, this));
	childSetValue("name_form", LLSD(asset_name));

	LLLineEditor *NameEditor = getChild<LLLineEditor>("name_form");
	if (NameEditor)
	{
		NameEditor->setMaxTextLength(DB_INV_ITEM_NAME_STR_LEN);
		NameEditor->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe);
	}

	y -= llfloor(PREVIEW_LINE_HEIGHT * 1.2f);
	y -= PREVIEW_LINE_HEIGHT;

	r.setLeftTopAndSize( PREVIEW_HPAD, y, line_width, PREVIEW_LINE_HEIGHT );  
	getChild<LLUICtrl>("description_form")->setCommitCallback(boost::bind(&LLFloaterNameDesc::doCommit, this));
	LLLineEditor *DescEditor = getChild<LLLineEditor>("description_form");
	if (DescEditor)
	{
		DescEditor->setMaxTextLength(DB_INV_ITEM_DESC_STR_LEN);
		DescEditor->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe);
	}

	y -= llfloor(PREVIEW_LINE_HEIGHT * 1.2f);

	// Cancel button
	getChild<LLUICtrl>("cancel_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnCancel, this));

	childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d", LLGlobalEconomy::Singleton::getInstance()->getPriceUpload() ));
	
	setDefaultBtn("ok_btn");
	
	return TRUE;
}
Example #6
0
BOOL LLPrefsIMImpl::postBuild()
{
	requires("online_visibility");
	requires("send_im_to_email");
	if (!checkRequirements())
	{
		return FALSE;
	}

	childSetLabelArg("send_im_to_email", "[EMAIL]", getString("log_in_to_change"));

	// Don't enable this until we get personal data
	childDisable("include_im_in_chat_console");
	childDisable("include_im_in_chat_history");
	childDisable("show_timestamps_check");
	childDisable("friends_online_notify_checkbox");
	
	childDisable("online_visibility");
	childDisable("send_im_to_email");
	childDisable("log_instant_messages");
	childDisable("log_chat");
	childDisable("log_show_history");
	childDisable("log_path_button");
	childDisable("busy_response");
	childDisable("log_instant_messages_timestamp");
	childDisable("log_chat_timestamp");
	childDisable("log_chat_IM");
	childDisable("log_date_timestamp");
	childDisable("logfile_name_datestamp");

	childSetText("busy_response", getString("log_in_to_change"));

	childSetValue("include_im_in_chat_console", gSavedSettings.getBOOL("IMInChatConsole"));
	childSetValue("include_im_in_chat_history", gSavedSettings.getBOOL("IMInChatHistory"));
	childSetValue("show_timestamps_check", gSavedSettings.getBOOL("IMShowTimestamps"));
	childSetValue("friends_online_notify_checkbox", gSavedSettings.getBOOL("ChatOnlineNotification"));

	childSetText("chat_logs_location", gSavedPerAccountSettings.getString("InstantMessageLogPath"));
	childSetValue("log_instant_messages", gSavedPerAccountSettings.getBOOL("LogInstantMessages")); 
	childSetValue("log_chat", gSavedPerAccountSettings.getBOOL("LogChat")); 
	childSetValue("log_show_history", gSavedPerAccountSettings.getBOOL("LogShowHistory"));
	childSetValue("log_instant_messages_timestamp", gSavedPerAccountSettings.getBOOL("IMLogTimestamp"));
	childSetValue("log_chat_timestamp", gSavedPerAccountSettings.getBOOL("LogChatTimestamp"));
	childSetValue("log_chat_IM", gSavedPerAccountSettings.getBOOL("LogChatIM"));
	childSetValue("log_date_timestamp", gSavedPerAccountSettings.getBOOL("LogTimestampDate"));
	childSetValue("logfile_name_datestamp", gSavedPerAccountSettings.getBOOL("LogFileNamewithDate"));

	childSetCommitCallback("log_chat",onCommitLogging,this);
	childSetCommitCallback("log_instant_messages",onCommitLogging,this);
	
	return TRUE;
}
//-----------------------------------------------------------------------------
// postBuild()
//-----------------------------------------------------------------------------
BOOL LLFloaterImagePreview::postBuild()
{
	if (!LLFloaterNameDesc::postBuild())
	{
		return FALSE;
	}

	childSetLabelArg("ok_btn", "[UPLOADFEE]", gHippoGridManager->getConnectedGrid()->getUploadFee());
	childSetAction("ok_btn", onBtnOK, this);

	LLCtrlSelectionInterface* iface = childGetSelectionInterface("clothing_type_combo");
	if (iface)
	{
		iface->selectFirstItem();
	}
	childSetCommitCallback("clothing_type_combo", onPreviewTypeCommit, this);

	mPreviewRect.set(PREVIEW_HPAD, 
		PREVIEW_TEXTURE_HEIGHT,
		getRect().getWidth() - PREVIEW_HPAD, 
		PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
	mPreviewImageRect.set(0.f, 1.f, 1.f, 0.f);

	childHide("bad_image_text");

	if (mRawImagep.notNull() && gAgent.getRegion() != NULL)
	{
		mAvatarPreview = new LLImagePreviewAvatar(256, 256);
		mAvatarPreview->setPreviewTarget("mPelvis", "mUpperBodyMesh0", mRawImagep, 2.f, FALSE);

		mSculptedPreview = new LLImagePreviewSculpted(256, 256);
		mSculptedPreview->setPreviewTarget(mRawImagep, 2.0f);

		if (mRawImagep->getWidth() * mRawImagep->getHeight () <= LL_IMAGE_REZ_LOSSLESS_CUTOFF * LL_IMAGE_REZ_LOSSLESS_CUTOFF)
			childEnable("lossless_check");

		// <edit>
		gSavedSettings.setBOOL("TemporaryUpload",FALSE);
		childSetValue("temp_check",FALSE);
		// </edit>
	}
	else
	{
		mAvatarPreview = NULL;
		mSculptedPreview = NULL;
		childShow("bad_image_text");
		childDisable("clothing_type_combo");
		childDisable("ok_btn");
	}

	return TRUE;
}
void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email)
{
	mGotPersonalInfo = true;
	mOriginalIMViaEmail = im_via_email;
	mDirectoryVisibility = visibility;
	
	if(visibility == VISIBILITY_DEFAULT)
	{
		mOriginalHideOnlineStatus = false;
		childEnable("online_visibility"); 	 
	}
	else if(visibility == VISIBILITY_HIDDEN)
	{
		mOriginalHideOnlineStatus = true;
		childEnable("online_visibility"); 	 
	}
	else
	{
		mOriginalHideOnlineStatus = true;
	}
	
	childEnable("include_im_in_chat_history");
	childEnable("show_timestamps_check_im");
	childEnable("friends_online_notify_checkbox");
	
	childSetValue("online_visibility", mOriginalHideOnlineStatus); 	 
	childSetLabelArg("online_visibility", "[DIR_VIS]", mDirectoryVisibility);
	childEnable("send_im_to_email");
	childSetValue("send_im_to_email", im_via_email);
	childEnable("plain_text_chat_history");
	childSetValue("plain_text_chat_history", gSavedSettings.getBOOL("PlainTextChatHistory"));
	childEnable("log_instant_messages");
//	childEnable("log_chat");
//	childEnable("busy_response");
//	childEnable("log_instant_messages_timestamp");
//	childEnable("log_chat_timestamp");
	childEnable("log_chat_IM");
	childEnable("log_date_timestamp");
	
//	childSetText("busy_response", gSavedSettings.getString("BusyModeResponse2"));
	
	childEnable("log_nearby_chat");
	childEnable("log_instant_messages");
	childEnable("show_timestamps_check_im");
	childDisable("log_path_string");// LineEditor becomes readonly in this case.
	childEnable("log_path_button");
	
	std::string display_email(email);
	childSetText("email_address",display_email);

}
Example #9
0
//-----------------------------------------------------------------------------
// postBuild()
//-----------------------------------------------------------------------------
BOOL LLPanelMsgs::postBuild()
{
	childSetAction("enable_popup", onClickEnablePopup, this);
	childSetAction("reset_dialogs_btn", onClickResetDialogs, this);
	childSetAction("skip_dialogs_btn", onClickSkipDialogs, this);
	buildLists();

	childSetValue("accept_new_inventory", gSavedSettings.getBOOL("AutoAcceptNewInventory"));
	childSetValue("show_new_inventory", gSavedSettings.getBOOL("ShowNewInventory"));
	childSetValue("show_in_inventory", gSavedSettings.getBOOL("ShowInInventory"));

	childSetValue("notify_money_change_checkbox", gSavedSettings.getBOOL("NotifyMoneyChange"));
	childSetLabelArg("notify_money_change_checkbox", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());

	return TRUE;
}
BOOL DOFloaterHex::postBuild(void)
{
	DOHexEditor* editor = getChild<DOHexEditor>("hex");
	mEditor = editor;
#ifndef COLUMN_SPAN
	// Set number of columns
	U8 columns = U8(gSavedSettings.getU32("HexEditorColumns"));
	editor->setColumns(columns);
	// Reflect clamped U8ness in settings
	gSavedSettings.setU32("HexEditorColumns", U32(columns));
#endif
	handleSizing();

	childSetEnabled("upload_btn", false);
	childSetLabelArg("upload_btn", "[UPLOAD]", std::string("Upload"));
	childSetAction("upload_btn", onClickUpload, this);
	childSetEnabled("save_btn", false);
	childSetAction("save_btn", onClickSave, this);

	if(!mVFS && mItem)
	{
		std::string title = "Hex editor: " + mItem->getName();
		const char* asset_type_name = LLAssetType::lookup(mItem->getType());
		if(asset_type_name)
		{
			title.append(" (" + std::string(asset_type_name) + ")");
		}
		setTitle(title);
	}
	if(!mVFS)
	{
		// Load the asset
		editor->setVisible(FALSE);
		childSetText("status_text", std::string("Loading..."));
		LLInventoryBackup::download(mItem, this, imageCallback, assetCallback);
	}
	else if (mVFS) //the asset already exists in the VFS, we don't need to fetch it
		           //and we don't want to associate it with an item
	{
		setTitle(mAssetId.asString());
		readVFile();
	} else {
		this->close(false);
	}

	return TRUE;
}
Example #11
0
BOOL LLPrefsIMImpl::postBuild()
{
	requires("online_visibility");
	requires("send_im_to_email");
	if (!checkRequirements())
	{
		return FALSE;
	}

	mGotPersonalInfo = false;
	mOriginalIMViaEmail = false;
	mOriginalHideOnlineStatus = true;
	childSetLabelArg("send_im_to_email", "[EMAIL]", childGetText("log_in_to_change"));

	// Don't enable this until we get personal data
	childDisable("online_visibility");
	childDisable("send_im_to_email");
	childDisable("log_instant_messages");
	childDisable("log_chat");
	childDisable("log_show_history");
	childDisable("log_path_button");
	childDisable("busy_response");
	childDisable("log_instant_messages_timestamp");
	childDisable("log_chat_timestamp");
	childDisable("log_chat_IM");
	childDisable("log_date_timestamp");

	childSetText("busy_response", childGetText("log_in_to_change"));
	
	refresh(); 

	childSetText("log_path_string", mLogPath);
	childSetValue("log_instant_messages", mLogInstantMessages); 
	childSetValue("log_chat", mLogChat); 
	childSetValue("log_show_history", mLogShowHistory);
	childSetValue("log_instant_messages_timestamp", mIMLogTimestamp);
	childSetValue("log_chat_timestamp", mLogChatTimestamp);
	childSetValue("log_chat_IM", mLogIMChat);
	childSetValue("log_date_timestamp",mLogTimestampDate);
	childSetAction("log_path_button", onClickLogPath, this);
	childSetCommitCallback("log_chat",onCommitLogging,this);
	childSetCommitCallback("log_instant_messages",onCommitLogging,this);
	
	return TRUE;
}
//-----------------------------------------------------------------------------
// postBuild()
//-----------------------------------------------------------------------------
BOOL LLFloaterSculptPreview::postBuild()
{
	childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d",sUploadAmount));

	LLCtrlSelectionInterface* iface = childGetSelectionInterface("clothing_type_combo");
	if (iface)
	{
		iface->selectFirstItem();
	}
	childSetCommitCallback("clothing_type_combo", onPreviewTypeCommit, this);

	mPreviewRect.set(PREVIEW_HPAD, 
		PREVIEW_TEXTURE_HEIGHT,
		getRect().getWidth() - PREVIEW_HPAD, 
		PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
	mPreviewImageRect.set(0.f, 1.f, 1.f, 0.f);

	childHide("bad_image_text");

	if (mRawImagep.notNull() && gAgent.getRegion() != NULL)
	{
		mAvatarPreview = new LLPreviewAvatar(256, 256);
		mAvatarPreview->setPreviewTarget("mPelvis", "mUpperBodyMesh0", mRawImagep, 2.f, FALSE);

		mSculptedPreview = new LLPreviewSculpted(256, 256);
		mSculptedPreview->setPreviewTarget(mRawImagep, 2.0f);

		if (mRawImagep->getWidth() * mRawImagep->getHeight () <= LL_IMAGE_REZ_LOSSLESS_CUTOFF * LL_IMAGE_REZ_LOSSLESS_CUTOFF)
			childEnable("lossless_check");

		childSetValue("temp_check",FALSE);
	}
	else
	{
		mAvatarPreview = NULL;
		mSculptedPreview = NULL;
		childShow("bad_image_text");
		childDisable("clothing_type_combo");
		childDisable("ok_btn");
	}

	return TRUE;
}
BOOL HGFloaterTextEditor::postBuild(void)
{
	LLTextEditor* editor = getChild<LLTextEditor>("text_editor");
	mEditor = editor;

	childSetEnabled("upload_btn", false);
	childSetLabelArg("upload_btn", "[UPLOAD]", std::string("Upload"));
	childSetAction("upload_btn", onClickUpload, this);
	childSetEnabled("save_btn", false);
	childSetAction("save_btn", onClickSave, this);

	if(mItem)
	{
		std::string title = "Text editor: " + mItem->getName();
		const char* asset_type_name = LLAssetType::lookup(mItem->getType());
		if(asset_type_name)
		{
			title.append(" (" + std::string(asset_type_name) + ")");
		}
		setTitle(title);
	}
#if OPENSIM_RULES!=1
	if(mItem->getCreatorUUID() == gAgentID)
	{
#endif /* OPENSIM_RULES!=1 */
		// Load the asset
		editor->setVisible(FALSE);
		childSetText("status_text", std::string("Loading..."));
		LLInventoryBackup::download(mItem, this, imageCallback, assetCallback);
#if OPENSIM_RULES!=1
	} else {
		this->close(false);
	}
#endif /* OPENSIM_RULES!=1 */

	return TRUE;
}
//-----------------------------------------------------------------------------
// postBuild()
//-----------------------------------------------------------------------------
BOOL LLFloaterAnimPreview::postBuild()
{
	LLRect r;
	LLKeyframeMotion* motionp = NULL;
	LLBVHLoader* loaderp = NULL;

	if (!LLFloaterNameDesc::postBuild())
	{
		return FALSE;
	}

	childSetCommitCallback("name_form", onCommitName, this);

	childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d",sUploadAmount));
	childSetAction("ok_btn", onBtnOK, this);
	setDefaultBtn();

	mPreviewRect.set(PREVIEW_HPAD, 
		PREVIEW_TEXTURE_HEIGHT,
		getRect().getWidth() - PREVIEW_HPAD, 
		PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
	mPreviewImageRect.set(0.f, 1.f, 1.f, 0.f);

	S32 y = mPreviewRect.mTop + BTN_HEIGHT;
	S32 btn_left = PREVIEW_HPAD;

	r.set( btn_left, y, btn_left + 32, y - BTN_HEIGHT );
	mPlayButton = getChild<LLButton>( "play_btn");
	if (!mPlayButton)
	{
		mPlayButton = new LLButton(std::string("play_btn"), LLRect(0,0,0,0));
	}
	mPlayButton->setClickedCallback(onBtnPlay);
	mPlayButton->setCallbackUserData(this);

	mPlayButton->setImages(std::string("button_anim_play.tga"),
						   std::string("button_anim_play_selected.tga"));
	mPlayButton->setDisabledImages(LLStringUtil::null,LLStringUtil::null);

	mPlayButton->setScaleImage(TRUE);

	mStopButton = getChild<LLButton>( "stop_btn");
	if (!mStopButton)
	{
		mStopButton = new LLButton(std::string("stop_btn"), LLRect(0,0,0,0));
	}
	mStopButton->setClickedCallback(onBtnStop);
	mStopButton->setCallbackUserData(this);

	mStopButton->setImages(std::string("button_anim_stop.tga"),
						   std::string("button_anim_stop_selected.tga"));
	mStopButton->setDisabledImages(LLStringUtil::null,LLStringUtil::null);

	mStopButton->setScaleImage(TRUE);

	r.set(r.mRight + PREVIEW_HPAD, y, getRect().getWidth() - PREVIEW_HPAD, y - BTN_HEIGHT);
	//childSetCommitCallback("playback_slider", onSliderMove, this);

	childHide("bad_animation_text");

	//childSetCommitCallback("preview_base_anim", onCommitBaseAnim, this);
	//childSetValue("preview_base_anim", "Standing");

	//childSetCommitCallback("priority", onCommitPriority, this);
	//childSetCommitCallback("loop_check", onCommitLoop, this);
	//childSetCommitCallback("loop_in_point", onCommitLoopIn, this);
	//childSetValidate("loop_in_point", validateLoopIn);
	//childSetCommitCallback("loop_out_point", onCommitLoopOut, this);
	//childSetValidate("loop_out_point", validateLoopOut);

	//childSetCommitCallback("hand_pose_combo", onCommitHandPose, this);
	
	//childSetCommitCallback("emote_combo", onCommitEmote, this);
	//childSetValue("emote_combo", "[None]");

	//childSetCommitCallback("ease_in_time", onCommitEaseIn, this);
	//childSetValidate("ease_in_time", validateEaseIn);
	//childSetCommitCallback("ease_out_time", onCommitEaseOut, this);
	//childSetValidate("ease_out_time", validateEaseOut);

	std::string exten = gDirUtilp->getExtension(mFilename);
	if (exten == "bvh")
	{
		// loading a bvh file

		// now load bvh file
		S32 file_size;
		
		LLAPRFile infile ;
		infile.open(mFilenameAndPath, LL_APR_RB, LLAPRFile::global, &file_size);
		
		if (!infile.getFileHandle())
		{
			llwarns << "Can't open BVH file:" << mFilename << llendl;	
		}
		else
		{
			char*	file_buffer;

			file_buffer = new char[file_size + 1];

			if (file_size == infile.read(file_buffer, file_size))
			{
				file_buffer[file_size] = '\0';
				llinfos << "Loading BVH file " << mFilename << llendl;
				loaderp = new LLBVHLoader(file_buffer);
			}

			infile.close() ;
			delete[] file_buffer;
		}
	}

	if (loaderp && loaderp->isInitialized() && loaderp->getDuration() <= MAX_ANIM_DURATION)
	{
		// generate unique id for this motion
		mTransactionID.generate();
		mMotionID = mTransactionID.makeAssetID(gAgent.getSecureSessionID());

		mAnimPreview = new LLPreviewAnimation(256, 256);

		// motion will be returned, but it will be in a load-pending state, as this is a new motion
		// this motion will not request an asset transfer until next update, so we have a chance to 
		// load the keyframe data locally
		motionp = (LLKeyframeMotion*)mAnimPreview->getDummyAvatar()->createMotion(mMotionID);

		// create data buffer for keyframe initialization
		S32 buffer_size = loaderp->getOutputSize();
		U8* buffer = new U8[buffer_size];

		LLDataPackerBinaryBuffer dp(buffer, buffer_size);

		// pass animation data through memory buffer
		loaderp->serialize(dp);
		dp.reset();
		BOOL success = motionp && motionp->deserialize(dp);

		delete []buffer;

		if (success)
		{
			setAnimCallbacks() ;
			
			const LLBBoxLocal &pelvis_bbox = motionp->getPelvisBBox();

			LLVector3 temp = pelvis_bbox.getCenter();
			// only consider XY?
			//temp.mV[VZ] = 0.f;
			F32 pelvis_offset = temp.magVec();

			temp = pelvis_bbox.getExtent();
			//temp.mV[VZ] = 0.f;
			F32 pelvis_max_displacement = pelvis_offset + (temp.magVec() * 0.5f) + 1.f;
			
			F32 camera_zoom = LLViewerCamera::getInstance()->getDefaultFOV() / (2.f * atan(pelvis_max_displacement / PREVIEW_CAMERA_DISTANCE));
		
			mAnimPreview->setZoom(camera_zoom);

			motionp->setName(childGetValue("name_form").asString());
			mAnimPreview->getDummyAvatar()->startMotion(mMotionID);
			childSetMinValue("playback_slider", 0.0);
			childSetMaxValue("playback_slider", 1.0);

			childSetValue("loop_check", LLSD(motionp->getLoop()));
			childSetValue("loop_in_point", LLSD(motionp->getLoopIn() / motionp->getDuration() * 100.f));
			childSetValue("loop_out_point", LLSD(motionp->getLoopOut() / motionp->getDuration() * 100.f));
			childSetValue("priority", LLSD((F32)motionp->getPriority()));
			childSetValue("hand_pose_combo", LLHandMotion::getHandPoseName(motionp->getHandPose()));
			childSetValue("ease_in_time", LLSD(motionp->getEaseInDuration()));
			childSetValue("ease_out_time", LLSD(motionp->getEaseOutDuration()));
			setEnabled(TRUE);
			std::string seconds_string;
			seconds_string = llformat(" - %.2f seconds", motionp->getDuration());

			setTitle(mFilename + std::string(seconds_string));
		}
		else
		{
			delete mAnimPreview;
			mAnimPreview = NULL;
			mMotionID.setNull();
			childSetValue("bad_animation_text", getString("failed_to_initialize"));
		}
	}
	else
	{
		if ( loaderp )
		{
			if (loaderp->getDuration() > MAX_ANIM_DURATION)
			{
				LLUIString out_str = getString("anim_too_long");
				out_str.setArg("[LENGTH]", llformat("%.1f", loaderp->getDuration()));
				out_str.setArg("[MAX_LENGTH]", llformat("%.1f", MAX_ANIM_DURATION));
				childSetValue("bad_animation_text", out_str.getString());
			}
			else
			{
				LLUIString out_str = getString("failed_file_read");
				out_str.setArg("[STATUS]", loaderp->getStatus()); // *TODO:Translate
				childSetValue("bad_animation_text", out_str.getString());
			}
		}

		//setEnabled(FALSE);
		mMotionID.setNull();
		mAnimPreview = NULL;
	}

	refresh();

	delete loaderp;

	return TRUE;
}
BOOL LLPanelMainInventory::postBuild()
{
	gInventory.addObserver(this);
	
	mFilterTabs = getChild<LLTabContainer>("inventory filter tabs");
	mFilterTabs->setCommitCallback(boost::bind(&LLPanelMainInventory::onFilterSelected, this));
	
	//panel->getFilter()->markDefault();

	// Set up the default inv. panel/filter settings.
	mActivePanel = getChild<LLInventoryPanel>("All Items");
	if (mActivePanel)
	{
		// "All Items" is the previous only view, so it gets the InventorySortOrder
		mActivePanel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::DEFAULT_SORT_ORDER));
		mActivePanel->getFilter()->markDefault();
		mActivePanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState);
		mActivePanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mActivePanel, _1, _2));
	}
	LLInventoryPanel* recent_items_panel = getChild<LLInventoryPanel>("Recent Items");
	if (recent_items_panel)
	{
		recent_items_panel->setSinceLogoff(TRUE);
		recent_items_panel->setSortOrder(LLInventoryFilter::SO_DATE);
		recent_items_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
		recent_items_panel->getFilter()->markDefault();
		recent_items_panel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, recent_items_panel, _1, _2));
	}

	// Now load the stored settings from disk, if available.
	std::ostringstream filterSaveName;
	filterSaveName << gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, FILTERS_FILENAME);
	llinfos << "LLPanelMainInventory::init: reading from " << filterSaveName << llendl;
	llifstream file(filterSaveName.str());
	LLSD savedFilterState;
	if (file.is_open())
	{
		LLSDSerialize::fromXML(savedFilterState, file);
		file.close();

		// Load the persistent "Recent Items" settings.
		// Note that the "All Items" settings do not persist.
		if(recent_items_panel)
		{
			if(savedFilterState.has(recent_items_panel->getFilter()->getName()))
			{
				LLSD recent_items = savedFilterState.get(
					recent_items_panel->getFilter()->getName());
				recent_items_panel->getFilter()->fromLLSD(recent_items);
			}
		}

	}

	mFilterEditor = getChild<LLFilterEditor>("inventory search editor");
	if (mFilterEditor)
	{
		mFilterEditor->setCommitCallback(boost::bind(&LLPanelMainInventory::onFilterEdit, this, _2));
	}

	// *TODO:Get the cost info from the server
	const std::string upload_cost("10");
	childSetLabelArg("Upload Image", "[COST]", upload_cost);
	childSetLabelArg("Upload Sound", "[COST]", upload_cost);
	childSetLabelArg("Upload Animation", "[COST]", upload_cost);
	childSetLabelArg("Bulk Upload", "[COST]", upload_cost);

	initListCommandsHandlers();
	return TRUE;
}
// Default constructor
LLFloaterPay::LLFloaterPay(const std::string& name, 
						   money_callback callback,
						   const LLUUID& uuid,
						   BOOL target_is_object) :
	LLFloater(name, std::string("FloaterPayRectB"), LLStringUtil::null, RESIZE_NO,
				DEFAULT_MIN_WIDTH, DEFAULT_MIN_HEIGHT, DRAG_ON_TOP,
				MINIMIZE_NO, CLOSE_YES),
	mCallbackData(),
	mCallback(callback),
	mObjectNameText(NULL),
	mTargetUUID(uuid),
	mTargetIsObject(target_is_object),
	mTargetIsGroup(FALSE)
{
	if (target_is_object)
	{
		LLUICtrlFactory::getInstance()->buildFloater(this,"floater_pay_object.xml");
		mObjectSelection = LLSelectMgr::getInstance()->getEditSelection();
	}
	else 
	{
		LLUICtrlFactory::getInstance()->buildFloater(this,"floater_pay.xml");
	}

	
	S32 i =0;

	LLGiveMoneyInfo* info = new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_0);
	mCallbackData.push_back(info);

	childSetAction("fastpay 1",&LLFloaterPay::onGive,info);
	childSetVisible("fastpay 1", FALSE);
	childSetLabelArg("fastpay 1", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());


	mQuickPayButton[i] = getChild<LLButton>("fastpay 1");
	mQuickPayInfo[i] = info;
	++i;

	info = new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_1);
	mCallbackData.push_back(info);

	childSetAction("fastpay 5",&LLFloaterPay::onGive,info);
	childSetVisible("fastpay 5", FALSE);
	childSetLabelArg("fastpay 5", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());

	mQuickPayButton[i] = getChild<LLButton>("fastpay 5");
	mQuickPayInfo[i] = info;
	++i;

	info = new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_2);
	mCallbackData.push_back(info);

	childSetAction("fastpay 10",&LLFloaterPay::onGive,info);
	childSetVisible("fastpay 10", FALSE);
	childSetLabelArg("fastpay 10", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());

	mQuickPayButton[i] = getChild<LLButton>("fastpay 10");
	mQuickPayInfo[i] = info;
	++i;

	info = new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_3);
	mCallbackData.push_back(info);

	childSetAction("fastpay 20",&LLFloaterPay::onGive,info);
	childSetVisible("fastpay 20", FALSE);
	childSetLabelArg("fastpay 20", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());

	mQuickPayButton[i] = getChild<LLButton>("fastpay 20");
	mQuickPayInfo[i] = info;
	++i;

	
    childSetVisible("amount text", FALSE);	
	childSetVisible("currency text", FALSE);
	childSetTextArg("currency text", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());

	std::string last_amount;
	if(sLastAmount > 0)
	{
		last_amount = llformat("%d", sLastAmount);
	}

    childSetVisible("amount", FALSE);
	
	childSetKeystrokeCallback("amount", &LLFloaterPay::onKeystroke, this);
	childSetText("amount", last_amount);
	childSetPrevalidate("amount", LLLineEditor::prevalidateNonNegativeS32);

	info = new LLGiveMoneyInfo(this, 0);
	mCallbackData.push_back(info);

	childSetAction("pay btn",&LLFloaterPay::onGive,info);
	setDefaultBtn("pay btn");
	childSetVisible("pay btn", FALSE);
	childSetEnabled("pay btn", (sLastAmount > 0));

	childSetAction("cancel btn",&LLFloaterPay::onCancel,this);

	center();
	open();		/*Flawfinder: ignore*/
}
//-----------------------------------------------------------------------------
// postBuild()
//-----------------------------------------------------------------------------
BOOL LLFloaterNameDesc::postBuild()
{
	LLRect r;

	std::string asset_name = mFilename;
	LLStringUtil::replaceNonstandardASCII( asset_name, '?' );
	LLStringUtil::replaceChar(asset_name, '|', '?');
	LLStringUtil::stripNonprintable(asset_name);
	LLStringUtil::trim(asset_name);

	std::string exten = gDirUtilp->getExtension(asset_name);
	if (exten == "wav")
	{
		mIsAudio = TRUE;
	}
	asset_name = gDirUtilp->getBaseFileName(asset_name, true); // no extsntion

	setTitle(mFilename);

	centerWithin(gViewerWindow->getRootView()->getRect());

	S32 line_width = getRect().getWidth() - 2 * PREVIEW_HPAD;
	S32 y = getRect().getHeight() - PREVIEW_LINE_HEIGHT;

	r.setLeftTopAndSize( PREVIEW_HPAD, y, line_width, PREVIEW_LINE_HEIGHT );
	y -= PREVIEW_LINE_HEIGHT;

	r.setLeftTopAndSize( PREVIEW_HPAD, y, line_width, PREVIEW_LINE_HEIGHT );    

	childSetCommitCallback("name_form", doCommit, this);
	childSetValue("name_form", LLSD(asset_name));

	LLLineEditor *NameEditor = getChild<LLLineEditor>("name_form");
	if (NameEditor)
	{
		NameEditor->setMaxTextLength(DB_INV_ITEM_NAME_STR_LEN);
		NameEditor->setPrevalidate(&LLLineEditor::prevalidatePrintableNotPipe);
	}

	y -= llfloor(PREVIEW_LINE_HEIGHT * 1.2f);
	y -= PREVIEW_LINE_HEIGHT;

	r.setLeftTopAndSize( PREVIEW_HPAD, y, line_width, PREVIEW_LINE_HEIGHT );  
	childSetCommitCallback("description_form", doCommit, this);
	LLLineEditor *DescEditor = getChild<LLLineEditor>("description_form");
	if (DescEditor)
	{
		DescEditor->setMaxTextLength(DB_INV_ITEM_DESC_STR_LEN);
		DescEditor->setPrevalidate(&LLLineEditor::prevalidatePrintableNotPipe);
	}

	y -= llfloor(PREVIEW_LINE_HEIGHT * 1.2f);

	// Cancel button
	childSetAction("cancel_btn", onBtnCancel, this);

	// OK button
	childSetLabelArg("ok_btn", "[UPLOADFEE]", gHippoGridManager->getConnectedGrid()->getUploadFee());
	childSetAction("ok_btn", onBtnOK, this);
	setDefaultBtn("ok_btn");

	return TRUE;
}
void LLFloaterBuyLandUI::refreshUI()
{
	// section zero: title area
	{
		LLTextureCtrl* snapshot = getChild<LLTextureCtrl>("info_image");
		if (snapshot)
		{
			snapshot->setImageAssetID(
				mParcelValid ? mParcelSnapshot : LLUUID::null);
		}
		
		if (mParcelValid)
		{
			childSetText("info_parcel", mParcelLocation);

			LLStringUtil::format_map_t string_args;
			string_args["[AMOUNT]"] = llformat("%d", mParcelActualArea);
			string_args["[AMOUNT2]"] = llformat("%d", mParcelSupportedObjects);
		
			childSetText("info_size", getString("meters_supports_object", string_args));

			F32 cost_per_sqm = 0.0f;
			if (mParcelActualArea > 0)
			{
				cost_per_sqm = (F32)mParcelPrice / (F32)mParcelActualArea;
			}

			LLStringUtil::format_map_t info_price_args;
			info_price_args["[PRICE]"] = llformat("%d", mParcelPrice);
			info_price_args["[PRICE_PER_SQM]"] = llformat("%.1f", cost_per_sqm);
			if (mParcelSoldWithObjects)
			{
				info_price_args["[SOLD_WITH_OBJECTS]"] = getString("sold_with_objects");
			}
			else
			{
				info_price_args["[SOLD_WITH_OBJECTS]"] = getString("sold_without_objects");
			}
			childSetText("info_price", getString("info_price_string", info_price_args));
			childSetVisible("info_price", mParcelIsForSale);
		}
		else
		{
			childSetText("info_parcel", getString("no_parcel_selected"));
			childSetText("info_size", LLStringUtil::null);
			childSetText("info_price", LLStringUtil::null);
		}
		
		childSetText("info_action",
			mCanBuy
				?
					mIsForGroup
						? getString("buying_for_group")//"Buying land for group:"
						: getString("buying_will")//"Buying this land will:"
				: 
					mCannotBuyIsError
						? getString("cannot_buy_now")//"Cannot buy now:"
						: getString("not_for_sale")//"Not for sale:"

			);
	}
	
	bool showingError = !mCanBuy || !mSiteValid;
	
	// error section
	if (showingError)
	{
		mChildren.setBadge(std::string("step_error"),
			mCannotBuyIsError
				? LLViewChildren::BADGE_ERROR
				: LLViewChildren::BADGE_WARN);
		
		LLTextBox* message = getChild<LLTextBox>("error_message");
		if (message)
		{
			message->setVisible(true);
			message->setValue(LLSD(!mCanBuy ? mCannotBuyReason : "(waiting for data)"));
		}

		childSetVisible("error_web", 
				mCannotBuyIsError && !mCannotBuyURI.empty());
	}
	else
	{
		childHide("step_error");
		childHide("error_message");
		childHide("error_web");
	}
	
	
	// section one: account
	if (!showingError)
	{
		mChildren.setBadge(std::string("step_1"),
			mSiteMembershipUpgrade
				? LLViewChildren::BADGE_NOTE
				: LLViewChildren::BADGE_OK);
		childSetText("account_action", mSiteMembershipAction);
		childSetText("account_reason", 
			mSiteMembershipUpgrade
				?	getString("must_upgrade")
				:	getString("cant_own_land")
			);
		
		LLComboBox* levels = getChild<LLComboBox>( "account_level");
		if (levels)
		{
			levels->setVisible(mSiteMembershipUpgrade);
			
			levels->removeall();
			for(std::vector<std::string>::const_iterator i
					= mSiteMembershipPlanNames.begin();
				i != mSiteMembershipPlanNames.end();
				++i)
			{
				levels->add(*i);
			}
			
			levels->setCurrentByIndex(mUserPlanChoice);
		}

		childShow("step_1");
		childShow("account_action");
		childShow("account_reason");
	}
	else
	{
		childHide("step_1");
		childHide("account_action");
		childHide("account_reason");
		childHide("account_level");
	}
	
	// section two: land use fees
	if (!showingError)
	{
		mChildren.setBadge(std::string("step_2"),
			mSiteLandUseUpgrade
				? LLViewChildren::BADGE_NOTE
				: LLViewChildren::BADGE_OK);
		childSetText("land_use_action", mSiteLandUseAction);
		
		std::string message;
		
		if (mIsForGroup)
		{
			LLStringUtil::format_map_t string_args;
			string_args["[GROUP]"] = std::string(gAgent.getGroupName());

			message += getString("insufficient_land_credits", string_args);
				
		}
		else
		{
			LLStringUtil::format_map_t string_args;
			string_args["[BUYER]"] = llformat("%d", mAgentCommittedTier);
			message += getString("land_holdings", string_args);
		}
		
		if (!mParcelValid)
		{
			message += getString("no_parcel_selected");
		}
		else if (mParcelBillableArea == mParcelActualArea)
		{
			LLStringUtil::format_map_t string_args;
			string_args["[AMOUNT]"] = llformat("%d ", mParcelActualArea);
			message += getString("parcel_meters", string_args);
		}
		else
		{

			if (mParcelBillableArea > mParcelActualArea)
			{	
				LLStringUtil::format_map_t string_args;
				string_args["[AMOUNT]"] = llformat("%d ", mParcelBillableArea);
				message += getString("premium_land", string_args);
			}
			else
			{
				LLStringUtil::format_map_t string_args;
				string_args["[AMOUNT]"] = llformat("%d ", mParcelBillableArea);
				message += getString("discounted_land", string_args);
			}
		}

		childSetValue("land_use_reason", message);

		childShow("step_2");
		childShow("land_use_action");
		childShow("land_use_reason");
	}
	else
	{
		childHide("step_2");
		childHide("land_use_action");
		childHide("land_use_reason");
	}
	
	// section three: purchase & currency
	S32 finalBalance = mAgentCashBalance + mCurrency.getAmount() - mParcelPrice;
	bool willHaveEnough = finalBalance >= 0;
	bool haveEnough = mAgentCashBalance >= mParcelPrice;
	S32 minContribution = llceil((F32)mParcelBillableArea / GROUP_LAND_BONUS_FACTOR);
	bool groupContributionEnough = mParcelGroupContribution >= minContribution;
	
	mCurrency.updateUI(!showingError  &&  !haveEnough);

	if (!showingError)
	{
		mChildren.setBadge(std::string("step_3"),
			!willHaveEnough
				? LLViewChildren::BADGE_WARN
				: mCurrency.getAmount() > 0
					? LLViewChildren::BADGE_NOTE
					: LLViewChildren::BADGE_OK);
			
		LLStringUtil::format_map_t string_args;
		string_args["[AMOUNT]"] = llformat("%d", mParcelPrice);
		string_args["[SELLER]"] = mParcelSellerName;
		childSetText("purchase_action", getString("pay_to_for_land", string_args));
		childSetVisible("purchase_action", mParcelValid);
		
		std::string reasonString;

		if (haveEnough)
		{
			LLStringUtil::format_map_t string_args;
			string_args["[AMOUNT]"] = llformat("%d", mAgentCashBalance);

			childSetText("currency_reason", getString("have_enough_lindens", string_args));
		}
		else
		{
			LLStringUtil::format_map_t string_args;
			string_args["[AMOUNT]"] = llformat("%d", mAgentCashBalance);
			string_args["[AMOUNT2]"] = llformat("%d", mParcelPrice - mAgentCashBalance);
			
			childSetText("currency_reason", getString("not_enough_lindens", string_args));

			childSetTextArg("currency_est", "[LOCAL_AMOUNT]", mCurrency.getLocalEstimate());
		}
		
		if (willHaveEnough)
		{
			LLStringUtil::format_map_t string_args;
			string_args["[AMOUNT]"] = llformat("%d", finalBalance);

			childSetText("currency_balance", getString("balance_left", string_args));

		}
		else
		{
			LLStringUtil::format_map_t string_args;
			string_args["[AMOUNT]"] = llformat("%d", mParcelPrice - mAgentCashBalance);
	
			childSetText("currency_balance", getString("balance_needed", string_args));
			
		}

		childSetValue("remove_contribution", LLSD(groupContributionEnough));
		childSetEnabled("remove_contribution", groupContributionEnough);
		bool showRemoveContribution = mParcelIsGroupLand
							&& (mParcelGroupContribution > 0);
		childSetLabelArg("remove_contribution", "[AMOUNT]",
							llformat("%d", minContribution));
		childSetVisible("remove_contribution", showRemoveContribution);

		childShow("step_3");
		childShow("purchase_action");
		childShow("currency_reason");
		childShow("currency_balance");
	}
	else
	{
		childHide("step_3");
		childHide("purchase_action");
		childHide("currency_reason");
		childHide("currency_balance");
		childHide("remove_group_donation");
	}


	bool agrees_to_covenant = false;
	LLCheckBoxCtrl* check = getChild<LLCheckBoxCtrl>("agree_covenant");
	if (check)
	{
	    agrees_to_covenant = check->get();
	}

	childSetEnabled("buy_btn",
		mCanBuy  &&  mSiteValid  &&  willHaveEnough  &&  !mTransaction && agrees_to_covenant);
}
Example #19
0
void LLPrefsIMImpl::setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email)
{
	mGotPersonalInfo = true;
	mOriginalIMViaEmail = im_via_email;
	mDirectoryVisibility = visibility;
	
	if(visibility == VISIBILITY_DEFAULT)
	{
		mOriginalHideOnlineStatus = false;
		childEnable("online_visibility"); 	 
	}
	else if(visibility == VISIBILITY_HIDDEN)
	{
		mOriginalHideOnlineStatus = true;
		childEnable("online_visibility"); 	 
	}
	else
	{
		mOriginalHideOnlineStatus = true;
	}

	childEnable("include_im_in_chat_console");
	childEnable("include_im_in_chat_history");
	childEnable("show_timestamps_check");
	childEnable("friends_online_notify_checkbox");

	childSetValue("online_visibility", mOriginalHideOnlineStatus); 	 
	childSetLabelArg("online_visibility", "[DIR_VIS]", mDirectoryVisibility);
	childEnable("send_im_to_email");
	childSetValue("send_im_to_email", im_via_email);
	childEnable("log_instant_messages");
	childEnable("log_chat");
	childEnable("busy_response");
	childEnable("log_instant_messages_timestamp");
	childEnable("log_chat_timestamp");
	childEnable("log_chat_IM");
	childEnable("log_date_timestamp");
	childEnable("logfile_name_datestamp");
	
	//RN: get wide string so replace char can work (requires fixed-width encoding)
	LLWString busy_response = utf8str_to_wstring( gSavedPerAccountSettings.getString("BusyModeResponse") );
	LLWStringUtil::replaceChar(busy_response, '^', '\n');
	LLWStringUtil::replaceChar(busy_response, '%', ' ');
	childSetText("busy_response", wstring_to_utf8str(busy_response));
// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g)
	if (gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM))
	{
		childDisable("busy_response");
	}
// [/RLVa:KB]

	enableHistory();

	// Truncate the e-mail address if it's too long (to prevent going off
	// the edge of the dialog).
	std::string display_email(email);
	if(display_email.size() > 30)
	{
		display_email.resize(30);
		display_email += "...";
	}

	childSetLabelArg("send_im_to_email", "[EMAIL]", display_email);
}