mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-24 12:46:45 +00:00
export file naming with correct extensions
This commit is contained in:
parent
ab5fdef919
commit
e9e10de266
4 changed files with 12 additions and 0 deletions
|
@ -44,6 +44,7 @@ public class FileWalletExportPane extends TitledDescriptionPane {
|
||||||
|
|
||||||
FileChooser fileChooser = new FileChooser();
|
FileChooser fileChooser = new FileChooser();
|
||||||
fileChooser.setTitle("Export " + exporter.getWalletModel().toDisplayString() + " File");
|
fileChooser.setTitle("Export " + exporter.getWalletModel().toDisplayString() + " File");
|
||||||
|
fileChooser.setInitialFileName(wallet.getName() + "-" + exporter.getWalletModel().toDisplayString().toLowerCase() + "." + exporter.getExportFileExtension());
|
||||||
|
|
||||||
File file = fileChooser.showSaveDialog(window);
|
File file = fileChooser.showSaveDialog(window);
|
||||||
if(file != null) {
|
if(file != null) {
|
||||||
|
|
|
@ -71,6 +71,11 @@ public class ColdcardMultisig implements WalletImport, KeystoreFileImport, Walle
|
||||||
return "Import file created by using the Settings > Multisig Wallets > Export XPUB feature on your Coldcard";
|
return "Import file created by using the Settings > Multisig Wallets > Export XPUB feature on your Coldcard";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getExportFileExtension() {
|
||||||
|
return "txt";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Wallet importWallet(InputStream inputStream, String password) throws ImportException {
|
public Wallet importWallet(InputStream inputStream, String password) throws ImportException {
|
||||||
Wallet wallet = new Wallet();
|
Wallet wallet = new Wallet();
|
||||||
|
|
|
@ -184,6 +184,11 @@ public class Electrum implements KeystoreFileImport, WalletImport, WalletExport
|
||||||
return "Import an Electrum wallet";
|
return "Import an Electrum wallet";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getExportFileExtension() {
|
||||||
|
return "json";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exportWallet(Wallet wallet, OutputStream outputStream) throws ExportException {
|
public void exportWallet(Wallet wallet, OutputStream outputStream) throws ExportException {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -7,4 +7,5 @@ import java.io.OutputStream;
|
||||||
public interface WalletExport extends Export {
|
public interface WalletExport extends Export {
|
||||||
void exportWallet(Wallet wallet, OutputStream outputStream) throws ExportException;
|
void exportWallet(Wallet wallet, OutputStream outputStream) throws ExportException;
|
||||||
String getWalletExportDescription();
|
String getWalletExportDescription();
|
||||||
|
String getExportFileExtension();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue