diff options
author | Jacek Antonelli | 2008-09-06 18:24:57 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-06 18:25:07 -0500 |
commit | 798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch) | |
tree | 1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llgivemoney.cpp | |
parent | Second Life viewer sources 1.20.15 (diff) | |
download | meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2 meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz |
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/newview/llgivemoney.cpp')
-rw-r--r-- | linden/indra/newview/llgivemoney.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/linden/indra/newview/llgivemoney.cpp b/linden/indra/newview/llgivemoney.cpp index 016acd5..82fead1 100644 --- a/linden/indra/newview/llgivemoney.cpp +++ b/linden/indra/newview/llgivemoney.cpp | |||
@@ -55,8 +55,6 @@ | |||
55 | /// Local function declarations, constants, enums, and typedefs | 55 | /// Local function declarations, constants, enums, and typedefs |
56 | ///---------------------------------------------------------------------------- | 56 | ///---------------------------------------------------------------------------- |
57 | 57 | ||
58 | const char* GIVE_MONEY_TITLE = ""; // Dialog contains text "Pay" | ||
59 | |||
60 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 58 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
61 | // Class LLGiveMoneyInfo | 59 | // Class LLGiveMoneyInfo |
62 | // | 60 | // |
@@ -84,7 +82,7 @@ LLFloaterPay::LLFloaterPay(const std::string& name, | |||
84 | money_callback callback, | 82 | money_callback callback, |
85 | const LLUUID& uuid, | 83 | const LLUUID& uuid, |
86 | BOOL target_is_object) : | 84 | BOOL target_is_object) : |
87 | LLFloater(name, "FloaterPayRectB", GIVE_MONEY_TITLE, RESIZE_NO, | 85 | LLFloater(name, std::string("FloaterPayRectB"), LLStringUtil::null, RESIZE_NO, |
88 | DEFAULT_MIN_WIDTH, DEFAULT_MIN_HEIGHT, DRAG_ON_TOP, | 86 | DEFAULT_MIN_WIDTH, DEFAULT_MIN_HEIGHT, DRAG_ON_TOP, |
89 | MINIMIZE_NO, CLOSE_YES), | 87 | MINIMIZE_NO, CLOSE_YES), |
90 | mCallbackData(), | 88 | mCallbackData(), |
@@ -150,7 +148,7 @@ LLFloaterPay::LLFloaterPay(const std::string& name, | |||
150 | 148 | ||
151 | childSetVisible("amount text", FALSE); | 149 | childSetVisible("amount text", FALSE); |
152 | 150 | ||
153 | LLString last_amount; | 151 | std::string last_amount; |
154 | if(sLastAmount > 0) | 152 | if(sLastAmount > 0) |
155 | { | 153 | { |
156 | last_amount = llformat("%d", sLastAmount); | 154 | last_amount = llformat("%d", sLastAmount); |
@@ -241,7 +239,7 @@ void LLFloaterPay::processPayPriceReply(LLMessageSystem* msg, void **userdata) | |||
241 | msg->getS32Fast(_PREHASH_ButtonData,_PREHASH_PayButton,pay_button,i); | 239 | msg->getS32Fast(_PREHASH_ButtonData,_PREHASH_PayButton,pay_button,i); |
242 | if (pay_button > 0) | 240 | if (pay_button > 0) |
243 | { | 241 | { |
244 | LLString button_str = "L$"; | 242 | std::string button_str = "L$"; |
245 | button_str += LLResMgr::getInstance()->getMonetaryString( pay_button ); | 243 | button_str += LLResMgr::getInstance()->getMonetaryString( pay_button ); |
246 | 244 | ||
247 | self->mQuickPayButton[i]->setLabelSelected(button_str); | 245 | self->mQuickPayButton[i]->setLabelSelected(button_str); |
@@ -262,10 +260,10 @@ void LLFloaterPay::processPayPriceReply(LLMessageSystem* msg, void **userdata) | |||
262 | } | 260 | } |
263 | 261 | ||
264 | // build a string containing the maximum value and calc nerw button width from it. | 262 | // build a string containing the maximum value and calc nerw button width from it. |
265 | LLString balance_str = "L$"; | 263 | std::string balance_str = "L$"; |
266 | balance_str += LLResMgr::getInstance()->getMonetaryString( max_pay_amount ); | 264 | balance_str += LLResMgr::getInstance()->getMonetaryString( max_pay_amount ); |
267 | const LLFontGL* font = LLResMgr::getInstance()->getRes(LLFONT_SANSSERIF); | 265 | const LLFontGL* font = LLResMgr::getInstance()->getRes(LLFONT_SANSSERIF); |
268 | S32 new_button_width = font->getWidth( LLString(balance_str)); | 266 | S32 new_button_width = font->getWidth( std::string(balance_str)); |
269 | new_button_width += ( 12 + 12 ); // padding | 267 | new_button_width += ( 12 + 12 ); // padding |
270 | 268 | ||
271 | // dialong is sized for 2 digit pay amounts - larger pay values need to be scaled | 269 | // dialong is sized for 2 digit pay amounts - larger pay values need to be scaled |
@@ -276,7 +274,7 @@ void LLFloaterPay::processPayPriceReply(LLMessageSystem* msg, void **userdata) | |||
276 | S32 num_digits_max = (S32)log10((double)max_pay_amount) + 1; | 274 | S32 num_digits_max = (S32)log10((double)max_pay_amount) + 1; |
277 | 275 | ||
278 | // calculate the extra width required by 2 buttons with max amount and some commas | 276 | // calculate the extra width required by 2 buttons with max amount and some commas |
279 | padding_required = ( num_digits_max - num_digits_threshold + ( num_digits_max / 3 ) ) * font->getWidth( "0" ); | 277 | padding_required = ( num_digits_max - num_digits_threshold + ( num_digits_max / 3 ) ) * font->getWidth( std::string("0") ); |
280 | }; | 278 | }; |
281 | 279 | ||
282 | // change in button width | 280 | // change in button width |
@@ -388,8 +386,8 @@ void LLFloaterPay::finishPayUI(const LLUUID& target_id, BOOL is_group) | |||
388 | 386 | ||
389 | // static | 387 | // static |
390 | void LLFloaterPay::onCacheOwnerName(const LLUUID& owner_id, | 388 | void LLFloaterPay::onCacheOwnerName(const LLUUID& owner_id, |
391 | const char* firstname, | 389 | const std::string& firstname, |
392 | const char* lastname, | 390 | const std::string& lastname, |
393 | BOOL is_group, | 391 | BOOL is_group, |
394 | void* userdata) | 392 | void* userdata) |
395 | { | 393 | { |
@@ -407,8 +405,8 @@ void LLFloaterPay::onCacheOwnerName(const LLUUID& owner_id, | |||
407 | self->childSetVisible("payee_resident",true); | 405 | self->childSetVisible("payee_resident",true); |
408 | } | 406 | } |
409 | 407 | ||
410 | self->childSetTextArg("payee_name", "[FIRST]", LLString(firstname)); | 408 | self->childSetTextArg("payee_name", "[FIRST]", firstname); |
411 | self->childSetTextArg("payee_name", "[LAST]", LLString(lastname)); | 409 | self->childSetTextArg("payee_name", "[LAST]", lastname); |
412 | } | 410 | } |
413 | 411 | ||
414 | // static | 412 | // static |
@@ -428,7 +426,7 @@ void LLFloaterPay::onKeystroke(LLLineEditor*, void* data) | |||
428 | if(self) | 426 | if(self) |
429 | { | 427 | { |
430 | // enable the Pay button when amount is non-empty and positive, disable otherwise | 428 | // enable the Pay button when amount is non-empty and positive, disable otherwise |
431 | LLString amtstr = self->childGetText("amount"); | 429 | std::string amtstr = self->childGetText("amount"); |
432 | self->childSetEnabled("pay btn", !amtstr.empty() && atoi(amtstr.c_str()) > 0); | 430 | self->childSetEnabled("pay btn", !amtstr.empty() && atoi(amtstr.c_str()) > 0); |
433 | } | 431 | } |
434 | } | 432 | } |
@@ -467,7 +465,7 @@ void LLFloaterPay::give(S32 amount) | |||
467 | { | 465 | { |
468 | // Find the name of the root object | 466 | // Find the name of the root object |
469 | LLSelectNode* node = mObjectSelection->getFirstRootNode(); | 467 | LLSelectNode* node = mObjectSelection->getFirstRootNode(); |
470 | LLString object_name; | 468 | std::string object_name; |
471 | if (node) | 469 | if (node) |
472 | { | 470 | { |
473 | object_name = node->mName; | 471 | object_name = node->mName; |
@@ -493,7 +491,7 @@ void LLFloaterPay::give(S32 amount) | |||
493 | else | 491 | else |
494 | { | 492 | { |
495 | // just transfer the L$ | 493 | // just transfer the L$ |
496 | mCallback(mTargetUUID, gAgent.getRegion(), amount, mTargetIsGroup, TRANS_GIFT, LLString::null); | 494 | mCallback(mTargetUUID, gAgent.getRegion(), amount, mTargetIsGroup, TRANS_GIFT, LLStringUtil::null); |
497 | 495 | ||
498 | // check if the payee needs to be unmuted | 496 | // check if the payee needs to be unmuted |
499 | LLMuteList::getInstance()->autoRemove(mTargetUUID, LLMuteList::AR_MONEY); | 497 | LLMuteList::getInstance()->autoRemove(mTargetUUID, LLMuteList::AR_MONEY); |