本文整理汇总了C++中LLCurrencyUIManager类的典型用法代码示例。如果您正苦于以下问题:C++ LLCurrencyUIManager类的具体用法?C++ LLCurrencyUIManager怎么用?C++ LLCurrencyUIManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LLCurrencyUIManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runWebSitePrep
void LLFloaterBuyLandUI::runWebSitePrep(const std::string& password)
{
if (!mCanBuy)
{
return;
}
BOOL remove_contribution = getChild<LLUICtrl>("remove_contribution")->getValue().asBoolean();
mParcelBuyInfo = LLViewerParcelMgr::getInstance()->setupParcelBuy(gAgent.getID(), gAgent.getSessionID(),
gAgent.getGroupID(), mIsForGroup, mIsClaim, remove_contribution);
if (mParcelBuyInfo
&& !mSiteMembershipUpgrade
&& !mSiteLandUseUpgrade
&& mCurrency.getAmount() == 0
&& mSiteConfirm != "password")
{
sendBuyLand();
return;
}
std::string newLevel = "noChange";
if (mSiteMembershipUpgrade)
{
LLComboBox* levels = getChild<LLComboBox>( "account_level");
if (levels)
{
mUserPlanChoice = levels->getCurrentIndex();
newLevel = mSiteMembershipPlanIDs[mUserPlanChoice];
}
}
LLXMLRPCValue keywordArgs = LLXMLRPCValue::createStruct();
keywordArgs.appendString("agentId", gAgent.getID().asString());
keywordArgs.appendString(
"secureSessionId",
gAgent.getSecureSessionID().asString());
keywordArgs.appendString("language", LLUI::getLanguage());
keywordArgs.appendString("levelId", newLevel);
keywordArgs.appendInt("billableArea",
mIsForGroup ? 0 : mParcelBillableArea);
keywordArgs.appendInt("currencyBuy", mCurrency.getAmount());
keywordArgs.appendInt("estimatedCost", mCurrency.getUSDEstimate());
keywordArgs.appendString("estimatedLocalCost", mCurrency.getLocalEstimate());
keywordArgs.appendString("confirm", mSiteConfirm);
if (!password.empty())
{
keywordArgs.appendString("password", password);
}
LLXMLRPCValue params = LLXMLRPCValue::createArray();
params.append(keywordArgs);
startTransaction(TransactionBuy, params);
}
示例2: draw
void LLFloaterBuyCurrencyUI::draw()
{
if (mManager.process())
{
if (mManager.bought())
{
close();
return;
}
updateUI();
}
LLFloater::draw();
}
示例3: onClickBuy
void LLFloaterBuyCurrencyUI::onClickBuy()
{
mManager.buy(getString("buy_currency"));
updateUI();
// Update L$ balance
LLStatusBar::sendMoneyBalanceRequest();
}
示例4: onClickErrorWeb
void LLFloaterBuyCurrencyUI::onClickErrorWeb()
{
LLWeb::loadURLExternal(mManager.errorURI());
closeFloater();
// Update L$ balance
LLStatusBar::sendMoneyBalanceRequest();
}
示例5: finishWebSiteInfo
void LLFloaterBuyLandUI::finishWebSiteInfo()
{
LLXMLRPCValue result = mTransaction->responseValue();
mSiteValid = result["success"].asBool();
if (!mSiteValid)
{
tellUserError(
result["errorMessage"].asString(),
result["errorURI"].asString()
);
return;
}
LLXMLRPCValue membership = result["membership"];
mSiteMembershipUpgrade = membership["upgrade"].asBool();
mSiteMembershipAction = membership["action"].asString();
mSiteMembershipPlanIDs.clear();
mSiteMembershipPlanNames.clear();
LLXMLRPCValue levels = membership["levels"];
for (LLXMLRPCValue level = levels.rewind();
level.isValid();
level = levels.next())
{
mSiteMembershipPlanIDs.push_back(level["id"].asString());
mSiteMembershipPlanNames.push_back(level["description"].asString());
}
mUserPlanChoice = 0;
LLXMLRPCValue landUse = result["landUse"];
mSiteLandUseUpgrade = landUse["upgrade"].asBool();
mSiteLandUseAction = landUse["action"].asString();
LLXMLRPCValue currency = result["currency"];
if (currency["estimatedCost"].isValid())
{
mCurrency.setUSDEstimate(currency["estimatedCost"].asInt());
}
if (currency["estimatedLocalCost"].isValid())
{
mCurrency.setLocalEstimate(currency["estimatedLocalCost"].asString());
}
mSiteConfirm = result["confirm"].asString();
}
示例6: startBuyPreConfirm
void LLFloaterBuyLandUI::startBuyPreConfirm()
{
std::string action;
std::string type_currency = LLGridManager::getInstance()->getCurrency();
if (mSiteMembershipUpgrade)
{
action += mSiteMembershipAction;
action += "\n";
LLComboBox* levels = getChild<LLComboBox>( "account_level");
if (levels)
{
action += " * ";
action += mSiteMembershipPlanNames[levels->getCurrentIndex()];
action += "\n";
}
}
if (mSiteLandUseUpgrade)
{
action += mSiteLandUseAction;
action += "\n";
}
if (mCurrency.getAmount() > 0)
{
LLStringUtil::format_map_t string_args;
string_args["[AMOUNT]"] = llformat("%d", mCurrency.getAmount());
string_args["[LOCAL_AMOUNT]"] = mCurrency.getLocalEstimate();
string_args["[CUR]"] = type_currency;
action += getString("buy_for_US", string_args);
}
LLStringUtil::format_map_t string_args;
string_args["[AMOUNT]"] = llformat("%d", mParcelPrice);
string_args["[SELLER]"] = mParcelSellerName;
string_args["[CUR]"] = type_currency;
action += getString("pay_to_for_land", string_args);
LLConfirmationManager::confirm(mSiteConfirm,
action,
*this,
&LLFloaterBuyLandUI::startBuyPostConfirm);
}
示例7: startBuyPreConfirm
void LLFloaterBuyLandUI::startBuyPreConfirm()
{
std::string action;
if (mSiteMembershipUpgrade)
{
action += mSiteMembershipAction;
action += "\n";
LLComboBox* levels = getChild<LLComboBox>( "account_level");
if (levels)
{
action += " * ";
action += mSiteMembershipPlanNames[levels->getCurrentIndex()];
action += "\n";
}
}
if (mSiteLandUseUpgrade)
{
action += mSiteLandUseAction;
action += "\n";
}
if (mCurrency.getAmount() > 0)
{
LLStringUtil::format_map_t string_args;
string_args["[AMOUNT]"] = llformat("%d", mCurrency.getAmount());
string_args["[AMOUNT2]"] = llformat("%#.2f", mCurrency.getEstimate() / 100.0);
string_args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol();
action += getString("buy_for_US", string_args);
}
LLStringUtil::format_map_t string_args;
string_args["[AMOUNT]"] = llformat("%d", mParcelPrice);
string_args["[SELLER]"] = mParcelSellerName;
string_args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol();
action += getString("pay_to_for_land", string_args);
LLConfirmationManager::confirm(mSiteConfirm,
action,
*this,
&LLFloaterBuyLandUI::startBuyPostConfirm);
}
示例8: draw
void LLFloaterBuyCurrencyUI::draw()
{
if (mManager.process())
{
if (mManager.bought())
{
LLNotificationsUtil::add("BuyLindenDollarSuccess");
closeFloater();
return;
}
updateUI();
}
// disable the Buy button when we are not able to buy
getChildView("buy_btn")->setEnabled(mManager.canBuy());
LLFloater::draw();
}
示例9: canClose
// virtual
BOOL LLFloaterBuyLandUI::canClose()
{
bool can_close = (mTransaction ? FALSE : TRUE) && mCurrency.canCancel();
if (!can_close)
{
// explain to user why they can't do this, see DEV-9605
LLNotificationsUtil::add("CannotCloseFloaterBuyLand");
}
return can_close;
}
示例10: postBuild
// virtual
BOOL LLFloaterBuyLandUI::postBuild()
{
mCurrency.prepare();
childSetAction("buy_btn", onClickBuy, this);
childSetAction("cancel_btn", onClickCancel, this);
childSetAction("error_web", onClickErrorWeb, this);
return TRUE;
}
示例11: canClose
// virtual
BOOL LLFloaterBuyLandUI::canClose()
{
bool can_close = (mTransaction ? FALSE : TRUE) && mCurrency.canCancel();
if (!can_close)
{
// explain to user why they can't do this, see DEV-9605
gViewerWindow->alertXml("CannotCloseFloaterBuyLand");
}
return can_close;
}
示例12: draw
void LLFloaterBuyCurrencyUI::draw()
{
if (mManager.process())
{
if (mManager.bought())
{
std::string type_currency = LLGridManager::getInstance()->getCurrency();
LLSD args;
args["CUR"] = type_currency;
LLNotificationsUtil::add("BuyLindenDollarSuccess", args);
closeFloater();
return;
}
updateUI();
}
// disable the Buy button when we are not able to buy
getChildView("buy_btn")->setEnabled(mManager.canBuy());
LLFloater::draw();
}
示例13: draw
void LLFloaterBuyLandUI::draw()
{
LLFloater::draw();
bool needsUpdate = false;
needsUpdate |= checkTransaction();
needsUpdate |= mCurrency.process();
if (mBought)
{
closeFloater();
}
else if (needsUpdate)
{
if (mCanBuy && mCurrency.hasError())
{
tellUserError(mCurrency.errorMessage(), mCurrency.errorURI());
}
refreshUI();
}
}
示例14: postBuild
// virtual
BOOL LLFloaterBuyLandUI::postBuild()
{
setVisibleCallback(boost::bind(&LLFloaterBuyLandUI::onVisibilityChange, this, _2));
mCurrency.prepare();
getChild<LLUICtrl>("buy_btn")->setCommitCallback( boost::bind(&LLFloaterBuyLandUI::onClickBuy, this));
getChild<LLUICtrl>("cancel_btn")->setCommitCallback( boost::bind(&LLFloaterBuyLandUI::onClickCancel, this));
getChild<LLUICtrl>("error_web")->setCommitCallback( boost::bind(&LLFloaterBuyLandUI::onClickErrorWeb, this));
center();
return TRUE;
}
示例15: postBuild
// virtual
BOOL LLFloaterBuyCurrencyUI::postBuild()
{
mManager.prepare();
getChild<LLUICtrl>("buy_btn")->setCommitCallback( boost::bind(&LLFloaterBuyCurrencyUI::onClickBuy, this));
getChild<LLUICtrl>("cancel_btn")->setCommitCallback( boost::bind(&LLFloaterBuyCurrencyUI::onClickCancel, this));
getChild<LLUICtrl>("error_web")->setCommitCallback( boost::bind(&LLFloaterBuyCurrencyUI::onClickErrorWeb, this));
center();
updateUI();
return TRUE;
}