mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-22 04:31:27 +00:00
- cleanup
- fix: now showing correct view, when selecting an already mounted directory
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package org.cryptomator.ui.util;
|
||||
package org.cryptomator.files;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.FileVisitResult;
|
||||
@@ -37,10 +37,10 @@ import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang3.CharUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.cryptomator.crypto.aes256.Aes256Cryptor;
|
||||
import org.cryptomator.files.EncryptingFileVisitor;
|
||||
import org.cryptomator.ui.controls.ClearOnDisableListener;
|
||||
import org.cryptomator.ui.controls.SecPasswordField;
|
||||
import org.cryptomator.ui.model.Directory;
|
||||
import org.cryptomator.ui.util.EncryptingFileVisitor;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
@@ -80,11 +80,17 @@ public class MainController implements Initializable, InitializationListener, Un
|
||||
private void selectedDirectoryDidChange(ListChangeListener.Change<? extends Directory> change) {
|
||||
final Directory selectedDir = directoryList.getSelectionModel().getSelectedItem();
|
||||
stage.setTitle(selectedDir.getName());
|
||||
showDirectory(selectedDir);
|
||||
}
|
||||
|
||||
private void showDirectory(Directory directory) {
|
||||
try {
|
||||
if (selectedDir.containsMasterKey()) {
|
||||
this.showUnlockView(selectedDir);
|
||||
if (directory.isUnlocked()) {
|
||||
this.showUnlockedView(directory);
|
||||
} else if (directory.containsMasterKey()) {
|
||||
this.showUnlockView(directory);
|
||||
} else {
|
||||
this.showInitializeView(selectedDir);
|
||||
this.showInitializeView(directory);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
LOG.error("Failed to analyze directory.", e);
|
||||
|
||||
@@ -87,8 +87,10 @@ public class UnlockController implements Initializable {
|
||||
directory.getCryptor().decryptMasterKey(masterKeyInputStream, password);
|
||||
if (!directory.startServer()) {
|
||||
messageLabel.setText(rb.getString("unlock.messageLabel.startServerFailed"));
|
||||
directory.getCryptor().swipeSensitiveData();
|
||||
return;
|
||||
}
|
||||
directory.setUnlocked(true);
|
||||
directory.mount();
|
||||
if (listener != null) {
|
||||
listener.didUnlock(this);
|
||||
|
||||
@@ -37,6 +37,7 @@ public class UnlockedController implements Initializable {
|
||||
protected void closeVault(ActionEvent event) {
|
||||
directory.unmount();
|
||||
directory.stopServer();
|
||||
directory.setUnlocked(false);
|
||||
if (listener != null) {
|
||||
listener.didLock(this);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,10 @@
|
||||
</Appenders>
|
||||
|
||||
<Loggers>
|
||||
<Root level="DEBUG">
|
||||
<!-- show our own debug messages: -->
|
||||
<Logger name="org.cryptomator" level="DEBUG"/>
|
||||
<!-- mute dependencies: -->
|
||||
<Root level="INFO">
|
||||
<AppenderRef ref="Console" />
|
||||
<AppenderRef ref="StdErr" />
|
||||
</Root>
|
||||
Reference in New Issue
Block a user