void setup(const LLChat& chat,const LLStyle::Params& style_params) { mAvatarID = chat.mFromID; mSessionID = chat.mSessionID; mSourceType = chat.mSourceType; gCacheName->get(mAvatarID, FALSE, boost::bind(&LLChatHistoryHeader::nameUpdatedCallback, this, _1, _2, _3, _4)); //*TODO overly defensive thing, source type should be maintained out there if (chat.mFromID.isNull() && (chat.mFromName.empty() || chat.mFromName == SYSTEM_FROM)) { mSourceType = CHAT_SOURCE_SYSTEM; } LLTextBox* userName = getChild<LLTextBox>("user_name"); userName->setReadOnlyColor(style_params.readonly_color()); userName->setColor(style_params.color()); userName->setValue(chat.mFromName); mFrom = chat.mFromName; if (chat.mFromName.empty() || CHAT_SOURCE_SYSTEM == mSourceType) { mFrom = LLTrans::getString("SECOND_LIFE"); userName->setValue(mFrom); } mMinUserNameWidth = style_params.font()->getWidth(userName->getWText().c_str()) + PADDING; setTimeField(chat); LLAvatarIconCtrl* icon = getChild<LLAvatarIconCtrl>("avatar_icon"); if(mSourceType != CHAT_SOURCE_AGENT) icon->setDrawTooltip(false); switch (mSourceType) { case CHAT_SOURCE_AGENT: icon->setValue(chat.mFromID); break; case CHAT_SOURCE_OBJECT: icon->setValue(LLSD("OBJECT_Icon")); break; case CHAT_SOURCE_SYSTEM: icon->setValue(LLSD("SL_Logo")); break; case CHAT_SOURCE_UNKNOWN: icon->setValue(LLSD("Unknown_Icon")); } }
BOOL LLToastScriptQuestion::postBuild() { createButtons(); LLTextBox* mMessage = getChild<LLTextBox>("top_info_message"); LLTextBox* mFooter = getChild<LLTextBox>("bottom_info_message"); mMessage->setValue(mNotification->getMessage()); mFooter->setValue(mNotification->getFooter()); snapToMessageHeight(); return TRUE; }
void LLInspectObject::updateDescription(LLSelectNode* nodep) { const char* const DEFAULT_DESC = "(No Description)"; std::string desc; if (!nodep->mDescription.empty() && nodep->mDescription != DEFAULT_DESC) { desc = nodep->mDescription; } LLTextBox* textbox = getChild<LLTextBox>("object_description"); textbox->setValue(desc); }
//--------------------------------------------------------------------------------- LLIMWellWindow::RowPanel::RowPanel(const LLSysWellWindow* parent, const LLUUID& sessionId, S32 chicletCounter, const std::string& name, const LLUUID& otherParticipantId) : LLPanel(LLPanel::Params()), mChiclet(NULL), mParent(parent) { buildFromFile( "panel_activeim_row.xml", NULL); // Choose which of the pre-created chiclets (IM/group) to use. // The other one gets hidden. LLIMChiclet::EType im_chiclet_type = LLIMChiclet::getIMSessionType(sessionId); switch (im_chiclet_type) { case LLIMChiclet::TYPE_GROUP: mChiclet = getChild<LLIMGroupChiclet>("group_chiclet"); break; case LLIMChiclet::TYPE_AD_HOC: mChiclet = getChild<LLAdHocChiclet>("adhoc_chiclet"); break; case LLIMChiclet::TYPE_UNKNOWN: // assign mChiclet a non-null value anyway case LLIMChiclet::TYPE_IM: mChiclet = getChild<LLIMP2PChiclet>("p2p_chiclet"); break; } // Initialize chiclet. mChiclet->setChicletSizeChangedCallback(boost::bind(&LLIMWellWindow::RowPanel::onChicletSizeChanged, this, mChiclet, _2)); mChiclet->enableCounterControl(true); mChiclet->setCounter(chicletCounter); mChiclet->setSessionId(sessionId); mChiclet->setIMSessionName(name); mChiclet->setOtherParticipantId(otherParticipantId); mChiclet->setVisible(true); if (im_chiclet_type == LLIMChiclet::TYPE_IM) { LLAvatarNameCache::get(otherParticipantId, boost::bind(&LLIMWellWindow::RowPanel::onAvatarNameCache, this, _1, _2)); } else { LLTextBox* contactName = getChild<LLTextBox>("contact_name"); contactName->setValue(name); } mCloseBtn = getChild<LLButton>("hide_btn"); mCloseBtn->setCommitCallback(boost::bind(&LLIMWellWindow::RowPanel::onClosePanel, this)); }
void LLInspectObject::updateMediaCurrentURL() { if(!mMediaEntry) return; LLTextBox* textbox = getChild<LLTextBox>("object_media_url"); std::string media_url = ""; textbox->setValue(media_url); textbox->setToolTip(media_url); LLStringUtil::format_map_t args; if(mMediaImpl.notNull() && mMediaImpl->hasMedia()) { LLPluginClassMedia* media_plugin = NULL; media_plugin = mMediaImpl->getMediaPlugin(); if(media_plugin) { if(media_plugin->pluginSupportsMediaTime()) { args["[CurrentURL]"] = mMediaImpl->getMediaURL(); } else { args["[CurrentURL]"] = media_plugin->getLocation(); } media_url = LLTrans::getString("CurrentURL", args); } } else if(mMediaEntry->getCurrentURL() != "") { args["[CurrentURL]"] = mMediaEntry->getCurrentURL(); media_url = LLTrans::getString("CurrentURL", args); } textbox->setText(media_url); textbox->setToolTip(media_url); }
void LLFloaterEnvSettings::syncMenu() { LLSliderCtrl* sldr; sldr = getChild<LLSliderCtrl>("EnvTimeSlider"); // sync the clock F32 val = (F32)LLWLParamManager::instance()->mAnimator.getDayTime(); std::string timeStr = timeToString(val); LLTextBox* textBox; textBox = getChild<LLTextBox>("EnvTimeText"); textBox->setValue(timeStr); // sync time slider which starts at 6 AM val -= 0.25; if(val < 0) { val++; } sldr->setValue(val); // sync cloud coverage bool err; childSetValue("EnvCloudSlider", LLWLParamManager::instance()->mCurParams.getFloat("cloud_shadow", err)); LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); // sync water params LLColor4 col = param_mgr->getFogColor(); LLColorSwatchCtrl* colCtrl = getChild<LLColorSwatchCtrl>("EnvWaterColor"); col.mV[3] = 1.0f; colCtrl->set(col); childSetValue("EnvWaterFogSlider", param_mgr->mFogDensity.mExp); param_mgr->setDensitySliderValue(param_mgr->mFogDensity.mExp); // turn off Use Estate Time button if it's already being used if(LLWLParamManager::instance()->mAnimator.mUseLindenTime) { childDisable("EnvUseEstateTimeButton"); } else { childEnable("EnvUseEstateTimeButton"); } if(!gPipeline.canUseVertexShaders()) { childDisable("EnvWaterColor"); childDisable("EnvWaterColorText"); //childDisable("EnvAdvancedWaterButton"); } else { childEnable("EnvWaterColor"); childEnable("EnvWaterColorText"); //childEnable("EnvAdvancedWaterButton"); } // only allow access to these if they are using windlight if(!gPipeline.canUseWindLightShaders()) { childDisable("EnvCloudSlider"); childDisable("EnvCloudText"); //childDisable("EnvAdvancedSkyButton"); } else { childEnable("EnvCloudSlider"); childEnable("EnvCloudText"); //childEnable("EnvAdvancedSkyButton"); } }
void LLFloaterBuyLandUI::refreshUI() { // section zero: title area { LLTextureCtrl* snapshot = getChild<LLTextureCtrl>("info_image"); if (snapshot) { snapshot->setImageAssetID( mParcelValid ? mParcelSnapshot : LLUUID::null); } if (mParcelValid) { getChild<LLUICtrl>("info_parcel")->setValue(mParcelLocation); LLStringUtil::format_map_t string_args; string_args["[AMOUNT]"] = llformat("%d", mParcelActualArea); string_args["[AMOUNT2]"] = llformat("%d", mParcelSupportedObjects); getChild<LLUICtrl>("info_size")->setValue(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"); } getChild<LLUICtrl>("info_price")->setValue(getString("info_price_string", info_price_args)); getChildView("info_price")->setVisible( mParcelIsForSale); } else { getChild<LLUICtrl>("info_parcel")->setValue(getString("no_parcel_selected")); getChild<LLUICtrl>("info_size")->setValue(LLStringUtil::null); getChild<LLUICtrl>("info_price")->setValue(LLStringUtil::null); } getChild<LLUICtrl>("info_action")->setValue( 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)")); } getChildView("error_web")->setVisible(mCannotBuyIsError && !mCannotBuyURI.empty()); } else { getChildView("step_error")->setVisible(FALSE); getChildView("error_message")->setVisible(FALSE); getChildView("error_web")->setVisible(FALSE); } // section one: account if (!showingError) { mChildren.setBadge(std::string("step_1"), mSiteMembershipUpgrade ? LLViewChildren::BADGE_NOTE : LLViewChildren::BADGE_OK); getChild<LLUICtrl>("account_action")->setValue(mSiteMembershipAction); getChild<LLUICtrl>("account_reason")->setValue( 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); } getChildView("step_1")->setVisible(TRUE); getChildView("account_action")->setVisible(TRUE); getChildView("account_reason")->setVisible(TRUE); } else { getChildView("step_1")->setVisible(FALSE); getChildView("account_action")->setVisible(FALSE); getChildView("account_reason")->setVisible(FALSE); getChildView("account_level")->setVisible(FALSE); } // section two: land use fees if (!showingError) { mChildren.setBadge(std::string("step_2"), mSiteLandUseUpgrade ? LLViewChildren::BADGE_NOTE : LLViewChildren::BADGE_OK); getChild<LLUICtrl>("land_use_action")->setValue(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 += LLTrans::getString("sentences_separator") + getString("no_parcel_selected"); } else if (mParcelBillableArea == mParcelActualArea) { LLStringUtil::format_map_t string_args; string_args["[AMOUNT]"] = llformat("%d ", mParcelActualArea); message += LLTrans::getString("sentences_separator") + getString("parcel_meters", string_args); } else { if (mParcelBillableArea > mParcelActualArea) { LLStringUtil::format_map_t string_args; string_args["[AMOUNT]"] = llformat("%d ", mParcelBillableArea); message += LLTrans::getString("sentences_separator") + getString("premium_land", string_args); } else { LLStringUtil::format_map_t string_args; string_args["[AMOUNT]"] = llformat("%d ", mParcelBillableArea); message += LLTrans::getString("sentences_separator") + getString("discounted_land", string_args); } } getChild<LLUICtrl>("land_use_reason")->setValue(message); getChildView("step_2")->setVisible(TRUE); getChildView("land_use_action")->setVisible(TRUE); getChildView("land_use_reason")->setVisible(TRUE); } else { getChildView("step_2")->setVisible(FALSE); getChildView("land_use_action")->setVisible(FALSE); getChildView("land_use_reason")->setVisible(FALSE); } // 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; getChild<LLUICtrl>("purchase_action")->setValue(getString("pay_to_for_land", string_args)); getChildView("purchase_action")->setVisible( mParcelValid); std::string reasonString; if (haveEnough) { LLStringUtil::format_map_t string_args; string_args["[AMOUNT]"] = llformat("%d", mAgentCashBalance); getChild<LLUICtrl>("currency_reason")->setValue(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); getChild<LLUICtrl>("currency_reason")->setValue(getString("not_enough_lindens", string_args)); getChild<LLUICtrl>("currency_est")->setTextArg("[LOCAL_AMOUNT]", mCurrency.getLocalEstimate()); } if (willHaveEnough) { LLStringUtil::format_map_t string_args; string_args["[AMOUNT]"] = llformat("%d", finalBalance); getChild<LLUICtrl>("currency_balance")->setValue(getString("balance_left", string_args)); } else { LLStringUtil::format_map_t string_args; string_args["[AMOUNT]"] = llformat("%d", mParcelPrice - mAgentCashBalance); getChild<LLUICtrl>("currency_balance")->setValue(getString("balance_needed", string_args)); } getChild<LLUICtrl>("remove_contribution")->setValue(LLSD(groupContributionEnough)); getChildView("remove_contribution")->setEnabled(groupContributionEnough); bool showRemoveContribution = mParcelIsGroupLand && (mParcelGroupContribution > 0); getChildView("remove_contribution")->setLabelArg("[AMOUNT]", llformat("%d", minContribution)); getChildView("remove_contribution")->setVisible( showRemoveContribution); getChildView("step_3")->setVisible(TRUE); getChildView("purchase_action")->setVisible(TRUE); getChildView("currency_reason")->setVisible(TRUE); getChildView("currency_balance")->setVisible(TRUE); } else { getChildView("step_3")->setVisible(FALSE); getChildView("purchase_action")->setVisible(FALSE); getChildView("currency_reason")->setVisible(FALSE); getChildView("currency_balance")->setVisible(FALSE); getChildView("remove_group_donation")->setVisible(FALSE); } bool agrees_to_covenant = false; LLCheckBoxCtrl* check = getChild<LLCheckBoxCtrl>("agree_covenant"); if (check) { agrees_to_covenant = check->get(); } getChildView("buy_btn")->setEnabled(mCanBuy && mSiteValid && willHaveEnough && !mTransaction && agrees_to_covenant); }
//--------------------------------------------------------------------------------- void LLIMWellWindow::RowPanel::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) { LLTextBox* contactName = getChild<LLTextBox>("contact_name"); contactName->setValue( av_name.getCompleteName() ); }