mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-04-19 17:16:53 -04:00
different labeling for volume type option in general volume preferences and vault options
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
package org.cryptomator.common.mount;
|
||||
|
||||
import org.cryptomator.integrations.mount.MountService;
|
||||
|
||||
import javafx.util.StringConverter;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
public class MountServiceConverter extends StringConverter<MountService> {
|
||||
|
||||
private final ResourceBundle resourceBundle;
|
||||
|
||||
public MountServiceConverter(ResourceBundle resourceBundle) {
|
||||
this.resourceBundle = resourceBundle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(MountService provider) {
|
||||
if (provider == null) {
|
||||
return resourceBundle.getString("preferences.volume.type.automatic");
|
||||
} else {
|
||||
return provider.displayName();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MountService fromString(String string) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package org.cryptomator.ui.preferences;
|
||||
|
||||
import dagger.Lazy;
|
||||
import org.cryptomator.common.ObservableUtil;
|
||||
import org.cryptomator.common.mount.MountServiceConverter;
|
||||
import org.cryptomator.common.settings.Settings;
|
||||
import org.cryptomator.common.vaults.VaultModule;
|
||||
import org.cryptomator.integrations.mount.MountCapability;
|
||||
@@ -70,7 +69,7 @@ public class VolumePreferencesController implements FxController {
|
||||
public void initialize() {
|
||||
volumeTypeChoiceBox.getItems().add(null);
|
||||
volumeTypeChoiceBox.getItems().addAll(mountProviders);
|
||||
volumeTypeChoiceBox.setConverter(new MountServiceConverter(resourceBundle));
|
||||
volumeTypeChoiceBox.setConverter(new MountServiceConverter());
|
||||
boolean autoSelected = settings.mountService.get() == null;
|
||||
volumeTypeChoiceBox.getSelectionModel().select(autoSelected ? null : selectedMountService.getValue());
|
||||
volumeTypeChoiceBox.valueProperty().addListener((observableValue, oldProvider, newProvider) -> {
|
||||
@@ -149,6 +148,25 @@ public class VolumePreferencesController implements FxController {
|
||||
return fuseRestartRequired.getValue();
|
||||
}
|
||||
|
||||
/* Helpers */
|
||||
|
||||
public class MountServiceConverter extends StringConverter<MountService> {
|
||||
|
||||
@Override
|
||||
public String toString(MountService provider) {
|
||||
if (provider == null) {
|
||||
return resourceBundle.getString("preferences.volume.type.automatic");
|
||||
} else {
|
||||
return provider.displayName();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MountService fromString(String string) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
public void openDocs() {
|
||||
application.get().getHostServices().showDocument(DOCS_MOUNTING_URL);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package org.cryptomator.ui.vaultoptions;
|
||||
import com.google.common.base.Strings;
|
||||
import dagger.Lazy;
|
||||
import org.cryptomator.common.ObservableUtil;
|
||||
import org.cryptomator.common.mount.MountServiceConverter;
|
||||
import org.cryptomator.common.mount.WindowsDriveLetters;
|
||||
import org.cryptomator.common.settings.VaultSettings;
|
||||
import org.cryptomator.common.vaults.Vault;
|
||||
@@ -147,7 +146,7 @@ public class MountOptionsController implements FxController {
|
||||
|
||||
vaultVolumeTypeChoiceBox.getItems().add(null);
|
||||
vaultVolumeTypeChoiceBox.getItems().addAll(mountProviders);
|
||||
vaultVolumeTypeChoiceBox.setConverter(new MountServiceConverter(resourceBundle));
|
||||
vaultVolumeTypeChoiceBox.setConverter(new MountServiceConverter());
|
||||
boolean autoSelected = vaultSettings.mountService.get() == null;
|
||||
vaultVolumeTypeChoiceBox.getSelectionModel().select(autoSelected ? null : selectedMountService.getValue());
|
||||
vaultVolumeTypeChoiceBox.valueProperty().addListener((observableValue, oldProvider, newProvider) -> {
|
||||
@@ -359,4 +358,20 @@ public class MountOptionsController implements FxController {
|
||||
return loopbackPortSupported.get();
|
||||
}
|
||||
|
||||
private class MountServiceConverter extends StringConverter<MountService> {
|
||||
|
||||
@Override
|
||||
public String toString(MountService provider) {
|
||||
if (provider == null) {
|
||||
return resourceBundle.getString("preferences.volume.type.default");
|
||||
} else {
|
||||
return provider.displayName();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MountService fromString(String string) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</padding>
|
||||
<children>
|
||||
<HBox spacing="12" alignment="CENTER_LEFT">
|
||||
<Label text="%preferences.volume.type"/>
|
||||
<Label text="%preferences.volume.defaultVolumeTypeLabel"/>
|
||||
<ChoiceBox fx:id="volumeTypeChoiceBox"/>
|
||||
<Hyperlink contentDisplay="GRAPHIC_ONLY" onAction="#openDocs">
|
||||
<graphic>
|
||||
@@ -32,8 +32,6 @@
|
||||
</Hyperlink>
|
||||
</HBox>
|
||||
|
||||
<Label styleClass="label-red" text="%preferences.volume.fuseRestartRequired" visible="${controller.fuseRestartRequired}" managed="${controller.fuseRestartRequired}"/>
|
||||
|
||||
<HBox spacing="12" alignment="CENTER_LEFT" visible="${controller.loopbackPortSupported}" managed="${controller.loopbackPortSupported}">
|
||||
<Label text="%preferences.volume.tcp.port"/>
|
||||
<NumericTextField fx:id="loopbackPortField"/>
|
||||
|
||||
@@ -292,9 +292,11 @@ preferences.interface.showTrayIcon=Show tray icon (requires restart)
|
||||
## Volume
|
||||
preferences.volume=Virtual Drive
|
||||
preferences.volume.type=Volume Type
|
||||
preferences.volume.defaultVolumeTypeLabel=Default Volume Type
|
||||
preferences.volume.type.automatic=Automatic
|
||||
preferences.volume.type.default=Default
|
||||
preferences.volume.docsTooltip=Open the documentation to learn more about the different volume types.
|
||||
preferences.volume.fuseRestartRequired=To apply the changes, Cryptomator needs to be restarted.
|
||||
preferences.volume.fuseRestartRequired=To mount this volume type, Cryptomator needs to be restarted.
|
||||
preferences.volume.tcp.port=TCP Port
|
||||
preferences.volume.supportedFeatures=The chosen volume type supports the following features:
|
||||
preferences.volume.feature.mountAuto=Automatic mount point selection
|
||||
|
||||
Reference in New Issue
Block a user