From 00b0cd41468cd2b64badc782381c85e8bb7d1f12 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 28 Aug 2015 20:09:01 +0200 Subject: [PATCH] FIRE-16812: Remember last amount paid again --- indra/newview/llfloaterpay.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/indra/newview/llfloaterpay.cpp b/indra/newview/llfloaterpay.cpp index 0eff177701..89813cbb16 100755 --- a/indra/newview/llfloaterpay.cpp +++ b/indra/newview/llfloaterpay.cpp @@ -118,9 +118,13 @@ protected: LLGiveMoneyInfo* mQuickPayInfo[MAX_PAY_BUTTONS]; LLSafeHandle mObjectSelection; + + // FIRE-16812: Remember last amount paid + static S32 sLastAmount; }; - +// FIRE-16812: Remember last amount paid +S32 LLFloaterPay::sLastAmount = 0; const S32 FASTPAY_BUTTON_WIDTH = 80; // FIRE-16092: Make payment confirmation customizable //const S32 PAY_AMOUNT_NOTIFICATION = 200; @@ -197,6 +201,14 @@ BOOL LLFloaterPay::postBuild() getChild("amount")->setKeystrokeCallback(&LLFloaterPay::onKeystroke, this); getChild("amount")->setPrevalidate(LLTextValidate::validateNonNegativeS32); + // FIRE-16812: Remember last amount paid + std::string last_amount; + if (sLastAmount > 0) + { + last_amount = llformat("%d", sLastAmount); + } + getChild("amount")->setValue(last_amount); + // info = new LLGiveMoneyInfo(this, 0); mCallbackData.push_back(info); @@ -204,7 +216,10 @@ BOOL LLFloaterPay::postBuild() childSetAction("pay btn",&LLFloaterPay::onGive,info); setDefaultBtn("pay btn"); getChildView("pay btn")->setVisible(FALSE); - getChildView("pay btn")->setEnabled(FALSE); + // FIRE-16812: Remember last amount paid + //getChildView("pay btn")->setEnabled(FALSE); + getChildView("pay btn")->setEnabled((sLastAmount > 0)); + // childSetAction("cancel btn",&LLFloaterPay::onCancel,this); @@ -549,6 +564,8 @@ void LLFloaterPay::give(S32 amount) { amount = atoi(getChild("amount")->getValue().asString().c_str()); } + // FIRE-16812: Remember last amount paid + sLastAmount = amount; // Try to pay an object. if (mObjectSelection.notNull())