diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java index 4c2a4f14..ef0116b2 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppController.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppController.java @@ -280,7 +280,7 @@ public class AppController implements Initializable { rootStack.setOnDragOver(event -> { if(event.getGestureSource() != rootStack && event.getDragboard().hasFiles()) { - event.acceptTransferModes(TransferMode.COPY_OR_MOVE); + event.acceptTransferModes(TransferMode.LINK); } event.consume(); }); diff --git a/src/main/java/com/sparrowwallet/sparrow/AppServices.java b/src/main/java/com/sparrowwallet/sparrow/AppServices.java index 8b9cfb01..1aeec014 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppServices.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppServices.java @@ -33,6 +33,7 @@ import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.concurrent.ScheduledService; +import javafx.concurrent.Service; import javafx.concurrent.Task; import javafx.concurrent.Worker; import javafx.fxml.FXMLLoader; @@ -859,6 +860,25 @@ public class AppServices { } } + public static void openFileUriArgumentsAfterWalletLoading(Window window) { + if(!argFiles.isEmpty() || !argUris.isEmpty()) { + Service service = new Service<>() { + @Override + protected Task createTask() { + return new Task<>() { + @Override + protected Void call() { + return null; + } + }; + } + }; + service.setExecutor(Storage.LoadWalletService.getSingleThreadedExecutor()); + service.setOnSucceeded(event -> openFileUriArguments(window)); + service.start(); + } + } + public static void openFileUriArguments(Window window) { openFiles(argFiles, window); argFiles.clear(); diff --git a/src/main/java/com/sparrowwallet/sparrow/SparrowDesktop.java b/src/main/java/com/sparrowwallet/sparrow/SparrowDesktop.java index e7e03e17..4e0ba0c9 100644 --- a/src/main/java/com/sparrowwallet/sparrow/SparrowDesktop.java +++ b/src/main/java/com/sparrowwallet/sparrow/SparrowDesktop.java @@ -108,7 +108,7 @@ public class SparrowDesktop extends Application { } } - AppServices.openFileUriArguments(stage); + AppServices.openFileUriArgumentsAfterWalletLoading(stage); AppServices.get().start(); } diff --git a/src/main/java/com/sparrowwallet/sparrow/control/DownloadVerifierDialog.java b/src/main/java/com/sparrowwallet/sparrow/control/DownloadVerifierDialog.java index b416a9c9..870c66f2 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/DownloadVerifierDialog.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/DownloadVerifierDialog.java @@ -231,7 +231,7 @@ public class DownloadVerifierDialog extends Dialog { private void setupDrag(DialogPane dialogPane) { dialogPane.setOnDragOver(event -> { if(event.getGestureSource() != dialogPane && event.getDragboard().hasFiles()) { - event.acceptTransferModes(TransferMode.COPY_OR_MOVE); + event.acceptTransferModes(TransferMode.LINK); } event.consume(); });