|
|
@ -60,7 +60,7 @@ public class PaymentController extends WalletFormController implements Initializ |
|
|
|
private FiatLabel fiatAmount; |
|
|
|
|
|
|
|
@FXML |
|
|
|
private Button maxButton; |
|
|
|
private ToggleButton maxButton; |
|
|
|
|
|
|
|
@FXML |
|
|
|
private Button addPaymentButton; |
|
|
@ -72,6 +72,11 @@ public class PaymentController extends WalletFormController implements Initializ |
|
|
|
sendController.utxoSelectorProperty().setValue(null); |
|
|
|
} |
|
|
|
|
|
|
|
for(Tab tab : sendController.getPaymentTabs().getTabs()) { |
|
|
|
PaymentController controller = (PaymentController) tab.getUserData(); |
|
|
|
controller.setSendMax(false); |
|
|
|
} |
|
|
|
|
|
|
|
Long recipientValueSats = getRecipientValueSats(); |
|
|
|
if(recipientValueSats != null) { |
|
|
|
setFiatAmount(AppServices.getFiatCurrencyExchangeRate(), recipientValueSats); |
|
|
@ -235,7 +240,7 @@ public class PaymentController extends WalletFormController implements Initializ |
|
|
|
} |
|
|
|
|
|
|
|
public Payment getPayment() { |
|
|
|
return getPayment(false); |
|
|
|
return getPayment(isSendMax()); |
|
|
|
} |
|
|
|
|
|
|
|
public Payment getPayment(boolean sendAll) { |
|
|
@ -273,6 +278,7 @@ public class PaymentController extends WalletFormController implements Initializ |
|
|
|
amount.textProperty().addListener(amountListener); |
|
|
|
|
|
|
|
fiatAmount.setText(""); |
|
|
|
setSendMax(false); |
|
|
|
} |
|
|
|
|
|
|
|
public void setMaxInput(ActionEvent event) { |
|
|
@ -287,9 +293,11 @@ public class PaymentController extends WalletFormController implements Initializ |
|
|
|
for(Tab tab : sendController.getPaymentTabs().getTabs()) { |
|
|
|
PaymentController controller = (PaymentController)tab.getUserData(); |
|
|
|
if(controller != this) { |
|
|
|
controller.setSendMax(false); |
|
|
|
payments.add(controller.getPayment()); |
|
|
|
} else { |
|
|
|
payments.add(getPayment(true)); |
|
|
|
setSendMax(true); |
|
|
|
payments.add(getPayment()); |
|
|
|
} |
|
|
|
} |
|
|
|
sendController.updateTransaction(payments); |
|
|
@ -333,6 +341,14 @@ public class PaymentController extends WalletFormController implements Initializ |
|
|
|
return addPaymentButton; |
|
|
|
} |
|
|
|
|
|
|
|
public boolean isSendMax() { |
|
|
|
return maxButton.isSelected(); |
|
|
|
} |
|
|
|
|
|
|
|
public void setSendMax(boolean sendMax) { |
|
|
|
maxButton.setSelected(sendMax); |
|
|
|
} |
|
|
|
|
|
|
|
@Subscribe |
|
|
|
public void bitcoinUnitChanged(BitcoinUnitChangedEvent event) { |
|
|
|
BitcoinUnit unit = sendController.getBitcoinUnit(event.getBitcoinUnit()); |
|
|
|