From c1f498a1140afb0e491d8ca795cd8490535f47f6 Mon Sep 17 00:00:00 2001 From: Nour Agha <50773468+nourkagha@users.noreply.github.com> Date: Tue, 20 Apr 2021 09:09:17 +0300 Subject: [PATCH] Add MEGA & pCloud providers to vault location presets (#1622) Fixes #1621 --- README.md | 2 +- .../CreateNewVaultLocationController.java | 6 +++ .../ui/addvaultwizard/LocationPresets.java | 42 +++++++++++++++++++ .../resources/fxml/addvault_new_location.fxml | 2 + 4 files changed, 51 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d5cf5ea8e..dccec1091 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Download native binaries of Cryptomator on [cryptomator.org](https://cryptomator ## Features -- Works with Dropbox, Google Drive, OneDrive, ownCloud, Nextcloud and any other cloud storage service which synchronizes with a local directory +- Works with Dropbox, Google Drive, OneDrive, MEGA, pCloud, ownCloud, Nextcloud and any other cloud storage service which synchronizes with a local directory - Open Source means: No backdoors, control is better than trust - Client-side: No accounts, no data shared with any online service - Totally transparent: Just work on the virtual drive as if it were a USB flash drive diff --git a/main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/CreateNewVaultLocationController.java b/main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/CreateNewVaultLocationController.java index 0202ee3f8..39e25d503 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/CreateNewVaultLocationController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/CreateNewVaultLocationController.java @@ -60,6 +60,8 @@ public class CreateNewVaultLocationController implements FxController { public RadioButton dropboxRadioButton; public RadioButton gdriveRadioButton; public RadioButton onedriveRadioButton; + public RadioButton megaRadioButton; + public RadioButton pcloudRadioButton; public RadioButton customRadioButton; public Label vaultPathStatus; public FontAwesome5IconView goodLocation; @@ -120,6 +122,10 @@ public class CreateNewVaultLocationController implements FxController { vaultPath.set(locationPresets.getGdriveLocation().resolve(vaultName.get())); } else if (onedriveRadioButton.equals(newValue)) { vaultPath.set(locationPresets.getOnedriveLocation().resolve(vaultName.get())); + } else if (megaRadioButton.equals(newValue)) { + vaultPath.set(locationPresets.getMegaLocation().resolve(vaultName.get())); + } else if (pcloudRadioButton.equals(newValue)) { + vaultPath.set(locationPresets.getPcloudLocation().resolve(vaultName.get())); } else if (customRadioButton.equals(newValue)) { vaultPath.set(customVaultPath.resolve(vaultName.get())); } diff --git a/main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/LocationPresets.java b/main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/LocationPresets.java index b9f796043..6cec655cb 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/LocationPresets.java +++ b/main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/LocationPresets.java @@ -16,15 +16,21 @@ public class LocationPresets { private static final String[] DROPBOX_LOCATIONS = {"~/Dropbox"}; private static final String[] GDRIVE_LOCATIONS = {"~/Google Drive"}; private static final String[] ONEDRIVE_LOCATIONS = {"~/OneDrive"}; + private static final String[] MEGA_LOCATIONS = {"~/MEGA"}; + private static final String[] PCLOUD_LOCATIONS = {"~/pCloudDrive"}; private final ReadOnlyObjectProperty iclouddriveLocation; private final ReadOnlyObjectProperty dropboxLocation; private final ReadOnlyObjectProperty gdriveLocation; private final ReadOnlyObjectProperty onedriveLocation; + private final ReadOnlyObjectProperty megaLocation; + private final ReadOnlyObjectProperty pcloudLocation; private final BooleanBinding foundIclouddrive; private final BooleanBinding foundDropbox; private final BooleanBinding foundGdrive; private final BooleanBinding foundOnedrive; + private final BooleanBinding foundMega; + private final BooleanBinding foundPcloud; @Inject public LocationPresets() { @@ -32,10 +38,14 @@ public class LocationPresets { this.dropboxLocation = new SimpleObjectProperty<>(existingWritablePath(DROPBOX_LOCATIONS)); this.gdriveLocation = new SimpleObjectProperty<>(existingWritablePath(GDRIVE_LOCATIONS)); this.onedriveLocation = new SimpleObjectProperty<>(existingWritablePath(ONEDRIVE_LOCATIONS)); + this.megaLocation = new SimpleObjectProperty<>(existingWritablePath(MEGA_LOCATIONS)); + this.pcloudLocation = new SimpleObjectProperty<>(existingWritablePath(PCLOUD_LOCATIONS)); this.foundIclouddrive = iclouddriveLocation.isNotNull(); this.foundDropbox = dropboxLocation.isNotNull(); this.foundGdrive = gdriveLocation.isNotNull(); this.foundOnedrive = onedriveLocation.isNotNull(); + this.foundMega = megaLocation.isNotNull(); + this.foundPcloud = pcloudLocation.isNotNull(); } private static Path existingWritablePath(String... candidates) { @@ -122,4 +132,36 @@ public class LocationPresets { return foundOnedrive.get(); } + public ReadOnlyObjectProperty megaLocationProperty() { + return megaLocation; + } + + public Path getMegaLocation() { + return megaLocation.get(); + } + + public BooleanBinding foundMegaProperty() { + return foundMega; + } + + public boolean isFoundMega() { + return foundMega.get(); + } + + public ReadOnlyObjectProperty pcloudLocationProperty() { + return pcloudLocation; + } + + public Path getPcloudLocation() { + return pcloudLocation.get(); + } + + public BooleanBinding foundPcloudProperty() { + return foundPcloud; + } + + public boolean isFoundPcloud() { + return foundPcloud.get(); + } + } diff --git a/main/ui/src/main/resources/fxml/addvault_new_location.fxml b/main/ui/src/main/resources/fxml/addvault_new_location.fxml index 313c6a476..3c25ba569 100644 --- a/main/ui/src/main/resources/fxml/addvault_new_location.fxml +++ b/main/ui/src/main/resources/fxml/addvault_new_location.fxml @@ -35,6 +35,8 @@ + +