code cleanup

This commit is contained in:
Sebastian Stenzel
2017-05-04 16:53:58 +02:00
parent d2a2e2304d
commit 425d4e8fed
3 changed files with 3 additions and 7 deletions

View File

@@ -50,8 +50,8 @@ import javafx.beans.binding.Bindings;
import javafx.beans.binding.BooleanBinding;
import javafx.beans.binding.BooleanExpression;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
@@ -115,7 +115,7 @@ public class MainController implements ViewController {
// derived bindings:
this.isShowingSettings = Bindings.equal(SettingsController.class, EasyBind.monadic(activeController).map(ViewController::getClass));
this.upgradeStrategyForSelectedVault = EasyBind.monadic(selectedVault).map(upgradeStrategies::getUpgradeStrategy);
this.areAllVaultsLocked = new SimpleBooleanProperty(false).not(); // = Bindings.isEmpty(FXCollections.observableList(vaults, Vault::observables).filtered(Vault::isUnlocked));
this.areAllVaultsLocked = Bindings.isEmpty(FXCollections.observableList(vaults, Vault::observables).filtered(Vault::isUnlocked));
EasyBind.subscribe(areAllVaultsLocked, Platform::setImplicitExit);
autoUnlocker.unlockAllSilently();

View File

@@ -202,10 +202,6 @@ public class UnlockController implements ViewController {
mountAfterUnlock.setSelected(settings.mountAfterUnlock().get());
revealAfterMount.setSelected(settings.revealAfterMount().get());
// settings.unlockAfterStartup().bind(unlockAfterStartup.selectedProperty());
// settings.mountAfterUnlock().bind(mountAfterUnlock.selectedProperty());
// settings.revealAfterMount().bind(revealAfterMount.selectedProperty());
vaultSubs = vaultSubs.and(EasyBind.subscribe(unlockAfterStartup.selectedProperty(), settings.unlockAfterStartup()::set));
vaultSubs = vaultSubs.and(EasyBind.subscribe(mountAfterUnlock.selectedProperty(), settings.mountAfterUnlock()::set));
vaultSubs = vaultSubs.and(EasyBind.subscribe(revealAfterMount.selectedProperty(), settings.revealAfterMount()::set));

View File

@@ -188,7 +188,7 @@ public class Vault {
// *******************************************************************************/
public Observable[] observables() {
return new Observable[] {unlockedProperty(), mountedProperty()};
return new Observable[] {unlocked, mounted};
}
public VaultSettings getVaultSettings() {