mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-23 20:36:44 +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.setTitle("Export " + exporter.getWalletModel().toDisplayString() + " File");
|
||||
fileChooser.setInitialFileName(wallet.getName() + "-" + exporter.getWalletModel().toDisplayString().toLowerCase() + "." + exporter.getExportFileExtension());
|
||||
|
||||
File file = fileChooser.showSaveDialog(window);
|
||||
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";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getExportFileExtension() {
|
||||
return "txt";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Wallet importWallet(InputStream inputStream, String password) throws ImportException {
|
||||
Wallet wallet = new Wallet();
|
||||
|
|
|
@ -184,6 +184,11 @@ public class Electrum implements KeystoreFileImport, WalletImport, WalletExport
|
|||
return "Import an Electrum wallet";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getExportFileExtension() {
|
||||
return "json";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportWallet(Wallet wallet, OutputStream outputStream) throws ExportException {
|
||||
try {
|
||||
|
|
|
@ -7,4 +7,5 @@ import java.io.OutputStream;
|
|||
public interface WalletExport extends Export {
|
||||
void exportWallet(Wallet wallet, OutputStream outputStream) throws ExportException;
|
||||
String getWalletExportDescription();
|
||||
String getExportFileExtension();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue