File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 66#include < QMessageBox>
77#include < string>
88
9+ #include < qt/navcoinunits.h>
10+
911#include < base58.h>
1012#include < consensus/cfund.h>
1113#include < qt/guiconstants.h>
@@ -192,11 +194,18 @@ void CommunityFundCreatePaymentRequestDialog::click_pushButtonSubmitPaymentReque
192194 // Validate requested amount
193195 if (nReqAmount <= 0 || nReqAmount > proposal.GetAvailable (*pcoinsTip, true )) {
194196 QMessageBox msgBox (this );
195- std::string str = " Cannot create a Payment Request for the requested amount\n " ;
196- msgBox.setText (tr (str.c_str ()));
197+ QString str = tr (" Requested amount must be greater than 0 NAV (Zero)\n " );
198+ if (nReqAmount > proposal.GetAvailable (*pcoinsTip, true )) {
199+ str = tr (" Requested amount %1 is more than avaible coins in the proposal (%2)\n " )
200+ .arg (
201+ NavCoinUnits::formatWithUnit (NavCoinUnits::NAV, nReqAmount),
202+ NavCoinUnits::formatWithUnit (NavCoinUnits::NAV, proposal.GetAvailable (*pcoinsTip, true ))
203+ );
204+ }
205+ msgBox.setText (str);
197206 msgBox.addButton (tr (" Ok" ), QMessageBox::AcceptRole);
198207 msgBox.setIcon (QMessageBox::Warning);
199- msgBox.setWindowTitle (" Invalid Amount" );
208+ msgBox.setWindowTitle (tr ( " Invalid Amount" ) );
200209 msgBox.exec ();
201210 return ;
202211 }
You can’t perform that action at this time.
0 commit comments