mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-18 18:51:26 +00:00
UI:
* remove restart notice for volume type * only show restart label, when switching between macFUSE and FUSET
This commit is contained in:
@@ -33,6 +33,7 @@ public class VolumePreferencesController implements FxController {
|
||||
private final ObservableValue<Boolean> mountToDriveLetterSupported;
|
||||
private final ObservableValue<Boolean> mountFlagsSupported;
|
||||
private final ObservableValue<Boolean> readonlySupported;
|
||||
private final ObservableValue<Boolean> macFuseAndFUSETRestartRequired;
|
||||
private final Lazy<Application> application;
|
||||
private final List<MountService> mountProviders;
|
||||
public ChoiceBox<MountService> volumeTypeChoiceBox;
|
||||
@@ -53,6 +54,12 @@ public class VolumePreferencesController implements FxController {
|
||||
this.mountToDriveLetterSupported = selectedMountService.map(s -> s.hasCapability(MountCapability.MOUNT_AS_DRIVE_LETTER));
|
||||
this.mountFlagsSupported = selectedMountService.map(s -> s.hasCapability(MountCapability.MOUNT_FLAGS));
|
||||
this.readonlySupported = selectedMountService.map(s -> s.hasCapability(MountCapability.READ_ONLY));
|
||||
var mountServiceAtStart = selectedMountService.getValue();
|
||||
this.macFuseAndFUSETRestartRequired = selectedMountService.map(s -> isFUSETOrMacFUSE(mountServiceAtStart) && isFUSETOrMacFUSE(s) && !mountServiceAtStart.equals(s));
|
||||
}
|
||||
|
||||
private boolean isFUSETOrMacFUSE(MountService service) {
|
||||
return List.of("org.cryptomator.frontend.fuse.mount.MacFuseMountProvider", "org.cryptomator.frontend.fuse.mount.FuseTMountProvider").contains(service.getClass().getName());
|
||||
}
|
||||
|
||||
public void initialize() {
|
||||
@@ -129,6 +136,14 @@ public class VolumePreferencesController implements FxController {
|
||||
return mountFlagsSupported.getValue();
|
||||
}
|
||||
|
||||
public ObservableValue<Boolean> macFuseAndFUSETRestartRequiredProperty() {
|
||||
return macFuseAndFUSETRestartRequired;
|
||||
}
|
||||
|
||||
public boolean isMacFuseAndFUSETRestartRequired() {
|
||||
return macFuseAndFUSETRestartRequired.getValue();
|
||||
}
|
||||
|
||||
/* Helpers */
|
||||
|
||||
private class MountServiceConverter extends StringConverter<MountService> {
|
||||
|
||||
Reference in New Issue
Block a user