Search in sources :

Example 1 with PersistableList

use of bisq.common.proto.persistable.PersistableList in project bisq-desktop by bisq-network.

the class GUIUtil method exportAccounts.

public static void exportAccounts(ArrayList<PaymentAccount> accounts, String fileName, Preferences preferences, Stage stage, PersistenceProtoResolver persistenceProtoResolver) {
    if (!accounts.isEmpty()) {
        String directory = getDirectoryFromChooser(preferences, stage);
        if (directory != null && !directory.isEmpty()) {
            Storage<PersistableList<PaymentAccount>> paymentAccountsStorage = new Storage<>(new File(directory), persistenceProtoResolver);
            paymentAccountsStorage.initAndGetPersisted(new PaymentAccountList(accounts), fileName, 100);
            paymentAccountsStorage.queueUpForSave();
            new Popup<>().feedback(Res.get("guiUtil.accountExport.savedToPath", Paths.get(directory, fileName).toAbsolutePath())).show();
        }
    } else {
        new Popup<>().warning(Res.get("guiUtil.accountExport.noAccountSetup")).show();
    }
}
Also used : PaymentAccountList(bisq.core.payment.PaymentAccountList) Storage(bisq.common.storage.Storage) PersistableList(bisq.common.proto.persistable.PersistableList) Popup(bisq.desktop.main.overlays.popups.Popup) File(java.io.File)

Aggregations

PersistableList (bisq.common.proto.persistable.PersistableList)1 Storage (bisq.common.storage.Storage)1 PaymentAccountList (bisq.core.payment.PaymentAccountList)1 Popup (bisq.desktop.main.overlays.popups.Popup)1 File (java.io.File)1