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

View File

@@ -116,6 +116,10 @@
-fx-font-size: 0.64em;
}
.label-red {
-fx-text-fill: RED_5;
}
.text-flow > * {
-fx-fill: TEXT_FILL;
}

View File

@@ -116,6 +116,10 @@
-fx-font-size: 0.64em;
}
.label-red {
-fx-text-fill: RED_5;
}
.text-flow > * {
-fx-fill: TEXT_FILL;
}

View File

@@ -32,6 +32,8 @@
</Hyperlink>
</HBox>
<Label styleClass="label-red" text="To apply the changes, Cryptomator needs to be restarted." visible="${controller.macFuseAndFUSETRestartRequired}" managed="${controller.macFuseAndFUSETRestartRequired}"/>
<HBox spacing="12" alignment="CENTER_LEFT" visible="${controller.loopbackPortSupported}" managed="${controller.loopbackPortSupported}">
<Label text="%preferences.volume.tcp.port"/>
<NumericTextField fx:id="loopbackPortField"/>

View File

@@ -275,7 +275,7 @@ preferences.interface.showMinimizeButton=Show minimize button
preferences.interface.showTrayIcon=Show tray icon (requires restart)
## Volume
preferences.volume=Virtual Drive
preferences.volume.type=Volume Type (requires restart)
preferences.volume.type=Volume Type
preferences.volume.type.automatic=Automatic
preferences.volume.docsTooltip=Open the documentation to learn more about the different volume types.
preferences.volume.tcp.port=TCP Port