mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-05 05:46:44 +00:00
add export button to wallet settings
This commit is contained in:
parent
1274d56fce
commit
0c2554da72
2 changed files with 19 additions and 0 deletions
|
@ -65,6 +65,8 @@ public class SettingsController extends WalletFormController implements Initiali
|
||||||
|
|
||||||
private TabPane keystoreTabs;
|
private TabPane keystoreTabs;
|
||||||
|
|
||||||
|
@FXML Button export;
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
private Button apply;
|
private Button apply;
|
||||||
|
|
||||||
|
@ -221,6 +223,7 @@ public class SettingsController extends WalletFormController implements Initiali
|
||||||
scriptType.getSelectionModel().select(walletForm.getWallet().getScriptType());
|
scriptType.getSelectionModel().select(walletForm.getWallet().getScriptType());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export.setDisable(!walletForm.getWallet().isValid());
|
||||||
revert.setDisable(true);
|
revert.setDisable(true);
|
||||||
apply.setDisable(true);
|
apply.setDisable(true);
|
||||||
}
|
}
|
||||||
|
@ -312,6 +315,11 @@ public class SettingsController extends WalletFormController implements Initiali
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void exportWallet(ActionEvent event) {
|
||||||
|
WalletExportDialog dlg = new WalletExportDialog(walletForm.getWallet());
|
||||||
|
dlg.showAndWait();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String describeKeystore(Keystore keystore) {
|
protected String describeKeystore(Keystore keystore) {
|
||||||
if(!keystore.isValid()) {
|
if(!keystore.isValid()) {
|
||||||
|
@ -341,6 +349,14 @@ public class SettingsController extends WalletFormController implements Initiali
|
||||||
|
|
||||||
revert.setDisable(false);
|
revert.setDisable(false);
|
||||||
apply.setDisable(!wallet.isValid());
|
apply.setDisable(!wallet.isValid());
|
||||||
|
export.setDisable(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void walletSettingsChanged(WalletSettingsChangedEvent event) {
|
||||||
|
if(event.getWalletFile().equals(walletForm.getWalletFile())) {
|
||||||
|
export.setDisable(!event.getWallet().isValid());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -112,6 +112,9 @@
|
||||||
<padding>
|
<padding>
|
||||||
<Insets left="25.0" right="25.0" bottom="25.0" />
|
<Insets left="25.0" right="25.0" bottom="25.0" />
|
||||||
</padding>
|
</padding>
|
||||||
|
<HBox AnchorPane.leftAnchor="0" spacing="20">
|
||||||
|
<Button fx:id="export" text="Export..." onAction="#exportWallet" />
|
||||||
|
</HBox>
|
||||||
<HBox AnchorPane.rightAnchor="10" spacing="20">
|
<HBox AnchorPane.rightAnchor="10" spacing="20">
|
||||||
<Button text="Advanced..." onAction="#showAdvanced" />
|
<Button text="Advanced..." onAction="#showAdvanced" />
|
||||||
<Button fx:id="revert" text="Revert" cancelButton="true" />
|
<Button fx:id="revert" text="Revert" cancelButton="true" />
|
||||||
|
|
Loading…
Reference in a new issue