aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llgivemoney.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llgivemoney.cpp')
-rw-r--r--linden/indra/newview/llgivemoney.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/linden/indra/newview/llgivemoney.cpp b/linden/indra/newview/llgivemoney.cpp
index 3722682..e89ab3d 100644
--- a/linden/indra/newview/llgivemoney.cpp
+++ b/linden/indra/newview/llgivemoney.cpp
@@ -155,7 +155,7 @@ LLFloaterPay::LLFloaterPay(const std::string& name,
155 155
156 childSetKeystrokeCallback("amount", &LLFloaterPay::onKeystroke, this); 156 childSetKeystrokeCallback("amount", &LLFloaterPay::onKeystroke, this);
157 childSetText("amount", last_amount); 157 childSetText("amount", last_amount);
158 childSetPrevalidate("amount", LLLineEditor::prevalidatePositiveS32); 158 childSetPrevalidate("amount", LLLineEditor::prevalidateNonNegativeS32);
159 159
160 info = new LLGiveMoneyInfo(this, 0); 160 info = new LLGiveMoneyInfo(this, 0);
161 mCallbackData.push_back(info); 161 mCallbackData.push_back(info);
@@ -422,14 +422,9 @@ void LLFloaterPay::onKeystroke(LLLineEditor*, void* data)
422 LLFloaterPay* self = reinterpret_cast<LLFloaterPay*>(data); 422 LLFloaterPay* self = reinterpret_cast<LLFloaterPay*>(data);
423 if(self) 423 if(self)
424 { 424 {
425 if (!self->childGetText("amount").empty()) 425 // enable the Pay button when amount is non-empty and positive, disable otherwise
426 { 426 LLString amtstr = self->childGetText("amount");
427 self->childSetEnabled("pay btn", TRUE); 427 self->childSetEnabled("pay btn", !amtstr.empty() && atoi(amtstr.c_str()) > 0);
428 }
429 else
430 {
431 self->childSetEnabled("pay btn", FALSE);
432 }
433 } 428 }
434} 429}
435 430