mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Edit account names - altcoin forms
This commit is contained in:
parent
e8ee3fa4c3
commit
702a31f1d6
@ -166,15 +166,14 @@ public class AssetsForm extends PaymentMethodForm {
|
||||
@Override
|
||||
protected void autoFillNameTextField() {
|
||||
if (useCustomAccountNameToggleButton != null && !useCustomAccountNameToggleButton.isSelected()) {
|
||||
accountNameTextField.setText(createAssetsAccountName(paymentAccount, addressInputTextField.getText()));
|
||||
accountNameTextField.setText(createAssetsAccountName(paymentAccount, assetAccount.getAddress()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addFormForEditAccount() {
|
||||
gridRowFrom = gridRow;
|
||||
addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"),
|
||||
assetAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
|
||||
addAccountNameTextFieldWithAutoFillToggleButton();
|
||||
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"),
|
||||
Res.get(assetAccount.getPaymentMethod().getId()));
|
||||
Tuple3<Label, TextField, VBox> tuple2 = addCompactTopLabelTextField(gridPane, ++gridRow,
|
||||
|
@ -101,6 +101,12 @@ class AltCoinAccountsDataModel extends ActivatableDataModel {
|
||||
TradeCurrency singleTradeCurrency = paymentAccount.getSingleTradeCurrency();
|
||||
preferences.addCryptoCurrency((CryptoCurrency) singleTradeCurrency);
|
||||
user.addPaymentAccount(paymentAccount);
|
||||
paymentAccount.onPersistChanges();
|
||||
}
|
||||
|
||||
public void onUpdateAccount(PaymentAccount paymentAccount) {
|
||||
paymentAccount.onPersistChanges();
|
||||
user.requestPersistence();
|
||||
}
|
||||
|
||||
public boolean onDeleteAccount(PaymentAccount paymentAccount) {
|
||||
|
@ -168,6 +168,16 @@ public class AltCoinAccountsView extends PaymentAccountsView<GridPane, AltCoinAc
|
||||
preferences.dontShowAgain(INSTANT_TRADE_NEWS, true);
|
||||
}
|
||||
|
||||
private void onUpdateAccount(PaymentAccount paymentAccount) {
|
||||
model.onUpdateAccount(paymentAccount);
|
||||
removeSelectAccountForm();
|
||||
}
|
||||
|
||||
private void onCancelSelectedAccount(PaymentAccount paymentAccount) {
|
||||
paymentAccount.revertChanges();
|
||||
removeSelectAccountForm();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Base form
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -220,11 +230,20 @@ public class AltCoinAccountsView extends PaymentAccountsView<GridPane, AltCoinAc
|
||||
paymentMethodForm = getPaymentMethodForm(paymentAccount);
|
||||
paymentMethodForm.addFormForEditAccount();
|
||||
gridRow = paymentMethodForm.getGridRow();
|
||||
Tuple2<Button, Button> tuple = add2ButtonsAfterGroup(root, ++gridRow, Res.get("shared.deleteAccount"), Res.get("shared.cancel"));
|
||||
Button deleteAccountButton = tuple.first;
|
||||
Tuple3<Button, Button, Button> tuple = add3ButtonsAfterGroup(
|
||||
root,
|
||||
++gridRow,
|
||||
Res.get("shared.save"),
|
||||
Res.get("shared.deleteAccount"),
|
||||
Res.get("shared.cancel")
|
||||
);
|
||||
|
||||
Button saveAccountButton = tuple.first;
|
||||
saveAccountButton.setOnAction(event -> onUpdateAccount(paymentAccount));
|
||||
Button deleteAccountButton = tuple.second;
|
||||
deleteAccountButton.setOnAction(event -> onDeleteAccount(paymentAccount));
|
||||
Button cancelButton = tuple.second;
|
||||
cancelButton.setOnAction(event -> removeSelectAccountForm());
|
||||
Button cancelButton = tuple.third;
|
||||
cancelButton.setOnAction(event -> onCancelSelectedAccount(paymentAccount));
|
||||
GridPane.setRowSpan(accountTitledGroupBg, paymentMethodForm.getRowSpan());
|
||||
model.onSelectAccount(paymentAccount);
|
||||
}
|
||||
|
@ -50,6 +50,10 @@ class AltCoinAccountsViewModel extends ActivatableWithDataModel<AltCoinAccountsD
|
||||
dataModel.onSaveNewAccount(paymentAccount);
|
||||
}
|
||||
|
||||
public void onUpdateAccount(PaymentAccount paymentAccount) {
|
||||
dataModel.onUpdateAccount(paymentAccount);
|
||||
}
|
||||
|
||||
public boolean onDeleteAccount(PaymentAccount paymentAccount) {
|
||||
return dataModel.onDeleteAccount(paymentAccount);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user