* remove restart notice for volume type
* only show restart label, when switching between macFUSE and FUSET
This commit is contained in:
Armin Schrenk
2023-03-13 11:17:56 +01:00
parent 7a0d255bd3
commit 58ed48b097
5 changed files with 26 additions and 1 deletions

View File

@@ -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> {