瀏覽代碼

adding cryptofs to pom and add implementation notes to migrate dialogue

Armin Schrenk 5 年之前
父節點
當前提交
b1dc983d6b
共有 2 個文件被更改,包括 10 次插入2 次删除
  1. 1 1
      main/pom.xml
  2. 9 1
      main/ui/src/main/java/org/cryptomator/ui/migration/MigrationRunController.java

+ 1 - 1
main/pom.xml

@@ -24,7 +24,7 @@
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 
 		<!-- cryptomator dependencies -->
-		<cryptomator.cryptofs.version>1.9.7</cryptomator.cryptofs.version>
+		<cryptomator.cryptofs.version>1.10.0-SNAPSHOT</cryptomator.cryptofs.version>
 		<cryptomator.jni.version>2.2.2</cryptomator.jni.version>
 		<cryptomator.fuse.version>1.2.3</cryptomator.fuse.version>
 		<cryptomator.dokany.version>1.1.13</cryptomator.dokany.version>

+ 9 - 1
main/ui/src/main/java/org/cryptomator/ui/migration/MigrationRunController.java

@@ -18,6 +18,7 @@ import org.cryptomator.common.vaults.Vault;
 import org.cryptomator.common.vaults.VaultState;
 import org.cryptomator.cryptofs.common.FileSystemCapabilityChecker;
 import org.cryptomator.cryptofs.migration.Migrators;
+import org.cryptomator.cryptofs.migration.api.MigrationContinuationListener;
 import org.cryptomator.cryptofs.migration.api.MigrationProgressListener;
 import org.cryptomator.cryptolib.api.InvalidPassphraseException;
 import org.cryptomator.keychain.KeychainAccess;
@@ -107,7 +108,7 @@ public class MigrationRunController implements FxController {
 		}, 0, MIGRATION_PROGRESS_UPDATE_MILLIS, TimeUnit.MILLISECONDS);
 		Tasks.create(() -> {
 			Migrators migrators = Migrators.get();
-			migrators.migrate(vault.getPath(), MASTERKEY_FILENAME, password, this::migrationProgressChanged);
+			migrators.migrate(vault.getPath(), MASTERKEY_FILENAME, password, this::migrationProgressChanged, this::migrationRequiresInput);
 			return migrators.needsMigration(vault.getPath(), MASTERKEY_FILENAME);
 		}).onSuccess(needsAnotherMigration -> {
 			if (needsAnotherMigration) {
@@ -149,6 +150,13 @@ public class MigrationRunController implements FxController {
 		};
 	}
 
+	private MigrationContinuationListener.ContinuationResult migrationRequiresInput(MigrationContinuationListener.ContinuationEvent event){
+		//TODO: creating a new scene seems a little over the top, maybe stick to this scene
+		// my suggestion is to make this quick and dirty by setting some elements unmanaged and invisible and afterwards activate them again
+		// otherwise: We need a more abstract runController which has two subviews (run and halted), see mainWindow for example
+		return MigrationContinuationListener.ContinuationResult.PROCEED;
+	}
+
 	private void loadStoredPassword() {
 		assert keychainAccess.isPresent();
 		char[] storedPw = null;