// static void LLPanelPermissions::onCommitIncludeInSearch(LLUICtrl* ctrl, void*) { LLCheckBoxCtrl* box = (LLCheckBoxCtrl*)ctrl; llassert(box); LLSelectMgr::getInstance()->selectionSetIncludeInSearch(box->get()); }
void LLFloaterBuyLandUI::updateCovenantText(const std::string &string, const LLUUID& asset_id) { LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("covenant_editor"); if (editor) { editor->setHandleEditKeysDirectly(FALSE); editor->setText(string); LLCheckBoxCtrl* check = getChild<LLCheckBoxCtrl>("agree_covenant"); LLTextBox* box = getChild<LLTextBox>("covenant_text"); if(check && box) { if (asset_id.isNull()) { check->set(true); check->setEnabled(false); refreshUI(); // remove the line stating that you must agree box->setVisible(FALSE); } else { check->setEnabled(true); // remove the line stating that you must agree box->setVisible(TRUE); } } } }
void LLFloaterWater::onBoolToggle(LLUICtrl* ctrl, void* userData) { LLCheckBoxCtrl* cbCtrl = static_cast<LLCheckBoxCtrl*>(ctrl); bool value = cbCtrl->get(); (*(static_cast<BOOL *>(userData))) = value; }
void LLPanelFace::sendFullbright() { LLCheckBoxCtrl* mCheckFullbright = getChild<LLCheckBoxCtrl>("checkbox fullbright"); if(!mCheckFullbright)return; U8 fullbright = mCheckFullbright->get() ? TEM_FULLBRIGHT_MASK : 0; LLSelectMgr::getInstance()->selectionSetFullbright( fullbright ); }
void LLFloaterBuyLandUI::updateCovenantInfo() { LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); if(!region) return; LLTextBox* region_name = getChild<LLTextBox>("region_name_text"); if (region_name) { region_name->setText(region->getName()); } LLTextBox* resellable_clause = getChild<LLTextBox>("resellable_clause"); if (resellable_clause) { if (region->getRegionFlags() & REGION_FLAGS_BLOCK_LAND_RESELL) { resellable_clause->setText(getString("can_not_resell")); } else { resellable_clause->setText(getString("can_resell")); } } LLTextBox* changeable_clause = getChild<LLTextBox>("changeable_clause"); if (changeable_clause) { if (region->getRegionFlags() & REGION_FLAGS_ALLOW_PARCEL_CHANGES) { changeable_clause->setText(getString("can_change")); } else { changeable_clause->setText(getString("can_not_change")); } } LLCheckBoxCtrl* check = getChild<LLCheckBoxCtrl>("agree_covenant"); if(check) { check->set(false); check->setEnabled(true); check->setCallbackUserData(this); check->setCommitCallback(onChangeAgreeCovenant); } LLTextBox* box = getChild<LLTextBox>("covenant_text"); if(box) { box->setVisible(FALSE); } // send EstateCovenantInfo message LLMessageSystem *msg = gMessageSystem; msg->newMessage("EstateCovenantRequest"); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID,gAgent.getSessionID()); msg->sendReliable(region->getHost()); }
// static void LLPanelDirLand::onCommitArea(LLUICtrl* ctrl, void* data) { LLPanelDirLand* self = (LLPanelDirLand*)data; LLCheckBoxCtrl* check = (LLCheckBoxCtrl*)ctrl; if (!self || !check) return; self->childSetEnabled("areaedit", check->get()); }
void LLFloaterSearchReplace::onBtnSearch(void* userdata) { if ( (!sInstance) || (!sInstance->mEditor) || (!sInstance->getDependee()) ) return; LLCheckBoxCtrl* caseChk = sInstance->getChild<LLCheckBoxCtrl>("case_text"); sInstance->mEditor->selectNext(sInstance->childGetText("search_text"), caseChk->get()); }
// static void LLPanelDisplay::onImpostorsEnable(LLUICtrl* ctrl, void* user_data) { LLPanelDisplay* self = (LLPanelDisplay*)user_data; LLCheckBoxCtrl* checkbox = (LLCheckBoxCtrl*)ctrl; self->mCtrlAvatarMaxVisible->setEnabled(checkbox->getValue().asBoolean()); self->mAvatarCountText->setEnabled(checkbox->getValue().asBoolean()); }
// Bool Toggle void LLFloaterPostProcess::onBoolToggle(LLUICtrl* ctrl, void* userData) { char const * boolVariableName = (char const *)userData; // check the bool LLCheckBoxCtrl* cbCtrl = static_cast<LLCheckBoxCtrl*>(ctrl); gPostProcess->tweaks[boolVariableName] = cbCtrl->getValue(); }
void LLFloaterWindLight::onBoolToggle(LLUICtrl* ctrl, void* userData) { deactivateAnimator(); LLCheckBoxCtrl* cbCtrl = static_cast<LLCheckBoxCtrl*>(ctrl); bool value = cbCtrl->get(); (*(static_cast<BOOL *>(userData))) = value; }
// static void LLPanelGeneral::onCommitAFKCheckbox(LLUICtrl* ctrl, void* data) { LLPanelGeneral* self = (LLPanelGeneral*)data; LLCheckBoxCtrl* check = (LLCheckBoxCtrl*)ctrl; if (!self || !check) return; self->childSetEnabled("afk_timeout_spinner", check->get()); self->childSetEnabled("minutes_textbox", check->get()); }
// static void LLPanelNetwork::onCommitPort(LLUICtrl* ctrl, void* data) { LLPanelNetwork* self = (LLPanelNetwork*)data; LLCheckBoxCtrl* check = (LLCheckBoxCtrl*)ctrl; if (!self || !check) return; self->childSetEnabled("connection_port", check->get()); LLNotifications::instance().add("ChangeConnectionPort"); }
// static void LLPanelNetwork::onCommitPort(LLUICtrl* ctrl, void* data) { LLPanelNetwork* self = (LLPanelNetwork*)data; LLCheckBoxCtrl* check = (LLCheckBoxCtrl*)ctrl; if (!self || !check) return; self->childSetEnabled("connection_port", check->get()); gViewerWindow->alertXml("ChangeConnectionPort"); }
// static void LLPanelNetwork::onCommitWebProxyEnabled(LLUICtrl* ctrl, void* data) { LLPanelNetwork* self = (LLPanelNetwork*)data; LLCheckBoxCtrl* check = (LLCheckBoxCtrl*)ctrl; if (!self || !check) return; self->childSetEnabled("web_proxy_editor", check->get()); self->childSetEnabled("web_proxy_port", check->get()); self->childSetEnabled("proxy_text_label", check->get()); }
//static void LLFloaterBulkPermission::onCommitCopy() { // Implements fair use BOOL copyable = gSavedSettings.getBOOL("BulkChangeNextOwnerCopy"); if(!copyable) { gSavedSettings.setBOOL("BulkChangeNextOwnerTransfer", TRUE); } LLCheckBoxCtrl* xfer =getChild<LLCheckBoxCtrl>("next_owner_transfer"); xfer->setEnabled(copyable); }
// static void LLPanelNetwork::onCommitCookies(LLUICtrl* ctrl, void* data) { LLPanelNetwork* self = (LLPanelNetwork*)data; LLCheckBoxCtrl* check = (LLCheckBoxCtrl*)ctrl; if (!self || !check) return; viewer_media_t media_source = get_web_media(); if (media_source && media_source->hasMedia()) media_source->getMediaPlugin()->enable_cookies(check->get()); }
// static void LLPanelNetwork::onCommitSocks5ProxyEnabled(LLUICtrl* ctrl, void* data) { LLPanelNetwork* self = (LLPanelNetwork*)data; LLCheckBoxCtrl* check = (LLCheckBoxCtrl*)ctrl; if (!self || !check) return; sSocksSettingsChanged = true; updateProxyEnabled(self, check->get(), self->childGetValue("socks5_auth")); }
void FSPanelPrefs::onCommitCopy() { // Implements fair use BOOL copyable = gSavedSettings.getBOOL("NextOwnerCopy"); if (!copyable) { gSavedSettings.setBOOL("NextOwnerTransfer", TRUE); } LLCheckBoxCtrl* xfer = getChild<LLCheckBoxCtrl>("next_owner_transfer"); xfer->setEnabled(copyable); }
//static void LLFloaterBulkPermission::onCommitCopy(LLUICtrl* ctrl, void* data) { LLFloaterBulkPermission* self = static_cast<LLFloaterBulkPermission*>(data); // Implements fair use BOOL copyable = gSavedSettings.getBOOL("BulkChangeNextOwnerCopy"); if(!copyable) { gSavedSettings.setBOOL("BulkChangeNextOwnerTransfer", TRUE); } LLCheckBoxCtrl* xfer = self->getChild<LLCheckBoxCtrl>("next_owner_transfer"); xfer->setEnabled(copyable); }
// static void LLPanelPermissions::onCommitPerm(LLUICtrl *ctrl, void *data, U8 field, U32 perm) { LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject(); if(!object) return; // Checkbox will have toggled itself // LLPanelPermissions* self = (LLPanelPermissions*)data; LLCheckBoxCtrl *check = (LLCheckBoxCtrl *)ctrl; BOOL new_state = check->get(); LLSelectMgr::getInstance()->selectionSetObjectPermissions(field, new_state, perm); }
LLScrollListItem* LLPanelNearByMedia::addListItem(const LLUUID &id) { if (NULL == mMediaList) return NULL; // Just set up the columns -- the values will be filled in by updateListItem(). LLSD row; row["id"] = id; LLSD &columns = row["columns"]; columns[CHECKBOX_COLUMN]["name"]="media_checkbox_ctrl"; columns[CHECKBOX_COLUMN]["column"] = "media_checkbox_ctrl"; columns[CHECKBOX_COLUMN]["type"] = "checkbox"; //if(mDebugInfoVisible) { columns[PROXIMITY_COLUMN]["name"]="media_proximity"; columns[PROXIMITY_COLUMN]["column"] = "media_proximity"; columns[PROXIMITY_COLUMN]["value"] = ""; columns[VISIBILITY_COLUMN]["name"]="media_visibility"; columns[VISIBILITY_COLUMN]["column"] = "media_visibility"; columns[VISIBILITY_COLUMN]["value"] = ""; columns[CLASS_COLUMN]["name"]="media_class"; columns[CLASS_COLUMN]["column"] = "media_class"; columns[CLASS_COLUMN]["type"] = "text"; columns[CLASS_COLUMN]["value"] = ""; } columns[NAME_COLUMN]["name"] = "media_name"; columns[NAME_COLUMN]["column"] = "media_name"; columns[NAME_COLUMN]["type"] = "text"; columns[NAME_COLUMN]["value"] = ""; //if(mDebugInfoVisible) { columns[DEBUG_COLUMN]["name"] = "media_debug"; columns[DEBUG_COLUMN]["column"] = "media_debug"; columns[DEBUG_COLUMN]["type"] = "text"; columns[DEBUG_COLUMN]["value"] = ""; } LLScrollListItem* new_item = mMediaList->addElement(row); if (NULL != new_item) { LLScrollListCheck* scroll_list_check = dynamic_cast<LLScrollListCheck*>(new_item->getColumn(CHECKBOX_COLUMN)); if (scroll_list_check) { LLCheckBoxCtrl *check = scroll_list_check->getCheckBox(); check->setCommitCallback(boost::bind(&LLPanelNearByMedia::onCheckItem, this, _1, id)); } } return new_item; }
void LLPanelPermissions::setAllSaleInfo() { llinfos << "LLPanelPermissions::setAllSaleInfo()" << llendl; LLSaleInfo::EForSale sale_type = LLSaleInfo::FS_NOT; LLCheckBoxCtrl *checkPurchase = getChild<LLCheckBoxCtrl>("checkbox for sale"); // Set the sale type if the object(s) are for sale. if(checkPurchase && checkPurchase->get()) { sale_type = static_cast<LLSaleInfo::EForSale>(getChild<LLComboBox>("sale type")->getValue().asInteger()); } S32 price = -1; LLSpinCtrl *edit_price = getChild<LLSpinCtrl>("Edit Cost"); price = (edit_price->getTentative()) ? DEFAULT_PRICE : edit_price->getValue().asInteger(); // If somehow an invalid price, turn the sale off. if (price < 0) sale_type = LLSaleInfo::FS_NOT; LLSaleInfo old_sale_info; LLSelectMgr::getInstance()->selectGetSaleInfo(old_sale_info); LLSaleInfo new_sale_info(sale_type, price); LLSelectMgr::getInstance()->selectionSetObjectSaleInfo(new_sale_info); U8 old_click_action = 0; LLSelectMgr::getInstance()->selectionGetClickAction(&old_click_action); if (old_sale_info.isForSale() && !new_sale_info.isForSale() && old_click_action == CLICK_ACTION_BUY) { // If turned off for-sale, make sure click-action buy is turned // off as well LLSelectMgr::getInstance()-> selectionSetClickAction(CLICK_ACTION_TOUCH); } else if (new_sale_info.isForSale() && !old_sale_info.isForSale() && old_click_action == CLICK_ACTION_TOUCH) { // If just turning on for-sale, preemptively turn on one-click buy // unless user have a different click action set LLSelectMgr::getInstance()-> selectionSetClickAction(CLICK_ACTION_BUY); } }
void LLFloaterWindLight::onCloudScrollYToggled(LLUICtrl* ctrl, void* userData) { deactivateAnimator(); LLCheckBoxCtrl* cbCtrl = static_cast<LLCheckBoxCtrl*>(ctrl); bool lock = cbCtrl->get(); LLWLParamManager::instance()->mCurParams.setEnableCloudScrollY(!lock); LLSliderCtrl* sldr = sWindLight->getChild<LLSliderCtrl>( "WLCloudScrollY"); if(cbCtrl->get()) { sldr->setEnabled(false); } else { sldr->setEnabled(true); } }
// static LLView* LLCheckBoxCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { std::string name("checkbox"); node->getAttributeString("name", name); std::string label(""); node->getAttributeString("label", label); LLFontGL* font = LLView::selectFont(node); BOOL radio_style = FALSE; node->getAttributeBOOL("radio_style", radio_style); LLUICtrlCallback callback = NULL; if (label.empty()) { label.assign(node->getTextContents()); } LLRect rect; createRect(node, rect, parent, LLRect()); LLCheckBoxCtrl* checkbox = new LLCheckboxCtrl(name, rect, label, font, callback, NULL, FALSE, radio_style); // if true, draw radio button style icons BOOL initial_value = checkbox->getValue().asBoolean(); node->getAttributeBOOL("initial_value", initial_value); LLColor4 color; color = LLUI::sColorsGroup->getColor( "LabelTextColor" ); LLUICtrlFactory::getAttributeColor(node,"text_enabled_color", color); checkbox->setEnabledColor(color); color = LLUI::sColorsGroup->getColor( "LabelDisabledColor" ); LLUICtrlFactory::getAttributeColor(node,"text_disabled_color", color); checkbox->setDisabledColor(color); checkbox->setValue(initial_value); checkbox->initFromXML(node, parent); return checkbox; }
// static void LLCheckBoxCtrl::onButtonPress( void *userdata ) { LLCheckBoxCtrl* self = (LLCheckBoxCtrl*) userdata; if (self->mRadioStyle) { self->setValue(TRUE); } self->setControlValue(self->getValue()); // HACK: because buttons don't normally commit self->onCommit(); if (self->mKeyboardFocusOnClick) { self->setFocus( TRUE ); self->onFocusReceived(); } }
// static void LLFloaterBulkPermission::onCommitPermissions(LLUICtrl* ctrl, void* data) { LLFloaterBulkPermission* self = (LLFloaterBulkPermission*)data; LLCheckBoxCtrl* CheckModify = self->getChild<LLCheckBoxCtrl>("Modify"); LLCheckBoxCtrl* CheckCopy = self->getChild<LLCheckBoxCtrl>("Copy"); LLCheckBoxCtrl* CheckTrans = self->getChild<LLCheckBoxCtrl>("Trans"); self->req_perm_mask=0; if(CheckModify->get()) { self->req_perm_mask|=PERM_MODIFY; } else { self->req_perm_mask&=~PERM_MODIFY; } if(CheckCopy->get()) { self->req_perm_mask|=PERM_COPY; } else { self->req_perm_mask&=~PERM_COPY; } if(CheckTrans->get()) { self->req_perm_mask|=PERM_TRANSFER; } else { self->req_perm_mask&=~PERM_TRANSFER; } }
BOOL LLPanelFace::postBuild() { childSetCommitCallback("combobox shininess",&LLPanelFace::onCommitShiny,this); childSetCommitCallback("combobox bumpiness",&LLPanelFace::onCommitBump,this); childSetCommitCallback("TexScaleU",&LLPanelFace::onCommitTextureInfo, this); childSetCommitCallback("checkbox flip s",&LLPanelFace::onCommitTextureInfo, this); childSetCommitCallback("TexScaleV",&LLPanelFace::onCommitTextureInfo, this); childSetCommitCallback("checkbox flip t",&LLPanelFace::onCommitTextureInfo, this); childSetCommitCallback("TexRot",&LLPanelFace::onCommitTextureInfo, this); childSetAction("button apply",&LLPanelFace::onClickApply,this); childSetCommitCallback("checkbox planar align",&LLPanelFace::onCommitPlanarAlign, this); childSetCommitCallback("TexOffsetU",LLPanelFace::onCommitTextureInfo, this); childSetCommitCallback("TexOffsetV",LLPanelFace::onCommitTextureInfo, this); childSetAction("button align",&LLPanelFace::onClickAutoFix,this); childSetAction("copytextures",&LLPanelFace::onClickCopy,this); childSetAction("pastetextures",&LLPanelFace::onClickPaste,this); LLRect rect = this->getRect(); LLTextureCtrl* mTextureCtrl; LLColorSwatchCtrl* mColorSwatch; LLComboBox* mComboTexGen; LLCheckBoxCtrl *mCheckFullbright; LLTextBox* mLabelColorTransp; LLSpinCtrl* mCtrlColorTransp; // transparency = 1 - alpha LLSpinCtrl* mCtrlGlow; setMouseOpaque(FALSE); mTextureCtrl = getChild<LLTextureCtrl>("texture control"); if(mTextureCtrl) { mTextureCtrl->setDefaultImageAssetID(LLUUID( gSavedSettings.getString( "DefaultObjectTexture" ))); mTextureCtrl->setCommitCallback( boost::bind(&LLPanelFace::onCommitTexture, this, _2) ); mTextureCtrl->setOnCancelCallback( boost::bind(&LLPanelFace::onCancelTexture, this, _2) ); mTextureCtrl->setOnSelectCallback( boost::bind(&LLPanelFace::onSelectTexture, this, _2) ); mTextureCtrl->setDragCallback(boost::bind(&LLPanelFace::onDragTexture, this, _2)); mTextureCtrl->setOnTextureSelectedCallback(boost::bind(&LLPanelFace::onTextureSelectionChanged, this, _1)); mTextureCtrl->setFollowsTop(); mTextureCtrl->setFollowsLeft(); mTextureCtrl->setImmediateFilterPermMask(PERM_NONE); mTextureCtrl->setDnDFilterPermMask(PERM_COPY | PERM_TRANSFER); } mColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); if(mColorSwatch) { mColorSwatch->setCommitCallback(boost::bind(&LLPanelFace::onCommitColor, this, _2)); mColorSwatch->setOnCancelCallback(boost::bind(&LLPanelFace::onCancelColor, this, _2)); mColorSwatch->setOnSelectCallback(boost::bind(&LLPanelFace::onSelectColor, this, _2)); mColorSwatch->setFollowsTop(); mColorSwatch->setFollowsLeft(); mColorSwatch->setCanApplyImmediately(TRUE); } mLabelColorTransp = getChild<LLTextBox>("color trans"); if(mLabelColorTransp) { mLabelColorTransp->setFollowsTop(); mLabelColorTransp->setFollowsLeft(); } mCtrlColorTransp = getChild<LLSpinCtrl>("ColorTrans"); if(mCtrlColorTransp) { mCtrlColorTransp->setCommitCallback(boost::bind(&LLPanelFace::onCommitAlpha, this, _2)); mCtrlColorTransp->setPrecision(0); mCtrlColorTransp->setFollowsTop(); mCtrlColorTransp->setFollowsLeft(); } mCheckFullbright = getChild<LLCheckBoxCtrl>("checkbox fullbright"); if (mCheckFullbright) { mCheckFullbright->setCommitCallback(LLPanelFace::onCommitFullbright, this); } mComboTexGen = getChild<LLComboBox>("combobox texgen"); if(mComboTexGen) { mComboTexGen->setCommitCallback(LLPanelFace::onCommitTexGen, this); mComboTexGen->setFollows(FOLLOWS_LEFT | FOLLOWS_TOP); } mCtrlGlow = getChild<LLSpinCtrl>("glow"); if(mCtrlGlow) { mCtrlGlow->setCommitCallback(LLPanelFace::onCommitGlow, this); } clearCtrls(); return TRUE; }
virtual bool apply(LLViewerObject* object, S32 te) { BOOL valid; F32 value; LLSpinCtrl* ctrlTexScaleS = mPanel->getChild<LLSpinCtrl>("TexScaleU"); LLSpinCtrl* ctrlTexScaleT = mPanel->getChild<LLSpinCtrl>("TexScaleV"); LLSpinCtrl* ctrlTexOffsetS = mPanel->getChild<LLSpinCtrl>("TexOffsetU"); LLSpinCtrl* ctrlTexOffsetT = mPanel->getChild<LLSpinCtrl>("TexOffsetV"); LLSpinCtrl* ctrlTexRotation = mPanel->getChild<LLSpinCtrl>("TexRot"); LLCheckBoxCtrl* checkFlipScaleS = mPanel->getChild<LLCheckBoxCtrl>("checkbox flip s"); LLCheckBoxCtrl* checkFlipScaleT = mPanel->getChild<LLCheckBoxCtrl>("checkbox flip t"); LLComboBox* comboTexGen = mPanel->getChild<LLComboBox>("combobox texgen"); llassert(comboTexGen); llassert(object); if (ctrlTexScaleS) { valid = !ctrlTexScaleS->getTentative() || !checkFlipScaleS->getTentative(); if (valid) { value = ctrlTexScaleS->get(); if( checkFlipScaleS->get() ) { value = -value; } if (comboTexGen && comboTexGen->getCurrentIndex() == 1) { value *= 0.5f; } object->setTEScaleS( te, value ); } } if (ctrlTexScaleT) { valid = !ctrlTexScaleT->getTentative() || !checkFlipScaleT->getTentative(); if (valid) { value = ctrlTexScaleT->get(); if( checkFlipScaleT->get() ) { value = -value; } if (comboTexGen && comboTexGen->getCurrentIndex() == 1) { value *= 0.5f; } object->setTEScaleT( te, value ); } } if (ctrlTexOffsetS) { valid = !ctrlTexOffsetS->getTentative(); if (valid) { value = ctrlTexOffsetS->get(); object->setTEOffsetS( te, value ); } } if (ctrlTexOffsetT) { valid = !ctrlTexOffsetT->getTentative(); if (valid) { value = ctrlTexOffsetT->get(); object->setTEOffsetT( te, value ); } } if (ctrlTexRotation) { valid = !ctrlTexRotation->getTentative(); if (valid) { value = ctrlTexRotation->get() * DEG_TO_RAD; object->setTERotation( te, value ); } } return true; }
void LLFloaterBuyLandUI::updateCovenantInfo() { LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); if(!region) return; U8 sim_access = region->getSimAccess(); std::string rating = LLViewerRegion::accessToString(sim_access); LLTextBox* region_name = getChild<LLTextBox>("region_name_text"); if (region_name) { std::string region_name_txt = region->getName() + " ("+rating +")"; region_name->setText(region_name_txt); LLIconCtrl* rating_icon = getChild<LLIconCtrl>("rating_icon"); LLRect rect = rating_icon->getRect(); S32 region_name_width = llmin(region_name->getRect().getWidth(), region_name->getTextBoundingRect().getWidth()); S32 icon_left_pad = region_name->getRect().mLeft + region_name_width + ICON_PAD; region_name->setToolTip(region_name->getText()); rating_icon->setRect(rect.setOriginAndSize(icon_left_pad, rect.mBottom, rect.getWidth(), rect.getHeight())); switch(sim_access) { case SIM_ACCESS_PG: rating_icon->setValue(getString("icon_PG")); break; case SIM_ACCESS_ADULT: rating_icon->setValue(getString("icon_R")); break; default: rating_icon->setValue(getString("icon_M")); } } LLTextBox* region_type = getChild<LLTextBox>("region_type_text"); if (region_type) { region_type->setText(region->getLocalizedSimProductName()); region_type->setToolTip(region->getLocalizedSimProductName()); } LLTextBox* resellable_clause = getChild<LLTextBox>("resellable_clause"); if (resellable_clause) { if (region->getRegionFlags() & REGION_FLAGS_BLOCK_LAND_RESELL) { resellable_clause->setText(getString("can_not_resell")); } else { resellable_clause->setText(getString("can_resell")); } } LLTextBox* changeable_clause = getChild<LLTextBox>("changeable_clause"); if (changeable_clause) { if (region->getRegionFlags() & REGION_FLAGS_ALLOW_PARCEL_CHANGES) { changeable_clause->setText(getString("can_change")); } else { changeable_clause->setText(getString("can_not_change")); } } LLCheckBoxCtrl* check = getChild<LLCheckBoxCtrl>("agree_covenant"); if(check) { check->set(false); check->setEnabled(true); check->setCommitCallback(onChangeAgreeCovenant, this); } LLTextBox* box = getChild<LLTextBox>("covenant_text"); if(box) { box->setVisible(FALSE); } // send EstateCovenantInfo message LLMessageSystem *msg = gMessageSystem; msg->newMessage("EstateCovenantRequest"); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID,gAgent.getSessionID()); msg->sendReliable(region->getHost()); }
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); }