From a226d5403a2b51235333a8893eb1b263c555eee3 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Thu, 14 Jan 2021 14:02:17 +0100 Subject: [PATCH 01/20] New translations strings.properties (Japanese) [ci skip] --- main/ui/src/main/resources/i18n/strings_ja.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/main/ui/src/main/resources/i18n/strings_ja.properties b/main/ui/src/main/resources/i18n/strings_ja.properties index 696a18616..867112a56 100644 --- a/main/ui/src/main/resources/i18n/strings_ja.properties +++ b/main/ui/src/main/resources/i18n/strings_ja.properties @@ -105,6 +105,7 @@ unlock.success.revealBtn=金庫を表示 unlock.error.heading=金庫の解錠に失敗 ### Invalid Mount Point unlock.error.invalidMountPoint.notExisting=マウントポイントが空のディレクトリか存在していません: %s +unlock.error.invalidMountPoint.existing=マウント ポイント "%s" が既に存在するか、親フォルダーがありません。 # Lock ## Force From 24b0ed25021ea72cedb1bf4e688753341c747031 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Thu, 14 Jan 2021 18:18:01 +0100 Subject: [PATCH 02/20] New translations strings.properties (German) [ci skip] --- main/ui/src/main/resources/i18n/strings_de.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/ui/src/main/resources/i18n/strings_de.properties b/main/ui/src/main/resources/i18n/strings_de.properties index 275235776..9e78da0f0 100644 --- a/main/ui/src/main/resources/i18n/strings_de.properties +++ b/main/ui/src/main/resources/i18n/strings_de.properties @@ -286,7 +286,7 @@ vaultOptions.mount.mountPoint.directoryPickerButton=Durchsuchen … vaultOptions.mount.mountPoint.directoryPickerTitle=Wähle ein leeres Verzeichnis ## Master Key vaultOptions.masterkey=Passwort -vaultOptions.masterkey.changePasswordBtn=Password ändern +vaultOptions.masterkey.changePasswordBtn=Passwort ändern vaultOptions.masterkey.forgetSavedPasswordBtn=Gespeichertes Passwort vergessen vaultOptions.masterkey.recoveryKeyExpanation=Bei Verlust deines Passworts ist ein Wiederherstellungsschlüssel deine einzige Möglichkeit, den Zugriff auf einen Tresor wiederherzustellen. vaultOptions.masterkey.showRecoveryKeyBtn=Wiederherstellungsschlüssel anzeigen From 1a49e24d8a8af980460983689373074e8d0fa953 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Sat, 16 Jan 2021 03:37:26 +0100 Subject: [PATCH 03/20] New translations strings.properties (Norwegian Bokmal) [ci skip] --- main/ui/src/main/resources/i18n/strings_nb.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/main/ui/src/main/resources/i18n/strings_nb.properties b/main/ui/src/main/resources/i18n/strings_nb.properties index bd97b4d00..014f3b264 100644 --- a/main/ui/src/main/resources/i18n/strings_nb.properties +++ b/main/ui/src/main/resources/i18n/strings_nb.properties @@ -151,6 +151,7 @@ preferences.general.debugLogging=Aktiver loggføring av feilsøk preferences.general.debugDirectory=Vis loggfiler preferences.general.autoStart=Start Cryptomator ved systemstart preferences.general.keychainBackend=Lagre passord med +preferences.general.keychainBackend.org.cryptomator.macos.keychain.MacSystemKeychainAccess=macOS nøkkelringtilgang preferences.general.interfaceOrientation=Grensesnittorientering preferences.general.interfaceOrientation.ltr=Fra venstre til høyre preferences.general.interfaceOrientation.rtl=Fra høyre til venstre From ca5d9eba3649c5596aaf5768728a51109b173ee2 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Sat, 16 Jan 2021 04:07:35 +0100 Subject: [PATCH 04/20] New translations strings.properties (Norwegian Bokmal) [ci skip] --- main/ui/src/main/resources/i18n/strings_nb.properties | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main/ui/src/main/resources/i18n/strings_nb.properties b/main/ui/src/main/resources/i18n/strings_nb.properties index 014f3b264..ad6e8f8cf 100644 --- a/main/ui/src/main/resources/i18n/strings_nb.properties +++ b/main/ui/src/main/resources/i18n/strings_nb.properties @@ -109,9 +109,12 @@ unlock.error.invalidMountPoint.existing=Monteringspunktet "%s" finnes enten alle # Lock ## Force +lock.forced.heading=Låsingen mislyktes +lock.forced.message=Låsing "%s" ble blokkert av ventende operasjoner eller åpne filer. Du kan tvinge låsing av dette hvelvet, men avbrytelse av I/O kan føre til tap av ulagrede data. lock.forced.confirmBtn=Tving låsing ## Failure lock.fail.heading=Låsing av hvelvet mislyktes. +lock.fail.message=Hvelvet "%s" kunne ikke låses. Forsikre deg om at ulagrede arbeider lagres andre steder, og at viktige lese/skrive-operasjoner er fullført. For å lukke hvelvet må du avbryte Cryptomatorprosessen. # Migration migration.title=Oppgrader hvelv @@ -146,12 +149,17 @@ preferences.general.theme.automatic=Automatisk preferences.general.theme.light=Lys preferences.general.theme.dark=Mørk preferences.general.unlockThemes=Lås opp mørk modus +preferences.general.showMinimizeButton=Vis minimerknapp +preferences.general.showTrayIcon=Vis verktøykasseikon (krever omstart) preferences.general.startHidden=Skjul vinduet når du starter Cryptomator preferences.general.debugLogging=Aktiver loggføring av feilsøk preferences.general.debugDirectory=Vis loggfiler preferences.general.autoStart=Start Cryptomator ved systemstart preferences.general.keychainBackend=Lagre passord med +preferences.general.keychainBackend.org.cryptomator.linux.keychain.SecretServiceKeychainAccess=Gnome Keyring +preferences.general.keychainBackend.org.cryptomator.linux.keychain.KDEWalletKeychainAccess=KDE Wallet preferences.general.keychainBackend.org.cryptomator.macos.keychain.MacSystemKeychainAccess=macOS nøkkelringtilgang +preferences.general.keychainBackend.org.cryptomator.windows.keychain.WindowsProtectedKeychainAccess=Windows Data Protection preferences.general.interfaceOrientation=Grensesnittorientering preferences.general.interfaceOrientation.ltr=Fra venstre til høyre preferences.general.interfaceOrientation.rtl=Fra høyre til venstre From 1134c1b2fff597795264150a301d78d62b39497d Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Tue, 19 Jan 2021 15:27:46 +0100 Subject: [PATCH 05/20] closes #1471 hand the javafx hostservice showDocument() method from ui package to the underlying nio-adapter-libraries through --- .../cryptomator/common/vaults/DokanyVolume.java | 12 ++++++++---- .../cryptomator/common/vaults/FuseVolume.java | 8 ++++---- .../org/cryptomator/common/vaults/Vault.java | 4 ++-- .../org/cryptomator/common/vaults/Volume.java | 15 ++++++++++++++- .../cryptomator/common/vaults/WebDavVolume.java | 10 ++++------ main/pom.xml | 6 +++--- .../org/cryptomator/ui/common/VaultService.java | 17 ++++++++++++++--- .../org/cryptomator/ui/fxapp/FxApplication.java | 2 ++ 8 files changed, 51 insertions(+), 23 deletions(-) diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/DokanyVolume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/DokanyVolume.java index e0379e9db..0da6452cc 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/DokanyVolume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/DokanyVolume.java @@ -8,6 +8,7 @@ import org.cryptomator.cryptofs.CryptoFileSystem; import org.cryptomator.frontend.dokany.Mount; import org.cryptomator.frontend.dokany.MountFactory; import org.cryptomator.frontend.dokany.MountFailedException; +import org.cryptomator.frontend.dokany.RevealException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -52,10 +53,12 @@ public class DokanyVolume extends AbstractVolume { } @Override - public void reveal() throws VolumeException { - boolean success = mount.reveal(); - if (!success) { - throw new VolumeException("Reveal failed."); + public void reveal(Revealer r) throws VolumeException { + try { + mount.reveal(r); + } catch (RevealException e) { + LOG.debug("Revealing the vault in file manger failed: " + e.getMessage()); + throw new VolumeException(e); } } @@ -79,6 +82,7 @@ public class DokanyVolume extends AbstractVolume { public boolean supportsForcedUnmount() { return true; } + @Override public boolean isSupported() { return DokanyVolume.isSupportedStatic(); diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/FuseVolume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/FuseVolume.java index e5c49d025..46db1221c 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/FuseVolume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/FuseVolume.java @@ -12,6 +12,7 @@ import org.cryptomator.frontend.fuse.mount.FuseMountFactory; import org.cryptomator.frontend.fuse.mount.FuseNotSupportedException; import org.cryptomator.frontend.fuse.mount.Mount; import org.cryptomator.frontend.fuse.mount.Mounter; +import org.cryptomator.frontend.fuse.mount.RevealException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -20,7 +21,6 @@ import javax.inject.Named; import java.nio.file.Path; import java.util.ArrayList; import java.util.List; -import java.util.SortedSet; import java.util.regex.Pattern; public class FuseVolume extends AbstractVolume { @@ -73,10 +73,10 @@ public class FuseVolume extends AbstractVolume { } @Override - public void reveal() throws VolumeException { + public void reveal(Revealer r) throws VolumeException { try { - mount.revealInFileManager(); - } catch (CommandFailedException e) { + mount.reveal(r); + } catch (RevealException e) { LOG.debug("Revealing the vault in file manger failed: " + e.getMessage()); throw new VolumeException(e); } diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/Vault.java b/main/commons/src/main/java/org/cryptomator/common/vaults/Vault.java index 5205d0fdd..adf39c6f2 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/Vault.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/Vault.java @@ -148,8 +148,8 @@ public class Vault { } } - public void reveal() throws VolumeException { - volume.reveal(); + public void reveal(Volume.Revealer vaultRevealer) throws VolumeException { + volume.reveal(vaultRevealer); } // ****************************************************************************** diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/Volume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/Volume.java index 624efea13..5760ab1fe 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/Volume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/Volume.java @@ -3,6 +3,8 @@ package org.cryptomator.common.vaults; import org.cryptomator.common.mountpoint.InvalidMountPointException; import org.cryptomator.common.settings.VolumeImpl; import org.cryptomator.cryptofs.CryptoFileSystem; +import org.cryptomator.frontend.fuse.mount.Revealer; +import org.cryptomator.frontend.webdav.mount.Mounter; import java.io.IOException; import java.nio.file.Path; @@ -34,7 +36,11 @@ public interface Volume { */ void mount(CryptoFileSystem fs, String mountFlags) throws IOException, VolumeException, InvalidMountPointException; - void reveal() throws VolumeException; + /** + * TODO: refactor, such that this method accepts a (new) interface revealer and document that it could be ignored. + * @throws VolumeException + */ + void reveal(Revealer revealer) throws VolumeException; void unmount() throws VolumeException; @@ -79,4 +85,11 @@ public interface Volume { } + /** + * Interface to bundle the different revealer interfaces in the used nio-adapters + */ + interface Revealer extends org.cryptomator.frontend.fuse.mount.Revealer, org.cryptomator.frontend.dokany.Revealer, Mounter.Revealer{ + + } + } diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java index fe9246085..dc4cefe5a 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java @@ -29,7 +29,6 @@ public class WebDavVolume implements Volume { private WebDavServer server; private WebDavServletController servlet; private Mounter.Mount mount; - private Path mountPoint; @Inject public WebDavVolume(Provider serverProvider, VaultSettings vaultSettings, Settings settings) { @@ -71,11 +70,10 @@ public class WebDavVolume implements Volume { } @Override - public void reveal() throws VolumeException { + public void reveal(Revealer r) throws VolumeException { try { - mount.reveal(); - } catch (Mounter.CommandFailedException e) { - e.printStackTrace(); + mount.reveal(r); + } catch (Mounter.RevealException e) { throw new VolumeException(e); } } @@ -102,7 +100,7 @@ public class WebDavVolume implements Volume { @Override public Optional getMountPoint() { - return Optional.ofNullable(mountPoint); //TODO + return mount.getMountPoint(); } @Override diff --git a/main/pom.xml b/main/pom.xml index 0be3baa81..bcc9f0d9f 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -29,9 +29,9 @@ 0.2.1 0.1.0-beta3 0.1.0-beta2 - 1.2.6 - 1.2.1 - 1.0.14 + 1.3.0-SNAPSHOT + 1.3.0-SNAPSHOT + 1.1.0-SNAPSHOT 15 diff --git a/main/ui/src/main/java/org/cryptomator/ui/common/VaultService.java b/main/ui/src/main/java/org/cryptomator/ui/common/VaultService.java index 1f4ffc3fd..2bd99ef98 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/common/VaultService.java +++ b/main/ui/src/main/java/org/cryptomator/ui/common/VaultService.java @@ -15,6 +15,7 @@ import java.util.Iterator; import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; +import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @FxApplicationScoped @@ -24,22 +25,29 @@ public class VaultService { private final ExecutorService executorService; + private AtomicReference vaultRevealer; + @Inject public VaultService(ExecutorService executorService) { this.executorService = executorService; + this.vaultRevealer = new AtomicReference<>(p -> {}); //the inital revealer does nuthin } public void reveal(Vault vault) { executorService.execute(createRevealTask(vault)); } + public void setVaultRevealer(Volume.Revealer revealer){ + this.vaultRevealer.set(revealer); + } + /** * Creates but doesn't start a reveal task. * * @param vault The vault to reveal */ public Task createRevealTask(Vault vault) { - Task task = new RevealVaultTask(vault); + Task task = new RevealVaultTask(vault, vaultRevealer.get()); task.setOnSucceeded(evt -> LOG.info("Revealed {}", vault.getDisplayName())); task.setOnFailed(evt -> LOG.error("Failed to reveal " + vault.getDisplayName(), evt.getSource().getException())); return task; @@ -99,19 +107,22 @@ public class VaultService { private static class RevealVaultTask extends Task { private final Vault vault; + private final Volume.Revealer revealer; /** * @param vault The vault to lock + * @param revealer The object to use to show the vault content to the user. */ - public RevealVaultTask(Vault vault) { + public RevealVaultTask(Vault vault, Volume.Revealer revealer) { this.vault = vault; + this.revealer = revealer; setOnFailed(evt -> LOG.error("Failed to reveal " + vault.getDisplayName(), getException())); } @Override protected Vault call() throws Volume.VolumeException { - vault.reveal(); + vault.reveal(revealer); return vault; } } diff --git a/main/ui/src/main/java/org/cryptomator/ui/fxapp/FxApplication.java b/main/ui/src/main/java/org/cryptomator/ui/fxapp/FxApplication.java index 65e6d1c6c..8633b6e8b 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/fxapp/FxApplication.java +++ b/main/ui/src/main/java/org/cryptomator/ui/fxapp/FxApplication.java @@ -68,6 +68,8 @@ public class FxApplication extends Application { this.licenseHolder = licenseHolder; this.visibleWindows = Stage.getWindows().filtered(Window::isShowing); this.hasVisibleWindows = Bindings.isNotEmpty(visibleWindows); + + vaultService.setVaultRevealer(p -> this.getHostServices().showDocument(p.toUri().toString())); } public void start() { From 0312f045aad8ec41e33e8375def43a7e68a28224 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Tue, 19 Jan 2021 15:28:50 +0100 Subject: [PATCH 06/20] add a logger to WebDAV-Volume --- .../main/java/org/cryptomator/common/vaults/WebDavVolume.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java index dc4cefe5a..e25e07465 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java @@ -10,6 +10,8 @@ import org.cryptomator.frontend.webdav.WebDavServer; import org.cryptomator.frontend.webdav.mount.MountParams; import org.cryptomator.frontend.webdav.mount.Mounter; import org.cryptomator.frontend.webdav.servlet.WebDavServletController; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import javax.inject.Inject; import javax.inject.Provider; @@ -20,6 +22,7 @@ import java.util.Optional; public class WebDavVolume implements Volume { + private static final Logger LOG = LoggerFactory.getLogger(WebDavVolume.class); private static final String LOCALHOST_ALIAS = "cryptomator-vault"; private final Provider serverProvider; @@ -74,6 +77,7 @@ public class WebDavVolume implements Volume { try { mount.reveal(r); } catch (Mounter.RevealException e) { + LOG.debug("Revealing the vault in file manger failed: " + e.getMessage()); throw new VolumeException(e); } } From 73554b4759873f59da777135f6a80eb1b7769c3c Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Tue, 19 Jan 2021 15:52:20 +0100 Subject: [PATCH 07/20] split WebDAV Volume mount method into servlet start and servlet mount --- .../org/cryptomator/common/vaults/WebDavVolume.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java index fe9246085..91291752e 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java @@ -17,6 +17,7 @@ import java.net.InetAddress; import java.net.UnknownHostException; import java.nio.file.Path; import java.util.Optional; +import java.util.function.Supplier; public class WebDavVolume implements Volume { @@ -40,6 +41,11 @@ public class WebDavVolume implements Volume { @Override public void mount(CryptoFileSystem fs, String mountFlags) throws VolumeException { + startServlet(fs); + mountServlet(); + } + + private void startServlet(CryptoFileSystem fs){ if (server == null) { server = serverProvider.get(); } @@ -50,10 +56,9 @@ public class WebDavVolume implements Volume { String urlConformMountName = acceptable.negate().collapseFrom(vaultSettings.mountName().get(), '_'); servlet = server.createWebDavServlet(fs.getPath("/"), vaultSettings.getId() + "/" + urlConformMountName); servlet.start(); - mount(); } - private void mount() throws VolumeException { + private void mountServlet() throws VolumeException { if (servlet == null) { throw new IllegalStateException("Mounting requires unlocked WebDAV servlet."); } @@ -65,7 +70,6 @@ public class WebDavVolume implements Volume { try { this.mount = servlet.mount(mountParams); // might block this thread for a while } catch (Mounter.CommandFailedException e) { - e.printStackTrace(); throw new VolumeException(e); } } From 7349a29831d6475cb0b47827154b4748c0d76425 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Tue, 19 Jan 2021 15:52:52 +0100 Subject: [PATCH 08/20] Ensure that on windows systems always the gui chooses the mountpoint for webdav --- .../cryptomator/common/vaults/WebDavVolume.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java index 91291752e..ff0bc1632 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java @@ -26,6 +26,7 @@ public class WebDavVolume implements Volume { private final Provider serverProvider; private final VaultSettings vaultSettings; private final Settings settings; + private final WindowsDriveLetters windowsDriveLetters; private WebDavServer server; private WebDavServletController servlet; @@ -33,10 +34,11 @@ public class WebDavVolume implements Volume { private Path mountPoint; @Inject - public WebDavVolume(Provider serverProvider, VaultSettings vaultSettings, Settings settings) { + public WebDavVolume(Provider serverProvider, VaultSettings vaultSettings, Settings settings, WindowsDriveLetters windowsDriveLetters) { this.serverProvider = serverProvider; this.vaultSettings = vaultSettings; this.settings = settings; + this.windowsDriveLetters = windowsDriveLetters; } @Override @@ -62,8 +64,17 @@ public class WebDavVolume implements Volume { if (servlet == null) { throw new IllegalStateException("Mounting requires unlocked WebDAV servlet."); } + + //on windows, prevent an automatic drive letter selection in the upstream library. Either we choose already a specifc one or there is no free. + Supplier driveLetterSupplier; + if(System.getProperty("os.name").toLowerCase().contains("windows") && vaultSettings.winDriveLetter().isEmpty().get()) { + driveLetterSupplier = () -> windowsDriveLetters.getAvailableDriveLetter().orElse(null); + } else { + driveLetterSupplier = () -> vaultSettings.winDriveLetter().get(); + } + MountParams mountParams = MountParams.create() // - .withWindowsDriveLetter(vaultSettings.winDriveLetter().get()) // + .withWindowsDriveLetter(driveLetterSupplier.get()) // .withPreferredGvfsScheme(settings.preferredGvfsScheme().get().getPrefix())// .withWebdavHostname(getLocalhostAliasOrNull()) // .build(); From 64897cfa214ef23bafe1d1d3d90304c8d1ed2630 Mon Sep 17 00:00:00 2001 From: stacksnack <75588168+stacksnack@users.noreply.github.com> Date: Wed, 20 Jan 2021 21:37:41 +0100 Subject: [PATCH 09/20] New translations strings.properties (Hungarian) Add hungarian translation --- .../main/resources/i18n/strings_hu.properties | 308 ++++++++++++++++++ 1 file changed, 308 insertions(+) create mode 100644 main/ui/src/main/resources/i18n/strings_hu.properties diff --git a/main/ui/src/main/resources/i18n/strings_hu.properties b/main/ui/src/main/resources/i18n/strings_hu.properties new file mode 100644 index 000000000..02db56bf8 --- /dev/null +++ b/main/ui/src/main/resources/i18n/strings_hu.properties @@ -0,0 +1,308 @@ +# Locale Specific CSS files such as CJK, RTL,... +additionalStyleSheets= + +# Generics +## Button +generic.button.apply=Alkalmaz +generic.button.back=Vissza +generic.button.cancel=Mégse +generic.button.change=Változtat +generic.button.close=Bezár +generic.button.copy=Másolás +generic.button.copied=Másolva! +generic.button.done=Kész +generic.button.next=Következő +generic.button.print=Nyomtatás +## Error +generic.error.title=Egy váratlan hiba történt +generic.error.instruction=Ennek nem lett volna szabad megtörténnie. Kérjük jelezze a hibát az alábbi szöveggel valamint a hiba reprodukálásához szükséges lépésekkel. + +# Defaults +defaults.vault.vaultName=Széf + +# Tray Menu +traymenu.showMainWindow=Megmutatás +traymenu.showPreferencesWindow=Beállítások +traymenu.lockAllVaults=Az összes zárolása +traymenu.quitApplication=Kilépés +traymenu.vault.unlock=Feloldás +traymenu.vault.lock=Zárolás +traymenu.vault.reveal=Megmutatás + +# Add Vault Wizard +addvaultwizard.title=Széf hozzáadása +## Welcome +addvaultwizard.welcome.newButton=Új széf létrehozása +addvaultwizard.welcome.existingButton=Meglévő széf megnyitása +## New +### Name +addvaultwizard.new.nameInstruction=Válasszon egy nevet az új széf számára +addvaultwizard.new.namePrompt=A széf neve +### Location +addvaultwizard.new.locationInstruction=Hova mentse a Cryptomator a széf titkosított fájljait? +addvaultwizard.new.locationLabel=Tárolási hely +addvaultwizard.new.locationPrompt=… +addvaultwizard.new.directoryPickerLabel=Egyedi hely +addvaultwizard.new.directoryPickerButton=Választás… +addvaultwizard.new.directoryPickerTitle=Könyvtár kiválasztása +addvaultwizard.new.fileAlreadyExists=Nem lehet a széfet létrehozni ezen a helyen, mert egy fájl már létezik itt. +addvaultwizard.new.locationDoesNotExist=Nem lehet a széfet létrehozni ezen a helyen, mert az útvonal legalább egy darabja nem létezik. +addvaultwizard.new.invalidName=Érvénytelen széf elnevezés. Kérjük vegye figyelembe a szabályos könyvtárelnevezésre vonatkozó szabályokat. +### Password +addvaultwizard.new.createVaultBtn=Széf létrehozása +addvaultwizard.new.generateRecoveryKeyChoice=Nem fog tudni hozzáférni az adataihoz a jelszó nélkül. Akar egy visszaállítási kulcsot arra az esetre, ha elveszíti a jelszavát? +addvaultwizard.new.generateRecoveryKeyChoice.yes=Igen kérem, jobb félni, mint megijedni. +addvaultwizard.new.generateRecoveryKeyChoice.no=Nem köszönöm, nem fogom elveszíteni a jelszavam. +### Information +addvault.new.readme.storageLocation.fileName=FONTOS.rtf +addvault.new.readme.storageLocation.1=⚠️ SZÉF FÁJLOK ⚠️ +addvault.new.readme.storageLocation.2=Ez a széfjének a tárolási helye. +addvault.new.readme.storageLocation.3=NE +addvault.new.readme.storageLocation.4=• ne módosítson semmilyen fájlt ebbe a könyvtárba +addvault.new.readme.storageLocation.5=• ne tegyen titkosítani való fájlokat ebbe a könyvtárba +addvault.new.readme.storageLocation.6=Ha fájlokat akr titkosítani és a széf tartalmát akarja szerkeszteni akkor tegye a következőt: +addvault.new.readme.storageLocation.7=1. Adja hozzá a széfet a Cryptomator-hoz. +addvault.new.readme.storageLocation.8=2. Nyissa meg a széfet a Cryptomator-ban. +addvault.new.readme.storageLocation.9=3. Nyissa meg a hozzáférési helyet a "Megjelenítés" gombra való kattintással. +addvault.new.readme.storageLocation.10=Ha segítségre van szüksége, akkor látogasson el a dokumentáció oldalára: %s +addvault.new.readme.accessLocation.fileName=ÜDVÖZÖLJÜK.rtf +addvault.new.readme.accessLocation.1=🔐️ TITKOSÍTOTT KÖTET 🔐️ +addvault.new.readme.accessLocation.2=Ez a széf hozzáférési helye. +addvault.new.readme.accessLocation.3=Bármilyen, a kötethez hozzáadott fájl titkosításra kerül a Cryptomator által. Úgy dolgozhat vele, mint minden más meghajtóval/mappával. Ez az egyetlen dekódolt tartalmi nézet. A fájlai folyamatosan titkosítva maradnak a merevlemezén. +addvault.new.readme.accessLocation.4=Bátran eltávolíthatja ezt a fájlt. +## Existing +addvaultwizard.existing.instruction=Válassza ki a már létező széfjéhez tartozó "masterkey.cryptomator" fájlt. +addvaultwizard.existing.chooseBtn=Kiválaszt… +addvaultwizard.existing.filePickerTitle=Mesterkulcs fájl kiválasztása +## Success +addvaultwizard.success.nextStepsInstructions=Széf létrehozva "%s".\nA tartalom eléréséhez, vagy hozzáadásához fel kell oldania a széfet. Alternatív megoldásként később bármikor feloldhatja. +addvaultwizard.success.unlockNow=Azonnali feloldás + +# Remove Vault +removeVault.title=Széf eltávolitása +removeVault.information=Ez kizárolag a Cryptomator-ból távolitja el ezt a széfet. Később hozzáadhatja újra. A titkosított fájlokat nem törli a merevlemezről. +removeVault.confirmBtn=Széf eltávolitása + +# Change Password +changepassword.title=Jelszó megváltoztatása +changepassword.enterOldPassword=Írja be a jelenlegi jelszavat a következő széfhez "%s" +changepassword.finalConfirmation=Megértettem, hogy nem fogok hozzáférni az adataimhoz amennyiben elfelejtem a jelszavam + +# Forget Password +forgetPassword.title=Jelszó elfelejtése +forgetPassword.information=Eltávolítja a széf mentett jelszavát a rendszere kulcstartójából. +forgetPassword.confirmBtn=Jelszó elfelejtése + +# Unlock +unlock.title=Széf feloldása +unlock.passwordPrompt=Írja be a jelszavát a következő széfhez "%s": +unlock.savePassword=Jelszó mentése +unlock.unlockBtn=Feloldás +## Success +unlock.success.message="%s" sikreresen feloldásra került! Mostmár hozzáférhet a széféhez. +unlock.success.rememberChoice=Jegyezze meg a választást és ne mutassa többet +unlock.success.revealBtn=Széf megjelenítése +## Failure +unlock.error.heading=Nem lehet feloldani a széfet +### Invalid Mount Point +unlock.error.invalidMountPoint.notExisting=A csatolási pont "%s" nem egy könyvtár, nem üres vagy nem létezik. +unlock.error.invalidMountPoint.existing=A csatolási pont "%s" már létezik vagy a already exists or szülőmappa hiányzik. + +# Migration +migration.title=Széf frissítése +## Start +migration.start.prompt=A "%s" széf formátuma frissítésre szorul. A folytatás előtt győződjön meg arról, hogy nincs függőben lévő szinkronizálás, amely befolyásolja ezt a széfet. +migration.start.confirm=Igen, a széfem teljes mértékben szinkronizálva van +## Run +migration.run.enterPassword=Írja be a jelszót a következőhöz Enter the password for "%s" +migration.run.startMigrationBtn=Széf migrációja +migration.run.progressHint=Ez eltarthat egy darabig… +## Sucess +migration.success.nextStepsInstructions=A "%s" sikeresen migrálva. \nMost már feloldhatja a széfet. +migration.success.unlockNow=Azonnali feloldás +## Missing file system capabilities +migration.error.missingFileSystemCapabilities.title=Nem támogatott fájlrendszer +migration.error.missingFileSystemCapabilities.description=A migráció nem kezdődött el, mert a széf nem megfelelő fájlrendszeren található. +migration.error.missingFileSystemCapabilities.reason.LONG_FILENAMES=A fájlrendszer nem támogatja a hosszú fájlneveket. +migration.error.missingFileSystemCapabilities.reason.LONG_PATHS=A fájlrendszer nem támogatja a hosszú útvonalakat. +migration.error.missingFileSystemCapabilities.reason.READ_ACCESS=A fájlrendszer nem teszi lehetővé az olvasást. +migration.error.missingFileSystemCapabilities.reason.WRITE_ACCESS=A fájlrendszer nem teszi lehetővé az írást. +## Impossible +migration.impossible.heading=A széf frissítése sikertelen +migration.impossible.reason=A széfet nem lehet automatikusan frissíteni, mert a tárolási helye vagy a hozzáférési pontja nem kompatibilis. +migration.impossible.moreInfo=A széf továbbra is megnyitható marad egy régebbi verzióval. A széf kézi frissítésével kapcsolatos utasításokért keresse fel a következő címet: + +# Preferences +preferences.title=Beállítások +## General +preferences.general=Általános +preferences.general.theme=Megjelenés +preferences.general.theme.automatic=Autómatikus +preferences.general.theme.light=Világos +preferences.general.theme.dark=Sötét +preferences.general.unlockThemes=Sötét mód feloldása +preferences.general.startHidden=Az ablak elrejtése a Cryptomator indítása után +preferences.general.debugLogging=Hibakeresési naplózás engedélyezése +preferences.general.debugDirectory=Naplófájlok megjelenítése +preferences.general.autoStart=Cryptomator indítása a rendszerrel együtt +preferences.general.keychainBackend=Itt tárolja a jelszavakat +preferences.general.keychainBackend.org.cryptomator.linux.keychain.SecretServiceKeychainAccess=Gnome Keyring +preferences.general.keychainBackend.org.cryptomator.linux.keychain.KDEWalletKeychainAccess=KDE Wallet +preferences.general.keychainBackend.org.cryptomator.macos.keychain.MacSystemKeychainAccess=macOS Keychain Access +preferences.general.keychainBackend.org.cryptomator.windows.keychain.WindowsProtectedKeychainAccess=Windows Data Protection +preferences.general.interfaceOrientation=Felhasználói felület orientációja +preferences.general.interfaceOrientation.ltr=Balról jobbra +preferences.general.interfaceOrientation.rtl=Jobbról balra +## Volume +preferences.volume=Virtuális meghajtó +preferences.volume.type=Kötet tipusa +preferences.volume.webdav.port=WebDAV Port +preferences.volume.webdav.scheme=WebDAV Scheme +## Updates +preferences.updates=Frissítések +preferences.updates.currentVersion=Jelenlegi verzió: %s +preferences.updates.autoUpdateCheck=Frissítések autómatikus keresése +preferences.updates.checkNowBtn=Ellenőrzés most +preferences.updates.updateAvailable=Frissítés a %s verzióra elérhető. +## Donation Key +preferences.donationKey=Adomány +preferences.donationKey.registeredFor=Regisztrálva %s számára +preferences.donationKey.noDonationKey=Nem található érvényes adománykulcs. Mint egy licenckulcs, csak olyan nagyszerű emberek számára, akik ingyenes szofvereket használnak. ;-) +preferences.donationKey.getDonationKey=Adománykulcs beszerzése +## About +preferences.about=Rólunk + +# Vault Statistics +stats.title=Statisztika ehhez %s +stats.cacheHitRate=Gyorsítótár találati arány +## Read +stats.read.throughput.idle=Olvasás: tétlen +stats.read.throughput.kibs=Olvasás: %.2f kiB/s +stats.read.throughput.mibs=Olvasás: %.2f MiB/s +stats.read.total.data.none=Olvasott adat: - +stats.read.total.data.kib=Olvasott adat: %.1f kiB +stats.read.total.data.mib=Olvasott adat: %.1f MiB +stats.read.total.data.gib=Olvasott adat: %.1f GiB +stats.decr.total.data.none=Dekódolt adat: - +stats.decr.total.data.kib=Dekódolt adat: %.1f kiB +stats.decr.total.data.mib=Dekódolt adat: %.1f MiB +stats.decr.total.data.gib=Dekódolt adat: %.1f GiB +stats.read.accessCount=Összes olvasás: %d +## Write +stats.write.throughput.idle=Írás: tétlen +stats.write.throughput.kibs=Írás: %.2f kiB/s +stats.write.throughput.mibs=Írás: %.2f MiB/s +stats.write.total.data.none=Írott adat: - +stats.write.total.data.kib=Írott adat: %.1f kiB +stats.write.total.data.mib=Írott adat: %.1f MiB +stats.write.total.data.gib=Írott adat: %.1f GiB +stats.encr.total.data.none=Titkosított adat: - +stats.encr.total.data.kib=Titkosított adat: %.1f kiB +stats.encr.total.data.mib=Titkosított adat: %.1f MiB +stats.encr.total.data.gib=Titkosított adat: %.1f GiB +stats.write.accessCount=Összes írás: %d + +# Main Window +main.closeBtn.tooltip=Bezárás +main.minimizeBtn.tooltip=Minimalizálás +main.preferencesBtn.tooltip=Beállítások +main.debugModeEnabled.tooltip=A hibakeresési mód aktiválva van +main.donationKeyMissing.tooltip=Kérjük, fontolja meg az adományozást +## Drag 'n' Drop +main.dropZone.dropVault=Adja hozzá ezt a széfet +main.dropZone.unknownDragboardContent=Ha egy széfet szeretne hozzáadni, akkor húzza át erre az ablakra. +## Vault List +main.vaultlist.emptyList.onboardingInstruction=Kattintson ide egy széf hozzáadásához +main.vaultlist.contextMenu.remove=Széf eltávolítása… +main.vaultlist.addVaultBtn=Széf hozzáadása +## Vault Detail +### Welcome +main.vaultDetail.welcomeOnboarding=Köszönjük, hogy a Cryptomator programot választotta a fájlai védelmére. Ha segítségre van szüksége, akkor olvassa el a kezdő útmutatónk lépéseit: +### Locked +main.vaultDetail.lockedStatus=ZÁROLVA +main.vaultDetail.unlockBtn=Feloldás… +main.vaultDetail.unlockNowBtn=Azonnali feloldás +main.vaultDetail.optionsBtn=Széf beállítások +main.vaultDetail.passwordSavedInKeychain=Jelszó mentve +### Unlocked +main.vaultDetail.unlockedStatus=FELOLDVA +main.vaultDetail.accessLocation=A széf tartalma itt érhető el: +main.vaultDetail.revealBtn=Széf megjelenítése +main.vaultDetail.lockBtn=Zárolás +main.vaultDetail.bytesPerSecondRead=Olvasás: +main.vaultDetail.bytesPerSecondWritten=Írás: +main.vaultDetail.throughput.idle=tétlen +main.vaultDetail.throughput.kbps=%.1f kiB/s +main.vaultDetail.throughput.mbps=%.1f MiB/s +main.vaultDetail.stats=Széf statisztika +### Missing +main.vaultDetail.missing.info=A Cryptomator nem talált széfet ezen az útvonalon. +main.vaultDetail.missing.recheck=Ellenőrizze újra +main.vaultDetail.missing.remove=A széf eltávolítása a listából… +main.vaultDetail.missing.changeLocation=A széf helyének megváltoztatása… +### Needs Migration +main.vaultDetail.migrateButton=Széf frissítése +main.vaultDetail.migratePrompt=A széfet új formátumra kell frissíteni, mielőtt hozzáférhet + +# Wrong File Alert +wrongFileAlert.title=Hogyan lehet fájlokat titkosítani +wrongFileAlert.header.title=Próbálta ezeket a fájlokat titkosítani? +wrongFileAlert.header.lead=Erre a célra a Cryptomator egy kötetet biztosít a rendszer fájlkezelőjében. +wrongFileAlert.instruction.0=Hogy titkosítsa a fájlokat kövesse a következő lépéseket: +wrongFileAlert.instruction.1=1. Oldja fel a széfet. +wrongFileAlert.instruction.2=2. Kattintson a "Megjelenítés" gombra, hogy megnyissa a kötetet a fájlkezelőjében. +wrongFileAlert.instruction.3=3. Adjon hozzá fájlokat a kötethez. +wrongFileAlert.link=További segítségért látogasson el ide + +# Vault Options +## General +vaultOptions.general=Általános +vaultOptions.general.vaultName=A széf neve +vaultOptions.general.unlockAfterStartup=A széf feloldása a Cryptomator indításakor +vaultOptions.general.actionAfterUnlock=Sikeres feloldás után +vaultOptions.general.actionAfterUnlock.ignore=Ne tegyen semmit +vaultOptions.general.actionAfterUnlock.reveal=Jelenítse meg a kötetet +vaultOptions.general.actionAfterUnlock.ask=Kérdezzen +## Mount +vaultOptions.mount=Csatolás +vaultOptions.mount.readonly=Csak olvasható +vaultOptions.mount.customMountFlags=Egyedi csatolási paraméterek +vaultOptions.mount.winDriveLetterOccupied=foglalt +vaultOptions.mount.mountPoint=Csatolási pont +vaultOptions.mount.mountPoint.auto=Válasszon egy megfelelő helyet autómatikusan +vaultOptions.mount.mountPoint.driveLetter=Használja a kiválasztott meghajtó betűjelét +vaultOptions.mount.mountPoint.custom=Egyedi útvonal +vaultOptions.mount.mountPoint.directoryPickerButton=Kiválasztás… +vaultOptions.mount.mountPoint.directoryPickerTitle=Válasszon egy üres könyvtárat +## Master Key +vaultOptions.masterkey=Jelszó +vaultOptions.masterkey.changePasswordBtn=Jelszó megváltoztatása +vaultOptions.masterkey.forgetSavedPasswordBtn=Elmentett jelszó elfelejtése +vaultOptions.masterkey.recoveryKeyExpanation=A helyreállítási kulcs az egyetlen módja annak, hogy visszaállítsa a széfhez való hozzáférést, ha elveíti a jelszavát. +vaultOptions.masterkey.showRecoveryKeyBtn=Visszaállítási kulcs megjelenítése +vaultOptions.masterkey.recoverPasswordBtn=Jelszó visszaállítása + +# Recovery Key +recoveryKey.title=Visszaállítási kulcs +recoveryKey.enterPassword.prompt=Írja be a jelszavát a "%s" visszaállítási kulcsának megjelenítéséhez: +recoveryKey.display.message=A következő helyreállítási kulcs használható a "%s" hozzáférésének visszaállítására: +recoveryKey.display.StorageHints=Tartsa nagyon biztonságos helyen. pl.:\n •Tárolja egy jelszókezelővel\n •Mentse el egy USB meghajtóra\n •Nyomtassa egy papírra +recoveryKey.recover.prompt=Írja be a visszaállítási kulcsát a következőhöz "%s": +recoveryKey.recover.validKey=Ez egy érvényes visszaállítási kulcs +recoveryKey.printout.heading=Cryptomator visszaállítási kulcs\n"%s"\n + +# New Password +newPassword.promptText=Írja be az új jelszavát +newPassword.reenterPassword=Erősítse meg az új jelszavát +newPassword.passwordsMatch=A jelszavak megegyeznek! +newPassword.passwordsDoNotMatch=A jelszavak nem egyeznek meg +passwordStrength.messageLabel.tooShort=Használjon legalább %d karaktert +passwordStrength.messageLabel.0=Nagyon gyenge +passwordStrength.messageLabel.1=Gyenge +passwordStrength.messageLabel.2=Átlagos +passwordStrength.messageLabel.3=Erős +passwordStrength.messageLabel.4=Nagyon erős + +# Quit +quit.prompt=Kilép az alkalmazásból? Vannak még lezáratlan széfek. +quit.lockAndQuit=Zárolás és kilépés From 93445e22d4cf27c78a6cb77859eb8dc8be3bb254 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Thu, 21 Jan 2021 06:37:41 +0100 Subject: [PATCH 10/20] update library versions --- main/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index bcc9f0d9f..dda21d3b6 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -29,9 +29,9 @@ 0.2.1 0.1.0-beta3 0.1.0-beta2 - 1.3.0-SNAPSHOT - 1.3.0-SNAPSHOT - 1.1.0-SNAPSHOT + 1.2.7 + 1.2.2 + 1.1.0 15 From 77db435b4fec3a9b39e5c8bab7cc433a538b36dc Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 21 Jan 2021 12:41:52 +0100 Subject: [PATCH 11/20] Refactor reveal call stack to apply facade pattern. --- .../cryptomator/common/vaults/DokanyVolume.java | 16 +++++++++++++--- .../cryptomator/common/vaults/FuseVolume.java | 16 +++++++++++++--- .../org/cryptomator/common/vaults/Vault.java | 2 +- .../org/cryptomator/common/vaults/Volume.java | 13 ++++++------- .../cryptomator/common/vaults/WebDavVolume.java | 16 +++++++++++++--- .../org/cryptomator/ui/common/VaultService.java | 8 ++++---- 6 files changed, 50 insertions(+), 21 deletions(-) diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/DokanyVolume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/DokanyVolume.java index 0da6452cc..e00c7c6ee 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/DokanyVolume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/DokanyVolume.java @@ -53,12 +53,22 @@ public class DokanyVolume extends AbstractVolume { } @Override - public void reveal(Revealer r) throws VolumeException { + public void reveal(RevealerFacade r) throws VolumeException { try { - mount.reveal(r); + mount.reveal(p -> { + try { + r.reveal(p); + } catch (VolumeException e) { + throw new RevealException(e); + } + }); } catch (RevealException e) { LOG.debug("Revealing the vault in file manger failed: " + e.getMessage()); - throw new VolumeException(e); + if (e.getCause() instanceof VolumeException) { + throw (VolumeException) e.getCause(); + } else { + throw new VolumeException(e); + } } } diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/FuseVolume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/FuseVolume.java index 46db1221c..191b47526 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/FuseVolume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/FuseVolume.java @@ -73,12 +73,22 @@ public class FuseVolume extends AbstractVolume { } @Override - public void reveal(Revealer r) throws VolumeException { + public void reveal(RevealerFacade r) throws VolumeException { try { - mount.reveal(r); + mount.reveal(p -> { + try { + r.reveal(p); + } catch (VolumeException e) { + throw new RevealException(e); + } + }); } catch (RevealException e) { LOG.debug("Revealing the vault in file manger failed: " + e.getMessage()); - throw new VolumeException(e); + if (e.getCause() instanceof VolumeException) { + throw (VolumeException) e.getCause(); + } else { + throw new VolumeException(e); + } } } diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/Vault.java b/main/commons/src/main/java/org/cryptomator/common/vaults/Vault.java index adf39c6f2..fd301c3bd 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/Vault.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/Vault.java @@ -148,7 +148,7 @@ public class Vault { } } - public void reveal(Volume.Revealer vaultRevealer) throws VolumeException { + public void reveal(Volume.RevealerFacade vaultRevealer) throws VolumeException { volume.reveal(vaultRevealer); } diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/Volume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/Volume.java index 5760ab1fe..644cd9ac1 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/Volume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/Volume.java @@ -3,8 +3,6 @@ package org.cryptomator.common.vaults; import org.cryptomator.common.mountpoint.InvalidMountPointException; import org.cryptomator.common.settings.VolumeImpl; import org.cryptomator.cryptofs.CryptoFileSystem; -import org.cryptomator.frontend.fuse.mount.Revealer; -import org.cryptomator.frontend.webdav.mount.Mounter; import java.io.IOException; import java.nio.file.Path; @@ -38,9 +36,10 @@ public interface Volume { /** * TODO: refactor, such that this method accepts a (new) interface revealer and document that it could be ignored. + * * @throws VolumeException */ - void reveal(Revealer revealer) throws VolumeException; + void reveal(RevealerFacade revealer) throws VolumeException; void unmount() throws VolumeException; @@ -85,10 +84,10 @@ public interface Volume { } - /** - * Interface to bundle the different revealer interfaces in the used nio-adapters - */ - interface Revealer extends org.cryptomator.frontend.fuse.mount.Revealer, org.cryptomator.frontend.dokany.Revealer, Mounter.Revealer{ + @FunctionalInterface + interface RevealerFacade { + + void reveal(Path p) throws VolumeException; } diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java index e25e07465..7af21d01a 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java @@ -73,12 +73,22 @@ public class WebDavVolume implements Volume { } @Override - public void reveal(Revealer r) throws VolumeException { + public void reveal(RevealerFacade r) throws VolumeException { try { - mount.reveal(r); + mount.reveal(p -> { + try { + r.reveal(p); + } catch (VolumeException e) { + throw new Mounter.RevealException(e); + } + }); } catch (Mounter.RevealException e) { LOG.debug("Revealing the vault in file manger failed: " + e.getMessage()); - throw new VolumeException(e); + if (e.getCause() instanceof VolumeException) { + throw (VolumeException) e.getCause(); + } else { + throw new VolumeException(e); + } } } diff --git a/main/ui/src/main/java/org/cryptomator/ui/common/VaultService.java b/main/ui/src/main/java/org/cryptomator/ui/common/VaultService.java index 2bd99ef98..4b9226acd 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/common/VaultService.java +++ b/main/ui/src/main/java/org/cryptomator/ui/common/VaultService.java @@ -25,7 +25,7 @@ public class VaultService { private final ExecutorService executorService; - private AtomicReference vaultRevealer; + private AtomicReference vaultRevealer; @Inject public VaultService(ExecutorService executorService) { @@ -37,7 +37,7 @@ public class VaultService { executorService.execute(createRevealTask(vault)); } - public void setVaultRevealer(Volume.Revealer revealer){ + public void setVaultRevealer(Volume.RevealerFacade revealer) { this.vaultRevealer.set(revealer); } @@ -107,13 +107,13 @@ public class VaultService { private static class RevealVaultTask extends Task { private final Vault vault; - private final Volume.Revealer revealer; + private final Volume.RevealerFacade revealer; /** * @param vault The vault to lock * @param revealer The object to use to show the vault content to the user. */ - public RevealVaultTask(Vault vault, Volume.Revealer revealer) { + public RevealVaultTask(Vault vault, Volume.RevealerFacade revealer) { this.vault = vault; this.revealer = revealer; From 886753221029ac0135b99f98f9c360904d65e65f Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 21 Jan 2021 12:42:00 +0100 Subject: [PATCH 12/20] add javadoc --- .../main/java/org/cryptomator/common/vaults/Volume.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/Volume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/Volume.java index 644cd9ac1..bf59423b4 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/Volume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/Volume.java @@ -35,8 +35,11 @@ public interface Volume { void mount(CryptoFileSystem fs, String mountFlags) throws IOException, VolumeException, InvalidMountPointException; /** - * TODO: refactor, such that this method accepts a (new) interface revealer and document that it could be ignored. + * Reveals the mounted volume. + *

+ * The given {@code revealer} might be used to do it, but not necessarily. * + * @param revealer An object capable of revealing the location of the mounted vault to view the content (e.g. in the default file browser). * @throws VolumeException */ void reveal(RevealerFacade revealer) throws VolumeException; @@ -84,6 +87,9 @@ public interface Volume { } + /** + * Hides and unifies the different Revealer implementations in the different nio-adapters. + */ @FunctionalInterface interface RevealerFacade { From 92b390d5bb68384caf0e3d4648d758071a5caefd Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 21 Jan 2021 12:44:32 +0100 Subject: [PATCH 13/20] update third-party licenses --- main/ui/src/main/resources/license/THIRD-PARTY.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/main/ui/src/main/resources/license/THIRD-PARTY.txt b/main/ui/src/main/resources/license/THIRD-PARTY.txt index b4f3ee28e..30a364776 100644 --- a/main/ui/src/main/resources/license/THIRD-PARTY.txt +++ b/main/ui/src/main/resources/license/THIRD-PARTY.txt @@ -11,7 +11,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. -Cryptomator uses 47 third-party dependencies under the following licenses: +Cryptomator uses 46 third-party dependencies under the following licenses: Apache License v2.0: - jffi (com.github.jnr:jffi:1.2.23 - http://github.com/jnr/jffi) - jnr-a64asm (com.github.jnr:jnr-a64asm:1.0.0 - http://nexus.sonatype.org/oss-repository-hosting.html/jnr-a64asm) @@ -26,7 +26,6 @@ Cryptomator uses 47 third-party dependencies under the following licenses: - Guava ListenableFuture only (com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava - https://github.com/google/guava/listenablefuture) - J2ObjC Annotations (com.google.j2objc:j2objc-annotations:1.3 - https://github.com/google/j2objc/) - Apache Commons CLI (commons-cli:commons-cli:1.4 - http://commons.apache.org/proper/commons-cli/) - - Apache Commons IO (commons-io:commons-io:2.6 - http://commons.apache.org/proper/commons-io/) - javax.inject (javax.inject:javax.inject:1 - http://code.google.com/p/atinject/) - Java Native Access (net.java.dev.jna:jna:5.6.0 - https://github.com/java-native-access/jna) - Java Native Access Platform (net.java.dev.jna:jna-platform:5.5.0 - https://github.com/java-native-access/jna) From 81fb6b879453aeebc0d414703d1d2c6050c77c5c Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Thu, 21 Jan 2021 15:06:37 +0100 Subject: [PATCH 14/20] get rid of RevealException --- .../common/vaults/DokanyVolume.java | 20 ++++--------------- .../cryptomator/common/vaults/FuseVolume.java | 20 ++++--------------- .../common/vaults/WebDavVolume.java | 19 ++++-------------- main/pom.xml | 6 +++--- 4 files changed, 15 insertions(+), 50 deletions(-) diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/DokanyVolume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/DokanyVolume.java index e00c7c6ee..e51d50fd3 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/DokanyVolume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/DokanyVolume.java @@ -8,7 +8,6 @@ import org.cryptomator.cryptofs.CryptoFileSystem; import org.cryptomator.frontend.dokany.Mount; import org.cryptomator.frontend.dokany.MountFactory; import org.cryptomator.frontend.dokany.MountFailedException; -import org.cryptomator.frontend.dokany.RevealException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -53,22 +52,11 @@ public class DokanyVolume extends AbstractVolume { } @Override - public void reveal(RevealerFacade r) throws VolumeException { + public void reveal(RevealerFacade revealer) throws VolumeException { try { - mount.reveal(p -> { - try { - r.reveal(p); - } catch (VolumeException e) { - throw new RevealException(e); - } - }); - } catch (RevealException e) { - LOG.debug("Revealing the vault in file manger failed: " + e.getMessage()); - if (e.getCause() instanceof VolumeException) { - throw (VolumeException) e.getCause(); - } else { - throw new VolumeException(e); - } + mount.reveal(revealer::reveal); + } catch (Exception e) { + throw new VolumeException(e); } } diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/FuseVolume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/FuseVolume.java index 191b47526..b8d3b650d 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/FuseVolume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/FuseVolume.java @@ -12,7 +12,6 @@ import org.cryptomator.frontend.fuse.mount.FuseMountFactory; import org.cryptomator.frontend.fuse.mount.FuseNotSupportedException; import org.cryptomator.frontend.fuse.mount.Mount; import org.cryptomator.frontend.fuse.mount.Mounter; -import org.cryptomator.frontend.fuse.mount.RevealException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -73,22 +72,11 @@ public class FuseVolume extends AbstractVolume { } @Override - public void reveal(RevealerFacade r) throws VolumeException { + public void reveal(RevealerFacade revealer) throws VolumeException { try { - mount.reveal(p -> { - try { - r.reveal(p); - } catch (VolumeException e) { - throw new RevealException(e); - } - }); - } catch (RevealException e) { - LOG.debug("Revealing the vault in file manger failed: " + e.getMessage()); - if (e.getCause() instanceof VolumeException) { - throw (VolumeException) e.getCause(); - } else { - throw new VolumeException(e); - } + mount.reveal(revealer::reveal); + } catch (Exception e) { + throw new VolumeException(e); } } diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java index 7af21d01a..312098303 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java @@ -73,22 +73,11 @@ public class WebDavVolume implements Volume { } @Override - public void reveal(RevealerFacade r) throws VolumeException { + public void reveal(RevealerFacade revealer) throws VolumeException { try { - mount.reveal(p -> { - try { - r.reveal(p); - } catch (VolumeException e) { - throw new Mounter.RevealException(e); - } - }); - } catch (Mounter.RevealException e) { - LOG.debug("Revealing the vault in file manger failed: " + e.getMessage()); - if (e.getCause() instanceof VolumeException) { - throw (VolumeException) e.getCause(); - } else { - throw new VolumeException(e); - } + mount.reveal(revealer::reveal); + } catch (Exception e) { + throw new VolumeException(e); } } diff --git a/main/pom.xml b/main/pom.xml index dda21d3b6..fbeed196e 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -29,9 +29,9 @@ 0.2.1 0.1.0-beta3 0.1.0-beta2 - 1.2.7 - 1.2.2 - 1.1.0 + 1.2.8 + 1.2.3 + 1.1.1 15 From d5eb84a000d6273366eda487fa05171271e84f10 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 21 Jan 2021 15:26:35 +0100 Subject: [PATCH 15/20] change reveal method in vault service: * revealer is no member anymore * reveal() takes as second argument revealer object * several other classes hand over a revealer object * added awt-revealer if application is not yet started --- .../cryptomator/ui/common/VaultService.java | 15 +++-------- .../cryptomator/ui/fxapp/FxApplication.java | 2 -- .../VaultDetailUnlockedController.java | 2 +- .../ui/traymenu/TrayMenuComponent.java | 3 +-- .../ui/traymenu/TrayMenuController.java | 7 +++-- .../ui/traymenu/TrayMenuModule.java | 27 +++++++++++++++++++ .../ui/unlock/UnlockSuccessController.java | 7 +++-- .../cryptomator/ui/unlock/UnlockWorkflow.java | 7 +++-- 8 files changed, 48 insertions(+), 22 deletions(-) create mode 100644 main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuModule.java diff --git a/main/ui/src/main/java/org/cryptomator/ui/common/VaultService.java b/main/ui/src/main/java/org/cryptomator/ui/common/VaultService.java index 4b9226acd..4baa9526c 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/common/VaultService.java +++ b/main/ui/src/main/java/org/cryptomator/ui/common/VaultService.java @@ -25,20 +25,13 @@ public class VaultService { private final ExecutorService executorService; - private AtomicReference vaultRevealer; - @Inject public VaultService(ExecutorService executorService) { this.executorService = executorService; - this.vaultRevealer = new AtomicReference<>(p -> {}); //the inital revealer does nuthin } - public void reveal(Vault vault) { - executorService.execute(createRevealTask(vault)); - } - - public void setVaultRevealer(Volume.RevealerFacade revealer) { - this.vaultRevealer.set(revealer); + public void reveal(Vault vault, Volume.RevealerFacade vaultRevealCmd) { + executorService.execute(createRevealTask(vault, vaultRevealCmd)); } /** @@ -46,8 +39,8 @@ public class VaultService { * * @param vault The vault to reveal */ - public Task createRevealTask(Vault vault) { - Task task = new RevealVaultTask(vault, vaultRevealer.get()); + public Task createRevealTask(Vault vault, Volume.RevealerFacade vaultRevealCmd) { + Task task = new RevealVaultTask(vault, vaultRevealCmd); task.setOnSucceeded(evt -> LOG.info("Revealed {}", vault.getDisplayName())); task.setOnFailed(evt -> LOG.error("Failed to reveal " + vault.getDisplayName(), evt.getSource().getException())); return task; diff --git a/main/ui/src/main/java/org/cryptomator/ui/fxapp/FxApplication.java b/main/ui/src/main/java/org/cryptomator/ui/fxapp/FxApplication.java index 8633b6e8b..65e6d1c6c 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/fxapp/FxApplication.java +++ b/main/ui/src/main/java/org/cryptomator/ui/fxapp/FxApplication.java @@ -68,8 +68,6 @@ public class FxApplication extends Application { this.licenseHolder = licenseHolder; this.visibleWindows = Stage.getWindows().filtered(Window::isShowing); this.hasVisibleWindows = Bindings.isNotEmpty(visibleWindows); - - vaultService.setVaultRevealer(p -> this.getHostServices().showDocument(p.toUri().toString())); } public void start() { diff --git a/main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailUnlockedController.java b/main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailUnlockedController.java index 0af909bbc..b85fa8bda 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailUnlockedController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailUnlockedController.java @@ -42,7 +42,7 @@ public class VaultDetailUnlockedController implements FxController { @FXML public void revealAccessLocation() { - vaultService.reveal(vault.get()); + vaultService.reveal(vault.get(), p -> application.getHostServices().showDocument(p.toUri().toString())); } @FXML diff --git a/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuComponent.java b/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuComponent.java index a4e068f8d..75e1b793c 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuComponent.java +++ b/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuComponent.java @@ -7,11 +7,10 @@ package org.cryptomator.ui.traymenu; import dagger.Lazy; import dagger.Subcomponent; - import java.awt.SystemTray; @TrayMenuScoped -@Subcomponent +@Subcomponent(modules = TrayMenuModule.class) public interface TrayMenuComponent { Lazy trayIconController(); diff --git a/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuController.java b/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuController.java index 96529c5fb..fada2b061 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuController.java @@ -1,6 +1,7 @@ package org.cryptomator.ui.traymenu; import org.cryptomator.common.vaults.Vault; +import org.cryptomator.common.vaults.Volume; import org.cryptomator.ui.fxapp.FxApplication; import org.cryptomator.ui.launcher.AppLifecycleListener; import org.cryptomator.ui.launcher.FxApplicationStarter; @@ -27,14 +28,16 @@ class TrayMenuController { private final AppLifecycleListener appLifecycle; private final FxApplicationStarter fxApplicationStarter; private final ObservableList vaults; + private final Volume.RevealerFacade revealer; private final PopupMenu menu; @Inject - TrayMenuController(ResourceBundle resourceBundle, AppLifecycleListener appLifecycle, FxApplicationStarter fxApplicationStarter, ObservableList vaults) { + TrayMenuController(ResourceBundle resourceBundle, AppLifecycleListener appLifecycle, FxApplicationStarter fxApplicationStarter, ObservableList vaults, Volume.RevealerFacade revealer) { this.resourceBundle = resourceBundle; this.appLifecycle = appLifecycle; this.fxApplicationStarter = fxApplicationStarter; this.vaults = vaults; + this.revealer = revealer; this.menu = new PopupMenu(); } @@ -121,7 +124,7 @@ class TrayMenuController { } private void revealVault(Vault vault) { - showMainAppAndThen(app -> app.getVaultService().reveal(vault)); + showMainAppAndThen(app -> app.getVaultService().reveal(vault, revealer)); } void showMainWindow(@SuppressWarnings("unused") ActionEvent actionEvent) { diff --git a/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuModule.java b/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuModule.java new file mode 100644 index 000000000..65227a880 --- /dev/null +++ b/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuModule.java @@ -0,0 +1,27 @@ +package org.cryptomator.ui.traymenu; + +import dagger.Module; +import dagger.Provides; +import org.cryptomator.common.vaults.Volume; + +import java.awt.Desktop; +import java.io.IOException; + +@Module +abstract class TrayMenuModule { + + @Provides + static Volume.RevealerFacade provideAwtRevealer(){ + return p -> { + if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.OPEN)) { + try { + Desktop.getDesktop().open(p.toFile()); + } catch (IOException e) { + throw new Volume.VolumeException(e); + } + } else { + throw new Volume.VolumeException("API to browse files not supported. Please try again from inside the application."); + } + }; + } +} diff --git a/main/ui/src/main/java/org/cryptomator/ui/unlock/UnlockSuccessController.java b/main/ui/src/main/java/org/cryptomator/ui/unlock/UnlockSuccessController.java index ee3ffc5ae..ef1d4fdf3 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/unlock/UnlockSuccessController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/unlock/UnlockSuccessController.java @@ -4,6 +4,7 @@ import org.cryptomator.common.settings.WhenUnlocked; import org.cryptomator.common.vaults.Vault; import org.cryptomator.ui.common.FxController; import org.cryptomator.ui.common.VaultService; +import org.cryptomator.ui.fxapp.FxApplication; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -29,17 +30,19 @@ public class UnlockSuccessController implements FxController { private final Vault vault; private final ExecutorService executor; private final VaultService vaultService; + private final FxApplication application; private final ObjectProperty revealButtonState; private final BooleanProperty revealButtonDisabled; public CheckBox rememberChoiceCheckbox; @Inject - public UnlockSuccessController(@UnlockWindow Stage window, @UnlockWindow Vault vault, ExecutorService executor, VaultService vaultService) { + public UnlockSuccessController(@UnlockWindow Stage window, @UnlockWindow Vault vault, ExecutorService executor, VaultService vaultService, FxApplication application) { this.window = window; this.vault = vault; this.executor = executor; this.vaultService = vaultService; + this.application = application; this.revealButtonState = new SimpleObjectProperty<>(ContentDisplay.TEXT_ONLY); this.revealButtonDisabled = new SimpleBooleanProperty(); } @@ -59,7 +62,7 @@ public class UnlockSuccessController implements FxController { revealButtonState.set(ContentDisplay.LEFT); revealButtonDisabled.set(true); - Task revealTask = vaultService.createRevealTask(vault); + Task revealTask = vaultService.createRevealTask(vault, p -> application.getHostServices().showDocument(p.toUri().toString())); revealTask.setOnSucceeded(evt -> { revealButtonState.set(ContentDisplay.TEXT_ONLY); revealButtonDisabled.set(false); diff --git a/main/ui/src/main/java/org/cryptomator/ui/unlock/UnlockWorkflow.java b/main/ui/src/main/java/org/cryptomator/ui/unlock/UnlockWorkflow.java index 8cb7e0752..87e666f2d 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/unlock/UnlockWorkflow.java +++ b/main/ui/src/main/java/org/cryptomator/ui/unlock/UnlockWorkflow.java @@ -15,6 +15,7 @@ import org.cryptomator.ui.common.FxmlFile; import org.cryptomator.ui.common.FxmlScene; import org.cryptomator.ui.common.UserInteractionLock; import org.cryptomator.ui.common.VaultService; +import org.cryptomator.ui.fxapp.FxApplication; import org.cryptomator.ui.unlock.UnlockModule.PasswordEntry; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -58,9 +59,10 @@ public class UnlockWorkflow extends Task { private final Lazy successScene; private final Lazy invalidMountPointScene; private final ErrorComponent.Builder errorComponent; + private final FxApplication application; @Inject - UnlockWorkflow(@UnlockWindow Stage window, @UnlockWindow Vault vault, VaultService vaultService, AtomicReference password, @Named("savePassword") AtomicBoolean savePassword, @Named("savedPassword") Optional savedPassword, UserInteractionLock passwordEntryLock, KeychainManager keychain, @FxmlScene(FxmlFile.UNLOCK) Lazy unlockScene, @FxmlScene(FxmlFile.UNLOCK_SUCCESS) Lazy successScene, @FxmlScene(FxmlFile.UNLOCK_INVALID_MOUNT_POINT) Lazy invalidMountPointScene, ErrorComponent.Builder errorComponent) { + UnlockWorkflow(@UnlockWindow Stage window, @UnlockWindow Vault vault, VaultService vaultService, AtomicReference password, @Named("savePassword") AtomicBoolean savePassword, @Named("savedPassword") Optional savedPassword, UserInteractionLock passwordEntryLock, KeychainManager keychain, @FxmlScene(FxmlFile.UNLOCK) Lazy unlockScene, @FxmlScene(FxmlFile.UNLOCK_SUCCESS) Lazy successScene, @FxmlScene(FxmlFile.UNLOCK_INVALID_MOUNT_POINT) Lazy invalidMountPointScene, ErrorComponent.Builder errorComponent, FxApplication application) { this.window = window; this.vault = vault; this.vaultService = vaultService; @@ -73,6 +75,7 @@ public class UnlockWorkflow extends Task { this.successScene = successScene; this.invalidMountPointScene = invalidMountPointScene; this.errorComponent = errorComponent; + this.application = application; setOnFailed(event -> { Throwable throwable = event.getSource().getException(); @@ -143,7 +146,7 @@ public class UnlockWorkflow extends Task { }); case REVEAL -> { Platform.runLater(window::close); - vaultService.reveal(vault); + vaultService.reveal(vault, p -> application.getHostServices().showDocument(p.toUri().toString())); } case IGNORE -> Platform.runLater(window::close); } From 89774406974f07f8d371672dcef8cdbe43dbc785 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 21 Jan 2021 15:29:04 +0100 Subject: [PATCH 16/20] Rename RevealerFacade to Revealer --- .../java/org/cryptomator/common/vaults/DokanyVolume.java | 2 +- .../java/org/cryptomator/common/vaults/FuseVolume.java | 2 +- .../main/java/org/cryptomator/common/vaults/Vault.java | 2 +- .../main/java/org/cryptomator/common/vaults/Volume.java | 4 ++-- .../java/org/cryptomator/common/vaults/WebDavVolume.java | 2 +- .../java/org/cryptomator/ui/common/VaultService.java | 9 ++++----- .../org/cryptomator/ui/traymenu/TrayMenuController.java | 4 ++-- .../java/org/cryptomator/ui/traymenu/TrayMenuModule.java | 2 +- 8 files changed, 13 insertions(+), 14 deletions(-) diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/DokanyVolume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/DokanyVolume.java index e51d50fd3..a33dbd5ee 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/DokanyVolume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/DokanyVolume.java @@ -52,7 +52,7 @@ public class DokanyVolume extends AbstractVolume { } @Override - public void reveal(RevealerFacade revealer) throws VolumeException { + public void reveal(Revealer revealer) throws VolumeException { try { mount.reveal(revealer::reveal); } catch (Exception e) { diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/FuseVolume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/FuseVolume.java index b8d3b650d..5400f8ff2 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/FuseVolume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/FuseVolume.java @@ -72,7 +72,7 @@ public class FuseVolume extends AbstractVolume { } @Override - public void reveal(RevealerFacade revealer) throws VolumeException { + public void reveal(Revealer revealer) throws VolumeException { try { mount.reveal(revealer::reveal); } catch (Exception e) { diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/Vault.java b/main/commons/src/main/java/org/cryptomator/common/vaults/Vault.java index fd301c3bd..adf39c6f2 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/Vault.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/Vault.java @@ -148,7 +148,7 @@ public class Vault { } } - public void reveal(Volume.RevealerFacade vaultRevealer) throws VolumeException { + public void reveal(Volume.Revealer vaultRevealer) throws VolumeException { volume.reveal(vaultRevealer); } diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/Volume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/Volume.java index bf59423b4..74a307d5a 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/Volume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/Volume.java @@ -42,7 +42,7 @@ public interface Volume { * @param revealer An object capable of revealing the location of the mounted vault to view the content (e.g. in the default file browser). * @throws VolumeException */ - void reveal(RevealerFacade revealer) throws VolumeException; + void reveal(Revealer revealer) throws VolumeException; void unmount() throws VolumeException; @@ -91,7 +91,7 @@ public interface Volume { * Hides and unifies the different Revealer implementations in the different nio-adapters. */ @FunctionalInterface - interface RevealerFacade { + interface Revealer { void reveal(Path p) throws VolumeException; diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java index 312098303..072851272 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java @@ -73,7 +73,7 @@ public class WebDavVolume implements Volume { } @Override - public void reveal(RevealerFacade revealer) throws VolumeException { + public void reveal(Revealer revealer) throws VolumeException { try { mount.reveal(revealer::reveal); } catch (Exception e) { diff --git a/main/ui/src/main/java/org/cryptomator/ui/common/VaultService.java b/main/ui/src/main/java/org/cryptomator/ui/common/VaultService.java index 4baa9526c..775b953bb 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/common/VaultService.java +++ b/main/ui/src/main/java/org/cryptomator/ui/common/VaultService.java @@ -15,7 +15,6 @@ import java.util.Iterator; import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; -import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @FxApplicationScoped @@ -30,7 +29,7 @@ public class VaultService { this.executorService = executorService; } - public void reveal(Vault vault, Volume.RevealerFacade vaultRevealCmd) { + public void reveal(Vault vault, Volume.Revealer vaultRevealCmd) { executorService.execute(createRevealTask(vault, vaultRevealCmd)); } @@ -39,7 +38,7 @@ public class VaultService { * * @param vault The vault to reveal */ - public Task createRevealTask(Vault vault, Volume.RevealerFacade vaultRevealCmd) { + public Task createRevealTask(Vault vault, Volume.Revealer vaultRevealCmd) { Task task = new RevealVaultTask(vault, vaultRevealCmd); task.setOnSucceeded(evt -> LOG.info("Revealed {}", vault.getDisplayName())); task.setOnFailed(evt -> LOG.error("Failed to reveal " + vault.getDisplayName(), evt.getSource().getException())); @@ -100,13 +99,13 @@ public class VaultService { private static class RevealVaultTask extends Task { private final Vault vault; - private final Volume.RevealerFacade revealer; + private final Volume.Revealer revealer; /** * @param vault The vault to lock * @param revealer The object to use to show the vault content to the user. */ - public RevealVaultTask(Vault vault, Volume.RevealerFacade revealer) { + public RevealVaultTask(Vault vault, Volume.Revealer revealer) { this.vault = vault; this.revealer = revealer; diff --git a/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuController.java b/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuController.java index fada2b061..9d45b1b68 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuController.java @@ -28,11 +28,11 @@ class TrayMenuController { private final AppLifecycleListener appLifecycle; private final FxApplicationStarter fxApplicationStarter; private final ObservableList vaults; - private final Volume.RevealerFacade revealer; + private final Volume.Revealer revealer; private final PopupMenu menu; @Inject - TrayMenuController(ResourceBundle resourceBundle, AppLifecycleListener appLifecycle, FxApplicationStarter fxApplicationStarter, ObservableList vaults, Volume.RevealerFacade revealer) { + TrayMenuController(ResourceBundle resourceBundle, AppLifecycleListener appLifecycle, FxApplicationStarter fxApplicationStarter, ObservableList vaults, Volume.Revealer revealer) { this.resourceBundle = resourceBundle; this.appLifecycle = appLifecycle; this.fxApplicationStarter = fxApplicationStarter; diff --git a/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuModule.java b/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuModule.java index 65227a880..99cf3d441 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuModule.java +++ b/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuModule.java @@ -11,7 +11,7 @@ import java.io.IOException; abstract class TrayMenuModule { @Provides - static Volume.RevealerFacade provideAwtRevealer(){ + static Volume.Revealer provideAwtRevealer(){ return p -> { if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.OPEN)) { try { From 95cef3423465b45fe3c374adc67f440f974ff966 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 21 Jan 2021 16:09:16 +0100 Subject: [PATCH 17/20] remove unnecessary awtReavealer and trayModule --- .../ui/traymenu/TrayMenuComponent.java | 2 +- .../ui/traymenu/TrayMenuController.java | 9 +++---- .../ui/traymenu/TrayMenuModule.java | 27 ------------------- 3 files changed, 5 insertions(+), 33 deletions(-) delete mode 100644 main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuModule.java diff --git a/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuComponent.java b/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuComponent.java index 75e1b793c..c4cbfd456 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuComponent.java +++ b/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuComponent.java @@ -10,7 +10,7 @@ import dagger.Subcomponent; import java.awt.SystemTray; @TrayMenuScoped -@Subcomponent(modules = TrayMenuModule.class) +@Subcomponent public interface TrayMenuComponent { Lazy trayIconController(); diff --git a/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuController.java b/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuController.java index 9d45b1b68..3311450e9 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuController.java @@ -1,7 +1,6 @@ package org.cryptomator.ui.traymenu; import org.cryptomator.common.vaults.Vault; -import org.cryptomator.common.vaults.Volume; import org.cryptomator.ui.fxapp.FxApplication; import org.cryptomator.ui.launcher.AppLifecycleListener; import org.cryptomator.ui.launcher.FxApplicationStarter; @@ -28,16 +27,14 @@ class TrayMenuController { private final AppLifecycleListener appLifecycle; private final FxApplicationStarter fxApplicationStarter; private final ObservableList vaults; - private final Volume.Revealer revealer; private final PopupMenu menu; @Inject - TrayMenuController(ResourceBundle resourceBundle, AppLifecycleListener appLifecycle, FxApplicationStarter fxApplicationStarter, ObservableList vaults, Volume.Revealer revealer) { + TrayMenuController(ResourceBundle resourceBundle, AppLifecycleListener appLifecycle, FxApplicationStarter fxApplicationStarter, ObservableList vaults) { this.resourceBundle = resourceBundle; this.appLifecycle = appLifecycle; this.fxApplicationStarter = fxApplicationStarter; this.vaults = vaults; - this.revealer = revealer; this.menu = new PopupMenu(); } @@ -124,7 +121,9 @@ class TrayMenuController { } private void revealVault(Vault vault) { - showMainAppAndThen(app -> app.getVaultService().reveal(vault, revealer)); + showMainAppAndThen(app -> // + app.getVaultService().reveal(vault, p -> app.getHostServices().showDocument(p.toUri().toString())) // + ); } void showMainWindow(@SuppressWarnings("unused") ActionEvent actionEvent) { diff --git a/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuModule.java b/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuModule.java deleted file mode 100644 index 99cf3d441..000000000 --- a/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuModule.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.cryptomator.ui.traymenu; - -import dagger.Module; -import dagger.Provides; -import org.cryptomator.common.vaults.Volume; - -import java.awt.Desktop; -import java.io.IOException; - -@Module -abstract class TrayMenuModule { - - @Provides - static Volume.Revealer provideAwtRevealer(){ - return p -> { - if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.OPEN)) { - try { - Desktop.getDesktop().open(p.toFile()); - } catch (IOException e) { - throw new Volume.VolumeException(e); - } - } else { - throw new Volume.VolumeException("API to browse files not supported. Please try again from inside the application."); - } - }; - } -} From 7cd5c6683607aa667d8cf43f3e86c6e6e2343773 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 21 Jan 2021 17:25:23 +0100 Subject: [PATCH 18/20] Refactor reveal() methods: * new class HostServiceRevealer implemeting the Volume.Revealer-Interface * this class is injected in vault service and always used for revealing * removed Revealer parameter from several reveal methods --- .../ui/common/HostServiceRevealer.java | 24 +++++++++++++++++++ .../cryptomator/ui/common/VaultService.java | 12 ++++++---- .../VaultDetailUnlockedController.java | 2 +- .../ui/traymenu/TrayMenuController.java | 4 +--- .../ui/unlock/UnlockSuccessController.java | 7 ++---- .../cryptomator/ui/unlock/UnlockWorkflow.java | 7 ++---- 6 files changed, 37 insertions(+), 19 deletions(-) create mode 100644 main/ui/src/main/java/org/cryptomator/ui/common/HostServiceRevealer.java diff --git a/main/ui/src/main/java/org/cryptomator/ui/common/HostServiceRevealer.java b/main/ui/src/main/java/org/cryptomator/ui/common/HostServiceRevealer.java new file mode 100644 index 000000000..966fd00bb --- /dev/null +++ b/main/ui/src/main/java/org/cryptomator/ui/common/HostServiceRevealer.java @@ -0,0 +1,24 @@ +package org.cryptomator.ui.common; + +import org.cryptomator.common.vaults.Volume; +import org.cryptomator.ui.launcher.FxApplicationStarter; + +import javax.inject.Inject; +import javax.inject.Singleton; +import java.nio.file.Path; + +@Singleton +public class HostServiceRevealer implements Volume.Revealer { + + private final FxApplicationStarter fxApplicationStarter; + + @Inject + public HostServiceRevealer(FxApplicationStarter fxApplicationStarter) { + this.fxApplicationStarter = fxApplicationStarter; + } + + @Override + public void reveal(Path p) throws Volume.VolumeException { + fxApplicationStarter.get().thenAccept(app -> app.getHostServices().showDocument(p.toUri().toString())); + } +} diff --git a/main/ui/src/main/java/org/cryptomator/ui/common/VaultService.java b/main/ui/src/main/java/org/cryptomator/ui/common/VaultService.java index 775b953bb..57393b858 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/common/VaultService.java +++ b/main/ui/src/main/java/org/cryptomator/ui/common/VaultService.java @@ -23,14 +23,16 @@ public class VaultService { private static final Logger LOG = LoggerFactory.getLogger(VaultService.class); private final ExecutorService executorService; + private final HostServiceRevealer vaultRevealer; @Inject - public VaultService(ExecutorService executorService) { + public VaultService(ExecutorService executorService, HostServiceRevealer vaultRevealer) { this.executorService = executorService; + this.vaultRevealer = vaultRevealer; } - public void reveal(Vault vault, Volume.Revealer vaultRevealCmd) { - executorService.execute(createRevealTask(vault, vaultRevealCmd)); + public void reveal(Vault vault) { + executorService.execute(createRevealTask(vault)); } /** @@ -38,8 +40,8 @@ public class VaultService { * * @param vault The vault to reveal */ - public Task createRevealTask(Vault vault, Volume.Revealer vaultRevealCmd) { - Task task = new RevealVaultTask(vault, vaultRevealCmd); + public Task createRevealTask(Vault vault) { + Task task = new RevealVaultTask(vault, vaultRevealer); task.setOnSucceeded(evt -> LOG.info("Revealed {}", vault.getDisplayName())); task.setOnFailed(evt -> LOG.error("Failed to reveal " + vault.getDisplayName(), evt.getSource().getException())); return task; diff --git a/main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailUnlockedController.java b/main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailUnlockedController.java index b85fa8bda..0af909bbc 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailUnlockedController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailUnlockedController.java @@ -42,7 +42,7 @@ public class VaultDetailUnlockedController implements FxController { @FXML public void revealAccessLocation() { - vaultService.reveal(vault.get(), p -> application.getHostServices().showDocument(p.toUri().toString())); + vaultService.reveal(vault.get()); } @FXML diff --git a/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuController.java b/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuController.java index 3311450e9..96529c5fb 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuController.java @@ -121,9 +121,7 @@ class TrayMenuController { } private void revealVault(Vault vault) { - showMainAppAndThen(app -> // - app.getVaultService().reveal(vault, p -> app.getHostServices().showDocument(p.toUri().toString())) // - ); + showMainAppAndThen(app -> app.getVaultService().reveal(vault)); } void showMainWindow(@SuppressWarnings("unused") ActionEvent actionEvent) { diff --git a/main/ui/src/main/java/org/cryptomator/ui/unlock/UnlockSuccessController.java b/main/ui/src/main/java/org/cryptomator/ui/unlock/UnlockSuccessController.java index ef1d4fdf3..ee3ffc5ae 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/unlock/UnlockSuccessController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/unlock/UnlockSuccessController.java @@ -4,7 +4,6 @@ import org.cryptomator.common.settings.WhenUnlocked; import org.cryptomator.common.vaults.Vault; import org.cryptomator.ui.common.FxController; import org.cryptomator.ui.common.VaultService; -import org.cryptomator.ui.fxapp.FxApplication; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -30,19 +29,17 @@ public class UnlockSuccessController implements FxController { private final Vault vault; private final ExecutorService executor; private final VaultService vaultService; - private final FxApplication application; private final ObjectProperty revealButtonState; private final BooleanProperty revealButtonDisabled; public CheckBox rememberChoiceCheckbox; @Inject - public UnlockSuccessController(@UnlockWindow Stage window, @UnlockWindow Vault vault, ExecutorService executor, VaultService vaultService, FxApplication application) { + public UnlockSuccessController(@UnlockWindow Stage window, @UnlockWindow Vault vault, ExecutorService executor, VaultService vaultService) { this.window = window; this.vault = vault; this.executor = executor; this.vaultService = vaultService; - this.application = application; this.revealButtonState = new SimpleObjectProperty<>(ContentDisplay.TEXT_ONLY); this.revealButtonDisabled = new SimpleBooleanProperty(); } @@ -62,7 +59,7 @@ public class UnlockSuccessController implements FxController { revealButtonState.set(ContentDisplay.LEFT); revealButtonDisabled.set(true); - Task revealTask = vaultService.createRevealTask(vault, p -> application.getHostServices().showDocument(p.toUri().toString())); + Task revealTask = vaultService.createRevealTask(vault); revealTask.setOnSucceeded(evt -> { revealButtonState.set(ContentDisplay.TEXT_ONLY); revealButtonDisabled.set(false); diff --git a/main/ui/src/main/java/org/cryptomator/ui/unlock/UnlockWorkflow.java b/main/ui/src/main/java/org/cryptomator/ui/unlock/UnlockWorkflow.java index 87e666f2d..8cb7e0752 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/unlock/UnlockWorkflow.java +++ b/main/ui/src/main/java/org/cryptomator/ui/unlock/UnlockWorkflow.java @@ -15,7 +15,6 @@ import org.cryptomator.ui.common.FxmlFile; import org.cryptomator.ui.common.FxmlScene; import org.cryptomator.ui.common.UserInteractionLock; import org.cryptomator.ui.common.VaultService; -import org.cryptomator.ui.fxapp.FxApplication; import org.cryptomator.ui.unlock.UnlockModule.PasswordEntry; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -59,10 +58,9 @@ public class UnlockWorkflow extends Task { private final Lazy successScene; private final Lazy invalidMountPointScene; private final ErrorComponent.Builder errorComponent; - private final FxApplication application; @Inject - UnlockWorkflow(@UnlockWindow Stage window, @UnlockWindow Vault vault, VaultService vaultService, AtomicReference password, @Named("savePassword") AtomicBoolean savePassword, @Named("savedPassword") Optional savedPassword, UserInteractionLock passwordEntryLock, KeychainManager keychain, @FxmlScene(FxmlFile.UNLOCK) Lazy unlockScene, @FxmlScene(FxmlFile.UNLOCK_SUCCESS) Lazy successScene, @FxmlScene(FxmlFile.UNLOCK_INVALID_MOUNT_POINT) Lazy invalidMountPointScene, ErrorComponent.Builder errorComponent, FxApplication application) { + UnlockWorkflow(@UnlockWindow Stage window, @UnlockWindow Vault vault, VaultService vaultService, AtomicReference password, @Named("savePassword") AtomicBoolean savePassword, @Named("savedPassword") Optional savedPassword, UserInteractionLock passwordEntryLock, KeychainManager keychain, @FxmlScene(FxmlFile.UNLOCK) Lazy unlockScene, @FxmlScene(FxmlFile.UNLOCK_SUCCESS) Lazy successScene, @FxmlScene(FxmlFile.UNLOCK_INVALID_MOUNT_POINT) Lazy invalidMountPointScene, ErrorComponent.Builder errorComponent) { this.window = window; this.vault = vault; this.vaultService = vaultService; @@ -75,7 +73,6 @@ public class UnlockWorkflow extends Task { this.successScene = successScene; this.invalidMountPointScene = invalidMountPointScene; this.errorComponent = errorComponent; - this.application = application; setOnFailed(event -> { Throwable throwable = event.getSource().getException(); @@ -146,7 +143,7 @@ public class UnlockWorkflow extends Task { }); case REVEAL -> { Platform.runLater(window::close); - vaultService.reveal(vault, p -> application.getHostServices().showDocument(p.toUri().toString())); + vaultService.reveal(vault); } case IGNORE -> Platform.runLater(window::close); } From b1d7cfc81bb8ae73567af09b8d86c98ae2bdeec4 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Fri, 22 Jan 2021 09:31:43 +0100 Subject: [PATCH 19/20] change scope of HostServiceRevealer to @FxApplicationScoped because unlock always happens after application start anyway --- .../ui/common/HostServiceRevealer.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/main/ui/src/main/java/org/cryptomator/ui/common/HostServiceRevealer.java b/main/ui/src/main/java/org/cryptomator/ui/common/HostServiceRevealer.java index 966fd00bb..829480592 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/common/HostServiceRevealer.java +++ b/main/ui/src/main/java/org/cryptomator/ui/common/HostServiceRevealer.java @@ -1,24 +1,25 @@ package org.cryptomator.ui.common; +import dagger.Lazy; import org.cryptomator.common.vaults.Volume; -import org.cryptomator.ui.launcher.FxApplicationStarter; +import org.cryptomator.ui.fxapp.FxApplicationScoped; import javax.inject.Inject; -import javax.inject.Singleton; +import javafx.application.Application; import java.nio.file.Path; -@Singleton +@FxApplicationScoped public class HostServiceRevealer implements Volume.Revealer { - private final FxApplicationStarter fxApplicationStarter; + private final Lazy application; @Inject - public HostServiceRevealer(FxApplicationStarter fxApplicationStarter) { - this.fxApplicationStarter = fxApplicationStarter; + public HostServiceRevealer(Lazy application) { + this.application = application; } @Override public void reveal(Path p) throws Volume.VolumeException { - fxApplicationStarter.get().thenAccept(app -> app.getHostServices().showDocument(p.toUri().toString())); + application.get().getHostServices().showDocument(p.toUri().toString()); } } From b2f27c0a3d7784aac312eec4379a2ff924a8f738 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Fri, 22 Jan 2021 09:34:18 +0100 Subject: [PATCH 20/20] removed dead code [ci skip] --- .../main/java/org/cryptomator/common/vaults/WebDavVolume.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java index 072851272..5864b39e1 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java @@ -10,8 +10,6 @@ import org.cryptomator.frontend.webdav.WebDavServer; import org.cryptomator.frontend.webdav.mount.MountParams; import org.cryptomator.frontend.webdav.mount.Mounter; import org.cryptomator.frontend.webdav.servlet.WebDavServletController; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import javax.inject.Inject; import javax.inject.Provider; @@ -22,7 +20,6 @@ import java.util.Optional; public class WebDavVolume implements Volume { - private static final Logger LOG = LoggerFactory.getLogger(WebDavVolume.class); private static final String LOCALHOST_ALIAS = "cryptomator-vault"; private final Provider serverProvider;